1234567891011 |
- function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}define("storytelling/glass/controllers/OpenActionHandler",["gemini/dashboard/glass/controllers/OpenActionHandler"],function(e){return e.extend({_getTargetPerspective:function(){return Promise.resolve("story")},_hasValidTags:function(e){return-1!==(e.tags||[]).indexOf("story")}})}),define("storytelling/nls/CAStorytellingResources",{root:!0,cs:!0,da:!0,de:!0,es:!0,fi:!0,fr:!0,hr:!0,hu:!0,it:!0,ja:!0,kk:!0,ko:!0,no:!0,nb:!0,nl:!0,pl:!0,pt:!0,"pt-br":!0,ro:!0,ru:!0,sl:!0,sv:!0,th:!0,tr:!0,zh:!0,"zh-cn":!0,"zh-tw":!0}),define("storytelling/nls/root/CAStorytellingResources",{story:"Story",noDashboardFound:"The story cannot be retrieved. Either it no longer exists or you don't have sufficient privileges to view it.",noDashboardCapability:"You do not have the capability to use stories",noDashboardPermision:"You do not have sufficient privileges to view this story",defaultName:"New story",storyProperties:"Story properties",createAvDataStoryLabel:"Story",createAvSlideShowLabel:"Slideshow",createAvPanAndZoomLabel:"Guided journey",dashboard_save_success:"Your story has been saved.",cmEmptySelection:"The story has been deleted. Try to save as a new story.",createStoryTitle:"Create a story",transitionStyleTitle:"Transition Style",createButton:"Create",cancelButton:"Cancel",dashboardResetTitle:"Reset story",dashboardResetMessage:"Are you sure you want to reset all changes applied to this story?",dashboardResetToast:"Your story has been reset.",filter_drag_and_drop_all_tabs:"Drag and drop data here to filter all scenes.",filter_drag_and_drop_current_tab:"Drag and drop data here to filter this scene.",filterIconLabel_Global:"All scenes",filterIconLabel_Tab:"This scene",filterIconTooltip_Global:"All scenes",filterIconTooltip_Tab:"This scene",filterOverflowMenu_Global:"All scenes overflow menu",filterOverflowMenu_Tab:"This scene overflow menu",renameScene:"Rename scene",duplicateScene:"Duplicate scene",deleteScene:"Delete scene",editTimelineHighlight:"Edit highlight",deleteTimelineHighlight:"Delete highlight",filter_includesAll:"Includes all",timeline_highlight_moved_to:"Time line highlight %{id} moved to %{time}",filter_tooltip:"[%{title}] - %{description}",selectLabel:"Select",newDefaultStoryName:"Story: %{modelName}",exportLabel:"Save",exportAsLabel:"Save as:",exportDialogTitle:"Save as a story",exportDialogFooter:"Save and cancel buttons",loadAfterExportLabel:"Open story after saving",selectTemplateLabel:"Select a template",outOfBoundsWarningMessage:"Some dashboard widgets are outside the grid and might not be displayed correctly after export.",emptyExploreCardsWarningMessage:"Empty cards were deleted during save as a story.",dashboard_export_success:"Your dashboard was successfully saved as a story.",explore_export_success:"Your exploration was successfully saved as a story.",toastUpgradeDone:"Your story has been upgraded. Save now to maintain optimum performance.",navigationMarker:"Navigation marker",navigateMarkers:"Navigate markers",navNextMarker:"Next marker",navPrevMarker:"Previous marker",navPrevMarkerAbbreviated:"Prev marker",timelineSettingsButton:"Playback options",autoPlay:"Play all scenes",loop:"Loop",refreshData:"Refresh at start",slideshowLabel:"Slide show",panAndZoomLabel:"Guided journey",slideShowLayoutLabel:"Slide show layout",panAndZoomLayoutLabel:"Guided journey layout",panAndZoomLayoutFooter:"A guided journey layout is a collection of scenes on a single canvas. When you run this type of story, the presentation zooms and pans on each individual scene in sequential order. This differs from a slide show layout where each scene is presented on a new canvas. The guided journey layout with three scenes connected by lines allows you to create a horizontal sequence of scenes. This is useful for showing a timeline.",PanAndZoomLayout1:"5 scenes arranged in a rectangular shape",PanAndZoomLayout2:"4 scenes arranged in a staircase shape going up from left to right",PanAndZoomLayout3:"6 scenes arranged in a rectangular shape",PanAndZoomLayout4:"7 scenes arranged in a rectangular shape, with 6 small scenes on the top and 1 large scene on the bottom",PanAndZoomLayout5:"3 scenes arranged with 2 small scenes on the top and 1 large scene on the bottom",PanAndZoomLayout6:"A sequence of 4 scenes arranged horizontally",pageSelectWarning:"Please select a scene.",noSceneTransitionLabel:"None",sceneTransitionPropertyLabel:"Scene transition",animatedPathSceneTransitionLabel:"Animated path",sweepSceneTransitionLabel:"Sweep",storyTypeLabel:"Story type",layoutLabel:"Layout",tabName_animation:"Animation",propAniAnimation:"Animation",propAniTypeEntrance:"Entrance animation",propAniDirectionIn:"Entrance direction",propAniTypeExit:"Exit animation",propAniDirectionOut:"Exit direction",propAniDirection:"Direction",propAniEntrance:"Entrance",propAniTypeEntranceSlideIn:"Slide in",propAniTypeEntranceFadeIn:"Fade in",propAniTypeEntrancePivotIn:"Pivot in",propAniTypeEntranceScaleIn:"Scale in",propAniTypeEntranceShrinkIn:"Shrink in",propAniDirectionInLeft:"From left",propAniDirectionInRight:"From right",propAniDirectionInTop:"From top",propAniDirectionInBottom:"From bottom",propAniExit:"Exit",propAniTypeExitSlideIn:"Slide out",propAniTypeExitFadeIn:"Fade out",propAniTypeExitPivotOut:"Pivot out",propAniTypeExitScaleIn:"Scale out",propAniTypeExitExpandOut:"Expand out",propAniDirectionOutLeft:"To left",propAniDirectionOutRight:"To right",propAniDirectionOutTop:"To top",propAniDirectionOutBottom:"To bottom",propAniEntranceTime:"Start at (secs):",propAniExitTime:"End at (secs):",animationNoEntranceText:"Entrance animation will not occur if the widget is at the beginning of the scene.",animationNoExitText:"Exit animation will not occur if the widget is at the end of the scene.",propAniTypeDataEntrance:"Data entrance",propAniRevealDuration:"Entry animation duration",timelineAnimationProperties:"Open animation properties",scenesPropertiesSection:"Scenes",editStoryCoachMarkTitle:"Edit story",editStoryCoachMarkContents:"Click the pencil icon to edit this story.",addDataStoryCoachMarkContents:"Drag and drop data from the data panel onto your story.",expandSceneCoachmarkTitle:"Open timeline",expandSceneCoachmarkContents:"Animate a scene by adjusting object visibility based on time and duration.",overviewCoachmarkTitle:"Overview scenes",overviewCoachmarkContents:"Use the overview scenes at the start and end of your story to show the big picture of all the scenes. From an overview scene, click and drag a scene to swap it with another scene. You can show or hide the overview scenes in the story properties.",animatedPathCoachmarkTitle:"Animated path",animatedPathCoachmarkContents:"To animate an object from one scene to another, duplicate a scene with an object. Then, move, resize, or rotate the duplicated object on the new scene.",propShowStoryOverviewFirstSlide:"Show all scenes at the start",propShowStoryOverviewLastSlide:"Show all scenes at the end",storySceneSingleCountLabel:"1 scene",storySceneCountLabel:"%{count} scenes",storySceneRangeCountLabel:"Scene %{index} of %{count}",storySceneExpand:"Open timeline",storySceneActionMenu:"Launch scene options menu",timelineRightContainerLabel:"Timeline button control group",timelineViewLabel:"Timeline",timelineZoomFit:"Zoom to fit",timelineZoomIn:"Zoom in",timelineZoomOut:"Zoom out",timelinePositionIndicator:"timeline position indicator at %{position}",timelinePositionIndicatorMoveLeftTo:"timeline position indicator move left to %{position}",timelinePositionIndicatorMoveRightTo:"timeline position indicator move right to %{position}",sceneStart:"Jump to the beginning of the scene to %{position}",sceneEnd:"Jump to the end of the scene to %{position}",timelineHighlightTitle:"Highlight",addTimelineHighlight:"Add highlight",addSceneBtnTitle:"Add a new scene with default template",addSceneChevronBtnTitle:"Choose a scene template",timelinePlay:"Play",timelinePause:"Pause",sceneNavigation:"Scene navigation",navNextScene:"Next scene",navPrevScene:"Previous scene",navPrevSceneAbbreviated:"Prev scene",navExitFullScreen:"Exit full screen",navToggleOverview:"Toggle overview",rowNumber:"Row %{number}",overviewBtnLabel:"Overview",sceneListStart:"Overview start",sceneListEnd:"Overview end",timelineLeftHandle:"left handle for %{name}",timelineRightHandle:"right handle for %{name}",timelineLeftHandleNoTitle:"left handle",timelineRightHandleNoTitle:"right handle",timelineMoveLeft:"Move %{object} left",timelineMoveRight:"Move %{object} right",timelineMoveWidget:"time line widget moved to %{newStartTime} and %{newEndTime}",timelineMoveWidgetStartTime:"time line widget start time changed to %{newStartTime}",timelineMoveWidgetEndTime:"time line widget end time changed to %{newEndTime}",timelineMoveWidgetDown:"time line widget moved down",timelineMoveWidgetUp:"time line widget moved up",addSceneTitle:"Add a scene",blankSceneLayout:"Blank",titleSceneLayout:"Title with subtitle",sceneLayout1:"Title with text beside one visualization",sceneLayout2:"Title with one visualization",sceneLayout3:"Title with two visualizations",sceneLayout4:"Multipurpose",sceneLayout5:"No title with text beside one visualization",sceneLayout6:"Multipurpose 2 by 2",sceneLayout7:"Multipurpose 2 beside 1",sceneLayout8:"Multipurpose 1 beside 2",sceneLayout9:"Multipurpose 1 over 2",sceneLayout10:"Multipurpose 2 over 1",sceneLayout11:"Multipurpose 4 over 1",sceneLayout12:"Multipurpose 1 over 1 beside 2 by 2 over 1",titleWidgetPlaceholderText:"Enter your title here",subtitleWidgetPlaceholderText:"Enter your subtitle here",createStoryViewTitle:"Create story",defaultStoryName:"New story",screenshot_label:"Story %{title}",screenshot_label_scene:"Scene %{sceneTitle} of story %{title}",filmstripHandleOpenLabel:"Open scene selector",filmstripHandleCloseLabel:"Close scene selector"}),define("storytelling/nls/StringResources",["i18n!./CAStorytellingResources","polyglot"],function(e,t){var i=new t({phrases:e,allowMissing:!0});return new(function(){function e(){_classCallCheck(this,e)}return e.prototype.get=function(e,t){return i.t(e,t)},e}())}),define("storytelling/glass/controllers/ShareActionHandler",["gemini/dashboard/glass/controllers/ShareActionHandler","../../nls/StringResources"],function(e,t){return e.extend({execute:function(e){if(e.urlMap.objRef){var t={perspective:"story",objRef:e.urlMap.objRef,action:"view"},i=e.glassContext.appController.getCurrentContentView(),n=i.storyPaneController.getCurrentSceneInfo();return t.sceneId=n&&n.id,t.sceneTime=i.storyPaneController.getCurrentTime(),t}throw new Error("Unable to resolve share context. Missing objRef.")},getShareableItems:function(e){var t=e.glassContext.appController.getCurrentContentView();return this.reRenderMaps(t).then(this._getShareableItems.bind(this,e))},_getShareableItems:function(e){var i=e.glassContext.appController.getCurrentContentView(),n=i.storyPaneController.getCurrentSceneInfo(),o=n&&n.title,s=o?t.get("screenshot_label_scene",{title:i.getTitle(),sceneTitle:o}):t.get("screenshot_label",{title:i.getTitle()}),r=i.boardController.layoutController.getLayoutView(n.id);return r?Promise.resolve([{el:r.$el,label:s}]):i.boardController.layoutController.getTopLayoutViewWhenReady().then(function(e){return[{el:e.$el,label:s}]})},enterShareState:function(e){return Promise.resolve().then(function(){return e.glassContext.appController.getCurrentContentView().storyPaneController.enterShareState(e.slideout)})},leaveShareState:function(e){return Promise.resolve().then(function(){return e.glassContext.appController.getCurrentContentView().storyPaneController.leaveShareState()})},canExportToPDF:function(){return!0},exportToPDF:function(e,t,i){var n=e.glassContext.appController.getCurrentContentView().getDashboardApi(),o=n.getFeature("Print"),s={pageSize:t,printFilters:i},r=n.getCanvas().getContent().getId();return o.print(r,e.glassContext.appController,s)}})}),define("text!storytelling/views/templates/TimelineRulerView.html",[],function(){return'{{? it.canvas }}<canvas class="ruler"></canvas>{{??}}<div class="ruler"></div>{{?}}'}),define("storytelling/views/TimelineRulerView",["baglass/core-client/js/core-client/ui/core/View","text!./templates/TimelineRulerView.html","jquery"],function(e,t,i){var n=e.extend({templateString:t,lastOffset:0,init:function(e){n.inherited("init",this,arguments),i("body").hasClass("highcontrast")?(this.majorTickColour="#AFAFAF",this.minorTickColour="#AFAFAF",this.fillColour="#AFAFAF"):(this.majorTickColour="#c0c0c0",this.minorTickColour="#cccccc",this.fillColour="#888888"),this.controller=e.controller,this.scaleManager=e.scaleManager,this._useDiv=!0===e.useDiv},remove:function(){i(window).off("resize.privateViewEvents"+this.viewId),this.$ruler&&(this.$ruler.off("click"),this.$ruler=null),n.inherited("remove",this,arguments)},render:function(){var e=this.dotTemplate({canvas:!this._useDiv});this.$el.html(e),this.$ruler=this.$el.find(".ruler"),this.$ruler.on("click",this.onRulerClick.bind(this)),i(window).off("resize.privateViewEvents"+this.viewId).on("resize.privateViewEvents"+this.viewId,this.onResize.bind(this)),this._updateCanvasWidth()},_updateCanvasWidth:function(){var e=this.$el.outerWidth(!1),t=this.$el.outerHeight(!1);this._useDiv?(this.$ruler.css("width","100%"),this.$ruler.css("height",t)):(this.$ruler[0].width=e,this.$ruler[0].height=t,this.context=this.$ruler[0].getContext("2d"),this.context.fillStyle=this.fillColour,this.context.font="100 14px HelvNeueforIBM,“Helvetica Neue”,Helvetica,Arial,sans-serif")},drawTicks:function(){if(!this._useDiv){this.context.clearRect(0,0,this.$ruler[0].width,this.$ruler[0].height);var e=this.scaleInfo.tickWidth,t=0,i=0;if(this.lastOffset>0){var n=this.lastOffset/e;t=Math.floor(n),i=(t-n)*e}var o={offsetCount:t,offsetX:i,depth:this.scaleInfo.depth};this._drawTicksRecursively(o,this.scaleInfo)}},setOffsetLeft:function(e){e!==this.lastOffset&&(this.lastOffset=e,this.refresh())},refresh:function(){this.scaleInfo=this._calculateScaleInfo(),this._updateCanvasWidth(),this.drawTicks()},onResize:function(){this.scaleInfo&&this.$el.is(":visible")&&(this._updateCanvasWidth(),this.drawTicks())},onRulerClick:function(e){var t=this._getTimeForPosition(e.pageX),i=this.controller.isPlaying();i&&this.controller.pause(),this.controller.setCurrentTime(t),i&&this.controller.play()},_drawTicksRecursively:function(e,t,i){var n=this.context;i=i||0,0===i?this._drawMajorTicks(e,t):this._drawMinorTicks(e,t,i),t.minorTicks?this._drawTicksRecursively(e,t.minorTicks,i+1):i>=e.depth-1&&n.stroke()},_drawMajorTicks:function(e,t){var i=e.offsetCount,n=this.$ruler[0].width,o=this.$ruler[0].height,s=this.context;s.strokeStyle=this.majorTickColour,s.beginPath();var r,a,l,c="",d=t.tickWidth;for(r=e.offsetX;r<n;r+=d)l=this.controller.getTimeLabel(i*t.tickDuration),l&&l!==c&&(c=l,a=15,s.fillText(l,r+3,a+11),r>0&&(s.moveTo(r,a),s.lineTo(r,o))),i++;s.stroke()},_drawMinorTicks:function(e,t,i){var n=this.$ruler[0].width,o=this.$ruler[0].height,s=this.context;1===i&&(s.strokeStyle=this.minorTickColour,s.beginPath());var r,a,l=2*t.tickWidth;for(r=e.offsetX+l;r<n;r+=l)r>0&&(a=40,s.moveTo(r,a),s.lineTo(r,o))},_getScaleInfo:function(e){var t,i=this.scaleManager.getMinScale(),n=this.scaleManager.getMaxScale(),o=(e-i)/(n-i);t=o>=1?500:o>=.5?1e3:o>=.25?2e3:o>=.125?2500:o>=.0625?5e3:o>=.02?1e4:o>=.01?2e4:o>0?5e4:1e5;var s=this.scaleManager.convertTimeToPosition(t),r={tickWidth:s,tickDuration:t,depth:1},a=this._getScaleInfoHelper(r,e,s/2);return a&&(r.minorTicks=a),r},_getScaleInfoHelper:function(e,t,i){var n=null;if(i>10){n={tickWidth:i},e.depth++;var o=this._getScaleInfoHelper(e,t,i/5);o&&(n.minorTicks=o)}return n},_calculateScaleInfo:function(){var e=this.scaleManager.getScale();return this._getScaleInfo(e)},_getTimeForPosition:function(e){var t=this.scaleInfo,i=t.tickWidth,n=t.tickDuration;return(e-this.$el.offset().left+this.lastOffset)/i*n}});return n}),define("text!storytelling/views/templates/TimeIndicator.html",[],function(){return'<div tabindex="0" class="handle" role="application" aria-label="{{= it.handleLabel}}" data-at-shortcutkeys="{\'SHIFT+LEFT\': \'SHIFT+LEFT\', \'SHIFT+RIGHT\': \'SHIFT+RIGHT\'}">{{? it.allInfo}}<div></div><div></div>{{?}}</div>{{? it.allInfo}}<div class="counterweight"></div>{{?}}'}),define("storytelling/views/TimelineTimeIndicatorView",["baglass/core-client/js/core-client/ui/core/View","jquery","underscore","gemini/app/util/ScreenReaderUtil","storytelling/nls/StringResources","text!./templates/TimeIndicator.html"],function(e,t,i,n,o,s){var r=e.extend({templateString:s,_allowDrag:!0,_isDragging:!1,_dragInfo:null,_seekRefreshInterval:200,_seekRefreshTimer:-1,_scrollEventHandler:null,lastScroll:0,init:function(e){r.inherited("init",this,arguments),this.controller=e.controller,this.controller.on("time:update",this.onTimeUpdated,this),this.scaleManager=e.scaleManager,this.scaleManager.on("scale:change",this.onScaleChanged,this),this._ScreenReader=new n,this._callOut=i.debounce(this._updateAriaLabel.bind(this),e.callOutDelay||600),this._indicatorOnly=!0===e.indicatorOnly,this._indicatorOnly&&"function"==typeof e.progressBarCallback&&(this.progressBarCallback=e.progressBarCallback)},remove:function(){this.$handle&&(this.$handle.off("focus touchstart touchend mousedown mouseup keydown"),this.$handle.hammer().off("dragstart dragleft dragright dragend"),this.$handle=null),this.controller&&this.controller.off("time:update",this.onTimeUpdated,this),this.scaleManager&&this.scaleManager.off("scale:change",this.onScaleChanged,this),r.inherited("remove",this,arguments)},render:function(){var e=this.dotTemplate({allInfo:!this._indicatorOnly,handleLabel:o.get("timelinePositionIndicator",{position:this.getCurrentTime()})});return this.$el.html(e),this.$handle=this.$el.find("div.handle"),this._indicatorOnly||(this.$handleValue=this.$handle.find("div:nth-of-type(1)"),this.$handleArrow=this.$handle.find("div:nth-of-type(2)")),this.$handle.on("focus",this.handleTimelinePositionIndicatorMove.bind(this)).on("touchstart",this.onTouchStart.bind(this)).on("touchend",this.onTouchEnd.bind(this)).on("mousedown",this.onTouchStart.bind(this)).on("mouseup",this.onTouchEnd.bind(this)).on("keydown",this._onKeyDown.bind(this)),this.$handle.hammer().on("dragstart",this.onDragStart.bind(this)).on("dragleft",this.onDragLeftRight.bind(this)).on("dragright",this.onDragLeftRight.bind(this)).on("dragend",this.onDragEnd.bind(this)),this._moveIndicatorWithTime(this.controller.getCurrentTime()),this},setFocus:function(){this.$handle.focus()},getCurrentTime:function(){return this.controller.getTimeLabel(this.controller.getCurrentTime(),!0)},getEndTime:function(){return this.controller.getTimeLabel(this.controller.getDuration(),!0)},onScroll:function(e){this.lastScroll=e.scrollLeft,this.refresh()},refresh:function(){this._moveIndicatorWithTime(this.controller.getCursorTime())},onTouchStart:function(){this.$el.addClass("dragging"),this.wasPlaying=this.controller.isPlaying(),this.wasPlaying&&this.controller.pause()},onTouchEnd:function(){this.$el.removeClass("dragging"),this.wasPlaying&&(this.wasPlaying=!1,this.controller.play())},onDragStart:function(e){e.gesture.preventDefault(),this.$el.addClass("dragging"),this._setDragStartInfo()},onDragLeftRight:function(e){e.gesture.preventDefault();var t=this._getBoundedPosition(e.gesture.deltaX);this._moveIndicatorWithPosition(t)},onDragEnd:function(e){e.gesture.preventDefault(),this._clearInterval(),this.$el.removeClass("dragging"),this._isDragging=!1;var t=this._getBoundedPosition(e.gesture.deltaX);this._moveIndicatorWithPosition(t),this._updateTimeFromDrag(),this._dragInfo=null},_onKeyDown:function(e){this._shouldScrub(e)?this._onArrowKeyPress(e):this._shouldJumpToNextMarker(e)?(this.controller.jumpToNextMarker(),this.handlePositionMoveRight(),e.stopPropagation()):this._shouldJumpToPreviousMarker(e)?(this.controller.jumpToPreviousMarker(),this.handlePositionMoveLeft(),e.stopPropagation()):this._shouldJumpToStartOfScene(e)?(this.controller.setCurrentTime(0),this._updateAriaLabel("sceneStart"),e.stopPropagation()):this._shouldJumpToEndOfScene(e)?(this.controller.setCurrentTime(this.controller.getDuration()),this._updateAriaLabel("sceneEnd"),e.stopPropagation()):this._shouldPerformTogglePlayPause(e)&&(this.controller.eventRouter.trigger("playback:togglePlayPause"),e.stopPropagation())},_shouldScrub:function(e){return!e.shiftKey&&-1!==[37,38,39,40].indexOf(e.keyCode)},_shouldJumpToPreviousMarker:function(e){return(this.$el.hasClass("timelinePosition")||this.controller.isNavigateMarkers())&&e.shiftKey&&-1!==[37,38].indexOf(e.keyCode)},_shouldJumpToNextMarker:function(e){return(this.$el.hasClass("timelinePosition")||this.controller.isNavigateMarkers())&&e.shiftKey&&-1!==[39,40].indexOf(e.keyCode)},_shouldJumpToStartOfScene:function(e){return this.$el.hasClass("progressBarPosition")&&e.shiftKey&&-1!==[37,38].indexOf(e.keyCode)},_shouldJumpToEndOfScene:function(e){return this.$el.hasClass("progressBarPosition")&&e.shiftKey&&-1!==[39,40].indexOf(e.keyCode)},_shouldPerformTogglePlayPause:function(e){return 32===e.keyCode},_onArrowKeyPress:function(e){t(e.currentTarget).focus();var i=this.controller.getTickDuration();switch(e.keyCode){case 37:case 38:i*=-1;break;case 39:case 40:break;default:return}e.stopPropagation(),e.preventDefault(),this.controller.setCurrentTime(this.controller.getCurrentTime()+i),i<0?this._callOut("timelinePositionIndicatorMoveLeftTo"):this._callOut("timelinePositionIndicatorMoveRightTo"),this._dragInfo=null},onScaleChanged:function(){this._moveIndicatorWithTime(this.controller.getCurrentTime())},onTimeUpdated:function(e){this._isDragging||this._moveIndicatorWithTime(e.currentTime)},handleTimelinePositionIndicatorMove:function(){this._callOut("timelinePositionIndicator")},handlePositionMoveLeft:function(){var e=this.getCurrentTime(),t="0:00.0"===e?"sceneStart":"timelinePositionIndicatorMoveLeftTo";this._callOut(t)},handlePositionMoveRight:function(){var e=this.controller.isAtEndOfScene()?"sceneEnd":"timelinePositionIndicatorMoveRightTo";this._callOut(e)},_setDragStartInfo:function(){this._isDragging=!0,this._dragInfo={},this._dragInfo.initialScroll=this.lastScroll,this._dragInfo.left=this.$el.position().left+this.lastScroll,this._dragInfo.currentLeft=this._dragInfo.left,this._clearInterval(),this._seekRefreshTimer=setInterval(this._updateTimeFromDrag.bind(this),this._seekRefreshInterval)},_updateTimeFromDrag:function(){var e=this.scaleManager.convertPositionToTime(this._dragInfo.currentLeft);this.controller.setCurrentTime(e)},_moveIndicatorWithTime:function(e){var t=this.scaleManager.convertTimeToPosition(e);this._moveIndicatorWithPosition(t)},_moveIndicatorWithPosition:function(e){if(this.$handle){if(!this._indicatorOnly){var t=this.scaleManager.convertPositionToTime(e),i=this.controller.getTickDuration();t=Math.round(t/i)*i,e=this.scaleManager.convertTimeToPosition(t)}var n=void 0,o=void 0;if(this._indicatorOnly){var s=this._getMaxPosition();o=0===s?0:e/s*100,n="calc("+o+"% - "+this.lastScroll+"px)"}else n=e-this.lastScroll+"px";this.$el.css({left:n}),this._moveHelper(e),this._indicatorOnly&&this.progressBarCallback&&this.progressBarCallback(o)}},_moveHelper:function(e){var t=this.$handle.outerWidth(!1)/2,i=e-t<0?e:t,n=Math.max(0,i-7),o=Math.max(0,Math.min(7,i)),s=this.scaleManager.convertPositionToTime(e);i===this._prevMargin&&n===this._preMarginLeft&&o===this._prevBorderLeftWidth&&s===this._prevTime||(this._preMarginLeft=n,this._prevMargin=i,this._prevBorderLeftWidth=o,this._prevTime=s,this._indicatorOnly||(this.$handle.css("margin-left",-i+"px"),this.$handleArrow.css({"margin-left":n+"px","border-left-width":o+"px"}),this._updateTimeLabel(s)),this._dragInfo&&(this._dragInfo.currentLeft=e),this.controller.setCursorTime(s))},_getMaxPosition:function(){return this.scaleManager.convertTimeToPosition(this.controller.getDuration())},_getCursorPosition:function(e){return this._dragInfo.left+e+this.lastScroll-this._dragInfo.initialScroll},_getBoundedPosition:function(e){return Math.max(0,Math.min(this._getCursorPosition(e),this._getMaxPosition()))},_updateTimeLabel:function(e){this.$handleValue.text(this.controller.getTimeLabel(e,1),!0)},_updateAriaLabel:function(e){if(this.$handle){var t=o.get(e,{position:this.getCurrentTime()});this.$handle.attr({"aria-label":t}),this._ScreenReader.callOut(t)}},_clearInterval:function(){this._seekRefreshTimer>=0&&(clearInterval(this._seekRefreshTimer),this._seekRefreshTimer=-1)}});return r}),define("storytelling/ScaleManager",["baglass/core-client/js/core-client/ui/core/Events"],function(e){var t=e.extend({defaultPixelsPerSecond:1,minScale:1,maxScale:250,scale:1,duration:0,availableWidth:0,init:function(){t.inherited("init",this,arguments)},updateDuration:function(e,t){this.duration=e,this.availableWidth=t},scaleToFit:function(){var e=this._calculateFitToSizeScale();this.setScale(e)},stepScale:function(e){0!==e&&this.setScale(this.scale*e)},setScale:function(e){var t=this.scale;this.scale=Math.max(this.minScale,Math.min(this.maxScale,e)),this.trigger("scale:change",{scale:this.scale,previousScale:t})},getScale:function(){return this.scale},getScaleToPixelRatio:function(){return this.defaultPixelsPerSecond},getMinScale:function(){return this.minScale},getMaxScale:function(){return this.maxScale},convertTimeToPosition:function(e){return e/1e3*this.defaultPixelsPerSecond*(this.scale||1)},convertPositionToTime:function(e){return e/(this.defaultPixelsPerSecond*(this.scale||1))*1e3},_calculateFitToSizeScale:function(){var e=this.convertTimeToPosition(this.duration),t=e>0?this.availableWidth/e:1;return this.scale*t}});return t}),define("storytelling/NoScaleManager",["./ScaleManager"],function(e){return e.extend({init:function(){e.inherited("init",this,arguments),this.maxScale=1e4}})}),define("text!storytelling/views/templates/PlayerViewProgressBar.html",[],function(){return'<div class="progressBarControl"></div><div class="completedBar"></div><div class="markersContainer"></div><div class="progressBarPosition"></div><span>/</span>'}),define("storytelling/views/PlayerViewProgressBar",["jquery","baglass/core-client/js/core-client/ui/core/View","./TimelineRulerView","./TimelineTimeIndicatorView","../NoScaleManager","text!./templates/PlayerViewProgressBar.html","underscore"],function(e,t,i,n,o,s,r){var a=t.extend({templateString:s,events:{"primaryaction div.marker":"onMarkerClick",primaryaction:"onProgressBarClick"},init:function(t){a.inherited("init",this,arguments),this.controller=t.controller,this.timelineController=t.timelineController,this.glassContext=t.glassContext,this.services=t.services,this.stringResources=this.services.getSvcSync(".StringResources"),this.noScaleManager=new o,this._refreshTimer=null,this._progressBarTransition=function(e){e.target===this.$el[0]&&e.propertyName.indexOf("flex-grow")>-1&&this._recalculateProgressBar()}.bind(this),this.$el[0].addEventListener("transitionend",this._progressBarTransition);var i=this.glassContext.appController.findPlugin("com.ibm.bi.glass.common.home");i&&i.$el&&1===i.$el.length&&(this._navbarItem=i.$el[0],this._navbarTransitionCheck=function(e){"width"===e.propertyName&&this._recalculateProgressBar()}.bind(this),this._navbarItem.addEventListener("transitionend",this._navbarTransitionCheck)),this._resizeHandler=this._recalculateProgressBar.bind(this),e(window).on("resize",this._resizeHandler),this.timelineController.eventRouter.on("navigation:complete",this.refreshMarkers.bind(this)),this.markers=[]},render:function(){var e=this.dotTemplate({});this.$el.html(e),this._scaleToFit(),this.timeRulerView=new i({el:this.$el.find(".progressBarControl"),controller:this.timelineController,scaleManager:this.noScaleManager,useDiv:!0}),this.timeRulerView.render(),this.timeIndicatorView=new n({el:this.$el.find(".progressBarPosition"),controller:this.timelineController,scaleManager:this.noScaleManager,indicatorOnly:!0,services:this.services,progressBarCallback:this._completionBarUpdate.bind(this)}),this.timeIndicatorView.render(),this._completionBarUpdate()},remove:function(){clearTimeout(this._refreshTimer),this.$el[0].removeEventListener("transitionend",this._progressBarTransition),this._removeMarkers(),a.inherited("remove",this,arguments),e(window).off("resize",this._resizeHandler),this._navBarItem&&this._navbarItem.removeEventListener("transitionend",this._navbarTransitionCheck),this.timeIndicatorView&&(this.timeIndicatorView.remove(),this.timeIndicatorView=null),this.timeRulerView&&(this.timeRulerView.remove(),this.timeRulerView=null)},refreshMarkers:function(){if(this.timelineController.isNavigateMarkers()&&!this.controller.isOverview())if(0===this.markers.length)this._renderMarkers();else{var e,t=this.timelineController.getMarkers();r.each(t,function(t,i){e=this.markers[i],e?this._updateMarkerTimer(e,t):this._renderMarker(t)}.bind(this)),this._removeMarkers(t.length)}else this._removeMarkers()},refresh:function(){this.timeRulerView.$el.is(":visible")&&(this._scaleToFit(),this.refreshMarkers(),this.timeRulerView.refresh(),this.timeIndicatorView.refresh())},onMarkerClick:function(e){var t=this._getMarker(e.currentTarget);t&&(this.timelineController.setCurrentTime(t.timer),this.timeIndicatorView.setFocus())},onProgressBarClick:function(){this.timeIndicatorView.setFocus()},_removeMarkers:function(e){if(e){for(var t=e;t<this.markers.length;t++)this.markers[t].$el.remove(),this.markers[t]=null;this.markers=r.compact(this.markers)}else this.markers.length>0&&(this.$el.find(".marker").remove(),this.markers=[])},_renderMarkers:function(){var e=this.timelineController.getMarkers();r.each(e,this._renderMarker.bind(this))},_renderMarker:function(t){var i=e("<div class='marker' tab-index='0'/>");i.attr("aria-label",this.stringResources.get("navigationMarker"));var n={$el:i,timer:t};return this.$el.find(".markersContainer").append(i),this.markers.push(n),this._positionMarker(n),i},_updateMarkerTimer:function(e,t){e.timer=t,this._positionMarker(e)},_positionMarker:function(e){var t=e.timer/this.timelineController.getDuration()*100,i=t+"%",n=e.$el.outerWidth()/2;e.$el.css("left","calc("+i+" - "+n+"px)")},_getMarker:function(e){
- return r.find(this.markers,function(t){return t.$el.is(e)})},_recalculateProgressBar:function(){this.timeRulerView&&this.timeIndicatorView&&(clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(function(){this.refresh()}.bind(this),1e3))},_completionBarUpdate:function(e){this.timeIndicatorView&&(e||(e=0),this.$el.find(".completedBar").css("width",e+"%"))},_scaleToFit:function(){var e=this.timelineController.getDuration();this.noScaleManager.updateDuration(e,this.$el.outerWidth(!1)),this.noScaleManager.scaleToFit()}});return a}),define("text!storytelling/views/templates/TimelinePlayerView.html",[],function(){return'<div class="storyContainer playerControls"><button title="{{=it.prevSceneLabel}}" aria-label="{{=it.prevSceneLabel}}" class="prevScene"><span class="navLabel">{{=it.prevSceneAbbreviatedLabel}}</span></button> <button title="{{=it.sceneStartLabel}}" aria-label="{{=it.sceneStartLabel}}" class="sceneStart"></button> <button title="{{=it.playLabel}}" aria-label="{{=it.playLabel}}" class="playPause"></button> <button class="sceneEnd"></button> <button title="{{=it.nextSceneLabel}}" aria-label="{{=it.nextSceneLabel}}" class="nextScene"><span class="navLabel">{{=it.nextSceneLabel}}</span></button></div><div class="separator"></div><div class="storyContainer"><div class="playerLabel numScenes">{{= it.stringSceneCount }}</div></div><div class="separator"></div><div class="storyContainer progressInfo"><span class="playerLabel timeLabel"></span><div class="progressBarView"></div><span class="playerLabel durationLabel"></span></div><div class="separator"></div><div class="storyContainer"><button title="{{=it.timelineSettingsLabel}}" data-selector="true" aria-label="{{=it.timelineSettingsLabel}}" class="timelineSettings"></button></div>'}),function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var i=window.webpackJsonPBaGraphics;window.webpackJsonPBaGraphics=function(n,s,r){for(var a,l,c,d=0,h=[];d<n.length;d++)l=n[d],o[l]&&h.push(o[l][0]),o[l]=0;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a]);for(i&&i(n,s,r);h.length;)h.shift()();if(r)for(d=0;d<r.length;d++)c=t(t.s=r[d]);return c};var n={},o={1733:0};t.m=e,t.c=n,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t.oe=function(e){throw console.error(e),e}}({"698d75b157f24ae829cc":function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},"9689a9c94ae38b47fa2c":function(e,t,i){(function(t){!function(t,i){e.exports=function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}var i=function(e){var t=e.id,i=e.viewBox,n=e.content;this.id=t,this.viewBox=i,this.content=n};i.prototype.stringify=function(){return this.content},i.prototype.toString=function(){return this.stringify()},i.prototype.destroy=function(){var e=this;["id","viewBox","content"].forEach(function(t){return delete e[t]})};var n=function(e){var t=!!document.importNode,i=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t?document.importNode(i,!0):i},o=("undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self,e(function(e,t){!function(t,i){e.exports=function(){function e(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function t(e){return Array.isArray(e)?[]:{}}function i(i,n){return n&&!0===n.clone&&e(i)?s(t(i),i,n):i}function n(t,n,o){var r=t.slice();return n.forEach(function(n,a){void 0===r[a]?r[a]=i(n,o):e(n)?r[a]=s(t[a],n,o):-1===t.indexOf(n)&&r.push(i(n,o))}),r}function o(t,n,o){var r={};return e(t)&&Object.keys(t).forEach(function(e){r[e]=i(t[e],o)}),Object.keys(n).forEach(function(a){e(n[a])&&t[a]?r[a]=s(t[a],n[a],o):r[a]=i(n[a],o)}),r}function s(e,t,s){var r=Array.isArray(t),a=s||{arrayMerge:n},l=a.arrayMerge||n;return r?Array.isArray(e)?l(e,t,s):i(t,s):o(e,t,s)}return s.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,i){return s(e,i,t)})},s}()}()})),s=e(function(e,t){var i={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};t.default=i,e.exports=t.default}),r=function(e){return Object.keys(e).map(function(t){return t+'="'+e[t].toString().replace(/"/g,""")+'"'}).join(" ")},a=s.svg,l=s.xlink,c={};c[a.name]=a.uri,c[l.name]=l.uri;var d=function(e,t){void 0===e&&(e="");var i=o(c,t||{});return"<svg "+r(i)+">"+e+"</svg>"};return function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={isMounted:{}};return i.isMounted.get=function(){return!!this.node},t.createFromExistingNode=function(e){return new t({id:e.getAttribute("id"),viewBox:e.getAttribute("viewBox"),content:e.outerHTML})},t.prototype.destroy=function(){this.isMounted&&this.unmount(),e.prototype.destroy.call(this)},t.prototype.mount=function(e){if(this.isMounted)return this.node;var t="string"==typeof e?document.querySelector(e):e,i=this.render();return this.node=i,t.appendChild(i),i},t.prototype.render=function(){var e=this.stringify();return n(d(e)).childNodes[0]},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(t.prototype,i),t}(i)}()}()}).call(t,i("698d75b157f24ae829cc"))},"9ce58a7deea14f49ef01":function(e,t,i){(function(t){!function(t,i){e.exports=function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function i(e){return e=e||Object.create(null),{on:function(t,i){(e[t]||(e[t]=[])).push(i)},off:function(t,i){e[t]&&e[t].splice(e[t].indexOf(i)>>>0,1)},emit:function(t,i){(e[t]||[]).map(function(e){e(i)}),(e["*"]||[]).map(function(e){e(t,i)})}}}function n(e,t){return C(e).reduce(function(e,i){if(!i.attributes)return e;var n=C(i.attributes),o=t?n.filter(t):n;return e.concat(o)},[])}function o(e){return e.replace(O,function(e){return"%"+e[0].charCodeAt(0).toString(16).toUpperCase()})}function s(e,t,i){return C(e).forEach(function(e){var n=e.getAttribute(E);if(n&&0===n.indexOf(t)){var o=n.replace(t,i);e.setAttributeNS(M,E,o)}}),e}var r=("undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self,e(function(e,t){!function(t,i){e.exports=function(){function e(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function t(e){return Array.isArray(e)?[]:{}}function i(i,n){return n&&!0===n.clone&&e(i)?s(t(i),i,n):i}function n(t,n,o){var r=t.slice();return n.forEach(function(n,a){void 0===r[a]?r[a]=i(n,o):e(n)?r[a]=s(t[a],n,o):-1===t.indexOf(n)&&r.push(i(n,o))}),r}function o(t,n,o){var r={};return e(t)&&Object.keys(t).forEach(function(e){r[e]=i(t[e],o)}),Object.keys(n).forEach(function(a){e(n[a])&&t[a]?r[a]=s(t[a],n[a],o):r[a]=i(n[a],o)}),r}function s(e,t,s){var r=Array.isArray(t),a=s||{arrayMerge:n},l=a.arrayMerge||n;return r?Array.isArray(e)?l(e,t,s):i(t,s):o(e,t,s)}return s.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,i){return s(e,i,t)})},s}()}()})),a=e(function(e,t){var i={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};t.default=i,e.exports=t.default}),l=function(e){return Object.keys(e).map(function(t){return t+'="'+e[t].toString().replace(/"/g,""")+'"'}).join(" ")},c=a.svg,d=a.xlink,h={};h[c.name]=c.uri,h[d.name]=d.uri;var u,g=function(e,t){void 0===e&&(e="");var i=r(h,t||{});return"<svg "+l(i)+">"+e+"</svg>"},f=a.svg,p=a.xlink,m={attrs:(u={style:["position: absolute","width: 0","height: 0"].join("; ")},u[f.name]=f.uri,u[p.name]=p.uri,u)},v=function(e){this.config=r(m,e||{}),this.symbols=[]};v.prototype.add=function(e){var t=this,i=t.symbols,n=this.find(e.id);return n?(i[i.indexOf(n)]=e,!1):(i.push(e),!0)},v.prototype.remove=function(e){var t=this,i=t.symbols,n=this.find(e);return!!n&&(i.splice(i.indexOf(n),1),n.destroy(),!0)},v.prototype.find=function(e){return this.symbols.filter(function(t){return t.id===e})[0]||null},v.prototype.has=function(e){return null!==this.find(e)},v.prototype.stringify=function(){var e=this.config,t=e.attrs,i=this.symbols.map(function(e){return e.stringify()}).join("");return g(i,t)},v.prototype.toString=function(){return this.stringify()},v.prototype.destroy=function(){this.symbols.forEach(function(e){return e.destroy()})};var y=function(e){var t=e.id,i=e.viewBox,n=e.content;this.id=t,this.viewBox=i,this.content=n};y.prototype.stringify=function(){return this.content},y.prototype.toString=function(){return this.stringify()},y.prototype.destroy=function(){var e=this;["id","viewBox","content"].forEach(function(t){return delete e[t]})};var _,S=function(e){var t=!!document.importNode,i=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t?document.importNode(i,!0):i},b=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={isMounted:{}};return i.isMounted.get=function(){return!!this.node},t.createFromExistingNode=function(e){return new t({id:e.getAttribute("id"),viewBox:e.getAttribute("viewBox"),content:e.outerHTML})},t.prototype.destroy=function(){this.isMounted&&this.unmount(),e.prototype.destroy.call(this)},t.prototype.mount=function(e){if(this.isMounted)return this.node;var t="string"==typeof e?document.querySelector(e):e,i=this.render();return this.node=i,t.appendChild(i),i},t.prototype.render=function(){var e=this.stringify();return S(g(e)).childNodes[0]},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(t.prototype,i),t}(y),w={autoConfigure:!0,mountTo:"body",syncUrlsWithBaseTag:!1,listenLocationChangeEvent:!0,locationChangeEvent:"locationChange",locationChangeAngularEmitter:!1,usagesToUpdate:"use[*|href]",moveGradientsOutsideSymbol:!1},C=function(e){return Array.prototype.slice.call(e,0)},x=navigator.userAgent,T={isChrome:/chrome/i.test(x),isFirefox:/firefox/i.test(x),isIE:/msie/i.test(x)||/trident/i.test(x),isEdge:/edge/i.test(x)},I=function(e,t){var i=document.createEvent("CustomEvent");i.initCustomEvent(e,!1,!1,t),window.dispatchEvent(i)},P=function(e){var t=[];return C(e.querySelectorAll("style")).forEach(function(e){e.textContent+="",t.push(e)}),t},L=function(e){return(e||window.location.href).split("#")[0]},A=function(e){angular.module("ng").run(["$rootScope",function(t){t.$on("$locationChangeSuccess",function(t,i,n){I(e,{oldUrl:n,newUrl:i})})}])},k=function(e,t){return void 0===t&&(t="linearGradient, radialGradient, pattern"),C(e.querySelectorAll("symbol")).forEach(function(e){C(e.querySelectorAll(t)).forEach(function(t){e.parentNode.insertBefore(t,e)})}),e},M=a.xlink.uri,E="xlink:href",O=/[{}|\\\^\[\]`"<>]/g,$=["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke","style"],R=$.map(function(e){return"["+e+"]"}).join(","),D=function(e,t,i,r){var a=o(i),l=o(r);n(e.querySelectorAll(R),function(e){var t=e.localName,i=e.value;return-1!==$.indexOf(t)&&-1!==i.indexOf("url("+a)}).forEach(function(e){return e.value=e.value.replace(a,l)}),s(t,a,l)},j={MOUNT:"mount",SYMBOL_MOUNT:"symbol_mount"},H=function(e){function t(t){var n=this;void 0===t&&(t={}),e.call(this,r(w,t));var o=i();this._emitter=o,this.node=null;var s=this,a=s.config;if(a.autoConfigure&&this._autoConfigure(t),a.syncUrlsWithBaseTag){var l=document.getElementsByTagName("base")[0].getAttribute("href");o.on(j.MOUNT,function(){return n.updateUrls("#",l)})}var c=this._handleLocationChange.bind(this);this._handleLocationChange=c,a.listenLocationChangeEvent&&window.addEventListener(a.locationChangeEvent,c),a.locationChangeAngularEmitter&&A(a.locationChangeEvent),o.on(j.MOUNT,function(e){a.moveGradientsOutsideSymbol&&k(e)}),o.on(j.SYMBOL_MOUNT,function(e){a.moveGradientsOutsideSymbol&&k(e.parentNode),(T.isIE||T.isEdge)&&P(e)})}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},t.prototype._autoConfigure=function(e){var t=this,i=t.config;void 0===e.syncUrlsWithBaseTag&&(i.syncUrlsWithBaseTag=void 0!==document.getElementsByTagName("base")[0]),void 0===e.locationChangeAngularEmitter&&(i.locationChangeAngularEmitter="angular"in window),void 0===e.moveGradientsOutsideSymbol&&(i.moveGradientsOutsideSymbol=T.isFirefox)},t.prototype._handleLocationChange=function(e){var t=e.detail,i=t.oldUrl,n=t.newUrl;this.updateUrls(i,n)},t.prototype.add=function(t){var i=this,n=e.prototype.add.call(this,t);return this.isMounted&&n&&(t.mount(i.node),this._emitter.emit(j.SYMBOL_MOUNT,t.node)),n},t.prototype.attach=function(e){var t=this,i=this;if(i.isMounted)return i.node;var n="string"==typeof e?document.querySelector(e):e;return i.node=n,this.symbols.forEach(function(e){e.mount(i.node),t._emitter.emit(j.SYMBOL_MOUNT,e.node)}),C(n.querySelectorAll("symbol")).forEach(function(e){var t=b.createFromExistingNode(e);t.node=e,i.add(t)}),this._emitter.emit(j.MOUNT,n),n},t.prototype.destroy=function(){var e=this,t=e.config,i=e.symbols,n=e._emitter;i.forEach(function(e){return e.destroy()}),n.off("*"),window.removeEventListener(t.locationChangeEvent,this._handleLocationChange),this.isMounted&&this.unmount()},t.prototype.mount=function(e,t){void 0===e&&(e=this.config.mountTo),void 0===t&&(t=!1);var i=this;if(i.isMounted)return i.node;var n="string"==typeof e?document.querySelector(e):e,o=i.render();return this.node=o,t&&n.childNodes[0]?n.insertBefore(o,n.childNodes[0]):n.appendChild(o),this._emitter.emit(j.MOUNT,o),o},t.prototype.render=function(){return S(this.stringify())},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},t.prototype.updateUrls=function(e,t){if(!this.isMounted)return!1;var i=document.querySelectorAll(this.config.usagesToUpdate);return D(this.node,i,L(e)+"#",L(t)+"#"),!0},Object.defineProperties(t.prototype,n),t}(v),B=e(function(e){!function(t,i){e.exports=function(){var e,t=[],i=document,n=i.documentElement.doScroll,o=(n?/^loaded|^c/:/^loaded|^i|^c/).test(i.readyState);return o||i.addEventListener("DOMContentLoaded",e=function(){for(i.removeEventListener("DOMContentLoaded",e),o=1;e=t.shift();)e()}),function(e){o?setTimeout(e,0):t.push(e)}}()}()});!window.__SVG_SPRITE__?(_=new H({attrs:{id:"__SVG_SPRITE_NODE__"}}),window.__SVG_SPRITE__=_):_=window.__SVG_SPRITE__;var W=function(){var e=document.getElementById("__SVG_SPRITE_NODE__");e?_.attach(e):_.mount(document.body,!0)};return document.body?W():B(W),_}()}()}).call(t,i("698d75b157f24ae829cc"))}}),define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js",function(){}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/chevron-left_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([1456],{"3865314c5959606874d4":function(t,i){t.exports=e},"77ca6f3adf409feb8f75":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"chevron-left_16_v6",use:"chevron-left_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="chevron-left_16_v6"><path d="M5 8l5-5 .7.7L6.4 8l4.3 4.3-.7.7z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a},bd4e46565456c9e0393c:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("77ca6f3adf409feb8f75"));t.default=o.a}},["bd4e46565456c9e0393c"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/chevron-right_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([1453],{"11851ffb8d2b05d6700a":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"chevron-right_16_v6",use:"chevron-right_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="chevron-right_16_v6"><path d="M11 8l-5 5-.7-.7L9.6 8 5.3 3.7 6 3z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a},"3865314c5959606874d4":function(t,i){t.exports=e},"5863da78ae10546f8ae3":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("11851ffb8d2b05d6700a"));t.default=o.a}},["5863da78ae10546f8ae3"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/settings_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([382],{"3865314c5959606874d4":function(t,i){t.exports=e},bc4eed15100e359217ef:function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"settings_16_v6",use:"settings_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="settings_16_v6"><path d="M13.5 8.4v-.8l1-.8c.4-.3.4-.9.2-1.3l-1.2-2c-.2-.3-.5-.5-.9-.5-.1 0-.2 0-.3.1l-1.2.4c-.2-.1-.4-.3-.7-.4l-.3-1.3c0-.5-.4-.8-.9-.8H6.8c-.5 0-.9.3-1 .8l-.2 1.3c-.3.1-.5.2-.7.3L3.7 3h-.3c-.4 0-.7.2-.9.5l-1.2 2c-.2.4-.1.9.3 1.3l.9.9v.8l-.9.7c-.4.3-.5.9-.2 1.3l1.2 2c.1.3.4.5.8.5.1 0 .2 0 .3-.1l1.2-.4c.2.1.4.3.7.4l.3 1.3c.1.5.5.8 1 .8h2.4c.5 0 .9-.3 1-.8l.3-1.3c.2-.1.4-.2.7-.4l1.2.4c.1 0 .2.1.3.1.4 0 .7-.2.9-.5l1.1-2c.2-.4.2-.9-.2-1.3l-1.1-.8zm-.9 3.6l-1.7-.6c-.4.3-.9.6-1.4.8L9.2 14H6.8l-.4-1.8c-.5-.2-.9-.5-1.4-.8l-1.6.6-1.2-2 1.4-1.2c-.1-.5-.1-1.1 0-1.6L2.2 6l1.2-2 1.7.6c.4-.4.9-.6 1.4-.8L6.8 2h2.4l.4 1.8c.5.2.9.5 1.4.8l1.6-.6 1.2 2-1.4 1.2c.1.5.1 1.1 0 1.6l1.4 1.2-1.2 2z" /><path d="M8 11c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3c0 1.6-1.3 3-3 3zm0-5c-1.1 0-2 .8-2 1.9V8c0 1.1.8 2 1.9 2H8c1.1 0 2-.8 2-1.9V8c0-1.1-.8-2-2-2 .1 0 0 0 0 0z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a},c01b61d22501dafa933d:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("bc4eed15100e359217ef"));t.default=o.a}},["c01b61d22501dafa933d"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/play_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([607],{"0261c092616c7956fe39":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("9abe0b0e9cd612ca2c8b"));t.default=o.a},"3865314c5959606874d4":function(t,i){t.exports=e},"9abe0b0e9cd612ca2c8b":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"play_16_v6",use:"play_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="play_16_v6"><path d="M3.5 14c-.3 0-.5-.2-.5-.5v-11c0-.2.1-.3.2-.4.2-.1.4-.1.6 0l9.5 5.5c.2.1.3.4.2.7 0 .1-.1.1-.2.2L3.8 14h-.3zM4 3.4v9.3L12 8 4 3.4z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a}},["0261c092616c7956fe39"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/pause_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([653],{"3865314c5959606874d4":function(t,i){t.exports=e},"4d5a769df345c8c33ea7":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("ec6daae6289868b6e348"));t.default=o.a},ec6daae6289868b6e348:function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"pause_16_v6",use:"pause_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="pause_16_v6"><path d="M6 4v8H4V4h2m0-1H4c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V4c0-.6-.4-1-1-1zm6 1v8h-2V4h2m0-1h-2c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V4c0-.6-.4-1-1-1z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a}},["4d5a769df345c8c33ea7"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/minimize_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([770],{"2c1b5424053b624aafc6":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("2c1e959f9177919ea3d6"));t.default=o.a},"2c1e959f9177919ea3d6":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"minimize_16_v6",use:"minimize_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="minimize_16_v6"><path d="M2 9v1h3.3L1 14.3l.7.7L6 10.7V14h1V9zm12-2V6h-3.3L15 1.7l-.7-.7L10 5.3V2H9v5z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a},"3865314c5959606874d4":function(t,i){t.exports=e}},["2c1b5424053b624aafc6"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/skip-back_32",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([364],{"2b8cad26de3a7890db09":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"skip-back_32_v6",use:"skip-back_32_v6-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="skip-back_32_v6"><path d="M27 28a1 1 0 01-.5-.13l-19-11a1 1 0 010-1.74l19-11a1 1 0 011 0A1 1 0 0128 5v22a1 1 0 01-1 1zM10 16l16 9.27V6.73zM2 4h2v24H2z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});r.a.add(a),t.a=a},"3865314c5959606874d4":function(t,i){t.exports=e},fa22f19e4814b4bb161a:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("2b8cad26de3a7890db09"));t.default=o.a}},["fa22f19e4814b4bb161a"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/skip-forward_32",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([359],{"261ebd0a93bbf965006b":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"skip-forward_32_v6",use:"skip-forward_32_v6-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="skip-forward_32_v6"><path d="M5 28a1 1 0 01-1-1V5a1 1 0 01.5-.87 1 1 0 011 0l19 11a1 1 0 010 1.74l-19 11A1 1 0 015 28zM6 6.73v18.54L22 16zM28 4h2v24h-2z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});r.a.add(a),t.a=a},"26c1139d2e1b384f8386":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("261ebd0a93bbf965006b"));t.default=o.a},"3865314c5959606874d4":function(t,i){t.exports=e}},["26c1139d2e1b384f8386"])}),define("storytelling/views/TimelinePlayerView",["baglass/core-client/js/core-client/ui/core/View","baglass/core-client/js/core-client/utils/Utils","./PlayerViewProgressBar","text!./templates/TimelinePlayerView.html","gemini/app/util/ScreenReaderUtil","storytelling-ui/storytelling-ui.min","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/chevron-left_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/chevron-right_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/settings_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/play_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/pause_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/minimize_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/skip-back_32","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/skip-forward_32","jquery","react","react-dom"],function(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,p,m){var v=e.extend({templateString:n,controller:null,currentPlayState:null,events:{"primaryaction button.playPause":"onPlayPauseClick","primaryaction button.sceneStart":"onSceneStartClick","primaryaction button.sceneEnd":"onSceneEndClick","primaryaction button.fullscreen":"onExitFullscreenClick","primaryaction button.timelineSettings":"onTimelineSettingsClick","primaryaction button.prevScene":"onPreviousSceneClick","primaryaction button.nextScene":"onNextSceneClick"},init:function(e){v.inherited("init",this,arguments),this.controller=e.controller,this.glassContext=e.glassContext,this.services=e.services,this._ScreenReader=new o,this.stringResources=this.services.getSvcSync(".StringResources"),this.flyoutHolder=document.createElement("div"),this.flyoutHolder.classList.add("flyout-holder")},render:function(){this.$el.addClass("timelinePlayer").attr("role","application"),this.$el.addClass("blockOnExpandView"),this.currentPlayState={};var e=this.dotTemplate({stringSceneCount:this._getSceneCountString(),sceneStartLabel:this.stringResources.get("sceneStart",{position:"0:00.0"}),playLabel:this.stringResources.get("timelinePlay"),prevSceneLabel:this.stringResources.get("navPrevScene"),prevSceneAbbreviatedLabel:this.stringResources.get("navPrevSceneAbbreviated"),nextSceneLabel:this.stringResources.get("navNextScene"),navModelLabel:this.stringResources.get("sceneNavigation"),showOverview:this.controller.hasOverview(),toggleOverviewLabel:this.stringResources.get("navToggleOverview"),fullscreenLabel:this.stringResources.get("navExitFullScreen"),timelineSettingsLabel:this.stringResources.get("timelineSettingsButton")});return this.$el.html(e),this.$sceneCountLabel=this.$el.find(".numScenes"),this.progressBar=new i({el:this.$el.find(".progressInfo > .progressBarView"),timelineController:this.controller.getTimelineController(),controller:this.controller,glassContext:this.glassContext,services:this.services}),this.progressBar.render(),this.timeLabel=this.$el.find(".progressInfo > .timeLabel"),this.durationLabel=this.$el.find(".progressInfo > .durationLabel"),this.$previousSceneButton=this.$el.find("button.prevScene"),this.$sceneStartButton=this.$el.find("button.sceneStart"),this.$playPauseButton=this.$el.find("button.playPause"),this.$sceneEndButton=this.$el.find("button.sceneEnd"),this.$nextSceneButton=this.$el.find("button.nextScene"),this.$timelineSettingsButton=this.$el.find("button.timelineSettings"),this.$fullscreenButton=this.$el.find("button.fullscreen"),this.$fullscreenButtonContainer=this.$el.find(".storyContainer.fullscreen"),this.$fullscreenButtonContainer.hide(),t.setIcon(this.$previousSceneButton,r.default.id),t.setIcon(this.$sceneStartButton,u.default.id),t.setIcon(this.$sceneEndButton,g.default.id),t.setIcon(this.$nextSceneButton,a.default.id,null,null,!0),t.setIcon(this.$timelineSettingsButton,l.default.id),t.setIcon(this.$fullscreenButton,h.default.id),f(window).on("resize.privateViewEvents"+this.viewId,this.onSmallScreenUpdate.bind(this)),this.controller.on("scene:add",this.onSceneAdded,this),this.controller.on("time:update",this.onTimeUpdated,this),this.controller.on("playState:change",this.onPlayStateChanged,this),this.controller.on("scene:select",this.onSceneSelected,this),this.controller.on("scene:expand",this.onSceneExpand,this),this.controller.on("scene:collapse",this.onSceneCollapse,this),this.controller.on("navigation:complete",this.onNavigationComplete,this),
- this.controller.on("change:showOverviews",this.onShowOverviewsChanged,this),this.controller.on("mode:change",this.onModeChange,this),this.controller.on("kioskMode:change",this._updateLabels,this),this.controller.on("navigateMarkers:change",this._onNavigateMarkersChange,this),this.controller.getTimelineController().on("duration:changed",this.onDurationChanged,this),this._updateTime(this.controller.getStoryCurrentTimeLabel()),this._updateDuration(),this._updatePlayState(),this._updateLabels(),this._updateLabelsVisibility(),this},onSmallScreenUpdate:function(){this._flyout&&this._closePlayThroughFlyout(),this._updateLabelsVisibility()},_updateLabelsVisibility:function(){var e=this.$el.width(),t=this.$previousSceneButton.find(".navLabel"),i=this.$nextSceneButton.find(".navLabel");e<1050?(t.addClass("hidden"),i.addClass("hidden")):(t.removeClass("hidden"),i.removeClass("hidden"))},remove:function(){this.timeLabel=null,f(window).off("resize.privateViewEvents"+this.viewId),this.controller.off("scene:add",this.onSceneAdded,this),this.controller.off("time:update",this.onTimeUpdated,this),this.controller.off("playState:change",this.onPlayStateChanged,this),this.controller.off("scene:select",this.onSceneSelected,this),this.controller.off("scene:expand",this.onSceneExpand,this),this.controller.off("scene:collapse",this.onSceneCollapse,this),this.controller.off("navigation:complete",this.onNavigationComplete,this),this.controller.off("change:showOverviews",this.onShowOverviewsChanged,this),this.controller.off("mode:change",this.onModeChange,this),this.controller.off("kioskMode:change",this._updateLabels,this),this.controller.off("navigateMarkers:change",this._onNavigateMarkersChange,this),this.controller.getTimelineController().off("duration:changed",this.onDurationChanged,this),this.progressBar&&this.progressBar.remove(),v.inherited("remove",this,arguments)},onPlayPauseClick:function(){this.controller.togglePlayPause()},onSceneStartClick:function(){this.controller.pause(),this.controller.setCurrentTime(0)},onSceneEndClick:function(){this.controller.pause(),this.controller.setCurrentTime(this.controller.getDuration())},onSceneAdded:function(){this._updateLabels()},onModeChange:function(){this.updateProgressBar(),this._updateLabels()},onDurationChanged:function(){this._updateDuration(),this.updateProgressBar()},onTimeUpdated:function(e){var t=this.controller.isPlaying();t||this._updateLabels(),this._updateTime(e.label),this._updatePlayState({time:e.time,playing:t})},onPlayStateChanged:function(e){var t=this.controller.isPlaying();t||0===e.currentTime||this.progressBar.timeIndicatorView.handleTimelinePositionIndicatorMove(),this._updatePlayState({time:e.currentTime,playing:t})},onSceneSelected:function(){this._updateLabels(),this._updateTime(this.controller.getStoryCurrentTimeLabel()),this._updateDuration()},onSceneExpand:function(){this.$el.addClass("viewingScene")},onSceneCollapse:function(){this.$el.removeClass("viewingScene")},onNavigationComplete:function(){this._updatePlayState()},toggleFullscreenControls:function(e){e?(this.$fullscreenButtonContainer.show(),this.controller.isAuthoring()&&this.controller.setCurrentTime(0)):this.$fullscreenButtonContainer.hide(),e&&this.$el.hide()},onTimelineSettingsClick:function(e){this._flyout?this._closePlayThroughFlyout():this._createPlayThroughFlyout(e)},onExitFullscreenClick:function(){this.controller.eventRouter.trigger("fullscreen:exit")},onPreviousSceneClick:function(){this.controller.previousScene(),this.progressBar.timeIndicatorView.handlePositionMoveLeft()},onNextSceneClick:function(){this.controller.nextScene(),this.progressBar.timeIndicatorView.handlePositionMoveRight()},onShowOverviewsChanged:function(){this._updateLabels()},_createPlayThroughFlyout:function(e){this.$el.append(this.flyoutHolder),this._flyout=p.createElement(s.PlayThroughFlyout,{anchorElement:e.currentTarget,closeFlyout:this._closePlayThroughFlyout.bind(this),controller:this.controller}),m.render(this._flyout,this.flyoutHolder),this.$timelineSettingsButton.addClass("selected")},_closePlayThroughFlyout:function(){m.unmountComponentAtNode(this.flyoutHolder),this.$el.find(".flyout-holder").remove(),this._flyout=null,this.$timelineSettingsButton.removeClass("selected")},_getSceneCountString:function(){var e=this.controller.getSceneCount(),t=this.controller.getSelectedSceneIndex();return t>=0?this.stringResources.get("storySceneRangeCountLabel",{index:t+1,count:e}):1===e?this.stringResources.get("storySceneSingleCountLabel"):this.stringResources.get("storySceneCountLabel",{count:e})},_onNavigateMarkersChange:function(){this._updateLabels(),this.updateProgressBar()},_updateLabels:function(){var e,t;this.controller.isKioskMode()?(t=!0,e=!0):(e=!this.controller.isOnFirstScene(),t=!this.controller.isOnLastScene(),this.controller.isNavigateMarkers()&&(e||(e=!this.controller.isAtStartOfScene()),t||(t=!this.controller.isAtEndOfScene()))),this.$previousSceneButton.prop("disabled",!e),this.$nextSceneButton.prop("disabled",!t),this.$sceneCountLabel.html(this._getSceneCountString());var i={abbreviatedString:this.stringResources.get("navPrevSceneAbbreviated"),string:this.stringResources.get("navPrevScene")},n={string:this.stringResources.get("navNextScene")};if(this.controller.isNavigateMarkers()){var o={abbreviatedString:this.stringResources.get("navPrevMarkerAbbreviated"),string:this.stringResources.get("navPrevMarker")},s={string:this.stringResources.get("navNextMarker")};this._updateLabel(this.$previousSceneButton,this.controller.isAtStartOfScene()?i:o),this._updateLabel(this.$nextSceneButton,this.controller.isAtEndOfScene()?n:s)}else this._updateLabel(this.$previousSceneButton,i),this._updateLabel(this.$nextSceneButton,n)},_updateLabel:function(e,t){e.attr("aria-label",t.string),e.attr("title",t.string),e.find(".navLabel").text(t.abbreviatedString?t.abbreviatedString:t.string)},updateProgressBar:function(){this.progressBar&&this.progressBar.refresh()},_updateDuration:function(){if(this.durationLabel){var e=this.controller.getStoryDurationLabel();this.durationLabel.text(e)}var t=this.$el.find(".sceneEnd"),i=this.stringResources.get("sceneEnd",{position:this.progressBar.timeIndicatorView.getEndTime()});t.attr("aria-label",i),t.attr("title",i)},_updateTime:function(e){this.timeLabel&&this.timeLabel.text(e)},_getCurrentTime:function(){return this.progressBar.timeIndicatorView.getCurrentTime()},_updatePlayState:function(e){e=e||{time:this.controller.getCurrentTime(),playing:this.controller.isPlaying()};var i=this.controller.getDuration(),n=e.playing,o=i>0||this.controller.isStartOverview(),s=e.time>0,r=e.time<i;if(n!==this.currentPlayState.playing){var a=n?this.stringResources.get("timelinePause"):this.stringResources.get("timelinePlay");this.$playPauseButton.attr("title",a).attr("aria-label",a).html(""),this._ScreenReader.callOut(a),n?t.setIcon(this.$playPauseButton,d.default.id):t.setIcon(this.$playPauseButton,c.default.id),this.currentPlayState.playing=n}o!==this.currentPlayState.canPlayPause&&(this.$playPauseButton.prop("disabled",!o),this.currentPlayState.canPlayPause=o),s!==this.currentPlayState.canGoToStart&&(this.$sceneStartButton.prop("disabled",!s),this.currentPlayState.canGoToStart=s),r!==this.currentPlayState.canGoToEnd&&(this.$sceneEndButton.prop("disabled",!r),this.currentPlayState.canGoToEnd=r)}});return v}),define("storytelling/navigation/ui/AutoHidingControl",["baglass/core-client/js/core-client/ui/core/View"],function(e){var t=e.extend({autohide:null,init:function(e){t.inherited("init",this,arguments),e=e||{},this.autohide=e.autohide||6e3,this.startHidden=e.startHidden||!1,this.hidden=!0},render:function(){var e=this;return this._renderContent().then(function(){e.$el.on("mouseenter",e._cancelAutoHide.bind(e)),e.$el.on("mouseleave",e._setAutoHide.bind(e)),e.hidden=!1,e.startHidden?e.hide({duration:0}):e.show({duration:0})})},destroy:function(){var e=this;return this._cancelAutoHide(),this.hide().then(function(){e.remove()})},toggle:function(){this.hidden?this.show():this.hide()},_cancelAutoHide:function(){this.timeout&&clearTimeout(this.timeout),this.timeout=null},_setAutoHide:function(){this.timeout=setTimeout(this.hide.bind(this),this.autohide)},show:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Promise.delay(t.delay||0).then(function(){return e._show(t).then(function(){e.$el.attr("aria-hidden","false"),e.hidden=!1,e._cancelAutoHide(),e._setAutoHide()})})},hide:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.hidden?Promise.resolve():this._hide(t).then(function(){e.$el.attr("aria-hidden","true"),e.hidden=!0})},_renderContent:function(){return Promise.resolve()},_show:function(){return Promise.resolve()},_hide:function(){return Promise.resolve()}});return t}),define("storytelling/views/StoryNavControl",["../navigation/ui/AutoHidingControl"],function(e){var t=e.extend({init:function(e){t.inherited("init",this,arguments),this.subview=e.subview},remove:function(){t.inherited("remove",this,arguments)},_renderContent:function(){return this.subview&&this.subview.$el.appendTo(this.$el.empty()).show(),Promise.resolve()},_show:function(e){var t=this,i=e&&e.duration||"fast";return new Promise(function(e){t.$el.css({"pointer-events":""}),t.$el.slideDown(i,function(){this.subview&&this.subview.updateProgressBar(),e()}.bind(t))})},_hide:function(e){var t=this,i=e&&e.duration||"fast";return new Promise(function(e){t.subview&&t.subview._flyout&&t.subview._flyout.close(),t.$el.css({"pointer-events":"none"}),t.$el.slideUp(i,function(){e()})})}});return t}),define("storytelling/views/MouseOverArea",["baglass/core-client/js/core-client/ui/core/View"],function(e){var t=e.extend({init:function(e){t.inherited("init",this,arguments),this.onActivate=e.onActivate,this.$el.on("mouseover",this.onActivate)},remove:function(){this.$el.off("mouseover",this.onActivate),t.inherited("remove",this,arguments)}});return t}),define("storytelling/StoryPaneController",["baglass/core-client/js/core-client/ui/core/Events","underscore","baglass/core-client/js/core-client/utils/ClassFactory"],function(e,t,i){var n=e.extend({authoring:!1,currentSceneIndex:0,timelineController:null,sceneCount:0,fullscreen:!1,layoutToListing:{slideshow:"slideShow",panAndZoom1:"panAndZoom1",panAndZoom2:"panAndZoom2",panAndZoom3:"panAndZoom3",panAndZoom4:"panAndZoom4",panAndZoom5:"panAndZoom5",panAndZoom6:"panAndZoom6"},init:function(e){n.inherited("init",this,arguments),this.eventRouter=e.eventRouter,this.model=e.model,this.timelineController=e.timelineController,this.authoring=e.authoring,this.dashboardApi=e.dashboardApi,this.eventRouter.on("layoutType:changed",this._onLayoutTypeChanged,this),this.eventRouter.on("mode:change",this.onModeChanged,this),this.eventRouter.on("navigation:started",this.onNavigationStarted,this),this.eventRouter.on("navigation:complete",this.onNavigationComplete,this),this.eventRouter.on("playback:prev",this.previousScene,this),this.eventRouter.on("playback:next",this.nextScene,this),this.eventRouter.on("playback:togglePlayPause",this.togglePlayPause,this),this.eventRouter.on("timeline:end",this.playThrough,this),this.model.layout.on("change:showOverviews",this.onShowOverviewsChanged,this),this.model.layout.on("change:pageSize",this.onPageSizeChange,this),this.timelineController.on("time:update",this.onTimeUpdated,this),this.timelineController.on("playState:change",this.onTimeStateChanged,this),this.timelineController.on("navigateMarkers:change",this.onNavigateMarkersChange,this),this.timelineController.on("kioskMode:change",this.onKioskModeChange,this),this.model.on("addLayouts",this.onAddLayouts,this),this.model.on("removeLayouts",this.onRemoveLayout,this),this.sceneCount=this.getSceneCount(),this.playThroughTimer=null,this.overviewPauseLength=5e3,this.startOverviewIndex=-1,this.endOverviewIndex=-2,this.currentSceneIndex=this.showStartOverview()&&!this.isAuthoring()?this.startOverviewIndex:0,this.startOverviewId="start",this.endOverviewId="end",this.currentSceneId=this.showStartOverview()&&!this.isAuthoring()?this.startOverviewId:this.model.layout.items[0].id,this.shareState=null},onStoryLayoutReady:function(e,t){if(e){var i=parseInt(e,10);this.currentSceneIndex=i<0?i:this.getSceneIndex(e)}this._updateSelectedScene(),this.timelineController.maxPreviousScenes(this.currentSceneIndex),this.timelineController.zeroFutureScenes(this.currentSceneIndex),t>=0&&this.setCurrentTime(t)},destroy:function(){this.eventRouter.off("layoutType:changed",this._onLayoutTypeChanged,this),this.eventRouter.off("mode:change",this.onModeChanged,this),this.eventRouter.off("navigation:started",this.onNavigationStarted,this),this.eventRouter.off("navigation:complete",this.onNavigationComplete,this),this.eventRouter.off("playback:prev",this.previousScene,this),this.eventRouter.off("playback:next",this.nextScene,this),this.eventRouter.off("playback:togglePlayPause",this.togglePlayPause,this),this.eventRouter.off("timeline:end",this.playThrough,this),this.model.layout.off("change:showOverviews",this.onShowOverviewsChanged,this),this.model.layout.off("change:pageSize",this.onPageSizeChange,this),this.timelineController.off("time:update",this.onTimeUpdated,this),this.timelineController.off("playState:change",this.onTimeStateChanged,this),this.timelineController.off("navigateMarkers:change",this.onNavigateMarkersChange,this),this.timelineController.off("kioskMode:change",this.onKioskModeChange,this),this.model.off("addLayouts",this.onAddLayouts,this),this.model.off("removeLayouts",this.onRemoveLayout,this)},enterShareState:function(e){if(!this.shareState){var t=this.isPlaying();t&&this.pause(),this.shareState={wasPlaying:t,slideout:e}}},leaveShareState:function(){this.shareState&&(this.shareState.wasPlaying&&!this.isPlaying()&&this.play(),this.shareState=null)},enterPrintMode:function(){return this.timelineController.maxPreviousScenes(-2)},leavePrintMode:function(e){var t=this;return this.timelineController.zeroFutureScenes(-1).then(function(){e>=0&&t.setCurrentTime(e)})},getTimelineController:function(){return this.timelineController},pause:function(){this.cancelPlaythroughTimer(),this.timelineController.pause()},cancelPlaythroughTimer:function(){this.playThroughTimer&&(clearTimeout(this.playThroughTimer),this.playThroughTimer=null)},selectNextSceneAfterPause:function(e){this.playThroughTimer||(this.playThroughTimer=setTimeout(function(){this.isAuthoring()||this.nextScene(e)}.bind(this),this.overviewPauseLength))},playThrough:function(e){this.isPlayThrough()&&!this.isAuthoring()&&!this.isPlaying()&&e&&!1!==e.play&&(this.isOverview()?this.selectNextSceneAfterPause({play:!0}):this.nextScene({play:"playing"===e.endState}))},play:function(){this.cancelPlaythroughTimer(),this.isStartOverview()?this.selectScene({index:0,play:!0}):this.timelineController.play()},stop:function(){this.cancelPlaythroughTimer(),this.timelineController.stop()},isScenePopulated:function(e){return this.model.layout.listWidgets([e]).length>0},isPlaying:function(){return this.timelineController.isPlaying()},togglePlayThrough:function(){this.cancelPlaythroughTimer(),this.timelineController.togglePlayThrough()},toggleKioskMode:function(){this.timelineController.toggleKioskMode(),this.trigger("kioskMode:change",{isKioskMode:this.isKioskMode()})},toggleNavigateMarkers:function(){this.timelineController.toggleNavigateMarkers()},toggleRefreshData:function(){this.timelineController.toggleRefreshData()},togglePlayPause:function(){this.isPlaying()?this.pause():this.play()},getCurrentTime:function(){return this.timelineController.getCurrentTime()},setCurrentTime:function(e){return this.timelineController.setCurrentTime(e)},getDuration:function(){return this.timelineController.getDuration()},widgetAtStartOfCurrentScene:function(e){var t=this.timelineController.getTimelineEpisodeById(e);return!!t&&t.touchesStart()},nextScene:function(e){return this.isNavigateMarkers()&&!this.timelineController.isAtEndOfScene()?this._nextMarker():this._nextScene(e)},_nextScene:function(e){if(this.dashboardApi.deselectAllWidgets(),this.isKioskMode()&&this.isOnLastScene()){var i=this.isRefreshData()&&!this.isAuthoring();return this.getSceneCount()>1?this._invokeLifeCycleHandlers("scene:next",t.extend({},e,{to:this.getFirstSceneIndex(),refreshData:i})):this.selectScene({index:this.getFirstSceneIndex(),forceSelect:!0,refreshData:i})}if(!this.isOnLastScene())return this._invokeLifeCycleHandlers("scene:next",e)},_nextMarker:function(){return this.timelineController.jumpToNextMarker()},previousScene:function(){return this.isNavigateMarkers()&&!this.timelineController.isAtStartOfScene()?this._previousMarker():this._previousScene()},_previousScene:function(){if(this.dashboardApi.deselectAllWidgets(),this.isKioskMode()&&this.isOnFirstScene())return this.getSceneCount()>1?this._invokeLifeCycleHandlers("scene:previous",{to:this.getLastSceneIndex()}):this.selectScene({index:this.getLastSceneIndex(),forceSelect:!0});if(!this.isOnFirstScene()){var e=this.isOnSecondScene()&&this.isRefreshData()&&!this.isAuthoring();return this._invokeLifeCycleHandlers("scene:previous",{refreshData:e})}},_previousMarker:function(){return this.timelineController.jumpToPreviousMarker()},_invokeLifeCycleHandlers:function(e,t){return this.dashboardApi.getDashboardCoreSvc(".LifeCycleManager").invokeLifeCycleHandlers(e,t)},getStoryDurationLabel:function(){return this.timelineController.getTimeLabel(this.timelineController.getDuration(),!0)},getStoryCurrentTimeLabel:function(){return this.timelineController.getTimeLabel(this.timelineController.getCurrentTime(),!0)},getSelectedSceneIndex:function(){return this.currentSceneIndex},getFirstSceneIndex:function(){return this.showAuthoringOverview()?this.startOverviewIndex:0},getLastSceneIndex:function(){return this.showEndOverview()?this.endOverviewIndex:this.model.layout.items.length-1},getSceneCount:function(){return this.model.layout.items.length},getScenes:function(){return this.model.layout.items},getScene:function(e){return this.model.layout.items[e]},getSceneById:function(e){return this.model.layout.findModel(e)},getSceneId:function(e){return this.model.layout.items[e].id},getSceneIndex:function(e){for(var t=this.model.layout.items||[],i=0;i<t.length;i++)if(t[i].id===e)return i;return-1},getCurrentSceneInfo:function(){var e={};if(this.currentSceneIndex<0)e.id=this.currentSceneIndex.toString();else{var t=this.getScene(this.currentSceneIndex);e.id=t.id,e.title=t.title}return e},addScene:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"SceneLayout1",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.stop(),this.dashboardApi.deselectAllWidgets(),i.loadModule("storytelling/layouts/"+t).then(function(t){var i=t.get();i.layout.title=n;var o={addLayoutArray:[{model:i.layout,parentId:e.model.layout.id,modelIdsValid:!0}],widgetSpecMap:i.widgets};return e.model.addLayouts(o)})},selectScene:function(e){if(this.dashboardApi.deselectAllWidgets(),this.currentSceneIndex!==e.index||e.forceSelect){var i=e.refreshData||e.index===this.getFirstSceneIndex()&&this.isRefreshData()&&!this.isAuthoring();return this.currentSceneIndex=e.index,this._invokeLifeCycleHandlers("scene:select",t.extend({},e,{refreshData:i}))}return Promise.resolve()},getNavModel:function(){return this.layoutToListing[this.model.layout.type]||""},changeNavModel:function(e){this.eventRouter.trigger("navigation:change",{type:e})},deleteScene:function(e){this.model.removeLayouts(e)},duplicateScene:function(e){this.model.duplicateLayout(e)},renameScene:function(e,t){var i=this.model.layout.findModel(e),n=this.model.getLanguageModelOptions();n.silent=!1,i&&i.set({title:t},n)},moveViewBefore:function(e,t){e.id!==t&&e.getNextSiblingId()!==t&&e.updateModel({updateArray:[{id:e.id,parentId:e.getParent().id,insertBefore:t}]})},moveSceneLeft:function(e){var t=this.model.layout.findModel(e),i=t.getPreviousSiblingId();i&&this.moveViewBefore(t,i)},moveSceneRight:function(e){var t=this.model.layout.findModel(e),i=this.model.layout.findModel(t.getNextSiblingId());i&&this.moveViewBefore(t,i.getNextSiblingId())},isPlayThrough:function(){return this.timelineController.isPlayThrough()},isKioskMode:function(){return this.timelineController.isKioskMode()},isNavigateMarkers:function(){return this.timelineController.isNavigateMarkers()},isRefreshData:function(){return this.timelineController.isRefreshData()},isOnFirstScene:function(){return this.currentSceneIndex===this.getFirstSceneIndex()},isOnSecondScene:function(){return this.currentSceneIndex===this.getFirstSceneIndex()+1},isOnLastScene:function(){return this.currentSceneIndex===this.getLastSceneIndex()},isOverview:function(){return this.currentSceneIndex<0},isStartOverview:function(){return this.currentSceneIndex===this.startOverviewIndex},isEndOverview:function(){return this.currentSceneIndex===this.endOverviewIndex},isAuthoring:function(){return this.authoring},isAtEndOfScene:function(){return this.timelineController.isAtEndOfScene()},isAtStartOfScene:function(){return this.timelineController.isAtStartOfScene()},isFullscreen:function(){return this.fullscreen},expandScene:function(){var e={index:this.currentSceneIndex};this.trigger("scene:expand",e)},collapseScene:function(){this.trigger("scene:collapse",{index:this.currentSceneIndex})},onShowOverviewsChanged:function(){this.showEndOverview()||this.currentSceneIndex!==this.endOverviewIndex||this.selectScene({index:this.getLastSceneIndex()}),this.trigger("change:showOverviews")},hasOverview:function(){return this.model.layout.hasOverview},showStartOverview:function(){return this.model.layout.hasOverview&&this.model.layout.showOverviews.showStart},showAuthoringOverview:function(){return this.model.layout.hasOverview&&(this.model.layout.showOverviews.showStart||this.authoring)},showEndOverview:function(){return this.model.layout.hasOverview&&this.model.layout.showOverviews.showEnd},didEnterFullScreen:function(){this.fullscreen=!0},didExitFullScreen:function(){this.fullscreen=!1},onModeChanged:function(e){this.authoring=e.authoring,this.showAuthoringOverview()||this.currentSceneIndex!==this.startOverviewIndex||this.selectScene({index:0,play:!1}),!this.authoring&&this.isRefreshData()&&this.selectScene({index:this.currentSceneIndex,play:!1,forceSelect:!0,refreshData:!0}),this.trigger("mode:change",{authoring:this.authoring})},onAddLayouts:function(e){var i=e.value.parameter.addLayoutArray;t.each(i,this.onAddLayout.bind(this))},onAddLayout:function(e){var t=this.model.layout.findModel(e.model.id),i=this.getSceneCount();if(this.sceneCount!==i){this.sceneCount=i;var n=e.insertBefore?e.insertBefore:null,o=this.getSceneIndex(t.id);this.trigger("scene:add",{scene:t,index:o,insertBefore:n})}},onRemoveLayout:function(e){var i=this.getSceneCount();if(this.sceneCount!==i){this.sceneCount=i,t.each(e.value.parameter,function(e){this.trigger("scene:remove",{id:e})}.bind(this)),this.timelineController.onRemoveLayout(e);var n=this.currentSceneIndex;n>=i&&(n=i-1),this.selectScene({index:n})}},onPageSizeChange:function(e){this.trigger("change:pageSize",e.value)},onTimeUpdated:function(e){this._triggerTimeUpdated(e.currentTime,e.sceneId)},_hideSharePanel:function(){this.shareState&&(this.shareState.slideout&&this.shareState.slideout.hide({hideOnly:!0}),this.shareState=null)},onTimeStateChanged:function(e){this._hideSharePanel(),this._triggerPlayStateUpdated(e)},onNavigateMarkersChange:function(e){this.trigger("navigateMarkers:change",e)},onKioskModeChange:function(e){this.trigger("kioskMode:change",e)},onNavigationStarted:function(e){this.cancelPlaythroughTimer(),this.currentSceneIndex=e.index,this.currentSceneId=e.scene.id,this._updateSelectedScene(),this._triggerSceneChanged(),this.trigger("scene:select",e),this._hideSharePanel(),e.overview||e.index<0?(this.playThrough(e),this.eventRouter.trigger("filterDock:disable")):!this.isFullscreen()&&e.scene&&this.eventRouter.trigger("filterDock:enable")},onNavigationComplete:function(e){this.trigger("navigation:complete",e)},_onLayoutTypeChanged:function(e){this.eventRouter.trigger("properties:refreshPane",{}),this.trigger("layoutType:changed",e)},_updateSelectedScene:function(){var e=this.getScene(this.currentSceneIndex);this.timelineController.setScene(e)},_triggerTimeUpdated:function(e,t){var i=this.timelineController.getTimeLabel(e,!0);this.trigger("time:update",{time:e,label:i,sceneId:t})},_triggerPlayStateUpdated:function(e){this.trigger("playState:change",e)},_triggerSceneChanged:function(){if(this.currentSceneIndex>=0){var e=this.getScene(this.currentSceneIndex).id;this.eventRouter.trigger("tab:tabChanged",{modelId:e})}},getTimelineAPI:function(){return this.timelineController.getAPI()}});return n}),define("storytelling/api/StoryAPI",[],function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.addScene=function(e,t){},e.prototype.deleteScene=function(e){},e.prototype.duplicateScene=function(e){},e.prototype.enterShareState=function(e){},e.prototype.getCurrentSceneInfo=function(){},e.prototype.getCurrentTime=function(){},e.prototype.getDuration=function(){},e.prototype.getSceneCount=function(){},e.prototype.getSelectedSceneIndex=function(){},e.prototype.getSceneId=function(e){},e.prototype.getTimelineAPI=function(){},e.prototype.isPlaying=function(){},e.prototype.isStartOverview=function(){},e.prototype.isEndOverview=function(){},e.prototype.isAtStartOfScene=function(){},e.prototype.isAtEndOfScene=function(){},e.prototype.toggleKioskMode=function(){},e.prototype.toggleNavigateMarkers=function(){},e.prototype.togglePlayThrough=function(){},e.prototype.isNavigateMarkers=function(){},e.prototype.isScenePopulated=function(e){},e.prototype.play=function(){},e.prototype.stop=function(){},e.prototype.leaveShareState=function(){},e.prototype.moveSceneLeft=function(e){},e.prototype.moveSceneRight=function(e){},e.prototype.nextScene=function(e){},e.prototype.previousScene=function(){},e.prototype.renameScene=function(e,t){},e.prototype.selectScene=function(e){},e.prototype.setCurrentTime=function(e){},e.prototype.enterPrintMode=function(){},e.prototype.leavePrintMode=function(e){},e}()}),define("storytelling/api/impl/StoryAPIImpl",["gemini/lib/@waca/dashboard-common/dist/core/APIFactory","../../StoryPaneController","../StoryAPI"],function(e,t,i){return function(t){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,t.apply(this,arguments))}return _inherits(n,t),n.prototype.getAPI=function(){return e.createAPI(this,[i])},n}(t)}),define("storytelling/AnimationDirector",["baglass/core-client/js/core-client/utils/BrowserUtils"],function(e){return function(){function t(e){_classCallCheck(this,t),this.pageContextAPI=e.pageContextAPI,this.widgetHelper=e.widgetHelper,this._inProgressCssAnimations={},this._inProgressWidgetsAnimation={},this._scrollBarsStateLockCount=0}return t.prototype.animate=function(e){var t=this,i=e.target,n=this.widgetHelper.getContentNode(i);if(n){var o=this._getLayoutNodeTransform(i);return o=o?" rotate("+o+"deg)":o,this._finishInProgressCssAnimation(n),0===e.duration?(this._immediateAnimate(n,o,e),Promise.resolve()):e.reveal?this._reveal(e.target).finally(function(){return t._animate(n,o,e)}):this._animate(n,o,e)}},t.prototype._animate=function(e,t,i){var n=this,o=parseInt(this._getNodeWidth(e),10),s=parseInt(this._getNodeHeight(e),10),r=e.getBoundingClientRect(),a=parseInt(r.left,10),l=parseInt(r.top,10),c=this._getDocumentWidth(),d=this._getDocumentHeight(),h=i.duration,u=e.style.opacity,g=void 0;return"scaleIn"===i.animation?(this._lockScrollBarsState(e),this._animation(e,{transition:"transform "+h+"ms",transform:t},function(){n._restoreScrollBarsState(e)})):"scaleOut"===i.animation?(this._lockScrollBarsState(e),this._animation(e,{transition:"transform "+h+"ms",transform:"scale(0,0) translate(0,0) rotate(0)"+t},function(){e.style.transition="all 0s",n._restoreScrollBarsState(e)})):"shrinkIn"===i.animation?(this._lockScrollBarsState(e),this._forceCssWrite(e,{opacity:"0",transition:"all 0s",transform:"scale(5,5) translate(0,0) rotate(0)"+t}),this._animation(e,{opacity:u,transition:"transform "+h+"ms, opacity "+h+"ms",transform:t},function(){n._restoreScrollBarsState(e)},2)):"expandOut"===i.animation?(this._lockScrollBarsState(e),this._animation(e,{opacity:"0",transition:"transform "+h+"ms, opacity "+h+"ms",transform:"scale(5,5) translate(0,0) rotate(0)"+t},function(){e.style.opacity=u,e.style.transition="all 0s",e.style.transform="scale(0,0) translate(0,0) rotate(0)"+t,n._restoreScrollBarsState(e)},2)):"pivotIn"===i.animation?(this._lockScrollBarsState(e),this._forceCssWrite(e,{opacity:"0",transition:"all 0s",transform:"scale(1,1) translate(-50%,50%) rotate(-45deg) translate(50%,-50%)"+t}),this._animation(e,{opacity:u,transition:"transform "+h+"ms, opacity "+h+"ms",transform:t},function(){n._restoreScrollBarsState(e)},2)):"pivotOut"===i.animation?(this._lockScrollBarsState(e),this._animation(e,{opacity:"0",transition:"transform "+h+"ms, opacity "+h+"ms",transform:"scale(1,1) translate(50%,50%) rotate(45deg) translate(-50%,-50%)"+t},function(){e.style.opacity=u,e.style.transition="all 0s",e.style.transform="scale(0,0) translate(0,0) rotate(0)"+t,n._restoreScrollBarsState(e)},2)):"slideInLeft"===i.animation?(g=a+o,e.parentElement&&e.parentElement.offsetLeft&&(g+=e.parentElement.offsetLeft),this._forceCssWrite(e,{transition:"all 0s",transform:"scale(1,1) translateX("+-g+"px) rotate(0)"+t}),this._animation(e,{transition:"transform "+h+"ms",transform:t})):"slideOutLeft"===i.animation?(g=a+o,e.parentElement&&e.parentElement.offsetLeft&&(g+=e.parentElement.offsetLeft),this._animation(e,{transition:"transform "+h+"ms",transform:"translateX("+-g+"px)"+t},function(){e.style.transition="all 0s",e.style.transform="scale(0,0) translate(0,0) rotate(0)"+t})):"slideInRight"===i.animation?(this._lockScrollBarsState(e),this._forceCssWrite(e,{transition:"all 0s",transform:"scale(1,1) translateX("+c+"px)"+t}),this._animation(e,{transition:"transform "+h+"ms",transform:t},function(){n._restoreScrollBarsState(e)})):"slideOutRight"===i.animation?(this._lockScrollBarsState(e),this._animation(e,{transition:"transform "+h+"ms",transform:"translateX("+c+"px)"+t},function(){e.style.transition="all 0s",e.style.transform="scale(0,0) translate(0,0) rotate(0)"+t,n._restoreScrollBarsState(e)})):"slideInTop"===i.animation?(g=l+s,e.parentElement&&e.parentElement.offsetTop&&(g+=e.parentElement.offsetTop),this._forceCssWrite(e,{transition:"all 0s",transform:"scale(1,1) translateY("+-g+"px)"+t}),this._animation(e,{transition:"transform "+h+"ms",transform:t})):"slideOutTop"===i.animation?(g=l+s,e.parentElement&&e.parentElement.offsetTop&&(g+=e.parentElement.offsetTop),this._animation(e,{transition:"transform "+h+"ms",transform:"translateY("+-g+"px)"+t},function(){e.style.transition="all 0s",e.style.transform="scale(0,0) translate(0,0) rotate(0)"+t})):"slideInBottom"===i.animation?(this._lockScrollBarsState(e),this._forceCssWrite(e,{transition:"all 0s",transform:"scale(1,1) translateY("+d+"px)"+t}),this._animation(e,{transition:"transform "+h+"ms",transform:t},function(){n._restoreScrollBarsState(e)})):"slideOutBottom"===i.animation?(this._lockScrollBarsState(e),this._animation(e,{transition:"transform "+h+"ms",transform:"translateY("+d+"px)"+t},function(){e.style.transition="all 0s",e.style.transform="scale(0,0) translate(0,0) rotate(0)"+t,n._restoreScrollBarsState(e)})):"show"===i.animation?(this._forceCssWrite(e,{opacity:"0",transition:"all 0s"}),this._animation(e,{transition:"opacity "+h+"ms",transform:t,opacity:u})):"hide"===i.animation?this._animation(e,{transition:"opacity "+h+"ms",opacity:"0"},function(){e.style.transition="all 0s",e.style.transform="scale(0,0) translate(0,0) rotate(0)"+t,e.style.opacity=u}):"highlight"===i.animation?this._highlightWidget(i):"clearHighlight"===i.animation?this._clearHighlightWidget(i):Promise.resolve()},
- t.prototype._reveal=function(e){var t=this;this._finishInProgressWidgetAnimation(e);var i=this.widgetHelper.getWidget(e);return Promise.resolve(i&&i.getVisApi&&i.getVisApi().ownerWidget.reveal?i.getVisApi().ownerWidget.reveal():null).then(function(i){i&&i.renderControlApi&&(t._inProgressWidgetsAnimation[e]=i.renderControlApi)})},t.prototype.pauseWidgetsAnimation=function(){var e=this;Object.keys(this._inProgressWidgetsAnimation).map(function(t){return e._inProgressWidgetsAnimation[t]}).forEach(function(e){e.pause&&e.pause()})},t.prototype.resumeWidgetsAnimation=function(){var e=this;Object.keys(this._inProgressWidgetsAnimation).map(function(t){return e._inProgressWidgetsAnimation[t]}).forEach(function(e){e.resume&&e.resume()})},t.prototype.finishWidgetsAnimation=function(){var e=this._inProgressWidgetsAnimation;this._inProgressWidgetsAnimation={},Object.keys(e).map(function(t){return e[t]}).forEach(function(e){e.complete&&e.complete()})},t.prototype._finishInProgressWidgetAnimation=function(e){var t=this._inProgressWidgetsAnimation[e];delete this._inProgressWidgetsAnimation[e],t&&t.complete&&t.complete()},t.prototype.finishInProgressAnimation=function(e){var t=this.widgetHelper.getContentNode(e.target);t&&(this._finishInProgressCssAnimation(t),this._finishInProgressWidgetAnimation(e.target))},t.prototype._immediateAnimate=function(t,i,n){switch(n.animation){case"show":case"slideInLeft":case"slideInRight":case"slideInTop":case"slideInBottom":case"scaleIn":case"shrinkIn":case"pivotIn":t.style.transition="all 0s",t.style.transform=i;break;case"hide":case"slideOutLeft":case"slideOutRight":case"slideOutTop":case"slideOutBottom":case"scaleOut":case"expandOut":case"pivotOut":if(this._forceCssWrite(t,{transition:"all 0s",transform:"scale(0) translate(0,0) rotate(0)"+i}),e.isSafari()||this._forceCssWrite(t,{transform:"scale3d(0,0,0) translate(0,0) rotate(0)"+i}),e.isIE()){var o=t.style.display;t.style.display="none",this._forceRepaint(t),t.style.display=o}break;case"highlight":this._highlightWidget(n);break;case"clearHighlight":this._clearHighlightWidget(n)}},t.prototype._getLayoutNodeTransform=function(e){var t=this.widgetHelper.getContent(e),i=t&&t.getPropertyValue("rotateAngle");return i||(i=""),i},t.prototype._animation=function(e,t,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new Promise(function(s){var r=n._inProgressCssAnimations[e.id];r&&n._finishInProgressCssAnimation(e),r=n._inProgressCssAnimations[e.id]={},e.classList.add("animating");var a=function(){i&&i(),e.classList.remove("animating"),s()};n._forceCssWrite(e,t),r.css=Object.assign({},t,{transition:"none"}),r.onTransitionEnd=n._onTransitionEnd.bind(n,e),r.onTransitionEndCallback=a,r.numAnimatedProperties=o,r.transitionEndCount=0,e.addEventListener("transitionend",r.onTransitionEnd)})},t.prototype._finishInProgressCssAnimation=function(e){var t=this._inProgressCssAnimations[e.id];t&&(this._forceCssWrite(e,t.css),e.removeEventListener("transitionend",t.onTransitionEnd),t.onTransitionEndCallback(),delete this._inProgressCssAnimations[e.id])},t.prototype._onTransitionEnd=function(e){var t=this._inProgressCssAnimations[e.id];t&&++t.transitionEndCount===t.numAnimatedProperties&&(e.removeEventListener("transitionend",t.onTransitionEnd),t.onTransitionEndCallback(),delete this._inProgressCssAnimations[e.id])},t.prototype._forceCssWrite=function(e,t){var i=this;Object.keys(t).forEach(function(n){i._applyPrefixStyling(e,n,t[n])}),this._forceRepaint(e)},t.prototype._applyPrefixStyling=function(e,t,i){["webkit","Webkit","moz","Moz","ms","o"].forEach(function(n){var o=n+t.charAt(0).toUpperCase()+t.slice(1);e.style[o]=i}),e.style[t]=i},t.prototype._forceRepaint=function(e){e.offsetHeight},t.prototype._getDocumentWidth=function(){return Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth)},t.prototype._getDocumentHeight=function(){return Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)},t.prototype._getNodeWidth=function(e){return Math.max(e.clientWidth,e.offsetWidth,e.scrollWidth)},t.prototype._getNodeHeight=function(e){return Math.max(e.clientHeight,e.offsetHeight,e.scrollHeight)},t.prototype._lockScrollBarsState=function(e){var t=e.closest(".pagecontainer");if(t){if("visible"!==window.getComputedStyle(t).overflow&&!(this._scrollBarsStateLockCount++>0)){var i=t.scrollHeight>t.clientHeight,n=t.scrollWidth>t.clientWidth;t.style.overflowX=n?"scroll":"hidden",t.style.overflowY=i?"scroll":"hidden"}}},t.prototype._restoreScrollBarsState=function(e){var t=e.closest(".pagecontainer");if(t){"visible"!==window.getComputedStyle(t).overflow&&(--this._scrollBarsStateLockCount>0||(t.style.overflowX="",t.style.overflowY=""))}},t.prototype._clearHighlightWidget=function(e){var t=this.widgetHelper.getContent(e.target),i=t&&t.getFeature("Visualization");if(i){var n={payloadData:{runtimeOnly:!0}},o=i.getDataSource();return o&&this.pageContextAPI.resetToPersistedValues({origin:"visualization",scope:this.widgetHelper.getPageContent(t).getId(),eventSourceId:e.target,sourceId:o.getId(),eventGroupId:this.widgetHelper.getEventGroupId(t.getId())},n),Promise.resolve()}},t.prototype._highlightWidget=function(e){var t=this,i=this.widgetHelper.getContent(e.target),n=i&&i.getFeature("Visualization");if(!n)return Promise.resolve();var o=e.payload||[],s=n.getDataSource();return o.forEach(function(n){var o=t.widgetHelper.getPageContent(i),r={origin:"visualization",scope:o&&o.getId(),eventSourceId:e.target,sourceId:s.getId(),itemId:n.columnId,eventGroupId:t.widgetHelper.getEventGroupId(i.getId()),hierarchies:[{hierarchyUniqueName:n.columnId}]},a={payloadData:{runtimeOnly:!0}},l={command:"replace",values:n.values};t.pageContextAPI.updateFilterContext(r,l,a)}),Promise.resolve()},t}()}),define("storytelling/TimeQueue",["baglass/core-client/js/core-client/ui/core/Class","underscore"],function(e,t){var i=e.extend({_endBufferTime:200,animationDuration:500,STATE:{PLAYING:"playing",STOPPED:"stopped",PAUSED:"paused"},_actionToAnimationMap:{show:{name:"show",entrance:!0,stateGroup:"visibility"},slideInLeft:{name:"slideInLeft",entrance:!0,stateGroup:"visibility"},slideInRight:{name:"slideInRight",entrance:!0,stateGroup:"visibility"},slideInTop:{name:"slideInTop",entrance:!0,stateGroup:"visibility"},slideInBottom:{name:"slideInBottom",entrance:!0,stateGroup:"visibility"},scaleIn:{name:"scaleIn",entrance:!0,stateGroup:"visibility"},shrinkIn:{name:"shrinkIn",entrance:!0,stateGroup:"visibility"},pivotIn:{name:"pivotIn",entrance:!0,stateGroup:"visibility"},hide:{name:"hide",entrance:!1,stateGroup:"visibility"},slideOutLeft:{name:"slideOutLeft",entrance:!1,stateGroup:"visibility"},slideOutRight:{name:"slideOutRight",entrance:!1,stateGroup:"visibility"},slideOutTop:{name:"slideOutTop",entrance:!1,stateGroup:"visibility"},slideOutBottom:{name:"slideOutBottom",entrance:!1,stateGroup:"visibility"},scaleOut:{name:"scaleOut",entrance:!1,stateGroup:"visibility"},expandOut:{name:"expandOut",entrance:!1,stateGroup:"visibility"},pivotOut:{name:"pivotOut",entrance:!1,stateGroup:"visibility"},highlight:{name:"highlight",entrance:!1,stateGroup:"highlight"},clearHighlight:{name:"clearHighlight",entrance:!1,stateGroup:"highlight"}},init:function(e){i.inherited("init",this,arguments),this.boardModel=e.boardModel,this.eventRouter=e.eventRouter,this.currentScene=e.sceneId,this.widgetHelper=e.widgetHelper,this._eventQueue={},this.currentState="stopped",this.duration=0,this.current=0,this._tickLength=50,this._timer=null,this._startTime=0,this._widgetStateCache={},this.timeQueue={play:this.play.bind(this),pause:this.pause.bind(this),stop:this.stop.bind(this),seek:this.seek.bind(this),getState:this.getState.bind(this),setTickLength:this.setTickLength.bind(this),STATE:this.STATE}},isPlaying:function(){return this.currentState===this.STATE.PLAYING},isStopped:function(){return this.currentState===this.STATE.STOPPED},play:function(){return!this._timer&&this._playScene()},isMarker:function(e){return!!this._eventQueue[e]&&this._eventQueue[e].some(function(e){return this._actionToAnimationMap[e.action].entrance||"highlight"===e.action}.bind(this))},isExitAction:function(e){return!!this._eventQueue[e]&&this._eventQueue[e].some(function(e){var t=this._actionToAnimationMap[e.action];return!t.entrance&&"visibility"===t.stateGroup}.bind(this))},jumpToNextMarker:function(){for(var e=this.duration,t=Object.keys(this._eventQueue),i=[],n=0;n<t.length;n++){var o=parseInt(t[n],10);if(o>this.current){if(this.isMarker(o)){e=o;break}this.isExitAction(o)&&i.push(this._executeTick(o))}}return this.isPlaying()&&e!==this.duration?(this.pause(),i.push(this._executeTick(e).then(this.play.bind(this)))):i.push(this._executeTick(e)),Promise.all(i)},jumpToPreviousMarker:function(){for(var e=0,t=Object.keys(this._eventQueue),i=1;i<=t.length;i++){var n=parseInt(t[t.length-i],10);if(n<this.current&&this.isMarker(n)){e=n;break}}return this.isPlaying()&&this.pause(),this.seek(e)},_playScene:function(){var e=!1;return this.currentScene&&(this.current>=this.duration&&(this.current=0),this.seek(this.current),this._setState(this.STATE.PLAYING),this._startTime=Date.now()-this.current,this._timer=setInterval(this._executeTick.bind(this),this._tickLength),e=!0),e},_generateEventQueue:function(){this._eventQueue={};var e=0,i=this._listWidgetsForCurrentScene();return t.each(i,function(t){var i=this.boardModel.timeline.episodes.get(t);i&&!i.acts.isEmpty()?e=this._addEpisodeToEventQueue(t,i,e):this._addEventToQueue(t,0,"show")}.bind(this)),t.each(Object.keys(this._eventQueue),function(t){t>e-this._endBufferTime&&delete this._eventQueue[t]}.bind(this)),e},_addEpisodeToEventQueue:function(e,t,i){return t.acts.each(function(t){if(t.timer||0===t.timer){var n=this._getEventTickTime(t.timer);this._addEventToQueue(e,n,t.action,t.payload),i=Math.max(i,n)}}.bind(this)),i},_addEventToQueue:function(e,t,i,n){this._eventQueue[t]||(this._eventQueue[t]=[]),this._eventQueue[t].push({action:i,payload:n,widget:e})},_getEventTickTime:function(e){return Math.round(e/this._tickLength)*this._tickLength},pause:function(){return!!this._timer&&(clearInterval(this._timer),this._timer=null,this._setState(this.STATE.PAUSED),!0)},stop:function(){return this._timer&&(clearInterval(this._timer),this._timer=null),this._setState(this.STATE.STOPPED),this.seek(0)},refresh:function(){this.duration=0,this.seek(this.current)},reset:function(){return this.duration=0,this.current=0,this.stop()},seek:function(e){var t=this;if(!this.currentScene)return this._triggerUpdateDuration(),this._triggerTickUpdated(),Promise.resolve(!1);this.currentState===this.STATE.PLAYING&&this.pause(),this.duration||(this.duration=this._generateEventQueue(),this._triggerUpdateDuration());var i=Math.max(0,Math.min(this.duration,this._getEventTickTime(e)));return this.current=i,this._setInitialWidgetState().then(function(){var e=!1;return i<t.duration&&(e=!0),t._triggerTickUpdated(),e})},getState:function(){return{currentState:this.currentState,currentTime:this.current,duration:this.duration,sceneId:this.currentScene,context:this}},getDuration:function(){return this.duration},getMarkers:function(){return t.map(Object.keys(this._eventQueue),function(e){return parseInt(e,10)}).filter(this.isMarker.bind(this))},endScene:function(){return this.seek(this.duration)},setTickLength:function(e){this.stop(),this._tickLength=e},getTickLength:function(){return this._tickLength},_executeTick:function(e){for(var i=Date.now()-this._startTime,n=[];i>=this.current+this._tickLength||t.isNumber(e);){if(t.isNumber(e)?this.current=e:this.current+=this._tickLength,this._eventQueue[this.current]&&t.each(this._eventQueue[this.current],function(e){n.push(this._dispatchEvent(e))}.bind(this)),this._triggerTickUpdated(),this.current>=this.duration){this.current=this.duration;var o=this.currentState;this._setState(this.STATE.STOPPED),clearInterval(this._timer),this._timer=null,this.eventRouter.trigger("timeline:end",{endState:o});break}if(t.isNumber(e))break}return Promise.all(n)},_triggerTickUpdated:function(){this.eventRouter.trigger("timequeue:tick",{currentTime:this.current,sceneId:this.currentScene})},_setState:function(e){var t=this.currentState;this.currentState=e,this.eventRouter.trigger("timequeue:stateChanged",{currentState:this.currentState,prevState:t,currentTime:this.current,duration:this.duration,sceneId:this.currentScene,context:this})},_dispatchEvent:function(e,t){var i=t?0:this.animationDuration,n={duration:i,target:e.widget,payload:e.payload,animation:this._actionToAnimationMap[e.action].name,reveal:i>0&&this._actionToAnimationMap[e.action].entrance};if(!n.animation)return Promise.resolve();this._updateEventForStateGroup(this._widgetStateCache,e);var o=this.widgetHelper.getContentState(n.target);return o?o.whenStatusChanges(o.STATUS.RENDERED).then(function(){this.eventRouter.trigger("widget:animate",n)}.bind(this)):Promise.resolve()},_setInitialWidgetState:function(){var e=this,i={},n=[];this._hideAllWidgets(i);var o=void 0,s=void 0;for(o=0;o<=this.current;o+=this._tickLength)if(this._eventQueue[o])for(s=0;s<this._eventQueue[o].length;s++)this._updateEventForStateGroup(i,this._eventQueue[o][s]);var r=function(i,n){var o=e._actionToAnimationMap[i.action],s=e._actionToAnimationMap[n.action];return o.entrance===s.entrance&&"visibility"===o.stateGroup&&"visibility"===s.stateGroup||t.isEqual(i,n)};return Object.keys(i).forEach(function(e){var t=i[e];Object.keys(t).forEach(function(i){this._widgetStateCache[e]&&this._widgetStateCache[e][i]&&r(this._widgetStateCache[e][i],t[i])||n.push(this._dispatchEvent(t[i],!0))},this)},this),Promise.all(n)},_hideAllWidgets:function(e){(this._listWidgetsForCurrentScene()||[]).forEach(function(t){this._updateEventForStateGroup(e,{action:"hide",widget:t}),this._updateEventForStateGroup(e,{action:"clearHighlight",widget:t})},this)},_updateEventForStateGroup:function(e,t){var i=this._actionToAnimationMap[t.action].stateGroup;e[i]||(e[i]={}),e[i][t.widget]=t},_triggerUpdateDuration:function(){this.eventRouter.trigger("timequeue:durationChanged",{duration:this.duration,sceneId:this.currentScene})},_listWidgetsForCurrentScene:function(){return this.currentScene&&this.boardModel?this.boardModel.layout.listWidgets([this.currentScene]):[]}});return i}),define("storytelling/util/WidgetHelper",["baglass/core-client/js/core-client/ui/core/Class"],function(e){return e.extend({init:function(e){this.dashboardApi=e.dashboardApi},getWidget:function(e){var t=this.getContent(e);return t?t.getFeature("WidgetAPI.deprecated"):null},getContent:function(e){var t=this.dashboardApi.getCanvas();return t?t.getContent(e):null},getEventGroupId:function(e){return this.dashboardApi.getFeature("EventGroups").getGroupId(e)},getPageContent:function(e){for(var t=null;e;)"page"===e.getType()&&(t=e),e=e.getContainer();return t},getContentNode:function(e){var t=this.getContent(e);return t?t.getFeature("ContentViewDOM").getNode():null},getContentState:function(e){var t=this.getContent(e);return t?t.getFeature("state.internal"):null}})}),define("storytelling/TimelineController",["baglass/core-client/js/core-client/ui/core/Events","dashboard-analytics/apiHelpers/SlotAPIHelper","underscore","./AnimationDirector","./TimeQueue","./util/WidgetHelper"],function(e,t,i,n,o,s){var r=e.extend({authoring:!1,duration:1e4,defaultWidgetDuration:5e3,animationDuration:500,cursorTime:0,suggestionTimelineCheckingInterval:100,suggestionTimeRange:[],lastEstablishedEventQueue:[],init:function(e){r.inherited("init",this,arguments),this.canvasController=e.canvasController,this.dashboardApi=e.dashboardApi,this.timeline=e.model.timeline,this.layout=e.model.layout,this.widgetInstances=e.model.widgetInstances,this.model=e.model,this.eventRouter=e.eventRouter,this.timeQueues={},this.selectedWidgetIds={},this.authoring=e.authoring,this.services=e.services,this.stringResources=this.services.getSvcSync(".StringResources"),this.widgetHelper=new s({dashboardApi:this.dashboardApi}),this.model.pageContext&&(this._animationDirector=new n({widgetHelper:this.widgetHelper,pageContextAPI:this.model.pageContext.getAPI()})),this.canvas=this.dashboardApi.getCanvas(),this.eventRouter.on("widget:maximize",this._onMaximizeWidget,this),this.eventRouter.on("widget:restore",this._onRestoreWidget,this),this.eventRouter.on("widget:selected",this.onSelectWidget,this),this.eventRouter.on("widget:deselected",this.onDeselectWidget,this),this.eventRouter.on("timequeue:tick",this.onTimeQueueTick,this),this.eventRouter.on("timequeue:stateChanged",this.onTimeQueueStateChanged,this),this.eventRouter.on("timequeue:durationChanged",this.onDurationChanged,this),this.eventRouter.on("navigation:complete",this.onNavigationComplete,this),this.eventRouter.on("scene:reorder",this.onSceneReorder,this),this.eventRouter.on("scene:swap",this.onSceneSwap,this),this.eventRouter.on("mode:change",this.onModeChanged,this),this.eventRouter.on("rendered",this.onWidgetRendered,this),this.eventRouter.on("widget:animate",this.onAnimate,this),this.eventRouter.on("layoutType:changed",this._onLayoutTypeChanged,this),this.eventRouter.on("timeline:end",this.onTimelinePlaybackEnd,this),this.timeline.on("change:kioskMode",this.onKioskModeChange,this),this.timeline.on("change:navigateMarkers",this.onNavigateMarkersChange,this),this.timeline.on("change:episodes",this.onModelEpisodeChange,this),this.timeline.on("timeline:episodeFragmentAdded",this.onEpisodeFragmentAdded,this),this.timeline.episodes.on("add",this.onEpisodeAdded,this),this.timeline.episodes.on("remove",this.onEpisodeRemoved,this),this.model.on("widget:change",this.onChangeWidget,this)},destroy:function(){this.eventRouter.off("widget:maximize",this._onMaximizeWidget,this),this.eventRouter.off("widget:restore",this._onRestoreWidget,this),this.eventRouter.off("widget:selected",this.onSelectWidget,this),this.eventRouter.off("widget:deselected",this.onDeselectWidget,this),this.eventRouter.off("timequeue:tick",this.onTimeQueueTick,this),this.eventRouter.off("timequeue:stateChanged",this.onTimeQueueStateChanged,this),this.eventRouter.off("timequeue:durationChanged",this.onDurationChanged,this),this.eventRouter.off("navigation:complete",this.onNavigationComplete,this),this.eventRouter.off("scene:reorder",this.onSceneReorder,this),this.eventRouter.off("scene:swap",this.onSceneSwap,this),this.eventRouter.off("mode:change",this.onModeChanged,this),this.eventRouter.off("rendered",this.onWidgetRendered,this),this.eventRouter.off("widget:animate",this.onAnimate,this),this.eventRouter.off("layoutType:changed",this._onLayoutTypeChanged,this),this.eventRouter.off("timeline:end",this.onTimelinePlaybackEnd,this),this.timeline.off("change:kioskMode",this.onKioskModeChange,this),this.timeline.off("change:navigateMarkers",this.onNavigateMarkersChange,this),this.timeline.off("change:episodes",this.onModelEpisodeChange,this),this.timeline.off("timeline:episodeFragmentAdded",this.onEpisodeFragmentAdded,this),this.timeline.episodes.off("add",this.onEpisodeAdded,this),this.timeline.episodes.off("remove",this.onEpisodeRemoved,this),this.model.off("widget:change",this.onChangeWidget,this);var e=this;i.each(this.widgetInstances,function(t){var i=e.widgetHelper.getWidget(t.getId());i&&i.getVisApi&&i.getVisApi()&&i.getVisApi().ownerWidget&&(i.getVisApi().ownerWidget.off("dwChange:visTransaction",e.onWidgetChange,e),i.getVisApi().ownerWidget.off("dwChange:visId",e.onWidgetChange,e))})},_onLayoutTypeChanged:function(){this.timeQueues={},this.scene=null},onWidgetChange:function(e){if(e&&e.model&&e.model.id&&"UndoRedoController"!==e.sender){var t=e.options||{};t.payloadData=e.data,t.sender=e.sender,t=this._validateModelOptions(t);var i=this.getTimelineEpisodeById(e.model.id);if(i){var n=this._getTimelineHighlightsForWidget(e.model.id);i.acts.updateHighlightPayloadColumns(n,t)}}},setScene:function(e){e?this.scene!==e&&(this.scene=e,this.setCursorTime(0)):(this.scene=null,this.trigger("time:update",{currentTime:0}))},onWidgetRendered:function(e){e&&this.trigger("slider:change",{name:"rendered",modelId:e.getId()});var t=this.widgetHelper.getWidget(e.getId());t&&t.getVisApi&&t.getVisApi()&&t.getVisApi().ownerWidget&&(t.getVisApi().ownerWidget.off("dwChange:visTransaction",this.onWidgetChange,this),t.getVisApi().ownerWidget.on("dwChange:visTransaction",this.onWidgetChange,this),t.getVisApi().ownerWidget.off("dwChange:visId",this.onWidgetChange,this),t.getVisApi().ownerWidget.on("dwChange:visId",this.onWidgetChange,this))},onRemoveLayout:function(e){i.each(e.value.parameter,function(e){this.timeQueues[e]&&delete this.timeQueues[e]}.bind(this))},_seekStory:function(e){if("slideshow"===this.layout.type){var t=this._currentTimeQueue();t&&t.pause();var i=this.model.layout.items.length;this._maxScene(0===e?i-1:e-1),this._zeroScene(e),this._zeroScene(e===i-1?0:e+1)}else this.maxPreviousScenes(e),this.zeroFutureScenes(e)},onNavigationComplete:function(e){var t;e&&(t=e.play,this._seekStory(e.index)),!1!==t&&((this.isAuthoring()||this.isPlaying()||this.isNavigateMarkers())&&!t||this.play())},isAuthoring:function(){return this.authoring},onModeChanged:function(e){this.authoring=e.authoring},onSceneReorder:function(e){this.trigger("scene:reorder",e)},maxPreviousScenes:function(e){var t=[];-2===e&&(e=this.model.layout.items.length);for(var i=0;i<e;i++)t.push(this._maxScene(i));return Promise.all(t)},zeroFutureScenes:function(e){var t=[];if(-2!==e){var i=this.model.layout.items.length,n=e;for(n<0&&(n=0);n<i;n++)t.push(this._zeroScene(n))}return Promise.all(t)},_zeroScene:function(e){var t=this.model.layout.items[e],i=this._getTimeQueue(t.id);return i.isPlaying()&&i.stop(),i.reset()},_maxScene:function(e){var t=this.model.layout.items[e],i=this._getTimeQueue(t.id);return i.isPlaying()&&i.stop(),i.endScene()},getCurrentScene:function(){return this.scene},getTimelineEpisodeCount:function(){return this._getWidgetIds().length},getTimelineEpisodeById:function(e){return this._isWidgetInCurrentScene(e)?this._getEpisodeModel(e):void 0},getTimelineEpisodes:function(){var e={};return this._getWidgetIds().forEach(function(t){e[t]=t}),i.filter(this.model.timeline.episodes.models,function(t){return t.id in e}.bind(this))},getTimelineEpisodeIDs:function(){var e=[],t=this.getTimelineEpisodes();return Object.keys(t).forEach(function(i){return e.push(t[i].id)}),e},getMarkers:function(){var e=this._currentTimeQueue();return e?e.getMarkers():[]},isHighlightSupported:function(e){var t=this._getTimelineHighlightsForWidget(e);return Boolean(t&&t.length)},updateLastEstablishedEventQueue:function(){this.lastEstablishedEventQueue=[];var e=this._currentTimeQueue();return e&&this._updateLastEstablishedEventQueue(e),this.lastEstablishedEventQueue},_updateLastEstablishedEventQueue:function(e){for(var t in e._eventQueue)if(e._eventQueue.hasOwnProperty(t))for(var i in this.selectedWidgetIds)(e._eventQueue[t][0].item!==i||e._eventQueue[t].length>1)&&this.lastEstablishedEventQueue.push(t)},moveEpisodeBefore:function(e,t,i){i=this._validateModelOptions(i),this.timeline.episodes.reorder(e,t,i)},updateTimelineDuration:function(e,t,n,o){o=this._validateModelOptions(o),this.suggestionTimeRange.length>0&&(t=this.suggestionTimeRange[0],n=this.suggestionTimeRange[1]);var s=this.timeline.episodes.get(e),r=i.map(s.acts.toArray(),i.clone),a=s.getEntranceAct().timer,l=s.getExitAct().timer,c=l-a,d=n-t;o.isMove=d<=c+2&&c<=d+2;var h=o.isMove&&Math.abs(a-t)<=5,u=function(t){this.trigger("modelEpisode:changed",{id:e,value:[s.getEntranceAct().timer,s.getExitAct().timer]}),this.model.trigger("change",t||h?{}:{value:i.map(s.acts.toArray(),i.clone),prevValue:r,sender:o.sender,data:o.payloadData,senderContext:{applyFn:function(e){s.acts.set(e,{silent:!0}),u(!0)}.bind(this)}}),this._refreshTimeQueue()}.bind(this);s.updateDuration(t,n,o),u(),this.suggestionTimeRange=[]},_getTimelineHighlightsForWidget:function(e){var n=this.widgetHelper.getContent(e),o=n.getFeature("Visualization"),s=o&&o.getSlots().getMappedSlotList(),r=function(e,i,n){return!t.isMultiMeasuresSeriesOrValue(e,n)&&"attribute"===i.getType()},a=[];return i.each(s,function(e){i.each(e.getDataItemList(),function(t,n){var o=t.getColumnId(),s=t.getLabel();r(e,t,n)&&!i.findWhere(a,{columnId:o})&&a.push({columnId:o,columnLabel:s,id:o,values:[]})})}),a},addTimelineHighlight:function(e,t){var n=this._getEpisodeModel(e),o=this._getTimelineHighlightsForWidget(e);t=t||0===t?t:this.getCurrentTime(),t=Math.max(t,n.getEntranceAct().timer+1),t=Math.min(t,n.getExitAct().timer-1);var s={timer:t,action:"highlight",payload:o},r={payloadData:{undoRedoTransactionId:i.uniqueId("highlight")}},a=n.acts.add(s,r);return this.trigger("slider:showHighlightSummary",{episodeModel:n,actModel:a}),a},updateTimelineHighlight:function(e,t,i){var n=this._getEpisodeModel(e),o=n.acts.get(t);return o&&o.set(i),o},deleteTimelineHighlight:function(e,t){var i=this._getEpisodeModel(e);if(i&&t){var n=i.acts.get(t);n&&"highlight"===n.action&&i.acts.remove(n)}},getSnapIndicatorTime:function(e,t){var i,n=e[1]-e[0],o=[],s=null;for(i=e.length-1;i>=0;i--)o.unshift(e[i]);var r=this._checkTimeQueueForSnapIndicator(e,t,o,n);r.changed&&(o=r.timeRange,s=r.changed||s);var a=this._checkStartAndEndForSnapIndicator(e,t,o);return a.changed&&(o=a.timeRange,s=a.changed||s),"content"===t&&("start"===s?o[1]=o[0]+n:"end"===s&&(o[0]=o[1]-n)),this.suggestionTimeRange=o,{changed:s,timeRange:o}},selectWidgetAndSlider:function(e){return this.deselectAllWidgetsAndSliders(),this.canvas.selectContent([e],{hideContextBar:!0}),Promise.resolve()},deselectWidgetAndSlider:function(e){return this.deselectAllWidgetsAndSliders(),this.canvas.deselectContent([e]),Promise.resolve()},deselectAllWidgetsAndSliders:function(){var e=this.canvas.getSelectedContentList(),t=e.map(function(e){return e.getId()});this.canvas.deselectContent(t)},getDefaultWidgetDuration:function(){return this.defaultWidgetDuration},getDuration:function(){var e=this._currentTimeQueue();return e?e.getDuration():0},isAtEndOfScene:function(){return this.getCurrentTime()===this.getDuration()},isAtStartOfScene:function(){return 0===this.getCurrentTime()},togglePlayThrough:function(){this.timeline.set({playThrough:!this.isPlayThrough()},{payloadData:{undoRedoTransactionId:i.uniqueId("togglePlayThrough")}})},toggleKioskMode:function(){this.timeline.set({kioskMode:!this.isKioskMode()},{payloadData:{undoRedoTransactionId:i.uniqueId("toggleKioskMode")}})},toggleNavigateMarkers:function(){this.timeline.set({navigateMarkers:!this.isNavigateMarkers()},{payloadData:{undoRedoTransactionId:i.uniqueId("toggleNavigateMarkers")}})},toggleRefreshData:function(){this.timeline.set({refreshData:!this.isRefreshData()},{payloadData:{undoRedoTransactionId:i.uniqueId("toggleRefreshData")}})},isPlayThrough:function(){return this.timeline.get("playThrough")},isKioskMode:function(){return this.timeline.get("kioskMode")},isNavigateMarkers:function(){return this.timeline.get("navigateMarkers")},isRefreshData:function(){return this.timeline.get("refreshData")},jumpToNextMarker:function(){return this._currentTimeQueue().jumpToNextMarker()},jumpToPreviousMarker:function(){return this._currentTimeQueue().jumpToPreviousMarker()},setCurrentTime:function(e){var t=this,i=this._currentTimeQueue();return i?i.seek(e).then(function(e){return t._animationDirector.finishWidgetsAnimation(),e}):(this._animationDirector.finishWidgetsAnimation(),Promise.resolve(!1))},getCurrentTime:function(){var e=this._currentTimeQueue();return e?e.getState().currentTime:0},setCursorTime:function(e){this.cursorTime=e},getCursorTime:function(){return this.cursorTime},getTickDuration:function(){var e=this._currentTimeQueue();return e?e.getTickLength():0},isPlaying:function(){var e=this._currentTimeQueue();return!!e&&e.isPlaying()},isStopped:function(){var e=this._currentTimeQueue();return!e||e.isStopped()},pause:function(){var e=!1,t=this._currentTimeQueue();return t&&(e=t.pause()),this._animationDirector.pauseWidgetsAnimation(),e},play:function(){var e=!1,t=this._currentTimeQueue();return t&&(this.deselectAllWidgetsAndSliders(),e=t.play()),this._animationDirector.resumeWidgetsAnimation(),e},stop:function(){var e=!1,t=this._currentTimeQueue();return t&&(e=t.stop()),this._animationDirector.finishWidgetsAnimation(),e},isWidgetSelected:function(e){return!!this.selectedWidgetIds[e]},getSelectedWidgetMap:function(){return this.selectedWidgetIds},getTimeComponents:function(e){var t=e||0,i=Math.floor(t/36e5);t-=60*i*60*1e3;var n=Math.floor(t/6e4);t-=60*n*1e3;var o=Math.floor(t/1e3);return t-=1e3*o,{hours:i,minutes:n,seconds:o,milliseconds:t}},getTimeLabel:function(e,t){var i=this.getTimeComponents(e),n=Math.round(i.milliseconds/100);n>=10&&(n=0,i.seconds++);var o="",s=i.hours>0?i.hours+":":"",r=i.minutes+":",a=i.seconds;return i.seconds<10&&(a="0"+a),o=o.concat(s),o=o.concat(r),o=o.concat(a),t&&(o=o.concat("."+n)),o},onSelectWidget:function(e){this.selectedWidgetIds[e.sender]=!0,this._selectTimelineSlider(e.sender)},onDeselectWidget:function(e){delete this.selectedWidgetIds[e.sender],this._deselectTimelineSlider(e.sender)},onChangeWidget:function(e){this.trigger("slider:change",e)},onDurationChanged:function(e){this.scene&&e.sceneId!==this.scene.id||this.trigger("duration:changed",e)},onTimeQueueTick:function(e){this.scene&&e.sceneId!==this.scene.id||this._triggerUpdateTime()},onTimeQueueStateChanged:function(e){this.scene&&e.sceneId!==this.scene.id||(this._triggerUpdateTime(),this.trigger("playState:change",e))},onEpisodeAdded:function(e){this.trigger("modelEpisode:added",e.model.id)},onEpisodeRemoved:function(e){var t=this.widgetHelper.getWidget(e.model.id);t&&t.getVisApi&&t.getVisApi()&&t.getVisApi().ownerWidget&&(t.getVisApi().ownerWidget.off("dwChange:visTransaction",this.onWidgetChange,this),t.getVisApi().ownerWidget.off("dwChange:visId",this.onWidgetChange,this)),this.trigger("modelEpisode:removed",e.model.id),this._refreshTimeQueue()},onSceneSwap:function(e){var t=this;i.each(e.scenes,function(e){t._getTimeQueue(e.id).refresh()})},onKioskModeChange:function(e){this.trigger("kioskMode:change",e)},onNavigateMarkersChange:function(e){this.trigger("navigateMarkers:change",e)},onModelEpisodeChange:function(e){var t=e,i=e.origCollectionEvent,n=e.origCollectionEvent?e.origCollectionEvent.origCollectionEvent:null;if(n&&"add"===n.name)n.model&&"highlight"===n.model.action&&this.trigger("slider:addHighlight",{actModel:n.model,episodeModel:i.model});else if(n&&"remove"===n.name)n.model&&"highlight"===n.model.action&&this.trigger("slider:removeHighlight",{actModel:n.model,episodeModel:i.model});else if(i&&i.model){var o=this._getEpisodeModel(i.model.id);if(o){var s=[o.getEntranceAct().timer,o.getExitAct().timer];this.trigger("modelEpisode:changed",{id:e.origCollectionEvent.model.id,value:s})}n&&"action"===e.name&&this._previewAnimation(e.value,i.model,n.model)}else"reorder"===t.name&&this.trigger("modelEpisodes:reorder");this._refreshTimeQueue()},onTimelinePlaybackEnd:function(){this._animationDirector.finishWidgetsAnimation()},_previewAnimation:function(e,t,i){var n=this,o=this.getCurrentTime(),s=t.getEntranceAct().timer,r=t.getExitAct().timer,a=o>=s&&o<r,l=i.timer===s;a?l?this._animationDirector.animate({target:t.id,animation:"hide",duration:0}).then(function(){n._animationDirector.animate({target:t.id,animation:e,duration:n.animationDuration})}):this._animationDirector.animate({target:t.id,animation:e,duration:this.animationDuration}).then(function(){n._animationDirector.animate({target:t.id,animation:"show",duration:0})}):l?this._animationDirector.animate({target:t.id,animation:e,duration:this.animationDuration}).then(function(){n._animationDirector.animate({target:t.id,animation:"hide",duration:n.animationDuration/2})}):this._animationDirector.animate({target:t.id,animation:"show",duration:this.animationDuration/2
- }).then(function(){n._animationDirector.animate({target:t.id,animation:e,duration:n.animationDuration})})},_validateModelOptions:function(e){return e=e||{},e.sender=e.sender||this,e.payloadData=e.payloadData||{},e.payloadData.undoRedoTransactionId=e.payloadData.undoRedoTransactionId||i.uniqueId("TimelineController"),e},_selectTimelineSlider:function(e){this.trigger("slider:select",{widgetId:e})},_deselectTimelineSlider:function(e){this.trigger("slider:deselect",{widgetId:e})},_refreshTimeQueue:function(){var e=this._currentTimeQueue();e&&e.refresh()},_triggerUpdateTime:function(){var e=this._currentTimeQueue();e&&this.trigger("time:update",e.getState())},_getWidgetIds:function(){return this.scene?this.model.layout.listWidgets([this.scene.id]):[]},_isWidgetInCurrentScene:function(e){return-1!==this._getWidgetIds().indexOf(e)},_getEpisodeModel:function(e){return this.model.timeline.episodes.get(e)},_getNewWidgetEpisodeInfo:function(){var e=this.getCurrentTime(),t=this.getDuration(),i=t-e;return 0===i&&(i=this.defaultWidgetDuration),{start:e,end:e+i}},onEpisodeFragmentAdded:function(e){var t=this._validateModelOptions(e.options||{}),i=this.getDuration(),n=this._getNewWidgetEpisodeInfo();this.updateTimelineDuration(e.id,n.start,n.end,t);var o=this.getDuration();o>i&&this.timeline.stretchEndingEpisodes({currentEndTime:i,newEndTime:o,subset:this._getWidgetIds()},this,t.payloadData)},_checkTimeQueueForSnapIndicator:function(e,t,i){var n=this.lastEstablishedEventQueue.length;if(0===n)return{};var o,s,r=this.suggestionTimelineCheckingInterval,a=null,l=function(t,n){var o=Math.abs(e[t]-n),s=o<r;return s&&(i[t]=+n),s};for(s=0;s<n&&!a;s++)o="content"===t,(o||"leftHandle"===t)&&l(0,this.lastEstablishedEventQueue[s])&&(a="start"),(o||"rightHandle"===t)&&l(1,this.lastEstablishedEventQueue[s])&&(a="end");return{timeRange:i,changed:a}},_checkStartAndEndForSnapIndicator:function(e,t,i){var n=null,o=e[0],s=e[1],r=this.getDuration(),a="content"===t;return(a||"leftHandle"===t)&&o>0&&o<this.suggestionTimelineCheckingInterval&&(i[0]=0,n="start"),(a||"rightHandle"===t)&&s<r&&s>r-this.suggestionTimelineCheckingInterval&&(i[1]=r,n="end"),{timeRange:i,changed:n}},_getTimeQueue:function(e){var t=this.timeQueues[e];return t||(t=new o({sceneId:e,boardModel:this.model,eventRouter:this.eventRouter,widgetHelper:this.widgetHelper}),this.timeQueues[e]=t,t.reset()),t},_currentTimeQueue:function(){var e=null;return this.scene&&this.scene.id&&(e=this._getTimeQueue(this.scene.id)),e},_onMaximizeWidget:function(){this.isPlaying()?(this.pause(),this.pausedForMaximize=!0):this.pausedForMaximize=!1},_onRestoreWidget:function(){this.pausedForMaximize&&this.play()},onAnimate:function(e){this._animationDirector&&this._animationDirector.animate(e)}});return r}),define("storytelling/api/TimelineAPI",[],function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.addHighlight=function(e,t){},e.prototype.deleteHighlight=function(e,t){},e.prototype.getEpisode=function(e){},e.prototype.getEpisodeIDs=function(){},e.prototype.isHighlightSupported=function(e){},e.prototype.moveEpisode=function(e,t,i){},e.prototype.updateEpisodeDuration=function(e,t,i,n){},e.prototype.updateHighlight=function(e,t,i){},e}()}),define("storytelling/api/impl/TimelineAPIImpl",["gemini/lib/@waca/dashboard-common/dist/core/APIFactory","../../TimelineController","../TimelineAPI"],function(e,t,i){return function(t){function n(e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,t.call(this,e));return i.addHighlight=i.addTimelineHighlight.bind(i),i.deleteHighlight=i.deleteTimelineHighlight.bind(i),i.getEpisode=i.getTimelineEpisodeById.bind(i),i.getEpisodeIDs=i.getTimelineEpisodeIDs.bind(i),i.moveEpisode=i.moveEpisodeBefore.bind(i),i.updateEpisodeDuration=i.updateTimelineDuration.bind(i),i.updateHighlight=i.updateTimelineHighlight.bind(i),i}return _inherits(n,t),n.prototype.getAPI=function(){return e.createAPI(this,[i])},n}(t)}),define("storytelling/glass/InlineContributions",[],function(){"use strict";return[]}),define("storytelling/glass/controllers/StoryPrint",["jquery","gemini/features/dashboard/dashboardPrint/api/AssetPrintAPI","gemini/lib/@waca/dashboard-common/dist/core/APIFactory"],function(e,t,i){return function(){function n(){_classCallCheck(this,n),this.style={},this.containerClass=".tabCntr"}return n.prototype.getAPI=function(){return i.createAPI(this,[t])},n.prototype.showContentsForPrint=function(t){var i=this;this.storyAPI=t.context.getCurrentContentView().getStoryAPI(),this.initCursorTime=this.storyAPI.getCurrentTime();var n=e(t.pageElement);return this._addBlocker(n),this.storyAPI.enterPrintMode().then(function(){var e=t.modelIds;i.$timelinePlayer=n.find(".timelinePlayer");var o=n.find(i.containerClass);o.css("display","block"),i.layoutType=t.layoutType,i.isSlideShow="slideshow"===i._getStoryType(t.layoutType);var s=t.printPageSize;i.isSlideShow?i._showContentsForSlideShow(e,n,o,s):i._showContentsForGuidedJourney(e,n,o,s),i.$timelinePlayer.hide()})},n.prototype.hideContentsAfterPrint=function(t,i){var n=this,o=e(i);return o.find(this.containerClass).css("display",""),o.find(".page").first().css("display","flex"),this.storyAPI.leavePrintMode(this.initCursorTime).then(function(){t.forEach(function(e){var t=o.find("#"+e+"_tab"),i=n.style[e];n.isSlideShow?(t.hasClass("selected")||t.toggleClass("hiddenScene",!0),t[0].style.width=i.width,t[0].style.height=i.height,t.find(".page.pagecontainer")[0].style.width=i.childWidth,t.find(".page.pagecontainer")[0].style.height=i.childHeight):(t.css("transform-style",i.transformStyle),t.toggleClass("step",!0),t.toggleClass("hiddenScene",!1),t.find(".sceneInfo").show(),"panAndZoom6"===n.layoutType&&(t.find(".sceneConnector").show(),t.find(".sequenceTimeline").show(),t.find(".sequenceSceneTitle").show()),n.$startOverview.after(t),n.$startOverview=t,t.css("width",i.width),t.css("height",i.height),t.find(".page.pagecontainer").css("width",i.childWidth),t.find(".page.pagecontainer").css("height",i.childHeight)),t.css("transform",i.transform)}),n.$timelinePlayer.show()}).then(this._removeBlocker.bind(this))},n.prototype.getOffScreenPageSize=function(){return!1},n.prototype._getStoryType=function(e){return"slideshow"===e?"slideshow":"panAndZoom"},n.prototype._showContentsForSlideShow=function(e,t,i,n){var o=this;this.originalParentMap={};var s=t.find(".pageTabContent.selected"),r=s.width()/s.height();t.find(".page").first().css("display","block"),e.forEach(function(e){var s=t.find("#"+e+"_tab"),a=s.find(".page.pagecontainer");o.style[e]={width:s[0].style.width,height:s[0].style.height,childWidth:a[0].style.width,childHeight:a[0].style.height,transform:s[0].style.transform},s.hasClass("selected")||(s.css("transform",""),s.toggleClass("hiddenScene",!1));var l=n.width/.75,c=n.height/.75,d=1.5*l,h=d/r;s[0].style.width=d+"px",s[0].style.height=Math.min(h,c)+"px",a[0].style.width=d+"px",a[0].style.height=Math.min(h,c)+"px",o.originalParentMap[e]=s.parent(),i.append(s)})},n.prototype._showContentsForGuidedJourney=function(e,t,i,n){var o=this;this.$startOverview=t.find('[id^="start_overview_"]');var s=n.width/.75,r=n.height/.75;t.find(".page").first().css("display","block"),e.forEach(function(e){var n=t.find("#"+e+"_tab"),a=n.find(".page.pagecontainer"),l=a.width()/a.height();o.style[e]={width:n.width(),height:n.height(),childWidth:a.width(),childHeight:a.height(),transformStyle:n.css("transform-style"),transform:n.css("transform")};var c=1.5*s,d=c/l;n.width(c),n.height(Math.min(d,r)),a.width(c),a.height(Math.min(d,r)),n.find(".sceneInfo").hide(),"panAndZoom6"===o.layoutType&&(n.find(".sceneConnector").hide(),n.find(".sequenceTimeline").hide(),n.find(".sequenceSceneTitle").hide()),n.css("transform-style",""),n.removeClass("step"),n.css("transform",""),i.append(n)})},n.prototype._addBlocker=function(t){this.blocker=e("<div>",{class:"printBlocker"}),t.append(this.blocker)},n.prototype._removeBlocker=function(){this.blocker.remove(),this.blocker=null},n}()}),define("storytelling/glass/StoryView",["gemini/dashboard/glass/BaseBoardView","jquery","../nls/StringResources","../views/TimelinePlayerView","../views/StoryNavControl","../views/MouseOverArea","gemini/lib/@waca/dashboard-common/dist/ui/CenterLoadingSpinner","react-dom","../api/impl/StoryAPIImpl","../api/impl/TimelineAPIImpl","gemini/app/util/ErrorUtils","./InlineContributions","./controllers/StoryPrint"],function(e,t,i,n,o,s,r,a,l,c,d,h,u){var g=e.extend({initialize:function(e){g.inherited("initialize",this,arguments),this.dashboard=this.getDashboardApi(),this.navControl=null,this.inlineContributions=e.inlineContributions||h,this.stringService.register(i,1),this.timelinePlayerView=null,this.sceneId=e.sceneId,this.sceneTime=parseInt(e.sceneTime,10)||void 0,this.eventRouter.on("navigation:started",this._onNavigationStarted,this),this.eventRouter.on("navigation:complete",this._onNavigationComplete,this)},getType:function(){return"storytelling"},getApplicationLabel:function(){return this.stringService.get("story")},getContent:function(){var e=g.inherited("getContent",this,arguments);return e.sceneId=this.sceneId||null,e},render:function(){var e=this,t=arguments;return a.render(r({variant:"circle",size:"normal"}),this.$el[0]),this._addInlineContribToCollections().then(function(){return g.inherited("render",e,t)}).then(function(){e.dashboard.getFeature("DashboardState").onUiStateChange(e._onStateChange.bind(e)),e.$content.on("click",">.page",e._onContentClick.bind(e)),e.eventRouter.on("navigation:change",e.onNavigationChange,e),e.boardController.layoutController.getTopLayoutViewWhenReady().then(function(){e.storyPaneController.onStoryLayoutReady(e.sceneId,e.sceneTime)});var t=e.dashboard.getFeature("Print"),i=(new u).getAPI();t.registerContent("slideshow",i),t.registerContent("panAndZoom1",i),t.registerContent("panAndZoom2",i),t.registerContent("panAndZoom3",i),t.registerContent("panAndZoom4",i),t.registerContent("panAndZoom5",i),t.registerContent("panAndZoom6",i),e._appendTimelinePlayerView()})},_onStateChange:function(e){e.fullScreen!==this.oldFullScreenState&&(e.fullScreen?this.setupFullScreenControls():e.fullScreen||this.teardownFullScreenControls(),this.oldFullScreenState=e.fullScreen)},_addInlineContribToCollections:function(){var e=this;return Promise.all(this.inlineContributions.map(function(t){return e.options.glassContext.appController.findCollection(t.containerId).then(function(e){e?e.filter(function(e){return e.id===t.id}).length?console.warn("WARNING: storytelling contribution already exists in collection id =",t.id):(console.log("adding contribution "+t.id+" to collection "+t.containerId),e.push(t)):console.error("ERROR: not adding contribution to non-existent collection. id =",t.containerId)})}))},remove:function(){this.storyPaneController&&(this.storyPaneController.destroy(),this.storyPaneController=null),this._timelineController&&(this._timelineController.destroy(),this._timelineController=null),this.mouseOverArea&&(this.mouseOverArea.remove(),this.mouseOverArea=null),this.navControl&&(this.navControl.destroy(),this.navControl=null),this.eventRouter&&(this.eventRouter.off("navigation:change",this.onNavigationChange,this),this.eventRouter.off("navigation:started",this._onNavigationStarted,this),this.eventRouter.off("navigation:complete",this._onNavigationComplete,this)),g.inherited("remove",this,arguments)},getSplitterState:function(){return this.isAuthorMode()?"open":"close"},onCanvasReady:function(){this._setupControllers(this.options)},deactivate:function(){return this.storyPaneController&&this.storyPaneController.pause(),g.inherited("deactivate",this,arguments)},onNavigationChange:function(e){this.boardModel.updateLayoutType(e)},_onNavigationStarted:function(){this.$content.toggleClass("animating",!0)},_onNavigationComplete:function(){this.$content.toggleClass("animating",!1)},setupFullScreenControls:function(){g.inherited("setupFullScreenControls",this,arguments),this.$el.addClass("disableScroll"),this.timelinePlayerView.toggleFullscreenControls(!0);var e=t("<div />").addClass("storyNavControlContainer").appendTo(this.$el.parent());return this.navControl=new o({el:e,subview:this.timelinePlayerView,startHidden:!0,autohide:4e3}),this._buildMouseOverArea(),this.navControl.render().then(function(){this.eventRouter.trigger("filterDock:disable"),this.storyPaneController.didEnterFullScreen(),this._showNavControl({delay:1e3})}.bind(this))},_buildMouseOverArea:function(){var e=t("<div />").addClass("mouseOverArea").prependTo(this.$el.parent());this.mouseOverArea=new s({el:e,onActivate:this._showNavControl.bind(this)})},teardownFullScreenControls:function(){return this.navControl?(this.storyPaneController.didExitFullScreen(),this.$el.removeClass("disableScroll"),this.navControl.subview=null,this.timelinePlayerView.$el.appendTo(this.$el).show(),this.timelinePlayerView.toggleFullscreenControls(!1),this.mouseOverArea&&(this.mouseOverArea.remove(),this.mouseOverArea=null),this.storyPaneController.isOverview()||this.eventRouter.trigger("filterDock:enable"),this.navControl.destroy().then(function(){this.navControl=null,g.inherited("teardownFullScreenControls",this,arguments)}.bind(this))):Promise.resolve()},_setupControllers:function(e){var t=this.getDashboardApi();this._timelineController=new c({canvasController:this.boardLoader.canvasController,dashboardApi:t,eventRouter:this.eventRouter,model:this.boardModel,authoring:e.isAuthoringMode,services:this.services}),this.storyPaneController=new l({eventRouter:this.eventRouter,model:this.boardModel,authoring:e.isAuthoringMode,timelineController:this._timelineController,dashboardApi:t}),t.registerDashboardSvc(".StoryPaneService",this.storyPaneController),this._storyApi=this.storyPaneController.getAPI()},_appendTimelinePlayerView:function(){var e=this;this.timelinePlayerView||this.getDashboardApi().getDashboardSvc(".StoryPaneService").then(function(t){e.timelinePlayerView=new n({controller:t,dashboardApi:e.getDashboardApi(),glassContext:e.options.glassContext,services:e.services}),e.$el.append(e.timelinePlayerView.$el),e.timelinePlayerView.render(),e.lifeCycleManager.registerLifeCycleHandler("post:dashboard.focus",e.timelinePlayerView.onSmallScreenUpdate.bind(e.timelinePlayerView))})},getIconTooltip:function(){return this.stringService.get("story")},getIcon:function(){return"common-catalog"},_onContentClick:function(e){this.isAuthoringMode||t(e.target).parentsUntil(e.currentTarget,".widget").length||(this._showNavControl(),this.eventRouter.trigger("playback:togglePlayPause"))},_processKeyDown:function(e){g.inherited("_processKeyDown",this,arguments);var i=e.isDefaultPrevented&&e.isDefaultPrevented()||!1;!this.isPressed(37)&&!this.isPressed(38)||this.isAuthoringMode||i?!this.isPressed(39)&&!this.isPressed(40)||this.isAuthoringMode||i?!this.isPressed(32)||t(e.target).is(":tabbable")||i||(this._showNavControl(),this.eventRouter.trigger("playback:togglePlayPause")):this.eventRouter.trigger("playback:next"):this.eventRouter.trigger("playback:prev")},_showNavControl:function(e){this.navControl&&this.navControl.show(e)},addFullScreenControl:function(){},getStoryAPI:function(){return this._storyApi},hasAuthoringCapability:function(){return d.hasCapability(this.glassContext,"canAuthorDashboard")},shouldShowCloseConfirmationDialog:function(){return this.isDirty()&&this.hasAuthoringCapability()}});return g}),define("storytelling/layouts/BlankSceneLayout",[],function(){return{get:function(){return{layout:{type:"container",templateName:"Template1",items:[{type:"genericPage",layoutPositioning:"relative",css:"templateBox aspectRatio_default",items:[{type:"templateIndicator",style:{top:"0%",left:"0%",right:"0%",bottom:"0%"}}]}]},widgets:{}}}}}),define("storytelling/layouts/SceneLayout2",["storytelling/nls/StringResources","baglass/core-client/js/core-client/utils/UniqueId"],function(e,t){return{get:function(){var i,n=t.get("title_"),o=t.get("vis1_");return{layout:{type:"container",templateName:"Template1",items:[{type:"genericPage",layoutPositioning:"relative",css:"templateBox aspectRatio_default",items:[{type:"templateIndicator",style:{top:"0%",left:"0%",right:"0%",bottom:"0%"}},{id:n,type:"widget",style:{width:"98.00%",height:"20.00%",top:"1.82%",left:"1.00%"}},{id:o,type:"widget",style:{width:"98.00%",height:"74.54%",top:"23.64%",left:"1.00%"}}]}]},widgets:(i={},i[n]={id:n,type:"text",isResponsive:!0,placeholder:{text:e.get("titleWidgetPlaceholderText")},content:'<div class="staticContent"><span class="textFitted responsiveColor responsiveFontSize responsiveFontFamily"><p style="text-align: center;"><br></p></span></div>',name:e.get("titleWidgetPlaceholderText"),defaults:{justifyCenter:!0}},i[o]={id:o,type:"multipurpose",placeholder:{iconType:"vis"}},i)}}}}),define("storytelling/model/EpisodeActEntry",["gemini/lib/@waca/dashboard-common/dist/core/Model"],function(e){var t=t=e.extend({whitelistAttrs:["id","timer","action","payload"],init:function(){t.inherited("init",this,arguments)}});return t}),define("storytelling/model/EpisodeActs",["gemini/lib/@waca/dashboard-common/dist/core/Collection","./EpisodeActEntry"],function(e,t){var i;return i=e.extend({modelClass:t,init:function(){i.inherited("init",this,arguments)},updateHighlightPayloadColumns:function(e,t){t=t||{};var i=[],n=[];this.filter(function(e){return"highlight"===e.action}).forEach(function(t){var o=t.payload.slice(),s=function(e,t){return e.find(function(e){return e.columnId===t})};e.forEach(function(e){if(!s(o,e.columnId)){var t=JSON.parse(JSON.stringify(e));o.push(t)}}),o=o.filter(function(t){return s(e,t.columnId)}),i.push({id:t.id,payload:o}),n.push({id:t.id,payload:t.payload})}),this._updateAndTriggerEvent("change:payload",i,n,t)},_updateAndTriggerEvent:function(e,t,i,n){this.set(t,{remove:!1,merge:!0,silent:!0});var o={name:e,eventName:e,collection:this,value:t,prevValue:i,options:n,data:n.payloadData,sender:n.sender?n.sender:this,senderContext:{applyFn:function(t,i){this.set(t,{remove:!1,merge:!0,silent:!0}),this.trigger(e,Object.assign({},n,{sender:i}))}.bind(this)}};this.trigger(e,o)}})}),define("storytelling/model/TimelineEpisodeEntry",["gemini/lib/@waca/dashboard-common/dist/core/Model","./EpisodeActs","underscore"],function(e,t,i){var n=e.extend({nestedCollections:{acts:t},whitelistAttrs:["id","type","title","acts"],_default_entrance:{timer:0,action:"show"},_default_exit:{timer:5e3,action:"hide"},_endBufferTime:200,init:function(){n.inherited("init",this,arguments),this.acts||this.set({acts:[this._default_entrance,this._default_exit]},{silent:!0})},updateDuration:function(e,t,n){t<=e+this._endBufferTime&&(t=e+this._endBufferTime),n=i.clone(n)||{},i.extend(n,{add:!1,remove:!1,merge:!0,silent:!0});var o=this.getEntranceAct(),s=this.getExitAct(),r=[];this.acts.each(function(i){var a=i.timer;i.id===o.id?a=e<0?0:e:i.id===s.id?a=t:(n.isMove&&(a=i.timer-o.timer+e),a=Math.max(a,e+1),a=Math.min(a,t-1)),r.push({id:i.id,timer:a})}),this.acts.set(r,n)},getEntranceAct:function(){return this.acts.min(function(e){return e.timer})},getExitAct:function(){return this.acts.max(function(e){return e.timer})},getDuration:function(){return this.getExitAct().timer-this.getEntranceAct().timer},touchesEnd:function(e){return e-this._endBufferTime<this.getExitAct().timer},touchesStart:function(){return this.getEntranceAct().timer-this._endBufferTime<0}});return n}),define("storytelling/model/TimelineEpisodes",["gemini/lib/@waca/dashboard-common/dist/core/Collection","./TimelineEpisodeEntry"],function(e,t){var i;return i=e.extend({modelClass:t,init:function(){i.inherited("init",this,arguments)}})}),define("storytelling/model/TimelineModel",["gemini/lib/@waca/dashboard-common/dist/core/Model","./TimelineEpisodes","underscore"],function(e,t,i){var n=e.extend({nestedCollections:{episodes:t},whitelistAttrs:["id","story","title","episodes","playThrough","kioskMode","navigateMarkers","refreshData"],init:function(e,t){var i=this;n.inherited("init",this,arguments),this.episodes||this.set({episodes:[]}),this.boardModel=t.boardModel,this.dashboardApi=t.dashboardApi,this.dashboardApi.getCanvasWhenReady().then(function(e){e.on("add:content:child",i._addContent,i),e.on("remove:content:child",i._removeContent,i)}),this.boardModel.on("addWidget",this._addWidget,this),this.boardModel.on("pre:removeWidget",this._removeWidget,this),this.boardModel.on("addFragment",this._addFragment,this),this.boardModel.on("addLayouts",this._addLayouts,this),this.boardModel.on("pre:removeLayouts",this._removeLayouts,this),this.boardModel.on("duplicateLayout",this._duplicateLayout,this)},stretchEndingEpisodes:function(e,t,n){e&&e.currentEndTime&&e.newEndTime&&e.subset&&i.each(e.subset,function(i){var o=this.episodes.get(i);if(o){var s=o.getExitAct();s&&s.timer>=e.currentEndTime&&s.set({timer:e.newEndTime},{sender:t,payloadData:n})}}.bind(this))},addEpisodeFragment:function(e,t){var i=this.episodes.add(e,t);this.trigger("timeline:episodeFragmentAdded",{id:i.id,options:t}),t.insertBefore&&this.episodes.reorder(i.id,t.insertBefore,t)},_getSceneDuration:function(e){return i.reduce(e,function(e,t){var i=this.episodes.get(t);return i?Math.max(e,i.getExitAct().timer):e}.bind(this),0)},getWidgetTransitionMap:function(e,t){if(!e||!t)return null;var n=this.boardModel.layout,o=n.listWidgets([e.id]),s=n.listWidgets([t.id]);if(!o.length||!s.length)return null;var r=e.model.getNextSiblingId();if(r&&r!==t.id)return null;var a=this._getSceneDuration(o);o=i.filter(o,function(e){var t=this.episodes.get(e);return!t||t.touchesEnd(a)}.bind(this)),s=i.filter(s,function(e){var t=this.episodes.get(e);return!t||t.touchesStart()}.bind(this));var l={forward:{},backward:{}};return i.each(o,function(e){var t=n.findModel(e);i.each(s,function(e){var o=n.findModel(e);if(t.id===o.from||t.from===o.id){var s=n.getLinkedLayoutTree(t,o);i.each(s,function(e){l.forward[e[0].id]=e[1].id,l.backward[e[1].id]=e[0].id})}}.bind(this))}.bind(this)),Object.keys(l.backward).length?l:null},_addContent:function(e){var t=!!e.context.undoRedo;if(t){var i=e.info.value,n=e.info.newContentId,o={skipUndoRedo:t,undoRedoTransactionId:e.transactionToken&&e.transactionToken.transactionId};this.addEpisodeFragment({type:"widget",id:n},{payloadData:o,insertBefore:i.insertBefore})}},_removeContent:function(e){var t=!!e.context.undoRedo;if(t){var i=e.info.value,n={undoRedoTransactionId:e.transactionToken&&e.transactionToken.transactionId,skipUndoRedo:t};this._removeEpisode(i,n)}},_addWidget:function(e){var t=e.value.parameter,i=e.sender,n=e.data;if(!this._isUndoRedoController(i))if(n.replace){var o;e.idMap=(o={},o[t.insertBefore]=t.model.id,o),this._duplicateLayout(e),this.episodes.reorder(t.model.id,t.insertBefore,{sender:i,payloadData:n})}else this.addEpisodeFragment({type:"widget",id:t.model.id},{sender:i,payloadData:n,insertBefore:t.insertBefore})},_removeWidget:function(e){var t=e.id,i=e.sender,n={undoRedoTransactionId:e.data&&e.data.undoRedoTransactionId};this._isUndoRedoController(i)||this._removeEpisode(t,n,i)},_removeEpisode:function(e,t,i){var n=this.episodes.get(e);if(n){var o=this.episodes.indexOf(n),s=this.episodes.models[o+1]?this.episodes.models[o+1].id:null;this.episodes.reorder(e,s,{sender:i,payloadData:t,forceEvent:!0}),this.episodes.remove(n,{sender:i,payloadData:t})}},_addFragment:function(e){var t=e.value.parameter,n=e.sender,o=e.data;if(!this._isUndoRedoController(n)){var s=t.model,r=i.invert(t.widgetIdMap);i.each(s.widgets,function(e){var t=e.id,a=r[t],l=i.find(s.episodes,function(e){return e.id===a})||{};i.each(l.acts,function(e){delete e.id}),i.extend(l,{id:t,type:"widget"}),this.addEpisodeFragment(l,{sender:n,payloadData:o})}.bind(this))}},_addLayouts:function(e){var t=this,n=e.value.parameter;this._isUndoRedoController(e.sender)||i.each(n.widgetSpecMap,function(i){t.addEpisodeFragment({id:i.id,type:"widget"},{sender:e.sender,payloadData:e.data})})},_removeLayouts:function(e){var t=this,i=e.sender,n={undoRedoTransactionId:e.data&&e.data.undoRedoTransactionId,skipUndoRedo:e.data&&e.data.skipUndoRedo};if(!this._isUndoRedoController(i)){this.boardModel.layout.listWidgets(e.idArray).forEach(function(e){var o=t.episodes.get(e),s=t.episodes.indexOf(o),r=t.episodes.models[s+1]?t.episodes.models[s+1].id:null;t.episodes.reorder(e,r,{sender:i,payloadData:n,forceEvent:!0}),t.episodes.remove(o,{sender:i,payloadData:n})})}},_duplicateLayout:function(e){var t=this,i=e.idMap,n=e.sender,o=e.data;if(!this._isUndoRedoController(n)){var s=[];this.episodes.each(function(e){if(i[e.id]){var n=e.toJSON();n.acts&&n.acts.forEach(function(e){delete e.id});var o=new t.episodes.modelClass(n);o.replaceIds(i),s.push(o)}}),s.length&&(this._reorderTimelines(this.episodes,s,n,o),this.episodes.add(s,{sender:n,payloadData:o,merge:!0}))}},_reorderTimelines:function(e,t,i,n){for(var o=t.length-1;o>0;o--)e.reorder(t[o-1].id,t[o].id,{sender:i,payloadData:n})},_isUndoRedoController:function(e){return"UndoRedoController"===e}});return n.widgetsToEpisodes=function(e,i,n){var o=new t(e.episodes);i.forEach(function(e){o.add({type:"widget",id:e.id},n)}),e.episodes=o.toJSON()},n}),define("storytelling/StoryService",["baglass/core-client/js/core-client/ui/core/Class","underscore","gemini/dashboard/util/PxPercentUtil","./layouts/BlankSceneLayout","./layouts/SceneLayout2","./model/TimelineModel"],function(e,t,i,n,o,s){var r=e.extend({init:function(e){r.inherited("init",this,arguments),this.dashboardApi=e.dashboardApi,this.hasOutOfBoundsWidget=!1,this.hasEmptyExploreCards=!1},createStory:function(e){var t=this;return this._checkOptions(e),this._setTargetInfo(e),this._createModelObjectForStory(e.boardModel,e.sourceType).then(function(i){i.timeline=i.timeline||{},t._updateLayout(i.layout);var n=t._findDescendantsWithType("widget",i.layout.items);return s.widgetsToEpisodes(i.timeline,n,{}),{model:i,status:{hasOutOfBoundsWidget:"slideshow"!==e.targetInfo.type&&t.hasOutOfBoundsWidget,hasEmptyExploreCards:t.hasEmptyExploreCards}}})},_findDescendantsWithType:function(e,t){var i=[];if(t)for(var n=0;n<t.length;n++)t[n].type===e?i.push({type:"widget",id:t[n].id}):t[n].items&&i.push.apply(i,this._findDescendantsWithType(e,t[n].items));return i},updateStory:function(e){this._checkOptions(e),this._setTargetInfo(e);var t=JSON.parse(JSON.stringify(e.boardModel.toJSON()));this._convertFreeformToTemplate(t.layout),this._updateLayout(t.layout);var i=this.dashboardApi.getCurrentContentView();i.clearTransientState(),i.getDashboardApi().getFeature("DashboardState").setDirty(!0);var n=i.getBoardId()||null;return i.reloadFromJSONSpec(t,{boardId:n})},_createModelObjectForStory:function(e,t){var i=this,n=e.toJSON();return this.dashboardApi.getGlassSvc(".ConversionService").then(function(e){return e.convert(t.toUpperCase(),"STORY",JSON.stringify(n))}).then(function(e){var o=JSON.parse(e);if("explore"===t){n.layout.items.length!==o.layout.length&&(i.hasEmptyExploreCards=!0);var s=i._convertExploreLayoutToStory(o),r=s.layout,a=s.widgets;n.layout=r,n.widgets=i._convertExploreWidgetsToStory(o.widgets),Object.assign(n.widgets,a)}else"dashboard"===t&&i._convertFreeformToTemplate(n.layout);return n}).catch(function(e){return"explore"===t?(i.hasEmptyExploreCards=!0,n.layout=i._convertExploreLayoutToStory().layout,n.widgets={},n):Promise.reject(e)})},_convertExploreLayoutToStory:function(e){var t=this,i={layout:{items:[],layoutPositioning:"relative",pageSize:{width:1280,height:720},style:{height:"100%"}},widgets:{}};if(e&&e.layout)return e.layout.reduce(function(i,n){return t._convertCardToSceneLayout(i,n,e.widgetToCardMap)},i);var o=n.get().layout;return i.layout.items.push(o),i},_convertCardToSceneLayout:function(e,t,i){var n=this._replaceWidget(t,"vis1_",o),s=n.layout,r=n.widgets;return s.id=i[t.id],e.layout.items.push(s),Object.assign(e.widgets,r),e},_replaceWidget:function(e,t,i){var n=i.get(),o=n.layout.items[0].items.find(function(e){return e.id&&e.id.startsWith(t)});return delete n.widgets[o.id],delete e.style,Object.assign(o,e),n},_convertExploreWidgetsToStory:function(e){return e.reduce(function(e,t){return e[t.id]=t,e},{})},_checkOptions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.targetInfo||(e.targetInfo={}),!e.boardModel)throw new Error("No board model found to convert")},_setTargetInfo:function(e){this._targetInfo={type:this._validateType(e.targetInfo.type)||"slideshow"},"slideshow"===e.targetInfo.type&&(this._targetInfo.transition=this._validateTransition(e.targetInfo.transition)||"none")},_validateType:function(e){switch(e){case"dashboard":case"slideshow":case"panAndZoom1":case"panAndZoom2":case"panAndZoom3":case"panAndZoom4":case"panAndZoom5":case"panAndZoom6":return e;default:return null}},_validateTransition:function(e){switch(e){case"none":case"scaleAndSlide":case"animatedPath":return e;default:return null}},_updateLayout:function(e){switch(e.type=this._targetInfo.type,this._targetInfo.type){case"dashboard":break;case"slideshow":this._updateLayoutForSlideShow(e);break;case"panAndZoom1":case"panAndZoom2":case"panAndZoom3":case"panAndZoom4":case"panAndZoom5":case"panAndZoom6":this._updateLayoutForPanAndZoom(e)}return this._fitWidgetsToScenes(e),e},_updateLayoutForSlideShow:function(e){e.items.forEach(function(e){delete e.data,delete e.style}),delete e.hasOverview,delete e.showOverviews,e.transition=this._targetInfo.transition},_updateLayoutForPanAndZoom:function(e){delete e.transition,e.hasOverview||(e.showOverviews={showStart:!0,showEnd:!0},e.hasOverview=!0),e.items.forEach(function(e,t){e.data={positionIndex:t}})},_isFreeform:function(e){return"container"===e.type&&e.items&&"genericPage"===e.items[0].type&&"absolute"===e.items[0].layoutPositioning},_convertFreeformToTemplate:function(e){var t=this;e.items.filter(this._isFreeform.bind(this)).forEach(function(i){return t._convertToRelativeLayout(e.pageSize,i.items[0])})},_convertToRelativeLayout:function(e,t){t.layoutPositioning="relative",t.items.forEach(function(t){i.changePixelPropertiesToPercent(t.style,e)})},_fitWidgetsToScenes:function(e){var t=this;(e.items||[]).forEach(function(e){t._fitWidgetsToScene(e)})},_fitWidgetsToScene:function(e){var t=this,i=function e(t){return t.style?[t]:(t.items||[]).reduce(function(t,i){return t.push.apply(t,e(i)),t},[])}(e);if(i.length){var n=i.reduce(function(e,i){var n=(parseFloat(i.style.left,10)||0)+(parseFloat(i.style.width,10)||0);return n>100&&(t.hasOutOfBoundsWidget=!0),Math.max(e,n)},100),o=i.reduce(function(e,i){var n=(parseFloat(i.style.top,10)||0)+(parseFloat(i.style.height,10)||0);return n>100&&(t.hasOutOfBoundsWidget=!0),Math.max(e,n)},100),s=Math.min(100/n,100/o);s<1&&i.forEach(function(e){["top","left","width","height"].forEach(function(t){void 0!==e.style[t]&&(e.style[t]=(parseFloat(e.style[t],10)||0)*s+"%")})})}}});return r}),define("storytelling/layout/views/SceneLayout",["gemini/dashboard/layout/views/PageCollectionView","jquery","underscore","../../StoryService"],function(e,t,i,n){var o=["layoutPositioning"],s=["button","input","select","textarea"].map(function(e){return e+":not([tabindex])"}).concat(['[tabindex="0"]']).join(),r=e.extend({init:function(e){var t=this;r.inherited("init",this,arguments),this._tabstops=[],this._scenes=[],this.sceneId=e.appSettings&&e.appSettings.sceneId||null,this.dashboardApi=e.dashboardApi,this.stringResources=this.dashboardApi.getDashboardCoreSvc(".StringResources"),this.dashboardApi.getDashboardCoreSvc(".LifeCycleManager").registerLifeCycleHandler("scene:select",this.onSceneSelected.bind(this)),this.dashboardApi.getDashboardCoreSvc(".LifeCycleManager").registerLifeCycleHandler("scene:next",this.onNextScene.bind(this)),this.dashboardApi.getDashboardCoreSvc(".LifeCycleManager").registerLifeCycleHandler("scene:previous",this.onPreviousScene.bind(this)),this.layoutController.eventRouter.on("scene:jump",this.onJumpScene,this),this.layoutController.layoutReady(this.model.id).then(function(){t.onLayoutReady()}),this.sceneLayoutApi={getAdjacentScenes:this._getAdjacentScenes.bind(this),
- getCurrentScene:this._getCurrentScene.bind(this),getNextScene:this._getNextScene.bind(this),getPreviousScene:this._getPreviousScene.bind(this),getSceneById:this._getSceneById.bind(this),getSceneByIndex:this._getSceneByIndex.bind(this),getSceneIndex:this._getSceneIndex.bind(this),getScenes:this._getScenes.bind(this)}},destroy:function(){this._scenes=[],this._tabstops=[],this.layoutController.eventRouter.off("scene:jump",this.onJumpScene,this),r.inherited("destroy",this,arguments)},onLayoutReady:function(){i.each(this.model.items,this._addScene.bind(this))},getSceneLayoutApi:function(){return this.sceneLayoutApi},extendApi:function(e){i.each(e,function(e,t){this.sceneLayoutApi[t]=e}.bind(this))},_hasScene:function(e){var t=this._getSceneId(e);return!!i.findWhere(this._scenes,{id:t})},_addScene:function(e){this._scenes.push(this._makeSceneInstance(e))},_removeScene:function(e){var t=this,n=this._getScene(e),o=this._getSceneIndex(e),s=this._scenes[o+1];return s||(s=this._scenes[o-1]),this._scenes=i.without(this._scenes,n),this._tabstops=this._tabstops.filter(function(e){return!!t.$el[0].contains(e)||(e.setAttribute("tabindex","0"),!1)}),this.didRemovePage({modelId:this.sceneId!==e.id?this.sceneId:s.id})},_makeSceneInstance:function(e){return{id:e.id,$el:this.$el.find("#"+this._getViewId(e.id)),getLayoutView:this.layoutController.getLayoutView.bind(this.layoutController,e.id),getLayoutViewWhenReady:this.layoutController.getLayoutViewWhenReady.bind(this.layoutController,e.id)}},_updateSceneList:function(e,t){var n=this._getSceneId(e),o=i.findWhere(this._scenes,{id:n});this._scenes=i.without(this._scenes,o);var s=this._scenes.length;if(t){var r=i.findWhere(this._scenes,{id:t});s=i.indexOf(this._scenes,r)}this._scenes.splice(s,0,this._makeSceneInstance(e))},_getScenes:function(){return this._scenes},_getScene:function(e){return this._getSceneById(e.id)},_getAdjacentScenes:function(e){var t=[],i=this._getPreviousScene(e),n=this._getNextScene(e);return i&&i!==e&&t.push(i),n&&n!==e&&t.push(n),t},_getCurrentScene:function(){return this._getSceneById(this.sceneId)},_getCurrentSceneIndex:function(){return this._getSceneIndexById(this.sceneId)},_getNextScene:function(e){var t=this._getCurrentSceneIndex();return e&&e.id!==this.sceneId&&(t=this._getSceneIndex(e)),t>=0&&t<this._scenes.length-1?this._getSceneByIndex(t+1):t===this._scenes.length-1?this._getSceneByIndex(0):null},_getPreviousScene:function(e){var t=this._getCurrentSceneIndex();return e&&e.id!==this.sceneId&&(t=this._getSceneIndex(e)),t>0&&t<this._scenes.length?this._getSceneByIndex(t-1):0===t?this._getSceneByIndex(this._scenes.length-1):null},_getSceneById:function(e){return this._scenes.filter(function(t){return t.id===e})[0]||null},_getSceneIndexById:function(e){for(var t=0;t<this._scenes.length;t++)if(this._scenes[t].id===e)return t;return-1},_getSceneIndex:function(e){return this._getSceneIndexById(e.id)},_getSceneByIndex:function(e){return e>-1&&e<this._scenes.length?this._scenes[e]:null},_getSceneId:function(e){return e.id},_getViewId:function(e){return e+"_tab"},_selectScene:function(e){return this.dashboardApi.getDashboardCoreSvc(".LifeCycleManager").invokeLifeCycleHandlers("scene:select",{modelId:e})},didRemovePage:function(e){return this.onJumpScene(e)},onPlaybackNext:function(){return this.layoutController.eventRouter.trigger("playback:next"),this},onPlaybackPrevious:function(){return this.layoutController.eventRouter.trigger("playback:prev"),this},onSceneSelected:function(e){var t=this;return this._pageNavigationController.jumpTo(i.extend(e,{onTargetSelected:this._navigationStarted.bind(this)})).then(function(n){t._navigationComplete(i.extend(n,{play:e?e.play:null}))})},onNextScene:function(e){var t=this;return this._pageNavigationController.nextPage(i.extend({},e,{onTargetSelected:this._navigationStarted.bind(this)})).then(function(n){t._navigationComplete(i.extend(n,{play:e?e.play:null}))})},onPreviousScene:function(e){var t=this;return this._pageNavigationController.previousPage(i.extend({},e,{onTargetSelected:this._navigationStarted.bind(this)})).then(function(n){t._navigationComplete(i.extend(n,{play:e?e.play:null}))})},onJumpScene:function(e){var t=this;return this._pageNavigationController.jumpTo(i.extend({},e,{onTargetSelected:this._navigationStarted.bind(this)})).then(function(n){t._navigationComplete(i.extend(n,{play:e?e.play:null}))})},_navigationStarted:function(e){this._navigationUpdated(e,"navigation:started")},_navigationComplete:function(e){this._navigationUpdated(e,"navigation:complete"),this.currentSceneChanged()},_updateTabStops:function(){var e=[];this._scenes.forEach(function(t){for(var i=t.$el[0].querySelector(".page.pagecontainer"),n=i?i.querySelectorAll(s):[],o=0;o<n.length;o++)e.push(n[o])}),this._tabstops=this._tabstops.concat(e),this._tabstops=i.uniq(this._tabstops);var t=this._getCurrentScene(),n=t&&t.$el.length?t.$el[0]:null;this._tabstops.forEach(function(e){n&&n.contains(e)?e.setAttribute("tabindex","0"):e.setAttribute("tabindex","-1")})},_navigationUpdated:function(e,t){this.sceneId=e.scene.id;var i=this._getCurrentSceneIndex(),n={index:i,scene:e.scene,overview:e.overview||i<0,play:e.play};this.layoutController.eventRouter.trigger(t,n)},currentSceneChanged:function(){this._updateTabStops()},_onPlaybackNext:function(){return this.onPlaybackNext()},_onPlaybackPrevious:function(){return this.onPlaybackPrevious()},_onKeyDown:function(e){return this.onKeyDown(e)},getBannerProperty:function(){return{value:this.stringResources.get("storyProperties"),name:"banner",type:"Banner",editable:!1}},getProperties:function(){var e=this;return r.inherited("getProperties",this,arguments).then(function(t){return t=t.filter(function(e){return-1===o.indexOf(e.id)}),t.push(e._getConvertProperty()),t})},_getConvertProperty:function(){var e=this,t=[{name:"panAndZoom1",label:this.stringResources.get("PanAndZoomLayout1"),type:"svg",value:"dashboard-guidedjourney1_32"},{name:"panAndZoom2",label:this.stringResources.get("PanAndZoomLayout2"),type:"svg",value:"dashboard-guidedjourney2_32"},{name:"panAndZoom3",label:this.stringResources.get("PanAndZoomLayout3"),type:"svg",value:"dashboard-guidedjourney3_32"},{name:"panAndZoom4",label:this.stringResources.get("PanAndZoomLayout4"),type:"svg",value:"dashboard-guidedjourney4_32"},{name:"panAndZoom5",label:this.stringResources.get("PanAndZoomLayout5"),type:"svg",value:"dashboard-guidedjourney5_32"},{name:"panAndZoom6",label:this.stringResources.get("PanAndZoomLayout6"),type:"svg",value:"dashboard-timesequence_32"}],i=void 0,o=this.model.get("type")||"slideshow";if(-1!=o.indexOf("panAndZoom")){var s=o.substring(o.length-1,o.length)-1;o=o.substring(0,o.length-1),i=t[s].name}var r={name:"storyType",label:this.stringResources.get("storyTypeLabel"),defaultValue:o,options:[{label:this.stringResources.get("slideshowLabel"),value:"slideshow"},{label:this.stringResources.get("panAndZoomLabel"),value:"panAndZoom"}]},a={type:"CollapsiblePicker",id:"layoutModel",name:"layoutModel",label:this.stringResources.get("layoutLabel"),selectedName:i,placeholder:{name:"",label:"",type:"svg",value:"dashboard-unknown_16"},contentSize:"large",items:t,isRequired:!0};return{type:"TwoStageCombo",name:"storyToStoryControl",id:"storyToStoryCombo",sectionName:this.stringResources.get("scenesPropertiesSection"),sectionOpened:!0,tabName:this.stringResources.get("tabName_general"),dropDownOptions:r,collapsiblePickerOptions:[null,a],onChange:function(t,i){var o=i;i&&i.name&&(o=o.name),new n({dashboardApi:e.dashboardApi}).updateStory({boardModel:e.model.boardModel,targetInfo:{type:o}})}}}});return r}),define("storytelling/navigation/NavigationController",["baglass/core-client/js/core-client/ui/core/Class"],function(e){var t=e.extend({init:function(e){t.inherited("init",this,arguments),this._transitionController=e.transitionController,this._sceneLoader=e.sceneLoader,this.logger=e.logger,this.sceneLayoutApi=e.sceneLayoutApi,this.inProgress=!1},jumpTo:function(e){var t=this;if(this.inProgress)return Promise.reject();this.inProgress=!0;var i=this.sceneLayoutApi.getSceneByIndex(e.index),n=i||this.sceneLayoutApi.getSceneById(e.modelId),o=this.sceneLayoutApi.getCurrentScene()||n,s=this.sceneLayoutApi.getAdjacentScenes(n).concat([n]),r=this.sceneLayoutApi.getAdjacentScenes(o).concat([o]);return this._sceneLoader.waitForSceneToLoad(n,e).then(function(){return t._sceneLoader.startBackgroundLoad(t._generateShiftedSceneArray(n),e),t._transitionController.deckScenes(s),t._updateSelection(o,n),e&&e.onTargetSelected&&e.onTargetSelected({scene:n,play:e.play}),t._transitionController.jumpTo(o,n)}).then(function(e){return t._transitionController.undeckScenes(r),t.inProgress=!1,{scene:n,overview:e.overview}}).catch(function(e){return t.logger.error("NavigationController.jumpTo()",e),t.inProgress=!1,Promise.reject()})},nextPage:function(e){var t=this;if(this.inProgress)return Promise.reject();this.inProgress=!0;var i=this.sceneLayoutApi.getSceneByIndex(e.to)||this.sceneLayoutApi.getNextScene(),n=this.sceneLayoutApi.getCurrentScene()||i,o=this.sceneLayoutApi.getAdjacentScenes(i).concat([i]),s=this.sceneLayoutApi.getAdjacentScenes(n).concat([n]);return this._sceneLoader.waitForSceneToLoad(i,e).then(function(){return e.refreshData&&t._sceneLoader.startBackgroundLoad(t._generateShiftedSceneArray(i),e),t._transitionController.deckScenes(o),t._updateSelection(n,i),e&&e.onTargetSelected&&e.onTargetSelected({scene:i}),t._transitionController.forward(n,i)}).then(function(e){return t._transitionController.undeckScenes(s),t.inProgress=!1,{scene:i,overview:e.overview}}).catch(function(e){return t.logger.error("NavigationController.nextPage()",e),t.inProgress=!1,Promise.reject()})},previousPage:function(e){var t=this;if(this.inProgress)return Promise.reject();this.inProgress=!0;var i=this.sceneLayoutApi.getSceneByIndex(e.to)||this.sceneLayoutApi.getPreviousScene(),n=this.sceneLayoutApi.getCurrentScene()||i,o=this.sceneLayoutApi.getAdjacentScenes(i).concat([i]),s=this.sceneLayoutApi.getAdjacentScenes(n).concat([n]);return this._sceneLoader.waitForSceneToLoad(i,e).then(function(){return e.refreshData&&t._sceneLoader.startBackgroundLoad(t._generateShiftedSceneArray(i),e),t._transitionController.deckScenes(o),t._updateSelection(n,i),e&&e.onTargetSelected&&e.onTargetSelected({scene:i}),t._transitionController.backward(n,i)}).then(function(e){return t._transitionController.undeckScenes(s),t.inProgress=!1,{scene:i,overview:e.overview}}).catch(function(e){return t.logger.error("NavigationController.previousPage()",e),t.inProgress=!1,Promise.reject()})},_updateSelection:function(e,t){e.$el.removeClass("selected"),t.$el.addClass("selected")},_generateShiftedSceneArray:function(e){var t=this.sceneLayoutApi.getNextScene(e),i=this.sceneLayoutApi.getScenes(),n=this.sceneLayoutApi.getSceneIndex(t);n=function(e,t){return e>=0&&e<t.length}(n,i)?n:0;for(var o=[],s=0;s<i.length;s++){var r=i[(s+n)%i.length];o.push(r)}return o[o.length-1].id===e.id&&o.pop(),o},setTransitionController:function(e){delete this._transitionController,this._transitionController=e}});return t}),define("storytelling/navigation/TransitionController",["baglass/core-client/js/core-client/ui/core/Class","underscore"],function(e,t){var i=e.extend({_deck:[],init:function(){i.inherited("init",this,arguments)},jumpTo:function(e,t){var i=this;return this._beforeJump(e,t).then(function(){return i._jump(e,t)}).then(function(){return i._afterJump(e,t)}).then(function(){return{overview:"end"===t.id||"start"===t.id}}).catch(function(n){return i._afterJump(e,t).then(function(){return Promise.reject(n)})})},forward:function(e,t){var i=this;return this._beforeNext(e,t).then(function(){return i._next(e,t)}).then(function(){return i._afterNext(e,t)}).then(function(){return{overview:!1}})},backward:function(e,t){var i=this;return this._beforePrevious(e,t).then(function(){return i._previous(e,t)}).then(function(){return i._afterPrevious(e,t)}).then(function(){return{overview:!1}})},_beforeJump:function(e,t){return this._setNextSceneScrollPosition(e,t),Promise.resolve()},_jump:function(){return Promise.resolve()},_afterJump:function(){return Promise.resolve()},_beforeNext:function(e,t){return this._setNextSceneScrollPosition(e,t),Promise.resolve()},_next:function(){return Promise.resolve()},_afterNext:function(){return Promise.resolve()},_beforePrevious:function(e,t){return this._setNextSceneScrollPosition(e,t),Promise.resolve()},_previous:function(){return Promise.resolve()},_afterPrevious:function(){return Promise.resolve()},_setNextSceneScrollPosition:function(e,t){if(e&&t&&e.getLayoutView&&t.getLayoutView){var i=e.getLayoutView().$el.scrollTop();t.getLayoutView().$el.scrollTop(i)}},deckScenes:function(e){var i=this,n=function(e){e.length&&(e.addClass("onDeck"),e.removeClass("hiddenScene"))};t.each(e,function(e){n(e.$el),i._showWidgets(e),i._hideWidgets(e)}),this._deck=e},undeckScenes:function(e){var i=this,n=function(e){e.length&&(e.removeClass("onDeck"),e.addClass("hiddenScene"),e.attr("aria-hidden","true"))};t.each(e,function(e){-1===i._deck.indexOf(e)&&n(e.$el)})},_hideWidgets:function(e){e&&e.getLayoutView&&e.getLayoutView().onHide()},_showWidgets:function(e){e&&e.getLayoutView&&e.getLayoutView().onShow()}});return i}),define("storytelling/util/AnimationHelper",["baglass/core-client/js/core-client/ui/core/Class","baglass/core-client/js/core-client/utils/BrowserUtils"],function(e,t){return new(e.extend({SCALE_ZERO:t.isIE()?"scale(0.00001)":"scale(0)",Animate:function(e,t){var i=!1;return e&&e.length&&t?new Promise(function(n){var o=function e(t){i=!0,n(),t.target.removeEventListener("transitionend",e)};setTimeout(function(){i||n()},1100),e[0].addEventListener("transitionend",o),e.css("transform"),e.css(t)}):Promise.resolve()}}))}),define("storytelling/navigation/slideShow/TransitionDirector",["baglass/core-client/js/core-client/ui/core/Class","../../util/AnimationHelper"],function(e,t){var i=e.extend({layoutConfiguration:{widget:{hasOpacity:!0,hideIfNotLinked:!0},group:{hasOpacity:!1,hideIfNotLinked:!1}},init:function(e){i.inherited("init",this,arguments),this.rootLayout=e.rootLayout},getOnTransitionCallback:function(e){return this._onTransitionCallback.bind(this,e)},getAfterTransitionCallback:function(e){return this._afterTransitionCallback.bind(this,e)},_onTransitionCallback:function(e,t,i){return i=i||[],e.to?i.push(this._animateToNext(e.linkIdMap,t)):e.from&&i.push(this._animateFromPrevious(e.linkIdMap,t)),i},_animateToNext:function(e,i){var n=this.layoutConfiguration[i.model.type],o=i.$el,s=e.forward[i.id];if(!s)return n&&n.hideIfNotLinked&&o.hide(),Promise.resolve();o.show();var r=this.rootLayout.findModel(s),a=i.model,l=parseFloat(r.style.width,10)/parseFloat(a.style.width,10),c=parseFloat(r.style.height,10)/parseFloat(a.style.height,10),d=(parseFloat(r.style.left,10)-parseFloat(a.style.left,10))/100,h=(parseFloat(r.style.top,10)-parseFloat(a.style.top,10))/100,u=o.parent().width()*d,g=o.parent().height()*h;o.css({transform:"scale(1)"});var f=this._getLayoutNodeTransform(r),p={transition:"transform 0.9s",transform:" translate("+u+"px, "+g+"px) "+f+"translate(-50%,-50%) scale("+l+","+c+") translate(50%,50%)"};return n&&n.hasOpacity&&(p.transition+=", opacity 0.9s ease-in",p.opacity="0"),t.Animate(o,p)},_animateFromPrevious:function(e,i){var n=this.layoutConfiguration[i.model.type],o=i.$el,s=e.backward[i.id];if(!s)return Promise.resolve();var r=this.rootLayout.findModel(s),a=i.model,l=parseFloat(a.style.width,10)/parseFloat(r.style.width,10),c=parseFloat(a.style.height,10)/parseFloat(r.style.height,10),d=(parseFloat(a.style.left,10)-parseFloat(r.style.left,10))/100,h=(parseFloat(a.style.top,10)-parseFloat(r.style.top,10))/100,u=o.parent().width()*d,g=o.parent().height()*h,f=this._getLayoutNodeTransform(a),p=this._getLayoutNodeTransform(r),m={transform:"translate("+-1*u+"px, "+-1*g+"px)"+p+" translate(-50%,-50%) scale("+1/l+","+1/c+") translate(50%,50%)"};return n&&n.hasOpacity&&(m.opacity="0"),o.css(m),m={transition:"transform 0.9s",transform:"translate(0px, 0px) "+f+"translate(-50%,-50%) scale(1, 1) translate(50%,50%)"},n&&n.hasOpacity&&(m.transition+=", opacity 0.9s ease-out",m.opacity=1,(a.style.opacity||0===a.style.opacity)&&(m.opacity=a.style.opacity)),t.Animate(o,m)},_afterTransitionCallback:function(e,t,i){i=i||[];var n=this.layoutConfiguration[t.model.type],o=t.$el,s=t.model,r=this._getLayoutNodeTransform(s),a={transition:"none",transform:r};n&&n.hasOpacity&&(a.opacity=1,(s.style.opacity||0===s.style.opacity)&&(a.opacity=s.style.opacity));var l=e.linkIdMap.backward[t.id],c=e.linkIdMap.forward[t.id];return(l||c)&&o.css(a),c||o.show(),i.push(Promise.resolve()),i},_getLayoutNodeTransform:function(e){var t,i=e.style;return i&&i.transform&&(t=i.transform),t&&"none"!==t&&"matrix(0, 0, 0, 0, 0, 0)"!==t||(t=""),t}});return i}),define("storytelling/navigation/slideShow/AnimatedPathSlideShowTransitionController",["../TransitionController","./TransitionDirector","../../util/AnimationHelper"],function(e,t,i){var n=e.extend({_duration:null,_cssOnScreen:{display:"block",transform:"scale(1)",position:"absolute",top:"0px",bottom:"0px",left:"0px",right:"0px"},init:function(e){n.inherited("init",this,arguments),this._duration=e.duration?e.duration:100,this._timeline=e.timeline},_beforeJump:function(e){return this._hideWidgets(e),n.inherited("_beforeJump",this,arguments)},_jump:function(e,t){return e&&e.$el&&e.$el.css({transform:i.SCALE_ZERO}).attr("aria-hidden","true"),t.$el.css(this._cssOnScreen).css({opacity:1}).addClass("selected").attr("aria-hidden","false"),n.inherited("_jump",this,arguments)},_afterJump:function(e,t){return this._showWidgets(t),n.inherited("_afterJump",this,arguments)},_beforeNext:function(e,t){return Promise.try(function(){this._beforeJump(e,t)}.bind(this)).then(function(){return t.$el.css(this._cssOnScreen).addClass("selected").attr("aria-hidden","false"),this._transitionWidgets(e,t)}.bind(this))},_next:function(){return n.inherited("_next",this,arguments)},_afterNext:function(e,t){return e.$el.css({transform:i.SCALE_ZERO}).attr("aria-hidden","true"),this._restoreWidgets(e,t).then(this._afterJump.bind(this,e,t))},_beforePrevious:function(e,t){return this._beforeJump(e,t)},_previous:function(e,t){return this._jump(e,t)},_afterPrevious:function(e,t){return this._afterJump(e,t)},_transitionWidgets:function(e,i){if(e&&e.getLayoutView&&i&&i.getLayoutView&&(this._transitionMap=this._timeline.getWidgetTransitionMap(e.getLayoutView(),i.getLayoutView()),this._transitionMap)){var n={current:e,to:i,linkIdMap:this._transitionMap},o={current:i,from:e,linkIdMap:this._transitionMap},s=e.getLayoutView();if(s&&s.model){var r=e.getLayoutView().model.getTopLayoutModel(),a=new t({rootLayout:r}),l=[];return l=l.concat(e.getLayoutView().reduce(a.getOnTransitionCallback(n))),l=l.concat(i.getLayoutView().reduce(a.getOnTransitionCallback(o))),Promise.all(l)}}return Promise.resolve()},_restoreWidgets:function(e,i){if(e&&e.getLayoutView&&i&&i.getLayoutView&&this._transitionMap){var n={current:e,to:i,linkIdMap:this._transitionMap},o={current:i,from:e,linkIdMap:this._transitionMap};this._transitionMap=null;var s=e.getLayoutView();if(s&&s.model){var r=e.getLayoutView().model.getTopLayoutModel(),a=new t({rootLayout:r}),l=[];return l=l.concat(e.getLayoutView().reduce(a.getAfterTransitionCallback(n))),l=l.concat(i.getLayoutView().reduce(a.getAfterTransitionCallback(o))),Promise.all(l)}}return Promise.resolve()}});return n}),define("storytelling/navigation/slideShow/SlideTransitionController",["../TransitionController","../../util/AnimationHelper"],function(e,t){var i=e.extend({_duration:null,_cssOnScreen:{display:"block",transform:"scale(1)",position:"absolute",top:"0px",bottom:"0px",left:"0px",right:"0px"},init:function(e){i.inherited("init",this,arguments),this._duration=e.duration?e.duration:800},_beforeJump:function(e){return this._hideWidgets(e),i.inherited("_beforeJump",this,arguments)},_jump:function(e,n){return e&&e.$el&&e.$el.css({transform:t.SCALE_ZERO}).attr("aria-hidden","true"),n.$el.css(this._cssOnScreen).css({opacity:1}).addClass("selected").attr("aria-hidden","false"),i.inherited("_jump",this,arguments)},_afterJump:function(e,t){return this._showWidgets(t),i.inherited("_afterJump",this,arguments)}});return i}),define("storytelling/navigation/slideShow/SlideShowTransitionController",["./SlideTransitionController","jquery","underscore","../../util/AnimationHelper"],function(e,t,i,n){var o=e.extend({$fromShim:null,$toShim:null,$backdrop:null,_minScale:null,init:function(e){o.inherited("init",this,arguments),this._minScale=e.minScale?e.minScale:.7},_beforeNext:function(e,i){return this.$fromShim=this._makeShim(e.$el).css(this._cssOnScreen).css({"z-index":1}),e.$el.css(this._cssOnScreen).css({"z-index":1}),this.$toShim=this._makeShim(i.$el).css(this._cssOnScreen).css({left:e.$el.width(),"z-index":2,opacity:1}),i.$el.css(this._cssOnScreen).css({left:e.$el.width(),"z-index":2,opacity:1}),this._showWidgets(i),this.$backdrop=t('<div class="animationBackdrop"/>').insertBefore(this.$fromShim),o.inherited("_beforeNext",this,arguments)},_next:function(e,t){return Promise.all([this._scaleOut(e),this._slideIn(t)])},_afterNext:function(e,t){return this._hideWidgets(e),e.$el.css({transform:n.SCALE_ZERO}),this._cleanAnimationArtifacts(e,t),o.inherited("_afterNext",this,arguments)},_beforePrevious:function(e,i){return this.$fromShim=this._makeShim(e.$el).css(this._cssOnScreen).css({"z-index":1}),e.$el.css(this._cssOnScreen).css({"z-index":1}),this.$toShim=this._makeShim(i.$el).css(this._cssOnScreen).css({"z-index":2,opacity:0}),i.$el.css(this._cssOnScreen).css({"z-index":2,opacity:0}),this._showWidgets(i),this.$backdrop=t('<div class="animationBackdrop"/>').insertBefore(this.$toShim),o.inherited("_beforePrevious",this,arguments)},_previous:function(e,t){return Promise.all([this._slideOut(e),this._scaleIn(t)])},_afterPrevious:function(e){return this._hideWidgets(e),e.$el.css({transform:n.SCALE_ZERO}),this._cleanAnimationArtifacts(),o.inherited("_afterPrevious",this,arguments)},_slideIn:function(e){var t=this;return new Promise(function(i){e.$el.addClass("slideShowSlide"),t._slideTo(t.$toShim,"0px",function(){}),t._slideTo(e.$el,"0px",function(){e.$el.removeClass("slideShowSlide"),i()})})},_slideOut:function(e){var t=this;return new Promise(function(i){e.$el.addClass("slideShowSlide"),t._slideTo(t.$fromShim,e.$el.width(),function(){}),t._slideTo(e.$el,e.$el.width(),function(){e.$el.removeClass("slideShowSlide"),i()})})},_slideTo:function(e,t,i){e.animate({left:t},{duration:this._duration,complete:i,queue:!1,easing:"swing"})},_scaleIn:function(e){var t=this;return new Promise(function(i){e.$el.addClass("slideShowScale"),t._scaleInAnimation(t.$toShim,function(){}),t._scaleInAnimation(e.$el,function(){e.$el.removeClass("slideShowScale"),i()})})},_scaleInAnimation:function(e,t){var i=this._minScale;e.animate({transform:1,opacity:1},{step:function(t,n){"transform"===n.prop&&e.css({transform:"scale("+(t*(1-i)+i)+")"})},duration:this._duration,complete:t},"swing")},_scaleOut:function(e){var t=this;return new Promise(function(i){e.$el.addClass("slideShowScale"),t._scaleOutAnimation(t.$fromShim,function(){}),t._scaleOutAnimation(e.$el,function(){e.$el.removeClass("slideShowScale"),e.$el.css({opacity:1}),i()})})},_scaleOutAnimation:function(e,t){var i=this._minScale,n=.8*this._duration;e.delay(this._duration-n).animate({transform:1,opacity:0},{step:function(t){e.css({transform:"scale("+(t*(1-i)+i)+")"})},duration:n,complete:t},"swing")},_makeShim:function(e){var n=t('<div class="animationShim"/>'),o=e.parents(".contentViewPane *").get(),s=n;return i.each(o.reverse(),function(e){var i=t(e.cloneNode(!1));s.append(i),s=i}),n.insertBefore(e),n},_cleanAnimationArtifacts:function(e,t){e&&e.$el&&e.$el.css({"z-index":""}),t&&t.$el&&t.$el.css({"z-index":""}),this.$toShim&&(this.$toShim.remove(),this.$toShim=null),this.$fromShim&&(this.$fromShim.remove(),this.$fromShim=null),this.$backdrop&&(this.$backdrop.remove(),this.$backdrop=null)}});return o}),define("storytelling/navigation/slideShow/NoTransitionSlideShowTransitionController",["../TransitionController","../../util/AnimationHelper"],function(e,t){var i=e.extend({_duration:null,_cssOnScreen:{display:"block",transform:"scale(1)",position:"absolute",top:"0px",bottom:"0px",left:"0px",right:"0px"},init:function(e){i.inherited("init",this,arguments),this._duration=e.duration?e.duration:100},_beforeJump:function(e){return this._hideWidgets(e),i.inherited("_beforeJump",this,arguments)},_jump:function(e,n){return e&&e.$el&&e.$el.css({transform:t.SCALE_ZERO}).attr("aria-hidden","true"),n.$el.css(this._cssOnScreen).css({opacity:1}).addClass("selected").attr("aria-hidden","false"),i.inherited("_jump",this,arguments)},_afterJump:function(e,t){return this._showWidgets(t),i.inherited("_afterJump",this,arguments)},_beforeNext:function(){return i.inherited("_beforeNext",this,arguments)},_next:function(e,t){return this._jump(e,t)},_afterNext:function(e,t){return this._afterJump(e,t)},_beforePrevious:function(e,t){return this._beforeJump(e,t)},_previous:function(e,t){return this._jump(e,t)},_afterPrevious:function(e,t){return this._afterJump(e,t)}});return i}),define("storytelling/navigation/SceneLoader",["baglass/core-client/js/core-client/ui/core/Class","react-dom","../util/WidgetHelper"],function(e,t,i){var n=e.extend({init:function(e){n.inherited("init",this,arguments),this.logger=e.logger,this.dashboardApi=e.dashboardApi,this.layoutController=e.layoutController,this._loadTimeout=e.loadTimeout||1e4,this._sceneLoadPromises={},this._loadSequence=[],this._loadSequenceGeneration=0,this.widgetHelper=new i({dashboardApi:this.dashboardApi})},loadScene:function(e,t){var i=this,n=t&&t.refreshData;if(e.isOverview)return Promise.resolve();if(!this._sceneLoadPromises[e.id]||n){var o=e.getLayoutView();e.$el.addClass("hiddenBackgroundLoadingScene").removeClass("hiddenScene"),o.render(),this._sceneLoadPromises[e.id]=Promise.resolve(this.layoutController.whenPageRenderComplete(o.model)).then(function(){if(n)return i._refreshData(o.model)}).then(function(){i.logger.debug("SceneLoader:loadScene: done loading scene: ",e.id),i._doneSceneBackgroundLoad(e)})}return this._sceneLoadPromises[e.id]},_doneSceneBackgroundLoad:function(e){e.$el.removeClass("hiddenBackgroundLoadingScene");var i=this.dashboardApi.getCurrentContentView().$el;t.unmountComponentAtNode(i[0])},waitForSceneToLoad:function(e,t){var i,n=this;return Promise.try(function(){return i=setTimeout(function(){n.layoutController.getTopLayoutView().setLoading(!0)},500),t&&t.refreshData?n.loadScene(e,t):n.loadScene(e,t).timeout(n._loadTimeout)}).catch(Promise.TimeoutError,function(){n.logger.warn("Scene taking more than "+n._loadTimeout/1e3+" seconds to load, loading the rest in background."),n._doneSceneBackgroundLoad(e)}).catch(function(t){n.logger.error("SceneLoader:waitForSceneToLoad: Error ocurred loading scene: ",t),n._doneSceneBackgroundLoad(e)}).finally(function(){clearTimeout(i),n.layoutController.getTopLayoutView().setLoading(!1)})},startBackgroundLoad:function(e,t){return this._loadSequence=e.slice(),this._loadSequenceGeneration+=1,Promise.try(function(){return this._doSequentialLoad(this._loadSequenceGeneration,t)}.bind(this)).catch(function(e){return this.logger.error("SceneLoader:waitForSceneToLoad:Error occurred pre-loading scene: ",e),null}.bind(this))},stopBackgroundLoad:function(){this._loadSequenceGeneration=-1},_doSequentialLoad:function(e,t){if(e!==this._loadSequenceGeneration)return null;var i=this._loadSequence.shift();return i?this.loadScene(i,t).then(function(){return this._doSequentialLoad(e,t)}.bind(this)):null},_refreshData:function(e){var t=this,i=[];return e.findDescendantsWithType("widget").forEach(function(e){var n=t.widgetHelper.getWidget(e.id);"live"===n.getType()&&i.push(n.getVisApi().ownerWidget.reRender({sender:"realtimeRefresh"}))}),Promise.all(i)}});return n}),define("storytelling/navigation/slideShow/SlideShowSceneLoader",["../SceneLoader"],function(e){var t=e.extend({_doneSceneBackgroundLoad:function(e){e.$el.hasClass("onDeck")||e.$el.addClass("hiddenScene"),t.inherited("_doneSceneBackgroundLoad",this,arguments)}});return t}),define("text!storytelling/layout/views/templates/SlideShow.html",[],function(){return'<div id="{{id}}" class="page page{{type}}{{extraCSS}}" {{style}}><div class="tabCntr">{{items}}</div></div>'}),define("text!storytelling/layout/views/templates/SlideShowItems.html",[],function(){return'<div id="{{item.id}}_tab" role="tabpanel" class="pageTabContent hiddenScene" style="transform: scale(0.00001);" aria-labelledby="{{item.id}}_tablabel" data-model-id="{{item.id}}">{{item}}</div>'}),define("storytelling/layout/views/SlideShow",["./SceneLayout","../../navigation/NavigationController","../../navigation/slideShow/AnimatedPathSlideShowTransitionController","../../navigation/slideShow/SlideShowTransitionController","../../navigation/slideShow/NoTransitionSlideShowTransitionController","../../navigation/slideShow/SlideShowSceneLoader","text!./templates/SlideShow.html","text!./templates/SlideShowItems.html","underscore","../../StoryService"],function(e,t,i,n,o,s,r,a,l,c){var d=e.extend({_pageNavigationController:null,transitionControllers:{animatedPath:i,scaleAndSlide:n,none:o},init:function(){d.inherited("init",this,arguments),this.model.transition||(this.model.transition="scaleAndSlide"),"progressive"===this.model.transition&&(this.model.transition="animatedPath"),this._sceneLoader=new s({logger:this.logger,dashboardApi:this.dashboardApi,layoutController:this.layoutController}),this.transitionController=this.transitionControllers[this.model.transition],this._pageNavigationController=new t({sceneLayoutApi:this.getSceneLayoutApi(),transitionController:new this.transitionController({timeline:this.model.boardModel.timeline}),logger:this.logger,sceneLoader:this._sceneLoader}),this.model.on("change:transition",this._setTransitionController,this)},destroy:function(){this._sceneLoader.stopBackgroundLoad(),d.inherited("destroy",this,arguments)},onLayoutReady:function(){return d.inherited("onLayoutReady",this,arguments),null===this.sceneId&&(this.sceneId=this._scenes[0].id),this._setupNavigationEvents(),this.onSceneSelected({modelId:this.sceneId,play:!1})},getProperties:function(){var e=this;return d.inherited("getProperties",this,arguments).then(function(t){return t.push({type:"DropDown",label:e.stringResources.get("sceneTransitionPropertyLabel"),name:"sceneTransition",id:"sceneTransition",defaultValue:e.model.get("transition"),options:[{label:e.stringResources.get("noSceneTransitionLabel"),value:"none"},{label:e.stringResources.get("animatedPathSceneTransitionLabel"),value:"animatedPath"},{label:e.stringResources.get("sweepSceneTransitionLabel"),value:"scaleAndSlide"}],tabName:e.stringResources.get("tabName_general"),sectionName:e.stringResources.get("scenesPropertiesSection"),coachMark:{render:function(t){var i={id:"com.ibm.bi.dashboard.storyProperties.animatedPath",title:e.stringResources.get("animatedPathCoachmarkTitle"),contents:e.stringResources.get("animatedPathCoachmarkContents"),placement:"top",domElement:t.$el[0]};e.dashboardApi.prepareGlassOptions(i),e.dashboardApi.getFeature("CoachMark").addCoachMark(i)}},onChange:function(t,i){"relative"!==e.model.layoutPositioning?e._updateStory(i):e._changeTransition(i)}}),t})},_updateStory:function(e){new c({dashboardApi:this.dashboardApi}).updateStory({boardModel:this.model.boardModel,targetInfo:{type:"slideshow",transition:e}})},_changeTransition:function(e){var t={undoRedoTransactionId:l.uniqueId("layout_transitionChange_")};this.model.set({transition:e},{sender:this,payloadData:t})},_setupNavigationEvents:function(){this.$el.on("swiperight",this._onPlaybackPrevious.bind(this)).on("swipeleft",this._onPlaybackNext.bind(this))},_setTransitionController:function(e){this.transitionController=this.transitionControllers[this.model.transition],
- this._pageNavigationController.setTransitionController(new this.transitionController({timeline:this.model.boardModel.timeline})),this._refreshPropertiesPane(e)},_refreshPropertiesPane:function(e){e&&"UndoRedoController"===e.sender&&this.eventRouter.trigger("properties:refreshPane")}});return d.getTemplate=function(){return[r,a]},d}),define("storytelling/navigation/panandzoom/PanAndZoomTransitionController",["../TransitionController"],function(e){"use strict";var t=t=e.extend({_duration:null,_cssOnScreen:{display:"block",position:"absolute",top:"0px",bottom:"0px",left:"0px",right:"0px"},init:function(e){t.inherited("init",this,arguments),this._duration=e.duration?e.duration:800,this._impress=e.impress},_beforeJump:function(e){return this._hideWidgets(e),t.inherited("_beforeJump",this,arguments)},_afterJump:function(e,i){return this._showWidgets(i),t.inherited("_afterJump",this,arguments)},_jump:function(e,i){return this._impress.goto(i.$el[0].id),t.inherited("_jump",this,arguments)},_beforeNext:function(e,i){return this._showWidgets(i),t.inherited("_beforeNext",this,arguments)},_next:function(e,t){return this._impress.goto(t.$el[0].id),Promise.resolve()},_afterNext:function(e){return this._hideWidgets(e),t.inherited("_afterNext",this,arguments)},_beforePrevious:function(e,i){return this._showWidgets(i),t.inherited("_beforePrevious",this,arguments)},_previous:function(e,t){return this._impress.goto(t.$el[0].id),Promise.resolve()},_afterPrevious:function(e){return this._hideWidgets(e),t.inherited("_afterPrevious",this,arguments)},deckScenes:function(){},undeckScenes:function(){}});return t}),define("storytelling/layout/views/PanAndZoomLayout",["./SceneLayout","../../navigation/NavigationController","../../navigation/SceneLoader","../../navigation/panandzoom/PanAndZoomTransitionController","baglass/core-client/js/core-client/utils/Deferred","jquery","underscore","impress"],function(e,t,i,n,o,s,r,a){var l=["fitPage"],c=e.extend({_impressFactory:a,_dropZoneSelector:".pagetemplateDropZone, .pagetemplateIndicator",_pageNavigationController:null,init:function(){c.inherited("init",this,arguments),this._trailingOverviewId="_overview_"+this.model.id,this.extendApi({getOverviews:this._getOverviews.bind(this)}),this._overviews=[{id:"start",$el:s("#start"+this._trailingOverviewId),isOverview:!0},{id:"end",$el:s("#end"+this._trailingOverviewId),isOverview:!0}],this._sceneLoader=new i({logger:this.logger,dashboardApi:this.dashboardApi,layoutController:this.layoutController}),this._layoutIsReady=new o,this.changePageSize({value:this.model.pageSize}),this.model.on("change:pageSize",this._handlePageUpdate,this)},destroy:function(){var e=this;this._sceneLoader.stopBackgroundLoad(),(this._scenes||[]).forEach(function(t){var i=t.getLayoutView();i&&(i.$el[0].style.height=null,i.$el[0].style.width=null,i.$el.find(e._dropZoneSelector).each(function(e,t){t.style.borderWidth=null}))}),clearInterval(this._viewPortSetIntervalId),this.$el[0].removeEventListener("impress:stepenter",this._impressStepEnterHandler),this.model.off("change:pageSize",this._handlePageUpdate,this),c.inherited("destroy",this,arguments)},_handlePageUpdate:function(e){this.changePageSize(e),this.onResize()},changePageSize:function(){},getProperties:function(){var e=this;return c.inherited("getProperties",this,arguments).then(function(t){return t=t.filter(function(e){return-1===l.indexOf(e.id)}),t.concat(e._getShowOverviewProperties())})},_getShowOverviewProperties:function(){var e=this,t=this.model.get("showOverviews"),i=function(t,i){var n;t=t.substring("overview_".length);var o={updateArray:[{id:e.model.id,showOverviews:(n={},n[t]=i,n)}]};e.model.updateModel(o,e,{undoRedoTransactionId:r.uniqueId("layoutShowOverview_")})};return[{name:"overview_showStart",sectionName:this.stringResources.get("scenesPropertiesSection"),type:"CheckBox",label:this.stringResources.get("propShowStoryOverviewFirstSlide"),checked:t.showStart,onChange:i,tabName:this.stringResources.get("tabName_general")},{name:"overview_showEnd",sectionName:this.stringResources.get("scenesPropertiesSection"),type:"CheckBox",label:this.stringResources.get("propShowStoryOverviewLastSlide"),checked:t.showEnd,onChange:i,tabName:this.stringResources.get("tabName_general")}]},_setupNavigationEvents:function(){this.$el.on("keydown",this._onKeyDown.bind(this)),this.$el.on("swiperight",this._onPlaybackPrevious.bind(this)).on("swipeleft",this._onPlaybackNext.bind(this)).on("clicktap",this._onOverviewSceneClick.bind(this)),this._impressStepEnterHandler=function(){window.location.hash="";var e=this.$el.find(".step.active")[0].dataset.modelId;e&&this.sceneId!==e&&this.layoutController.eventRouter.trigger("scene:jump",{modelId:e})}.bind(this),this.$el[0].addEventListener("impress:stepenter",this._impressStepEnterHandler)},_getViewPort:function(){var e=void 0;return this._getSceneIndexById(this.sceneId)<0?(this.layoutController.eventRouter.trigger("filterDock:enable"),e=this.$el[0].getBoundingClientRect(),this.layoutController.eventRouter.trigger("filterDock:disable")):e=this.$el[0].getBoundingClientRect(),0===e.height&&0===e.width&&this.resizeOnShow(),e},_onResize:function(){var e=this,t=arguments;return this._layoutIsReady.promise.then(function(){var i=e._getViewPort(),n=e._getSceneIndexById(e.sceneId);r.each(e._scenes,function(t,o){e._updateSceneSize(t,i),n===o&&e._impress.goto(t.$el[0].id,0)});var o=e._getOverviewLocation(i);r.each(e._overviews,function(t,i){e._updateElementData(t.$el,o),-1*(i+1)===n&&e._impress.goto(t.$el[0].id,0)}),e.$el.removeClass("scenesHidden"),c.inherited("_onResize",e,t)})},onLayoutReady:function(){var e=this;c.inherited("onLayoutReady",this,arguments),this._updateEndpoints(),this._impress=this._impressFactory("impress_"+this.model.id),this._impress.init(),this._didImpressInit=!0;var i=void 0;if(this.sceneId){var o=parseInt(this.sceneId,10);i=o<0?this._getSceneByIndex(o):this._getSceneById(this.sceneId)}else i=this.isAuthoringMode||!this.model.showOverviews.showStart?this._scenes[0]:this._overviews[0];this.sceneId=i.id,this._pageNavigationController=new t({sceneLayoutApi:this.getSceneLayoutApi(),transitionController:new n({impress:this._impress}),logger:this.logger,sceneLoader:this._sceneLoader}),this._setupNavigationEvents(),this.currentSceneChanged(),this._isOverview()&&this.layoutController.eventRouter.trigger("filterDock:collapse"),r.each(this.model.items,function(e){this._updateSceneLabel({model:e})}.bind(this));var s=this._getCurrentSceneIndex();return this._impress.goto(s+1,0),this.onJumpScene({modelId:this.sceneId,play:!1}).then(function(){return e._onResize(),e._layoutIsReady.resolve()})},_getSceneById:function(e){return"start"===e?this._overviews[0]:"end"===e?this._overviews[1]:c.inherited("_getSceneById",this,arguments)},_getSceneByIndex:function(e){return-1===e?this._overviews[0]:-2===e?this._overviews[1]:c.inherited("_getSceneByIndex",this,arguments)},_getSceneIndexById:function(e){var t=c.inherited("_getSceneIndexById",this,arguments);return-1===t&&r.each(this._overviews,function(i){i.id===e&&"end"===i.id&&(t=-2)}),t},_getNextScene:function(e){var t=this._getCurrentSceneIndex();return e&&e.id!==this.sceneId&&(t=this._getSceneIndex(e)),t>=-2&&t<this._scenes.length-1?this._getSceneByIndex(t+1):t===this._scenes.length-1?this._getSceneByIndex(-2):null},_getPreviousScene:function(e){var t=this._getCurrentSceneIndex();return e&&e.id!==this.sceneId&&(t=this._getSceneIndex(e)),t>=0?this._getSceneByIndex(t-1):-2===t?this._getSceneByIndex(this._scenes.length-1):null},onKeyDown:function(e){switch(e.keyCode||e.charCode){case 13:case 32:this._jumpToScene(e)}},didRemovePage:function(){var e=this;return c.inherited("didRemovePage",this,arguments).then(function(){e._updateEndpoints()})},_getOverviews:function(){return this._overviews},_isOverview:function(){return"start"===this.sceneId||"end"===this.sceneId},_addScene:function(e){c.inherited("_addScene",this,arguments);var t=this._getSceneById(e.id);this._updateSceneSize(t,this._getViewPort());var i=this._getSceneIndex(e);t.$el.find(".sceneOrder").attr("data-index",i+1)},currentSceneChanged:function(){c.inherited("currentSceneChanged",this,arguments),this.$el.find(".swapSelected").removeClass("swapSelected"),this.$el.toggleClass("overview",this._isOverview())},_onOverviewSceneClick:function(e){this._jumpToScene(e)},_jumpToScene:function(e){var t=s(e.target).closest(".overview .step.pageTabContent");if(1===t.length){var i=t[0].dataset.modelId;this.layoutController.eventRouter.trigger("scene:jump",{modelId:i}),e.stopPropagation()}},_updateElementData:function(e,t){var i=function(e){var t=document.getElementById(e),i=t.nextElementSibling,n=i?i.id:void 0;this._impress.removeStep(e),this._impress.addStep("#"+e,n)}.bind(this);e.attr({"data-scale":t.scale,"data-x":t.x,"data-y":t.y}),this._didImpressInit&&i(e.attr("id"))},_updateSceneSize:function(e,t){var i=e.getLayoutView(),n=e.$el.find(".overviewBlockerCell");if(i){var o=this._getSceneLocation(i.model.data.positionIndex,t);if(this._updateElementData(e.$el,o),o.stepHeight&&o.stepWidth){var s={height:o.stepHeight+"px",width:o.stepWidth+"px"},r={height:o.sceneHeight+"px",width:o.sceneWidth+"px"};e.$el.css(s),i.$el.css(r),n.css(r)}else{var a={height:o.height+"px",width:o.width+"px"};e.$el.css(a),i.$el.css(a),n.css(a)}}},_updateSceneLabel:function(e){this.$el.find("#"+e.model.id+"_sceneLabel").text(e.model.get("title")||"")},_updateEndpoints:function(){this.$el.find(".sequenceEndpoint").removeClass("sequenceEndpoint sequenceEnd sequenceStart");var e=this.model.items.length-1,t=this.model.items.find(function(e){return 0===e.data.positionIndex});this._getSceneById(t.id).$el.addClass("sequenceEndpoint sequenceStart");var i=this.model.items.find(function(t){return t.data.positionIndex===e});this._getSceneById(i.id).$el.addClass("sequenceEndpoint sequenceEnd")},getSceneScale:function(e){var t=this.sceneLocations.length;return this.sceneLocations[e%t].scale},_computeViewportScale:function(e,t,i){var n=1;if(e){var o=(e.height-58)/t*.95,s=e.width/i*.95;n=Math.min(o,s)}return n},_computeTemplateScale:function(e,t,i,n){return Math.min((t*n+i)/t,(e*n+i)/e)}});return c}),define("text!storytelling/layout/views/templates/PanAndZoom.html",[],function(){return'<div id="{{id}}" class="panAndZoom page page{{type}}{{extraCSS}} scenesHidden" {{style}}><div class="tabCntr"><div id="impress_{{id}}" data-max-scale="1" data-min-scale="1"><div id="start_overview_{{id}}" class="step" aria-labelledby="start_overview_tablabel" data-x="{{dx}}" data-y="{{dy}}" data-scale="{{dscale}}" data-model-id="start"></div>{{items}}<div id="end_overview_{{id}}" class="step" aria-labelledby="end_overview_tablabel" data-x="{{dx}}" data-y="{{dy}}" data-scale="{{dscale}}" data-model-id="end"></div></div></div></div>'}),define("text!storytelling/layout/views/templates/PanAndZoomItems.html",[],function(){return'<div id="{{item.id}}_tab" role="tabpanel" aria-labelledby="{{item.id}}_tablabel" class="step pageTabContent hiddenScene" data-scale="{{dscale}}" data-x="{{dx}}" data-y="{{dy}}" data-model-id="{{item.id}}"><div class="sceneInfo"><div class="sceneOrder" data-index=""></div></div>{{item}}<div class="overviewBlockerCell" tabindex="0"></div></div>'}),define("storytelling/layout/views/PanAndZoomLayout1",["./PanAndZoomLayout","text!./templates/PanAndZoom.html","text!./templates/PanAndZoomItems.html"],function(e,t,i){var n=e.extend({changePageSize:function(e){var t={scenePadding:10,height:e.value.height,width:e.value.width};t.offsetWidth=t.width+t.scenePadding,t.offsetHeight=t.height+t.scenePadding,t.halfOffsetWidth=t.offsetWidth/2,t.halfOffsetHeight=t.offsetHeight/2,this._boxLayoutInfo=t,this.sceneLocations=[{x:0,y:0,scale:1},{x:0,y:t.offsetHeight,scale:1},{x:t.halfOffsetWidth+t.offsetWidth,y:t.halfOffsetHeight,scale:this._computeTemplateScale(t.width,t.height,t.scenePadding,2)},{x:1.5*t.halfOffsetWidth-t.halfOffsetWidth,y:1.5*t.offsetHeight+1.5*t.halfOffsetHeight,scale:this._computeTemplateScale(t.width,t.height,t.scenePadding,1.5)},{x:1.5*t.halfOffsetWidth-t.halfOffsetWidth+1.5*t.offsetWidth,y:1.5*t.offsetHeight+1.5*t.halfOffsetHeight,scale:this._computeTemplateScale(t.width,t.height,t.scenePadding,1.5)}]},_getSceneLocation:function(e,t){var i=this._boxLayoutInfo,n=Math.floor(e/5),o=this.sceneLocations[e%5],s=(this.sceneLocations[4].y+1.5*i.halfOffsetHeight+i.halfOffsetHeight)*n,r=this._computeViewportScale(t,i.offsetHeight,i.offsetWidth);return{x:o.x*r,y:(o.y+s)*r,scale:o.scale,height:i.height*r,width:i.width*r}},_getOverviewLocation:function(e){var t=this._boxLayoutInfo,i=-1*t.halfOffsetWidth,n=-1*t.halfOffsetHeight,o=0,s=0;o=this.model.items.length<3?t.halfOffsetWidth:this.sceneLocations[2].x+t.halfOffsetWidth*this.sceneLocations[2].scale;var r=this._getSceneLocation(this.model.items.length-1);s=r.y+t.halfOffsetHeight*r.scale;var a=(o+i)/2,l=(s+n)/2,c=(o-i)/t.offsetWidth,d=(s-n)/t.offsetHeight,h=this._computeViewportScale(e,t.offsetHeight,t.offsetWidth);return{scale:Math.max(c,d),x:a*h,y:l*h}}});return n.getTemplate=function(){return[t,i]},n}),define("storytelling/layout/views/PanAndZoomLayout2",["./PanAndZoomLayout","text!./templates/PanAndZoom.html","text!./templates/PanAndZoomItems.html"],function(e,t,i){var n=e.extend({changePageSize:function(e){var t={scenePadding:10,height:e.value.height,width:e.value.width};t.offsetWidth=t.width+t.scenePadding,t.offsetHeight=t.height+t.scenePadding,t.halfOffsetWidth=t.offsetWidth/2,t.halfOffsetHeight=t.offsetHeight/2,this._boxLayoutInfo=t,this.sceneLocations=[{x:0,y:0,scale:1}]},_getSceneLocation:function(e,t){var i=this._boxLayoutInfo,n=this.sceneLocations[0],o=Math.floor((e+1)/2)*i.offsetWidth,s=Math.floor(e/2)*i.offsetHeight*-1,r=this._computeViewportScale(t,i.offsetHeight,i.offsetWidth);return{x:o*r,y:s*r,scale:n.scale,height:i.height*r,width:i.width*r}},_getOverviewLocation:function(e){var t=-1*this._boxLayoutInfo.halfOffsetWidth,i=this._boxLayoutInfo.halfOffsetHeight,n=this._getSceneLocation(this.model.items.length-1),o=n.x+this._boxLayoutInfo.halfOffsetWidth,s=n.y-this._boxLayoutInfo.halfOffsetHeight,r=(o-t)/this._boxLayoutInfo.offsetWidth,a=(s-i)/this._boxLayoutInfo.offsetHeight,l=(o+t)/2,c=(s+i)/2,d=this._computeViewportScale(e,this._boxLayoutInfo.offsetHeight,this._boxLayoutInfo.offsetWidth);return{scale:Math.max(r,a),x:l*d,y:c*d}}});return n.getTemplate=function(){return[t,i]},n}),define("storytelling/layout/views/PanAndZoomLayout3",["./PanAndZoomLayout","text!./templates/PanAndZoom.html","text!./templates/PanAndZoomItems.html"],function(e,t,i){var n=e.extend({changePageSize:function(e){var t={scenePadding:10,height:e.value.height,width:e.value.width};t.offsetWidth=t.width+t.scenePadding,t.offsetHeight=t.height+t.scenePadding,t.halfOffsetWidth=t.offsetWidth/2,t.halfOffsetHeight=t.offsetHeight/2,this._boxLayoutInfo=t,this.sceneLocations=[{x:t.halfOffsetWidth,y:t.halfOffsetHeight,scale:this._computeTemplateScale(t.width,t.height,t.scenePadding,2)},{x:2*t.offsetWidth,y:0,scale:1},{x:2*t.offsetWidth,y:t.offsetHeight,scale:1},{x:0,y:2*t.offsetHeight,scale:1},{x:0,y:3*t.offsetHeight,scale:1},{x:1.5*t.offsetWidth,y:2.5*t.offsetHeight,scale:this._computeTemplateScale(t.width,t.height,t.scenePadding,2)}]},_getSceneLocation:function(e,t){var i=this._boxLayoutInfo,n=Math.floor(e/6),o=this.sceneLocations[e%6],s=(this.sceneLocations[5].y+3*i.halfOffsetHeight)*n,r=this._computeViewportScale(t,i.offsetHeight,i.offsetWidth);return{x:o.x*r,y:(o.y+s)*r,scale:o.scale,height:i.height*r,width:i.width*r}},_getOverviewLocation:function(e){var t=this._boxLayoutInfo,i=-1*t.halfOffsetWidth,n=-1*t.halfOffsetHeight,o=0,s=0;o=1===this.model.items.length?t.offsetWidth+t.halfOffsetWidth:this.sceneLocations[1].x+t.halfOffsetWidth*this.sceneLocations[1].scale;var r=this._getSceneLocation(this.model.items.length-1);s=r.y+t.halfOffsetHeight*r.scale;var a=(o+i)/2,l=(s+n)/2,c=(o-i)/t.offsetWidth,d=(s-n)/t.offsetHeight,h=this._computeViewportScale(e,t.offsetHeight,t.offsetWidth);return{scale:Math.max(c,d),x:a*h,y:l*h}}});return n.getTemplate=function(){return[t,i]},n}),define("storytelling/layout/views/PanAndZoomLayout4",["./PanAndZoomLayout","text!./templates/PanAndZoom.html","text!./templates/PanAndZoomItems.html"],function(e,t,i){var n=e.extend({changePageSize:function(e){var t={scenePadding:10,height:e.value.height,width:e.value.width};t.offsetWidth=t.width+t.scenePadding,t.offsetHeight=t.height+t.scenePadding,t.halfOffsetWidth=t.offsetWidth/2,t.halfOffsetHeight=t.offsetHeight/2,this._boxLayoutInfo=t,this.sceneLocations=[{x:0,y:0,scale:1},{x:t.offsetWidth,y:0,scale:1},{x:2*t.offsetWidth,y:0,scale:1},{x:0,y:t.offsetHeight,scale:1},{x:t.offsetWidth,y:t.offsetHeight,scale:1},{x:2*t.offsetWidth,y:t.offsetHeight,scale:1},{x:t.offsetWidth,y:3*t.offsetHeight,scale:this._computeTemplateScale(t.width,t.height,t.scenePadding,3)}]},_getSceneLocation:function(e,t){var i=this._boxLayoutInfo,n=Math.floor(e/7),o=this.sceneLocations[e%7],s=(this.sceneLocations[6].y+2*i.offsetHeight)*n,r=this._computeViewportScale(t,i.offsetHeight,i.offsetWidth);return{x:o.x*r,y:(o.y+s)*r,scale:o.scale,height:i.height*r,width:i.width*r}},_getOverviewLocation:function(e){var t=this._boxLayoutInfo,i=-1*t.halfOffsetWidth,n=-1*t.halfOffsetHeight,o=0,s=0;o=1===this.model.items.length?t.halfOffsetWidth:2===this.model.items.length?this.sceneLocations[1].x+t.halfOffsetWidth*this.sceneLocations[1].scale:this.sceneLocations[2].x+t.halfOffsetWidth*this.sceneLocations[2].scale;var r=this._getSceneLocation(this.model.items.length-1);s=r.y+t.halfOffsetHeight*r.scale;var a=(o+i)/2,l=(s+n)/2,c=(o-i)/t.offsetWidth,d=(s-n)/t.offsetHeight,h=this._computeViewportScale(e,t.offsetHeight,t.offsetWidth);return{scale:Math.max(c,d),x:a*h,y:l*h}}});return n.getTemplate=function(){return[t,i]},n}),define("storytelling/layout/views/PanAndZoomLayout5",["./PanAndZoomLayout","text!./templates/PanAndZoom.html","text!./templates/PanAndZoomItems.html"],function(e,t,i){var n=e.extend({changePageSize:function(e){var t={scenePadding:10,height:e.value.height,width:e.value.width};t.offsetWidth=t.width+t.scenePadding,t.offsetHeight=t.height+t.scenePadding,t.halfOffsetWidth=t.offsetWidth/2,t.halfOffsetHeight=t.offsetHeight/2,this._boxLayoutInfo=t,this.sceneLocations=[{x:0,y:0,scale:1},{x:t.offsetWidth,y:0,scale:1},{x:t.halfOffsetWidth,y:t.offsetHeight+t.halfOffsetHeight,scale:this._computeTemplateScale(t.width,t.height,t.scenePadding,2)}]},_getSceneLocation:function(e,t){var i=this._boxLayoutInfo,n=Math.floor(e/3),o=this.sceneLocations[e%3],s=(this.sceneLocations[2].y+3*i.halfOffsetHeight)*n,r=this._computeViewportScale(t,i.offsetHeight,i.offsetWidth);return{x:o.x*r,y:(o.y+s)*r,scale:o.scale,height:i.height*r,width:i.width*r}},_getOverviewLocation:function(e){var t=this._boxLayoutInfo,i=-1*t.halfOffsetWidth,n=-1*t.halfOffsetHeight,o=0,s=0;o=1===this.model.items.length?t.halfOffsetWidth:this.sceneLocations[1].x+t.halfOffsetWidth*this.sceneLocations[1].scale;var r=this._getSceneLocation(this.model.items.length-1);s=r.y+t.halfOffsetHeight*r.scale;var a=(o+i)/2,l=(s+n)/2,c=(o-i)/t.offsetWidth,d=(s-n)/t.offsetHeight,h=this._computeViewportScale(e,t.offsetHeight,t.offsetWidth);return{scale:Math.max(c,d),x:a*h,y:l*h}}});return n.getTemplate=function(){return[t,i]},n}),define("text!storytelling/layout/views/templates/Sequence.html",[],function(){return'<div id="{{id}}" class="panAndZoom page page{{type}} scenesHidden {{extraCSS}}" {{style}}><div class="tabCntr"><div id="impress_{{id}}" data-max-scale="1" data-min-scale="1"><div id="start_overview_{{id}}" class="step" aria-labelledby="start_overview_tablabel" data-x="{{dx}}" data-y="{{dy}}" data-scale="{{dscale}}" data-model-id="start"></div>{{items}}<div id="end_overview_{{id}}" class="step" aria-labelledby="end_overview_tablabel" data-x="{{dx}}" data-y="{{dy}}" data-scale="{{dscale}}" data-model-id="end"></div></div></div></div>'}),define("text!storytelling/layout/views/templates/SequenceItems.html",[],function(){return'<div id="{{item.id}}_tab" role="tabpanel" aria-labelledby="{{item.id}}_tablabel" class="step pageTabContent hiddenScene sequenceEndpoint" data-scale="{{dscale}}" data-x="{{dx}}" data-y="{{dy}}" data-model-id="{{item.id}}"><div class="sceneInfo"><div class="sceneOrder"></div></div>{{item}}<div class="sceneConnector"></div><div class="sequenceTimeline"><div class="sequenceOrb"></div><div class="sequenceConnector sequenceLeft"></div><div class="sequenceConnector sequenceRight"></div></div><div id="{{item.id}}_sceneLabel" class="sequenceSceneTitle"></div><div class="overviewBlockerCell" tabindex="0"></div></div>'}),define("storytelling/layout/views/PanAndZoomLayout6",["./PanAndZoomLayout","text!./templates/Sequence.html","text!./templates/SequenceItems.html"],function(e,t,i){var n=e.extend({changePageSize:function(e){var t={scenePadding:16,sceneHeight:e.value.height,stepHeight:e.value.height*(640/440),width:e.value.width};t.offsetWidth=t.width+t.scenePadding,t.offsetHeight=t.stepHeight+t.scenePadding,t.halfOffsetWidth=t.offsetWidth/2,t.halfOffsetHeight=t.offsetHeight/2,this._boxLayoutInfo=t,this.sceneLocations=[{x:0,y:0,scale:1}]},_getSceneLocation:function(e,t){var i=this._boxLayoutInfo,n=this.sceneLocations[0],o=i.offsetWidth*e,s=this._computeViewportScale(t,this._boxLayoutInfo.offsetHeight,this._boxLayoutInfo.offsetWidth);return{x:o*s,y:n.y,scale:n.scale,sceneHeight:i.sceneHeight*s,sceneWidth:i.width*s,stepHeight:i.stepHeight*s,stepWidth:i.width*s}},_getOverviewLocation:function(e){var t=-1*this._boxLayoutInfo.halfOffsetWidth,i=this._boxLayoutInfo.halfOffsetHeight,n=this._getSceneLocation(this.model.items.length-1),o=n.x+this._boxLayoutInfo.halfOffsetWidth,s=n.y-this._boxLayoutInfo.halfOffsetHeight,r=(o-t)/this._boxLayoutInfo.offsetWidth,a=(s-i)/this._boxLayoutInfo.offsetHeight,l=(o+t)/2,c=(s+i)/2,d=this._computeViewportScale(e,this._boxLayoutInfo.offsetHeight,this._boxLayoutInfo.offsetWidth),h=this._computeScaleRatio(e),u=Math.max(r,a)*h;return{scale:u>1?u:1,x:l*d,y:c*d}},_computeScaleRatio:function(e){return this._boxLayoutInfo.offsetWidth/this._boxLayoutInfo.offsetHeight/(e.width/e.height)}});return n.getTemplate=function(){return[t,i]},n}),define("storytelling/layout/views/all",["./SlideShow","./PanAndZoomLayout1","./PanAndZoomLayout2","./PanAndZoomLayout3","./PanAndZoomLayout4","./PanAndZoomLayout5","./PanAndZoomLayout6"],function(){}),define("storytelling/model/extensions/LayoutModelData",["underscore"],function(e){return{update:function(t,i){if(!i)return null;t.data||(t.data={});var n=e.clone(t.data);return e.extend(t.data,i),{event:"change:data",value:i,previousValue:n}}}}),define("storytelling/model/extensions/LayoutModelHasOverview",[],function(){return{}}),define("storytelling/model/extensions/LayoutModelShowOverviews",["underscore"],function(e){return{init:function(e,t){if(t.hasOverview&&void 0===t.showOverviews){var i={showStart:!0,showEnd:!0};e.showOverviews=t.showOverviews=i}},update:function(t,i){if(!i)return null;t.showOverviews||(t.showOverviews={});var n=e.clone(t.showOverviews);return e.extend(t.showOverviews,i),{event:"change:showOverviews",value:i,previousValue:n}}}}),define("storytelling/model/extensions/LayoutModelTransition",[],function(){return{init:function(e){e.on("change:transition",e.boardModel.onLayoutChange,e.boardModel)}}}),define("storytelling/model/extensions/all",["./LayoutModelData","./LayoutModelHasOverview","./LayoutModelShowOverviews","./LayoutModelTransition"],function(){}),define("text!storytelling/views/templates/StoryPaneView.html",[],function(){return'<div class="content"></div>'}),define("text!storytelling/views/templates/FilmStripView.html",[],function(){return'<div class="sceneSequencer"><div class="sceneList" role="tablist"></div></div>'}),define("text!storytelling/views/templates/SceneCell.html",[],function(){return'<div {{? it.id}}id="{{= it.id}}_tablabel" data-model-id="{{= it.id}}" {{?}} class="scene{{? it.selected }} selected{{?}}" tabindex="{{? it.selected }}0{{??}}-1{{?}}" role="tab"><div class="sceneSubContainer"><div class="{{? it.widgetIndicated}}widgetIndicated{{?}} widgetIndicator"></div><div class="pageInfo"><div class="pageNumber" data-index="{{= it.index + 1}}"></div></div></div><div {{? it.title }}title="{{! it.title}}" {{?}}class="sceneOverlay pageTitle">{{? it.title }}{{! it.title}}{{??}} {{?}}</div><span title="{{= it.sceneActionMenuLabel}}" class="sceneOverlay overflow"></span> <span title="{{= it.expandSceneLabel}}" class="sceneOverlay expandScene"></span></div>'}),define("text!storytelling/views/templates/AddSceneCell.html",[],function(){return'<div class="addScene"><div class="sceneSubContainer"><div class="addContainer" tabindex="0" role="button" title="{{= it.addTitle }}" aria-label="{{= it.addTitle }}"></div><div class="divider"></div><div class="chevron" tabindex="0" role="button" title="{{= it.chevronTitle }}" aria-label="{{= it.chevronTitle }}"></div></div></div>'}),define("text!storytelling/views/templates/OverviewCell.html",[],function(){return'<div class="overview{{? it.selected }} selected{{?}}" tabindex="0" role="button" title="{{! it.title }}" aria-label="{{! it.title }}"><div class="sceneSubContainer"><div class="pageInfo"><div class="pageNumber" data-index="{{= it.index}}"></div></div><div class="layoutIcon"></div></div></div>'}),define("text!storytelling/layout/templates/sceneLayoutListing.json",[],function(){return'{"sceneLayouts":[{\n\t\t"id":"titleSceneLayout",\n\t\t"name": "TitleSceneLayout"\n\t}, {\n\t\t"id":"blankSceneLayout",\n\t\t"name": "BlankSceneLayout"\n\t}, {\n\t\t"id":"sceneLayout1",\n\t\t"name": "SceneLayout1"\n\t}, {\n\t\t"id":"sceneLayout2",\n\t\t"name": "SceneLayout2"\n\t}, {\n\t\t"id":"sceneLayout3",\n\t\t"name": "SceneLayout3"\n\t}, {\n\t\t"id":"sceneLayout4",\n\t\t"name": "SceneLayout4"\n\t}, {\n\t\t"id":"sceneLayout5",\n\t\t"name": "SceneLayout5"\n\t}, {\n\t\t"id":"sceneLayout6",\n\t\t"name": "SceneLayout6"\n\t}, {\n\t\t"id":"sceneLayout7",\n\t\t"name": "SceneLayout7"\n\t}, {\n\t\t"id":"sceneLayout8",\n\t\t"name": "SceneLayout8"\n\t}, {\n\t\t"id":"sceneLayout9",\n\t\t"name": "SceneLayout9"\n\t}, {\n\t\t"id":"sceneLayout10",\n\t\t"name": "SceneLayout10"\n\t}, {\n\t\t"id":"sceneLayout11",\n\t\t"name": "SceneLayout11"\n\t}, {\n\t\t"id":"sceneLayout12",\n\t\t"name": "SceneLayout12"\n\t}\n]}\n'}),define("text!storytelling/views/templates/TimelineView.html",[],function(){return'<div class="timelineBody"><div class="leftContainer"></div><div class="timelineContainer"><div class="timelineRuler"></div><div class="timelinePosition"></div><div class="timelineContent"><div class="timelineBlanket"></div><div class="timelineSliders"></div></div></div><div class="rightContainer" role="region" aria-label="{{=it.timelineRightContainerLabel}}"><div class="collapseScene" title="{{=it.collapseScene}}" role="button" aria-label="{{=it.collapseScene}}" tabindex="0"></div><div class="zoomFit" title="{{=it.zoomToFit}}" role="button" aria-label="{{=it.zoomToFit}}" tabindex="0"></div><div class="zoomIn" title="{{=it.zoomIn}}" role="button" aria-label="{{=it.zoomIn}}" tabindex="0"></div><div class="zoomOut" title="{{=it.zoomOut}}" role="button" aria-label="{{=it.zoomOut}}" tabindex="0"></div></div></div>'}),define("text!storytelling/views/templates/TimelineSliderContentView.html",[],function(){return'<div id="{{=it.id}}DragSlider" class="slider-selection" aria-labelledby="{{=it.id}}DragSliderTitle"><div class="handle lefthandle" tabindex="0" role="slider" aria-label="{{=it.leftHandleLabel}}"><span class="svgHandleIcon"></span></div><div class="content" tabindex="0" role="slider" aria-labelledby="{{=it.id}}DragSliderTitle"><span class="title" id="{{=it.id}}DragSliderTitle"></span></div><div class="handle righthandle" tabindex="0" role="slider" aria-label="{{=it.rightHandleLabel}}"><span class="svgHandleIcon"></span></div></div><div class="highlights-container"></div>'}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/resize-panel_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([468],{"3865314c5959606874d4":function(t,i){t.exports=e},"507dccab2da440281d39":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"resize-panel_16_v6",use:"resize-panel_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="resize-panel_16_v6"><path d="M6.5 15h-1V1h1v14zm4-14h-1v14h1V1z" /></symbol>'});r.a.add(a),t.a=a},f545095202f52c9f748d:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("507dccab2da440281d39"));t.default=o.a}},["f545095202f52c9f748d"])}),define("storytelling/views/TimelineSliderContentView",["baglass/core-client/js/core-client/ui/core/View","jquery","underscore","gemini/app/util/ScreenReaderUtil","baglass/core-client/js/core-client/utils/ContentFormatter","text!./templates/TimelineSliderContentView.html","baglass/core-client/js/core-client/utils/dom-utils","baglass/core-client/js/core-client/utils/Utils","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/resize-panel_16"],function(e,t,i,n,o,s,r,a,l){var c=e.extend({templateString:s,_endBufferTime:200,dragValue:null,value:null,min:0,max:0,scale:1,title:null,notifyChangedInterval:200,draggingElement:null,events:{},init:function(e){c.inherited("init",this,arguments),this.id=e.id,this.min=e.min||0,this.max=e.max||0,this.value=e.value,this.scale=e.scale||1,this.title=e.title,this.dndManager=e.dndManager,this.cssClassSelector=e.cssClassSelector,this.stringResources=e.services.getSvcSync(".StringResources"),this.timelineController=e.timelineController,this._minimumDuration=this._endBufferTime/1e3,this._ScreenReader=new n},render:function(){var e=this.title?this.stringResources.get("timelineLeftHandle",{name:this.title}):this.stringResources.get("timelineLeftHandleNoTitle"),t=this.title?this.stringResources.get("timelineRightHandle",{name:this.title}):this.stringResources.get("timelineRightHandleNoTitle"),i=this.dotTemplate({id:this.id,leftHandleLabel:e,rightHandleLabel:t});this.$el.html(i),this.$highlightsEl=this.$el.find(".highlights-container"),this.$selection=this.$el.find(".slider-selection"),this.$handles=this.$selection.find(".handle"),this.$content=this.$selection.find(".content"),this.$content=this.$el.find(".content"),this.$title=this.$content.find(".title"),a.setIcon(this.$el.find(".svgHandleIcon"),l.default.id);var n=this._isTouchMode();return this._toggleDragEvents(!n),n?this._addHoldEvents():this._addKeyDownEvents(),this._addClickEvents(),this._update(),this._updateTitle(),this},setTitle:function(e){this.title=e,this._updateTitle()},middleShortenTitle:function(e){this.setTitle(e),o.middleShortenString(this.$title[0])},setScale:function(e){this.scale=e,this._update()},setValue:function(e,t){this.value=e,this.$content&&(this._update(),t||this._notifyValueChanged())},getValue:function(){return this.value},getDragValue:function(){return this.dragValue},setMax:function(e){this.max=e},toggleSelected:function(e){this.$el.toggleClass("selected",e),this._isTouchMode()&&this._toggleDragEvents(this.isSelected())},isSelected:function(){return this.$el.hasClass("selected")},move:function(e){this._move(e[0],e[1]-e[0])},onHold:function(e){this._select(e)},onClick:function(e){this._select(e)},_startArrowKeyMove:function(){this.dragValue=this.value,this._notifyValueChangeBegin()},_select:function(e){this.toggleSelected(!0),
- this.trigger("dragSlider:select",e)},_move:function(e,t,i){var n=this.timelineController.getTickDuration()/1e3,o=function(e){return Math.round(e/n)*n};e=o(e),t=o(t),e<0&&(e=0),t<this._minimumDuration&&(t=this._minimumDuration);var s={left:e*this.scale+"px",width:t*this.scale+"px"};this.$selection.css(s);var r=[e,e+t];i||(this.value=r);var a=this._roundValueForScreenReader(this.$el.width()/this.scale);return this.$handles.eq(0).attr("aria-valuenow",this._roundValueForScreenReader(r[0])),this.$handles.eq(0).attr("aria-valuemin",0),this.$handles.eq(0).attr("aria-valuemax",this._roundValueForScreenReader(r[1]-this._minimumDuration)),this.$handles.eq(1).attr("aria-valuenow",this._roundValueForScreenReader(r[1])),this.$handles.eq(1).attr("aria-valuemin",this._roundValueForScreenReader(r[0]+this._minimumDuration)),this.$handles.eq(1).attr("aria-valuemax",a),this.$content.attr("aria-valuenow",this._roundValueForScreenReader((r[0]+r[1])/2)),this.$content.attr("aria-valuemin",0),this.$content.attr("aria-valuemax",a),r},_update:function(){this.move(this.value)},_updateTitle:function(){var e=this.title?this.stringResources.get("timelineLeftHandle",{name:this.title}):this.stringResources.get("timelineLeftHandleNoTitle"),t=this.title?this.stringResources.get("timelineRightHandle",{name:this.title}):this.stringResources.get("timelineRightHandleNoTitle");this.$title.text(this.title),this.$handles.eq(0).attr("aria-label",e),this.$handles.eq(1).attr("aria-label",t)},_notifyValueChangeBegin:function(){this.trigger("value:willChange")},_notifyValueChanged:function(e){this.trigger("value:changed",i.extend({value:this.value,min:this.min,max:this.max},e))},_addHoldEvents:function(){var e=this.onHold.bind(this);this.$handles.hammer().on("hold",e),this.$content.hammer().on("hold",e)},_addClickEvents:function(){var e=function(){this.isDragging=!1}.bind(this),t=function(e){this.isDragging||this.onClick(e)}.bind(this);this.$handles.on("mousedown",e),this.$content.on("mousedown",e),this.$handles.on("click",t),this.$content.on("click",t)},_addKeyDownEvents:function(){this.$handles.on("keydown",this._onKeyPress.bind(this)),this.$content.on("keydown",this._onKeyPress.bind(this))},_toggleDragEvents:function(e){this._toggleDragEvent(this.$handles.eq(0),e,this._leftHandleDragHandler),this._toggleDragEvent(this.$handles.eq(1),e,this._rightHandleDragHandler),this._toggleDragEvent(this.$content,e,this._contentDragHandler)},_toggleDragEvent:function(e,t,i){t?e.hammer().on("dragstart",this._dragHandler.bind(this,i)):e.hammer().off("dragstart")},_dragHandler:function(e,n){this.trigger("dragSlider:dragStarted");var o={payloadData:{undoRedoTransactionId:i.uniqueId("dragSlider")}},s={type:"timelineSlider",data:{slider:this},restrictToXAxis:!0,avatar:null,event:n,callerCallbacks:{onDragStart:function(i,n){t("body").addClass("overflowHidden"),this.dragValue=this.value,e.onDragStart&&e.onDragStart.bind(this)(i,n),this._notifyValueChangeBegin()}.bind(this),onMove:function(t,i){e.onMove&&e.onMove.bind(this)(t,i)}.bind(this),onDragDone:function(n,s){e.onDragDone&&e.onDragDone.bind(this)(n,i.extend({},s,o)),this.dragValue&&(this._move(this.dragValue[0],this.dragValue[1]-this.dragValue[0]),this.dragValue=null,this._notifyValueChanged(o)),this.draggingElement=null,t("body").removeClass("overflowHidden"),this._select(n)}.bind(this)}};if(e.getConfig){var r=e.getConfig.bind(this)(n);i.extend(s,r)}this.dndManager.startDrag(s)},_leftHandleDragHandler:{onDragStart:function(){this.draggingElement="leftHandle",this.isDragging=!0},onMove:function(e,t){var i=t.dragObject.position.x-t.dragObject.startPosition.x,n=i/this.scale,o=n+this.value[0],s=this.value[1]-this.value[0]-n;o<0?s+=o:o+this._minimumDuration>this.value[1]&&(o=this.value[1]-this._minimumDuration),this.dragValue=this._move(o,s,!0)}},_rightHandleDragHandler:{onDragStart:function(){this.draggingElement="rightHandle",this.isDragging=!0},onMove:function(e,t){var i=t.dragObject.position.x-t.dragObject.startPosition.x;this.dragValue=this._move(this.value[0],i/this.scale+(this.value[1]-this.value[0]),!0)}},_contentDragHandler:{getConfig:function(e){var i=t("<div>").addClass("dragAvatar timelineContent bringToFront selected").hide();t("body").append(i),i.append(this.$selection.clone()),this.cssClassSelector&&i.append(this.$el.find("."+this.cssClassSelector).clone());var n=this.$selection.offset(),o=r.getEventPos(e),s=n.top-o.pageY,a=n.left-o.pageX-this.value[0]*this.scale;return{type:"dragSliderContent",dragLockToAxis:!0,restrictToXAxis:!1,restrictToYAxis:!1,moveXThreshold:20,moveYThreshold:20,data:{slider:this,avatar:i},avatar:i[0],avatarXOffset:a,avatarYOffset:s}},onDragStart:function(e,t){this.draggingElement="content",t.dragObject.data.avatar.show(),this.cssClassSelector&&(this.$cssClassSelector=this.$el.find("."+this.cssClassSelector),this.$cssClassSelector.hide()),this.$selection.hide(),this.isDragging=!0},onMove:function(e,t){var i=t.dragObject.position.x-t.dragObject.startPosition.x;this.dragValue=this._move(i/this.scale+this.value[0],this.value[1]-this.value[0],!0)},onDragDone:function(e,t){this.$selection.show(),this.cssClassSelector&&this.$cssClassSelector.show(),t.dragObject.data.avatar.hide(),this.trigger("dragSlider:isDropped",i.extend({id:this.id},t))}},_onKeyPress:function(e){var n=t(e.currentTarget),o=n.hasClass("lefthandle"),s=n.hasClass("righthandle");if(13===e.keyCode||32===e.keyCode)return this._select(e),n.toggleClass("active",o||s),void n.focus();var r={title:this.title},a=0,l=0,c="";switch(e.keyCode){case 9:return void n.toggleClass("active",!1);case 37:a=-.1;break;case 39:a=.1;break;case 38:if(o||s)return e.stopPropagation(),void e.preventDefault();l=-1;break;case 40:if(o||s)return e.stopPropagation(),void e.preventDefault();l=1;break;default:return}if(e.stopPropagation(),e.preventDefault(),n.toggleClass("active",o||s),this._startArrowKeyMove(),o){var d=a+this.value[0],h=this.value[1]-this.value[0]-a;d<0?h+=d:d>this.value[1]&&(d=this.value[1]),this.dragValue=this._move(d,h,!0)}else if(s)this.dragValue=this._move(this.value[0],a+(this.value[1]-this.value[0]),!0);else if(0!=a)this.dragValue=this._move(a+this.value[0],this.value[1]-this.value[0],!0);else{var u={id:this.id,payloadData:{undoRedoTransactionId:i.uniqueId("dragSlider")}},g=l>0?"dragSlider:movingDown":"dragSlider:movingUp";this.trigger(g,u),this.trigger("dragSlider:isDropped",u)}this.dragValue&&(r.newStartTime=this._roundValueForScreenReader(this.dragValue[0]),r.newEndTime=this._roundValueForScreenReader(this.dragValue[1]),this._move(this.dragValue[0],this.dragValue[1]-this.dragValue[0]),this.dragValue=null,this._notifyValueChanged()),r.resourceName=o?"timelineMoveWidgetStartTime":s?"timelineMoveWidgetEndTime":l<0?"timelineMoveWidgetUp":l>0?"timelineMoveWidgetDown":"timelineMoveWidget",this._update(),c=this.stringResources.get(r.resourceName,r),this._ScreenReader.callOut(c)},_roundValueForScreenReader:function(e){return Math.round(100*e)/100},_isTouchMode:function(){return"ontouchstart"in document.documentElement}});return c}),define("text!storytelling/views/templates/TimelineHighlightIndicatorView.html",[],function(){return'<div class="indicatorContainer" id="indicatorContainer_{{=it.id}}" data-selector="true"><svg class="svgIcon" focusable="false"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-highlight-small"></use></svg></div>'}),define("storytelling/views/highlight/TimelineHighlightAction",["dashboard-analytics/visualizations/interactions/FilterAction","jquery","underscore"],function(e,t,i){return e.extend({init:function(e,t,i,n,o,s,r){this.visualization=e,this.slot=t,this.dataItem=t.getDataItemList()[i],this.mapIndex=i,this.pageContextAPI=n,this.services=o,this.logger=s,this.itemContext={uniqueId:this.dataItem.getId(),itemId:this.dataItem.getColumnId(),itemName:this.dataItem.getLabel(),dataType:this.dataItem.getDataType(),sourceId:this.visualization.getDataSource().getId()},this.renderModule=this.getEditorModuleName(),this.highlightAct=r},removeFilter:function(e){var n=t.extend(!0,[],this.highlightAct.get("payload"));i.find(this.highlightAct.payload,function(t,i){if(t.columnId===e){if(!t.operator)return!0;var o={columnId:n[i].columnId,columnLabel:n[i].columnLabel,id:n[i].columnId,values:[]};return n[i].aggregationType&&(o.aggregationType=n[i].aggregationType),n[i]=o,this.highlightAct.set({payload:n}),!0}}.bind(this))},getEditorModuleName:function(){return"storytelling/views/highlight/TimelineHighlightEditWrapperView"}})}),define("storytelling/views/highlight/TimelineHighlightFlyoutController",["underscore","dashboard-analytics/visualizations/renderer/filter/FilterLabelHelper","./TimelineHighlightAction"],function(e,t,i){return function(){function n(e){_classCallCheck(this,n),this.highlightAct=e.highlightAct,this.launchView=e.launchView,this.launchPoint=e.launchPoint,this.backButtonCallback=e.show,this.dashboardApi=e.dashboardApi,this.pageContextAPI=e.pageContextAPI,this.services=e.services,this.logger=this.dashboardApi.getGlassCoreSvc(".Logger"),this.stringResources=this.dashboardApi.getDashboardCoreSvc(".StringResources"),this.content=e.content,this.visualization=e.visualization,this.filterLabelHelper=new t({dataSource:this.visualization.getDataSource(),timelineFilter:"timelineFilter",filterLineEnabled:this._isFilterLineEnabled,filterLineDeleteEnabled:this._isFilterLineDeleteEnabled,dashboardApi:this.dashboardApi})}return n.prototype.onEditTimelineFilter=function(e,t){this.editTimelineFilter(t,e.currentTarget)},n.prototype.onRemoveTimelineFilter=function(t,n){t.stopPropagation();var o=e.find(this.visualization.getSlots().getMappingInfoList(),function(e){return e.dataItem.getColumnId()===n}),s=o.slot,r=o.indexInSlot;new i(this.visualization,s,r,this.pageContextAPI,this.services,this.logger,this.highlightAct).removeFilter(n)},n.prototype.getItemActions=function(){return this._generateFilterListItems(this.highlightAct.get("payload"))},n.prototype._generateFilterListItems=function(e){var t=this,i=this.filterLabelHelper.generateFilterListItems(e);return i.forEach(function(e){e.editLabel=t.stringResources.get("editTimelineHighlight"),e.deleteLabel=t.stringResources.get("deleteTimelineHighlight"),e.editAction=t.onEditTimelineFilter.bind(t),e.deleteAction=t.onRemoveTimelineFilter.bind(t)}),i},n.prototype.editTimelineFilter=function(t,n){if(!n)return Promise.resolve();var o=[e.findWhere(this.highlightAct.get("payload"),{columnId:t})],s=e.find(this.visualization.getSlots().getMappingInfoList(),function(e){return e.dataItem.getColumnId()===t}),r=s.slot,a=s.dataItem,l=s.indexInSlot,c=new i(this.visualization,r,l,this.pageContextAPI,this.services,this.logger,this.highlightAct),d=c.getEditorModuleName(),h={columnId:t,filterSpec:o,highlightAct:this.highlightAct,columnTitle:a.getLabel(),title:this.stringResources.get("timelineHighlightTitle"),slot:r,dashboardApi:this.dashboardApi,pageContextAPI:this.pageContextAPI,services:this.services,itemContext:c.itemContext};return this.content.getFeature("InteractivityController.deprecated").getActionHelper().renderFilterDialog(d,h,this.launchPoint,this.launchView,this.backButtonCallback)},n.prototype._isFilterLineDeleteEnabled=function(e){return Boolean(e.values.length)},n.prototype._isFilterLineEnabled=function(){return!0},n}()}),define("storytelling/views/TimelineHighlightIndicatorView",["baglass/core-client/js/core-client/ui/core/View","jquery","gemini/app/util/ScreenReaderUtil","storytelling-ui/storytelling-ui.min","text!./templates/TimelineHighlightIndicatorView.html","dashboard-analytics/visualizations/renderer/filter/FilterLabelHelper","./highlight/TimelineHighlightFlyoutController","react","react-dom","../util/WidgetHelper"],function(e,t,i,n,o,s,r,a,l,c){var d=e.extend({templateString:o,init:function(e){d.inherited("init",this,arguments),this.controller=e.controller,this.widgetId=e.widgetId,this.scaleManager=e.scaleManager,this.episodeModel=e.episodeModel,this.highlightAct=e.highlightAct,this.id=e.highlightAct.id,this.services=e.services,this.dashboardApi=e.dashboardApi,this.widgetHelper=new c({dashboardApi:this.dashboardApi}),this.widget=this.widgetHelper.getWidget(this.widgetId),this.content=this.widgetHelper.getContent(this.widgetId),this.widget&&this.content&&(this.visualization=this.content.getFeature("Visualization"),this.filterLabelHelper=new s({dataSource:this.visualization.getDataSource(),dashboardApi:this.dashboardApi})),this.pageContextAPI=this.controller.model.pageContext.getAPI(),this.extraCssClass=e.extraCssClass||"",this._ScreenReader=new i,this.stringResources=this.dashboardApi.getDashboardCoreSvc(".StringResources"),this.flyoutHolder=document.createElement("div"),this.flyoutHolder.classList.add("flyout-holder")},render:function(){var e=this._getTooltipLabel();this.el.id="timelineHighlight_"+this.id,this.el.setAttribute("role","application"),this.el.className="timelineHighlight "+this.extraCssClass,this.el.setAttribute("tabindex","0"),this.el.dataset.selector="true",this.el.dataset.id=this.id,e&&(this.el.setAttribute("aria-label",e),this.el.setAttribute("title",e));var t=this.dotTemplate({id:this.id});this.$el.html(t),this._indicatorWidth=this.$el.outerWidth(),this._handleWidth=this.$el.closest(".sliderContent").find(".handle").outerWidth(),this._updateHighlightPosition(this.highlightAct.timer,!1),this._updateHighlightState(),this._registerEvents()},remove:function(){this._unregisterEvents(),d.inherited("remove",this,arguments)},onSliderChange:function(){this._updateHighlightPosition(this.highlightAct.timer,!1)},onScaleChange:function(){this._updateHighlightPosition(this.highlightAct.timer,!1)},onPayloadChange:function(){this._updateHighlightState(),this._updateTooltipLabel()},_updateHighlightState:function(){this.highlightAct.get("payload").filter(function(e){return e.operator}).length?this.$el.removeClass("empty"):this.$el.addClass("empty")},_updateHighlightPosition:function(e,t){var i=this.controller.getTickDuration();e=Math.round(e/i)*i;var n=this.scaleManager.convertTimeToPosition(e);return n-=this._indicatorWidth/2,t||(n=this._limitPositionToInsideHandles(n)),this.$el.css("left",n+"px"),n},launchHighlightSummaryDialog:function(){this.flyoutView=new r({dashboardApi:this.dashboardApi,content:this.content,visualization:this.visualization,pageContextAPI:this.pageContextAPI,services:this.services,highlightAct:this.highlightAct,launchView:this,show:this.launchHighlightSummaryDialog,launchPoint:this.$el.get(0)}),this.$el.append(this.flyoutHolder),this._flyout=a.createElement(n.HighlightSummaryFlyout,{anchorElement:this.$el.get(0),closeFlyout:this.closeFlyout.bind(this),itemActions:this.flyoutView.getItemActions(),title:this.stringResources.get("timelineHighlightTitle")}),l.render(this._flyout,this.flyoutHolder)},getPlacement:function(){return"top"},_registerEvents:function(){this._dragStartCallback=this._onDragStart.bind(this),this._dragLeftRightCallback=this._onDragLeftRight.bind(this),this._dragEndCallback=this._onDragEnd.bind(this),this._clickCallback=this._onClick.bind(this),this._onKeyPressCallback=this._onKeyPress.bind(this),this.$el.hammer({correct_for_drag_min_distance:!1}).on("dragstart",this._dragStartCallback).on("dragleft",this._dragLeftRightCallback).on("dragright",this._dragLeftRightCallback).on("dragend",this._dragEndCallback),this.$el.find(".svgIcon").on("primaryaction",this._clickCallback),this.$el.on("keydown",this._onKeyPressCallback)},setTime:function(e){this._updateHighlightPosition(e,!1)},_unregisterEvents:function(){this._flyout&&this.closeFlyout(),this.$el&&(this.$el.off("dragstart",null,this._dragStartCallback).off("dragleft",null,this._dragLeftRightCallback).off("dragright",null,this._dragLeftRightCallback).off("dragend",null,this._dragEndCallback),this.$el.find(".svgIcon").off("primaryaction",this._clickCallback),this.$el.off("keydown",this._onKeyPressCallback))},_onDragLeftRight:function(e){if(e.gesture){e.gesture.preventDefault(),e.gesture.stopPropagation();var t=this._positionFromLeft+e.gesture.deltaX,i=this.scaleManager.convertPositionToTime(t);i=this._limitTimerToSlider(i),this._updateHighlightPosition(i,!0)}},_onDragEnd:function(e){if(e.gesture){e.gesture.stopPropagation(),this.controller.trigger("timeline:highlightIndicatorDragEnded");var t=this._positionFromLeft+e.gesture.deltaX,i=this.scaleManager.convertPositionToTime(t);i=this._limitTimerToSlider(i),this._updateHighlightPosition(i,!1),this.controller.updateTimelineHighlight(this.widgetId,this.id,{timer:i})}this._dragEnd=!0},_onDragStart:function(){this.closeFlyout(),this.controller.trigger("timeline:highlightIndicatorDragStarted",this.widgetId);var e=this.scaleManager.convertTimeToPosition(this.highlightAct.timer);this._positionFromLeft=this._limitPositionToInsideHandles(e)},_updateTooltipLabel:function(){var e=this._getTooltipLabel();e!==this.$el.attr("title")&&(this.$el.attr("title",e),this.$el.attr("aria-label",e))},_getTooltipLabel:function(){var e=this,t=this.stringResources.get("timelineHighlightTitle");if(this.filterLabelHelper){this.filterLabelHelper.generateFilterListItems(this.highlightAct.payload).forEach(function(i){t+="\n",t+=e.stringResources.get("filter_tooltip",{title:i.title,description:i.description})})}return t},_onClick:function(e){if("click"===e.type&&this._dragEnd)return void(this._dragEnd=!1);if(e.stopPropagation(),e.preventDefault(),!this.visAPI){var t=this.widgetHelper.getWidget(this.widgetId),i=this.widgetHelper.getContent(this.widgetId);if(!t||!i)return;this.visAPI=t.getVisApi&&t.getVisApi(),this.visualization=i.getFeature("Visualization")}this.$el.append(this.flyoutHolder);var o=a.createElement(n.HighlightFlyout,{widgetId:this.widgetId,actId:this.id,controller:this.controller,anchorElement:this.$el.get(0),closeFlyout:this.closeFlyout.bind(this),openSummaryDialog:this.launchHighlightSummaryDialog.bind(this)});l.render(o,this.flyoutHolder)},_onKeyPress:function(e){t(e.currentTarget).focus();var i=0;switch(e.keyCode){case 13:case 32:return void this._onClick(e);case 37:i=this.scaleManager.convertPositionToTime(-20);break;case 39:i=this.scaleManager.convertPositionToTime(20);break;case 38:case 40:return e.stopPropagation(),void e.preventDefault();default:return}e.stopPropagation(),e.preventDefault();var n=this._limitTimerToSlider(this.highlightAct.timer+i);this._updateHighlightPosition(n,!1),this.controller.updateTimelineHighlight(this.widgetId,this.id,{timer:n});var o={id:this.id,time:n},s=this.stringResources.get("timeline_highlight_moved_to",o);this._ScreenReader.callOut(s)},_limitTimerToSlider:function(e){return e=Math.max(e,this.episodeModel.getEntranceAct().timer+1),e=Math.min(e,this.episodeModel.getExitAct().timer-1)},_limitPositionToInsideHandles:function(e){var t=this.episodeModel.getEntranceAct().timer,i=this.scaleManager.convertTimeToPosition(t);i+=this._handleWidth;var n=this.episodeModel.getExitAct().timer,o=this.scaleManager.convertTimeToPosition(n);o-=this._handleWidth+this._indicatorWidth,e=Math.min(e,o),e=Math.max(e,i);var s=this.scaleManager.convertTimeToPosition(n-t-2*this._handleWidth);return s<this._indicatorWidth&&(e-=(this._indicatorWidth-s)/2),e},closeFlyout:function(){l.unmountComponentAtNode(this.flyoutHolder),this.$el.find(".flyout-holder").remove()}});return d}),define("storytelling/views/TimelineSliderView",["baglass/core-client/js/core-client/ui/core/View","../nls/StringResources","./TimelineSliderContentView","./TimelineHighlightIndicatorView","storytelling-ui/storytelling-ui.min","react","react-dom"],function(e,t,i,n,o,s,r){var a=e.extend({init:function(e){a.inherited("init",this,arguments),this.id=e.id,this.model=e.model,this.label=e.label,this.scaleManager=e.scaleManager,this.timelineController=e.timelineController,this.glassContext=e.glassContext,this.dndManager=e.dndManager,this.dashboardApi=e.dashboardApi,this.services=e.services,this._dashboardState=this.dashboardApi.getFeature("DashboardState"),this._flyoutHolder=document.createElement("div"),this._flyoutHolder.classList.add("flyout-holder"),this.extraCssClassForHighlight="timelineHighlight",this._timelineIndicators=[],this._highlightActModelListeners=[]},render:function(){this.el.id="timelineWidgetSlider"+this.id,this.el.classList.add("sliderContent"),this._renderDragSlider(),this._renderTimelineHighlightIndicators(),this._addDropZone(),this.scaleManager.on("scale:change",this.onScaleChanged,this),this.timelineController.on("slider:addHighlight",this.onAddTimelineHighlight,this),this.timelineController.on("slider:closeFlyouts",this._closeFlyouts,this),this.timelineController.on("slider:deselect",this.onHideSliderSelection,this),this.timelineController.on("slider:removeHighlight",this.onRemoveTimelineHighlight,this),this.timelineController.on("slider:select",this.onShowSliderSelection,this),this.timelineController.on("slider:showHighlightSummary",this.onShowHighlightSummary,this)},remove:function(){this._dropZone&&this._dropZone.remove(),this._removeActModelListeners(),this._removeTimelineIndicators(),this._rangeSlider&&this._rangeSlider.remove(),this.scaleManager.off("scale:change",this.onScaleChanged,this),this.timelineController.off("slider:addHighlight",this.onAddTimelineHighlight,this),this.timelineController.off("slider:closeFlyouts",this._closeFlyouts,this),this.timelineController.off("slider:deselect",this.onHideSliderSelection,this),this.timelineController.off("slider:removeHighlight",this.onRemoveTimelineHighlight,this),this.timelineController.off("slider:select",this.onShowSliderSelection,this),this.timelineController.off("slider:showHighlightSummary",this.onShowHighlightSummary,this),a.inherited("remove",this,arguments)},_removeActModelListeners:function(){this._highlightActModelListeners.forEach(function(e){e.remove()}),this._highlightActModelListeners=[]},_removeTimelineIndicators:function(){this._timelineIndicators.forEach(function(e){e.remove()}),this._timelineIndicators=[]},onScaleChanged:function(){this._timelineIndicators.forEach(function(e){e.onScaleChange()})},onAddTimelineHighlight:function(){this._refreshTimelineHighlightIndicators()},onShowHighlightSummary:function(e){var t=this._timelineIndicators.find(function(t){return t.id===e.actModel.id});t&&t.launchHighlightSummaryDialog()},_closeFlyouts:function(e){this._flyout&&(r.unmountComponentAtNode(this._flyoutHolder),this._flyout=null,this.el.removeChild(this._flyoutHolder)),this._timelineIndicators.forEach(function(e){return e.closeFlyout()}),e&&e.setActive?e.setActive():e&&e.focus&&e.focus()},onRemoveTimelineHighlight:function(e){var t=this._highlightActModelListeners.find(function(t){return t.id===e.actModel.id});t&&(t.remove(),this._highlightActModelListeners=this._highlightActModelListeners.filter(function(t){return t.id!==e.actModel.id}));var i=this._timelineIndicators.find(function(t){return t.id===e.actModel.id});i&&(i.remove(),this._timelineIndicators=this._timelineIndicators.filter(function(t){return t.id!==e.actModel.id}))},onShowSliderSelection:function(e){if(e.widgetId===this.id){this.toggleSelected(!0);var t=this.$el.parent(".timelineContent");this.$el.toggleClass("bringToFront",0===t.scrollTop())}},onHideSliderSelection:function(e){e.widgetId===this.id&&(this.toggleSelected(!1),this._closeFlyouts(),this.$el.removeClass("bringToFront"))},setLabel:function(e){this.label=e,this._rangeSlider.middleShortenTitle(this.label)},getLabel:function(){return this.label},setScale:function(e){var t=this.model.scale!==e;this.model.scale=e,this._rangeSlider.setScale(e),t&&this._rangeSlider.middleShortenTitle(this.label)},setValue:function(e,t){this._rangeSlider.setValue(e,t),this._timelineIndicators.forEach(function(e){e.onSliderChange()}),this._rangeSlider.middleShortenTitle(this.label)},getValue:function(){return this._rangeSlider.getValue()},getDragValue:function(){return this._rangeSlider.dragValue},getDraggingElement:function(){return this._rangeSlider.draggingElement},toggleSelected:function(e){this._rangeSlider.toggleSelected(e)},onScroll:function(e){this._rangeSlider.onScroll(e)},onSliderSelect:function(e){var t=this;e.stopPropagation(),e.preventDefault(),this.timelineController.trigger("timeline:select",{widgetId:this.id,pageX:e&&e.pageX?e.pageX:0,originalEvent:e}),this.timelineController.selectWidgetAndSlider(this.id).then(function(){"mouseup"!==e.type&&"touchend"!==e.type&&t._toggleFlyout(e)})},addTimelineHighlight:function(e){var t=this.scaleManager.convertPositionToTime(e-this.$el.offset().left);this.timelineController.addTimelineHighlight(this.id,t)},isHighlightSupported:function(){return this.timelineController.isHighlightSupported(this.id)},_toggleFlyout:function(e){if(this._flyout)return void this._closeFlyouts(e.currentTarget);var t=this.$el.closest(".timelineContent"),i=t[0].scrollLeft,n=this.$el.children().first()[0].offsetLeft,a=this.el.querySelector(".slider-selection").getBoundingClientRect().left;e.pageX&&(a=e.pageX);var l=a-this.el.getBoundingClientRect().left;this._flyoutHolder.style.left=(e.pageX?l:Math.max(i,n))+"px",this.$el.append(this._flyoutHolder),this._flyout=s.createElement(o.SliderFlyout,{isHighlightSupported:this.isHighlightSupported.bind(this),anchorElement:this._flyoutHolder,pageX:e.pageX||0,closeFlyout:this._closeFlyouts.bind(this,e.currentTarget),openAnimationProperties:this.openAnimationProperties.bind(this),addTimelineHighlight:this.addTimelineHighlight.bind(this)}),r.render(this._flyout,this._flyoutHolder)},openAnimationProperties:function(){this._dashboardState.getUiState().fullScreen||(this._dashboardState.setSelectionProperties(!0),this._dashboardState.setSidePanelCurrentView(this._getProviderId()),this._dashboardState.setSidePanelOpen(!0))},_getProviderId:function(){return"PropertiesPane"},onSliderWillChange:function(){this.timelineController.trigger("timeline:willChange",{widgetId:this.id,getDragValue:this.getDragValue.bind(this),getDraggingElement:this.getDraggingElement.bind(this)})},onSliderChange:function(e){this._updateWidgetTimeline(this.id,e.value,e.payloadData),this._rangeSlider.middleShortenTitle(this.label),this._timelineIndicators.forEach(function(e){e.onSliderChange()}),this.timelineController.trigger("timeline:change",{widgetId:this.id})},onSliderDrop:function(e){this.timelineController.trigger("timeline:doneMoving",e)},onSliderMoveUp:function(e){this.timelineController.trigger("timeline:movingUp",e)},onSliderMoveDown:function(e){this.timelineController.trigger("timeline:movingDown",e)},onSliderDragStarted:function(e){this.timelineController.trigger("timeline:sliderDragStarted",e)},_addDropZone:function(){var e=this;this._dropZone=this.dndManager.addDropTarget(this.$el[0],{accepts:function(e){return"dragSliderContent"===e.type},onDragLeave:function(t){t&&"dragSliderContent"===t.type&&t.data&&t.data.slider&&e._rangeSlider.id!==t.data.slider.id&&(t.lastPosition||(t.lastPosition=t.startPosition),t.position.y<t.lastPosition.y?e.timelineController.trigger("timeline:movingUp",{id:t.data.slider.id,to:e.id}):e.timelineController.trigger("timeline:movingDown",{id:t.data.slider.id,to:e.id}),t.lastPosition=t.position)}})},_renderDragSlider:function(){this._rangeSlider=new i({id:this.id,el:this.$el,value:this.model.value,scale:this.model.scale,title:this.label,cssClassSelector:this.extraCssClassForHighlight,dndManager:this.dndManager,services:this.services,timelineController:this.timelineController}),this._rangeSlider.on("value:changed",this.onSliderChange.bind(this)),this._rangeSlider.on("value:willChange",this.onSliderWillChange.bind(this)),this._rangeSlider.on("dragSlider:select",this.onSliderSelect.bind(this)),this._rangeSlider.on("dragSlider:isDropped",this.onSliderDrop.bind(this)),this._rangeSlider.on("dragSlider:movingUp",this.onSliderMoveUp.bind(this)),this._rangeSlider.on("dragSlider:movingDown",this.onSliderMoveDown.bind(this)),this._rangeSlider.on("dragSlider:dragStarted",this.onSliderDragStarted.bind(this)),this._rangeSlider.render(),this._rangeSlider.middleShortenTitle(this.label)},_updateWidgetTimeline:function(e,t,i){var n=this.scaleManager.getScaleToPixelRatio();this.timelineController.updateTimelineDuration(e,t[0]/n*1e3,t[1]/n*1e3,{payloadData:i})},_renderTimelineHighlightIndicators:function(){var e=this,t=this.timelineController.getTimelineEpisodeById(this.id),i=t.acts.filter(function(e){return"highlight"===e.get("action")});i.sort(function(e,t){return e.get("timer")-t.get("timer")}),i.forEach(function(i){e._renderTimelineHighlightIndicator(t,i)}),t.acts.on("change:payload",this.onTimelineHighlightPayloadChange,this)},_renderTimelineHighlightIndicator:function(e,t){if(e.id===this.id){var i=document.createElement("div");this._rangeSlider.$highlightsEl.append(i);var o=new n({el:i,widgetId:this.id,controller:this.timelineController,scaleManager:this.scaleManager,episodeModel:e,highlightAct:t,extraCssClass:this.extraCssClassForHighlight,services:this.services,dashboardApi:this.dashboardApi});o.render(),this._timelineIndicators.push(o);var s=t.on("change:timer",this.onTimelineHighlightTimerChange,this),r=s.remove;this._highlightActModelListeners.push({id:t.id,remove:r})}},_refreshTimelineHighlightIndicators:function(){this._removeActModelListeners(),this._removeTimelineIndicators(),this._renderTimelineHighlightIndicators()},onTimelineHighlightTimerChange:function(){var e=!1,t=document.activeElement.id;document.activeElement.classList.contains("timelineHighlight")&&(e=!0),this._refreshTimelineHighlightIndicators(),e&&document.getElementById(t).focus()},onTimelineHighlightPayloadChange:function(){this._timelineIndicators.forEach(function(e){return e.onPayloadChange()})}});return a}),define("storytelling/views/SnapIndicatorView",["baglass/core-client/js/core-client/ui/core/View","jquery"],function(e,t){var i=e.extend({id:null,snapIndicatorRefreshInverval:100,snapIndicatorTimer:null,events:{},init:function(e){i.inherited("init",this,arguments),this.$slidersHolder=e.$slidersHolder,this.id=e.id,this.controller=e.controller,this.scaleManager=e.scaleManager,this.$snapIndicator=t(document.createElement("div")).addClass("guideline").css({position:"absolute",height:"100%",zIndex:1066,top:0,display:"block"})},render:function(){return this},refreshSnapIndicator:function(e,i){this.$snapIndicator.css("height",Math.max(this.controller.getTimelineEpisodeCount()*t(".sliderContent").height()+50,this.$slidersHolder.height()+50)),this.isDragging=!0,this.$snapIndicator.remove();var n=e();if(n){var o=1e3*n[0],s=1e3*n[1],r=this.controller.getSnapIndicatorTime([o,s],i());"start"===r.changed?(this.$snapIndicator.css("left",this.scaleManager.convertTimeToPosition(r.timeRange[0])),this.$slidersHolder.append(this.$snapIndicator)):"end"===r.changed&&(this.$snapIndicator.css("left",this.scaleManager.convertTimeToPosition(r.timeRange[1])),this.$slidersHolder.append(this.$snapIndicator))}},showIndicator:function(e,t){this.snapIndicatorTimer=setInterval(this.refreshSnapIndicator.bind(this,e,t),this.snapIndicatorRefreshInverval)},removeIndicator:function(){this.snapIndicatorTimer&&clearInterval(this.snapIndicatorTimer),this.snapIndicatorTimer=null,this.$snapIndicator.remove()}});return i}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/zoom-in_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([8],{"3865314c5959606874d4":function(t,i){t.exports=e},"67a028d36a358d57b346":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("df212c5f1089313f5052"));t.default=o.a},
- df212c5f1089313f5052:function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"zoom-in_16_v6",use:"zoom-in_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="zoom-in_16_v6"><path d="M9 6H7V4H6v2H4v1h2v2h1V7h2z" /><path d="M10.7 10c.8-1 1.3-2.2 1.3-3.5C12 3.5 9.5 1 6.5 1S1 3.5 1 6.5 3.5 12 6.5 12c1.3 0 2.5-.5 3.5-1.3l3.8 3.8.7-.7-3.8-3.8zm-4.2 1C4 11 2 9 2 6.5S4 2 6.5 2 11 4 11 6.5 9 11 6.5 11z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a}},["67a028d36a358d57b346"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/zoom-out_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([3],{"260d0f7fca78ef9be641":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("bf8b125c61ce0c4e0359"));t.default=o.a},"3865314c5959606874d4":function(t,i){t.exports=e},bf8b125c61ce0c4e0359:function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"zoom-out_16_v6",use:"zoom-out_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="zoom-out_16_v6"><path d="M4 6h5v1H4z" /><path d="M10.7 10c.8-1 1.3-2.2 1.3-3.5C12 3.5 9.5 1 6.5 1S1 3.5 1 6.5 3.5 12 6.5 12c1.3 0 2.5-.5 3.5-1.3l3.8 3.8.7-.7-3.8-3.8zm-4.2 1C4 11 2 9 2 6.5S4 2 6.5 2 11 4 11 6.5 9 11 6.5 11z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a}},["260d0f7fca78ef9be641"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/zoom-fit_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([11],{"3865314c5959606874d4":function(t,i){t.exports=e},"57d26dcbc4c7ec6b0dbf":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("939e1d4ea6e9e284e10c"));t.default=o.a},"939e1d4ea6e9e284e10c":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"zoom-fit_16_v6",use:"zoom-fit_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="zoom-fit_16_v6"><path d="M6 3h1v4H3V6h2.3L1.1 1.9l.7-.7L6 5.3V3zM3 9v1h2.3l-4.1 4.1.7.7L6 10.7V13h1V9H3zm10-2V6h-2.3l4.1-4.2-.7-.7L10 5.3V3H9v4h4zm0 3V9H9v4h1v-2.3l4.1 4.1.7-.7-4.1-4.1H13z" /></symbol>'});r.a.add(a),t.a=a}},["57d26dcbc4c7ec6b0dbf"])}),define("storytelling/views/TimelineView",["baglass/core-client/js/core-client/ui/core/View","jquery","underscore","text!./templates/TimelineView.html","./TimelineRulerView","./TimelineTimeIndicatorView","./TimelineSliderView","./SnapIndicatorView","storytelling-ui/storytelling-ui.min","react","react-dom","../ScaleManager","baglass/core-client/js/core-client/utils/Utils","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/zoom-in_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/zoom-out_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/zoom-fit_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/minimize_16"],function(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,p,m){var v=e.extend({templateString:n,events:{"primaryaction .zoomIn":"onZoomInClick","primaryaction .zoomOut":"onZoomOutClick","primaryaction .zoomFit":"onZoomToFitClick","primaryaction .timelineRuler":"onTimelineRulerClick"},init:function(e){v.inherited("init",this,arguments),this.storyController=e.storyController,this.controller=e.controller,this.dashboardApi=e.dashboardApi,this.dndManager=e.dndManager,this.glassContext=e.glassContext,this.services=e.services,this.stringResources=this.dashboardApi.getDashboardCoreSvc(".StringResources"),this.zoom=1,this.rangeSliders=null,this.rangeSlidersMap=null,this.scaleManager=new h},render:function(){this.controller.on("duration:changed",this.onDurationChanged,this),this.controller.on("modelEpisode:added",this.onWidgetAdded,this),this.controller.on("modelEpisode:removed",this.onWidgetRemoved,this),this.controller.on("modelEpisode:changed",this.onModelEpisodeChanged,this),this.controller.on("modelEpisodes:reorder",this.onModelEpisodesReorder,this),this.controller.on("slider:change",this.onSliderTitleChange,this),this.controller.on("timeline:change",this.onSliderChange,this),this.controller.on("timeline:willChange",this.onSliderWillChange,this),this.controller.on("timeline:select",this.onSliderSelect,this),this.controller.on("timeline:movingUp",this.onSliderMoveUp,this),this.controller.on("timeline:movingDown",this.onSliderMoveDown,this),this.controller.on("timeline:doneMoving",this.onSliderDrop,this),this.controller.on("timeline:sliderDragStarted",this.onDragStarted,this),this.controller.on("timeline:highlightIndicatorDragStarted",this.highlightIndicatorDragStarted,this),this.controller.on("timeline:highlightIndicatorDragEnded",this.highlightIndicatorDragEnded,this),this.scaleManager.on("scale:change",this.onScaleChanged,this),t(window).on("resize.privateViewEvents"+this.viewId,this.onResize.bind(this));var e=this.dotTemplate({timelineRightContainerLabel:this.stringResources.get("timelineRightContainerLabel"),collapseScene:this.stringResources.get("close"),zoomToFit:this.stringResources.get("timelineZoomFit"),zoomIn:this.stringResources.get("timelineZoomIn"),zoomOut:this.stringResources.get("timelineZoomOut")});this.$el.addClass("timeline").attr("role","region").attr("aria-label",this.stringResources.get("timelineViewLabel")).html(e),this.$scrollContainer=this.$(".timelineContent"),this.$timelineSliders=this.$scrollContainer.find(".timelineSliders"),this.$blanket=this.$el.find(".timelineBlanket"),this.$leftContainer=this.$el.find(".leftContainer");var i=this.$el.find(".rightContainer");this.$zoomOutButton=i.find(".zoomOut"),this.$zoomInButton=i.find(".zoomIn"),this.$zoomFitButton=i.find(".zoomFit"),this.$collapseButton=i.find(".collapseScene"),u.setIcon(this.$zoomInButton,g.default.id),u.setIcon(this.$zoomOutButton,f.default.id),u.setIcon(this.$zoomFitButton,p.default.id),u.setIcon(this.$collapseButton,m.default.id),this.renderTimelineRowTracks(),this.renderTimelines(),this.renderRulerView(),this.scaleToFit(),this.registerHandlers(),this._updateSelectedSliders(),this.setFocus()},renderFadeIn:function(e){this.render(),this.hide(),this.$el.fadeIn(e)},fadeOut:function(e){this.$el.fadeOut(e)},renderRulerView:function(){this.timeRulerView=new o({el:this.$el.find(".timelineRuler"),controller:this.controller,scaleManager:this.scaleManager}),this.timeRulerView.render(),this.timeIndicatorView=new s({el:this.$el.find(".timelinePosition"),controller:this.controller,scaleManager:this.scaleManager,services:this.services}),this.timeIndicatorView.render(),this._fixRulerPosition()},renderSnapIndicatorView:function(){this.snapIndicatorView=new a({$slidersHolder:this.$el.find(".timelineSliders"),controller:this.controller,scaleManager:this.scaleManager}),this.snapIndicatorView.render()},registerHandlers:function(){this.$collapseButton.on("primaryaction",this.storyController.collapseScene.bind(this.storyController)),this.$scrollContainer.on("scroll",this.onScroll.bind(this))},onSliderTitleChange:function(){this.rangeSlidersMap&&i.each(this.rangeSlidersMap,function(e){var t=this._getWidgetTitle(e.id);t!==e.getLabel()&&e.setLabel(t)}.bind(this))},renderTimelineRowTracks:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=c.createElement(l.RowTrackView,{timelineEpisodes:this.controller.getTimelineEpisodes(),marginTop:e});d.render(t,this.$leftContainer[0])},renderTimelines:function(){this.rangeSlidersId=[],this.rangeSlidersMap&&i.each(this.rangeSlidersMap,function(e){e.remove()}),this.rangeSlidersMap={};var e=this._createTimelineInfos();i.each(e,function(e){this.renderTimeline(e)}.bind(this))},renderTimeline:function(e){var i=t("<div/>").appendTo(this.$timelineSliders),n=new r({el:i,id:e.id,model:e.model,label:this._getWidgetTitle(e.id),scaleManager:this.scaleManager,timelineController:this.controller,glassContext:this.glassContext,dndManager:this.dndManager,services:this.services,dashboardApi:this.dashboardApi});n.render(),this.rangeSlidersId.push(e.id),this.rangeSlidersMap[e.id]=n},setFocus:function(){this.$el.find(".timelinePosition .handle").focus()},remove:function(){t(window).off("resize.privateViewEvents"+this.viewId),this.controller.off("duration:changed",this.onDurationChanged,this),this.controller.off("modelEpisode:added",this.onWidgetAdded,this),this.controller.off("modelEpisode:removed",this.onWidgetRemoved,this),this.controller.off("modelEpisode:changed",this.onModelEpisodeChanged,this),this.controller.off("modelEpisodes:reorder",this.onModelEpisodesReorder,this),this.controller.off("slider:change",this.onSliderTitleChange,this),this.controller.off("timeline:change",this.onSliderChange,this),this.controller.off("timeline:willChange",this.onSliderWillChange,this),this.controller.off("timeline:select",this.onSliderSelect,this),this.controller.off("timeline:movingUp",this.onSliderMoveUp,this),this.controller.off("timeline:movingDown",this.onSliderMoveDown,this),this.controller.off("timeline:doneMoving",this.onSliderDrop,this),this.controller.off("timeline:sliderDragStarted",this.onDragStarted,this),this.controller.off("timeline:highlightIndicatorDragStarted",this.highlightIndicatorDragStarted,this),this.controller.off("timeline:highlightIndicatorDragEnded",this.highlightIndicatorDragEnded,this),this.scaleManager.off("scale:change",this.onScaleChanged,this),this.timeRulerView=null,this.timeIndicatorView&&(this.timeIndicatorView.remove(),this.timeIndicatorView=null),this.$leftContainer&&this.$leftContainer.length&&d.unmountComponentAtNode(this.$leftContainer[0]),this.rangeSlidersId=null,this.rangeSlidersMap&&i.each(this.rangeSlidersMap,function(e){e.remove()}),this.rangeSlidersMap=null,v.inherited("remove",this,arguments)},scaleToFit:function(){var e=this.controller.getDuration();0===e&&(e=this.controller.getDefaultWidgetDuration()),this.scaleManager.updateDuration(e,this.$scrollContainer.outerWidth(!1)),this.scaleManager.scaleToFit()},onResize:function(){this.$el.is(":visible")&&(this.scaleToFit(),this.scaleManager.stepScale(this.zoom),this._updateTimelineWidth())},onScroll:function(){this._fixRulerPosition(),this._updateSelectedSliders()},onZoomInClick:function(){this.scaleManager.stepScale(2),this.zoom=2*this.zoom,this._updateZoomButtons()},onZoomOutClick:function(){this.scaleManager.stepScale(.5),this.zoom=.5*this.zoom,this._updateZoomButtons()},onZoomToFitClick:function(){this.scaleToFit(),this.zoom=1,this._updateZoomButtons()},onTimelineRulerClick:function(){this.timeIndicatorView.setFocus()},onSliderWillChange:function(e){this.controller.isPlaying()&&this.controller.pause(),e.getDragValue&&(this.controller.updateLastEstablishedEventQueue(),this.snapIndicatorView||this.renderSnapIndicatorView(),this.snapIndicatorView.showIndicator(e.getDragValue,e.getDraggingElement))},onSliderChange:function(){this._updateTimelineWidth(),this.lastStatePlaying&&this.controller.getCursorTime()<this.controller.getDuration()&&this.controller.play(),this.snapIndicatorView&&this.snapIndicatorView.removeIndicator()},onSliderSelect:function(){this.lastStatePlaying=this.controller.isPlaying()},_closeFlyouts:function(e){this.controller.trigger("slider:closeFlyouts",{widgetId:e})},onScaleChanged:function(e){this._updateTimelinesScale(e.scale,e.previousScale),this._updateZoomButtons()},onDurationChanged:function(){this._updateBlanket()},onWidgetAdded:function(e){var t=this.controller.getTimelineEpisodeById(e);if(t){var i=this._createTimelineInfo(t);this.renderTimeline(i),this._onWidgetAddRemove()}},onWidgetRemoved:function(e){this._closeFlyouts(e);var t=this._getSliderByModelId(e);if(t){t.remove();var n=i.indexOf(this.rangeSlidersId,e);n>=0&&(this.rangeSlidersId.splice(n,1),this.rangeSlidersMap[e].remove(),delete this.rangeSlidersMap[e]),this._onWidgetAddRemove()}},_getWidgetTitle:function(e){var t=this.dashboardApi.getCanvas().getContent(e),i=t.getFeature("Serializer").toJSON(),n=!!t.getPropertyValue("value.graphic.content"),o=Object.assign({},i.features.Models_internal,{hasGraphic:n});return this.dashboardApi.getFeature(".SmartNamingSvc").getWidgetName(o)},onModelEpisodeChanged:function(e){if(this.rangeSlidersMap){var t=this.rangeSlidersMap[e.id];if(t){var i=this._createTimelineValue(e.value);t.setValue(i,!0)}}},onModelEpisodesReorder:function(){var e=t(document.activeElement),n=this._createTimelineInfos();this.rangeSlidersId=[];var o=null;i.each(n,function(e){this.rangeSlidersId.push(e.id);var t=this._getSliderByModelId(e.id);o?o.after(t):this.$timelineSliders.prepend(t),o=t}.bind(this)),e.focus()},onShowSliderSelection:function(e){var t=this.rangeSlidersMap[e.widgetId];t&&(t.toggleSelected(!0),this._updateSelectedSlider(e.widgetId))},onSliderDrop:function(e){var t=i.indexOf(this.rangeSlidersId,e.id);this.controller.moveEpisodeBefore(e.id,this.rangeSlidersId[t+1],{payloadData:e.payloadData})},onDragStarted:function(e){this._closeFlyouts(e)},highlightIndicatorDragStarted:function(){this.$scrollContainer.css({overflow:"hidden"})},highlightIndicatorDragEnded:function(){this.$scrollContainer.css({overflow:"auto"})},onSliderMoveUp:function(e){var n=t(document.activeElement),o=i.indexOf(this.rangeSlidersId,e.id),s=e.to?i.indexOf(this.rangeSlidersId,e.to):o-1;if(!(-1===o||s<0)){for(;o>s;){var r=this._getSliderByModelId(this.rangeSlidersId[o]),a=this._getSliderByModelId(this.rangeSlidersId[o-1]);r.insertBefore(a);var l=this.rangeSlidersId[o-1];this.rangeSlidersId[o-1]=this.rangeSlidersId[o],this.rangeSlidersId[o]=l,o--}u.embedSVGIcon(this.$el),n.focus()}},onSliderMoveDown:function(e){var n=t(document.activeElement),o=i.indexOf(this.rangeSlidersId,e.id),s=e.to?i.indexOf(this.rangeSlidersId,e.to):o+1;if(!(-1===o||-1===s||s>=this.rangeSlidersId.length)){for(;o<s;){var r=this._getSliderByModelId(this.rangeSlidersId[o]),a=this._getSliderByModelId(this.rangeSlidersId[o+1]);r.insertAfter(a);var l=this.rangeSlidersId[o+1];this.rangeSlidersId[o+1]=this.rangeSlidersId[o],this.rangeSlidersId[o]=l,o++}u.embedSVGIcon(this.$el),n.focus()}},_getSliderByModelId:function(e){return this.$timelineSliders.find("#timelineWidgetSlider"+e)},_updateBlanket:function(){this.$blanket.css("left",this.scaleManager.convertTimeToPosition(this.controller.getDuration())+"px")},_updateSelectedSliders:function(){var e=this.controller.getSelectedWidgetMap();i.each(Object.keys(e),function(t){e[t]&&(this.onShowSliderSelection({widgetId:t}),this._closeFlyouts(t))}.bind(this))},_updateSelectedSlider:function(e){this.rangeSlidersMap[e].$el.toggleClass("bringToFront",0===this.$scrollContainer.scrollTop())},_clearHoverTimeout:function(){this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=null)},_onWidgetAddRemove:function(){this._updateTimelineWidth(),this.timeIndicatorView.refresh(),this._fixRulerPosition()},_updateTimelineWidth:function(){var e=500+this.scaleManager.convertTimeToPosition(this.controller.getDuration()),t=this.$scrollContainer.outerWidth(!1),i=Math.max(e,t);this.$timelineSliders.css("width",i+"px"),this.$blanket.css("width",i-parseInt(this.$blanket.css("left"),10)),this.timeRulerView.refresh()},_updateTimelinesScale:function(e){this._updateBlanket(),this._updateTimelineWidth();var t=this.rangeSlidersMap;i.each(this.rangeSlidersId,function(i){t[i].setScale(e)})},_createTimelineValue:function(e){var t=this.scaleManager.getScaleToPixelRatio();return[e[0]/1e3*t,e[1]/1e3*t]},_createTimelineInfo:function(e){var t=e.getEntranceAct().timer,i=e.getExitAct().timer;return{model:{value:this._createTimelineValue([t,i]),scale:this.scaleManager.getScale()},id:e.id}},_createTimelineInfos:function(){return i.map(this.controller.getTimelineEpisodes(),function(e){return this._createTimelineInfo(e)}.bind(this))},_fixRulerPosition:function(){var e=this.$scrollContainer.scrollTop(),t=this.$scrollContainer.scrollLeft();this.$blanket.css("top",e+"px"),this.timeIndicatorView.onScroll({scrollTop:e,scrollLeft:t}),this.timeRulerView.setOffsetLeft(t),this.renderTimelineRowTracks(-e)},_updateZoomButtons:function(){var e=this.scaleManager.getScale(),t=e<this.scaleManager.getMaxScale(),i=e>this.scaleManager.getMinScale();this.$zoomOutButton.toggleClass("disabled",!i),this.$zoomInButton.toggleClass("disabled",!t),this.$zoomInButton.attr("aria-disabled",!t),this.$zoomOutButton.attr("aria-disabled",!i)}});return v}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/chevron-down_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([1459],{"3865314c5959606874d4":function(t,i){t.exports=e},aa537d430eed17163a1c:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("f21266730b5c85314a2a"));t.default=o.a},f21266730b5c85314a2a:function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"chevron-down_16_v6",use:"chevron-down_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="chevron-down_16_v6"><path d="M8 11L3 6l.7-.7L8 9.6l4.3-4.3.7.7z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a}},["aa537d430eed17163a1c"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/add_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([1713],{"3865314c5959606874d4":function(t,i){t.exports=e},"3b1c227192eaf5ac253d":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"add_16_v6",use:"add_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="add_16_v6"><path d="M9 7V3H7v4H3v2h4v4h2V9h4V7z" /></symbol>'});r.a.add(a),t.a=a},ad744edc6295a7b387a2:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("3b1c227192eaf5ac253d"));t.default=o.a}},["ad744edc6295a7b387a2"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/maximize_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([800],{"1fbfbad79d094b145b98":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("ddd6212080dade5a747e"));t.default=o.a},"3865314c5959606874d4":function(t,i){t.exports=e},ddd6212080dade5a747e:function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"maximize_16_v6",use:"maximize_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="maximize_16_v6"><path d="M6 15v-1H2.7L7 9.7 6.3 9 2 13.3V10H1v5zm4-14v1h3.3L9 6.3l.7.7L14 2.7V6h1V1z" /><path style="fill:none" d="M-.2-.1h16v16" /></symbol>'});r.a.add(a),t.a=a}},["1fbfbad79d094b145b98"])}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/overflow-menu--horizontal_16",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([696],{"3865314c5959606874d4":function(t,i){t.exports=e},"3e093e5642cd68f65e20":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"overflow-menu--horizontal_16_v6",use:"overflow-menu--horizontal_16_v6-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="overflow-menu--horizontal_16_v6"><circle cx="3" cy="8" r="1" /><circle cx="8" cy="8" r="1" /><circle cx="13" cy="8" r="1" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});r.a.add(a),t.a=a},"7b8e9c951999a27dfd31":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("3e093e5642cd68f65e20"));t.default=o.a}},["7b8e9c951999a27dfd31"])}),function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var i=window.webpackJsonPBaGraphics;window.webpackJsonPBaGraphics=function(n,s,r){for(var a,l,c,d=0,h=[];d<n.length;d++)l=n[d],o[l]&&h.push(o[l][0]),o[l]=0;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a]);for(i&&i(n,s,r);h.length;)h.shift()();if(r)for(d=0;d<r.length;d++)c=t(t.s=r[d]);return c};var n={},o={147:0};t.m=e,t.c=n,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t.oe=function(e){throw console.error(e),e}}({"698d75b157f24ae829cc":function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},"9689a9c94ae38b47fa2c":function(e,t,i){(function(t){!function(t,i){e.exports=function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}var i=function(e){var t=e.id,i=e.viewBox,n=e.content;this.id=t,this.viewBox=i,this.content=n};i.prototype.stringify=function(){return this.content},i.prototype.toString=function(){return this.stringify()},i.prototype.destroy=function(){var e=this;["id","viewBox","content"].forEach(function(t){return delete e[t]})};var n=function(e){var t=!!document.importNode,i=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t?document.importNode(i,!0):i},o=("undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self,e(function(e,t){!function(t,i){e.exports=function(){function e(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function t(e){return Array.isArray(e)?[]:{}}function i(i,n){return n&&!0===n.clone&&e(i)?s(t(i),i,n):i}function n(t,n,o){var r=t.slice();return n.forEach(function(n,a){void 0===r[a]?r[a]=i(n,o):e(n)?r[a]=s(t[a],n,o):-1===t.indexOf(n)&&r.push(i(n,o))}),r}function o(t,n,o){var r={};return e(t)&&Object.keys(t).forEach(function(e){r[e]=i(t[e],o)}),Object.keys(n).forEach(function(a){e(n[a])&&t[a]?r[a]=s(t[a],n[a],o):r[a]=i(n[a],o)}),r}function s(e,t,s){var r=Array.isArray(t),a=s||{arrayMerge:n},l=a.arrayMerge||n;return r?Array.isArray(e)?l(e,t,s):i(t,s):o(e,t,s)}return s.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,i){return s(e,i,t)})},s}()}()})),s=e(function(e,t){var i={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};t.default=i,e.exports=t.default}),r=function(e){return Object.keys(e).map(function(t){return t+'="'+e[t].toString().replace(/"/g,""")+'"'}).join(" ")},a=s.svg,l=s.xlink,c={};c[a.name]=a.uri,c[l.name]=l.uri;var d=function(e,t){void 0===e&&(e="");var i=o(c,t||{});return"<svg "+r(i)+">"+e+"</svg>"};return function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={isMounted:{}};return i.isMounted.get=function(){return!!this.node},t.createFromExistingNode=function(e){return new t({id:e.getAttribute("id"),viewBox:e.getAttribute("viewBox"),content:e.outerHTML})},t.prototype.destroy=function(){this.isMounted&&this.unmount(),e.prototype.destroy.call(this)},t.prototype.mount=function(e){if(this.isMounted)return this.node;var t="string"==typeof e?document.querySelector(e):e,i=this.render();return this.node=i,t.appendChild(i),i},t.prototype.render=function(){var e=this.stringify();return n(d(e)).childNodes[0]},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(t.prototype,i),t}(i)}()}()}).call(t,i("698d75b157f24ae829cc"))},"9ce58a7deea14f49ef01":function(e,t,i){(function(t){!function(t,i){e.exports=function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function i(e){return e=e||Object.create(null),{on:function(t,i){(e[t]||(e[t]=[])).push(i)},off:function(t,i){e[t]&&e[t].splice(e[t].indexOf(i)>>>0,1)},emit:function(t,i){(e[t]||[]).map(function(e){e(i)}),(e["*"]||[]).map(function(e){e(t,i)})}}}function n(e,t){return C(e).reduce(function(e,i){if(!i.attributes)return e;var n=C(i.attributes),o=t?n.filter(t):n;return e.concat(o)},[])}function o(e){return e.replace(O,function(e){return"%"+e[0].charCodeAt(0).toString(16).toUpperCase()})}function s(e,t,i){return C(e).forEach(function(e){var n=e.getAttribute(E);if(n&&0===n.indexOf(t)){var o=n.replace(t,i);e.setAttributeNS(M,E,o)}}),e}var r=("undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self,e(function(e,t){!function(t,i){e.exports=function(){function e(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function t(e){return Array.isArray(e)?[]:{}}function i(i,n){return n&&!0===n.clone&&e(i)?s(t(i),i,n):i}function n(t,n,o){var r=t.slice();return n.forEach(function(n,a){void 0===r[a]?r[a]=i(n,o):e(n)?r[a]=s(t[a],n,o):-1===t.indexOf(n)&&r.push(i(n,o))}),r}function o(t,n,o){var r={};return e(t)&&Object.keys(t).forEach(function(e){r[e]=i(t[e],o)}),Object.keys(n).forEach(function(a){e(n[a])&&t[a]?r[a]=s(t[a],n[a],o):r[a]=i(n[a],o)}),r}function s(e,t,s){var r=Array.isArray(t),a=s||{arrayMerge:n},l=a.arrayMerge||n;return r?Array.isArray(e)?l(e,t,s):i(t,s):o(e,t,s)}return s.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,i){return s(e,i,t)})},s}()}()})),a=e(function(e,t){var i={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};t.default=i,e.exports=t.default}),l=function(e){return Object.keys(e).map(function(t){return t+'="'+e[t].toString().replace(/"/g,""")+'"'}).join(" ")},c=a.svg,d=a.xlink,h={};h[c.name]=c.uri,h[d.name]=d.uri;var u,g=function(e,t){void 0===e&&(e="");var i=r(h,t||{});return"<svg "+l(i)+">"+e+"</svg>"},f=a.svg,p=a.xlink,m={attrs:(u={style:["position: absolute","width: 0","height: 0"].join("; ")},u[f.name]=f.uri,u[p.name]=p.uri,u)},v=function(e){this.config=r(m,e||{}),this.symbols=[]};v.prototype.add=function(e){var t=this,i=t.symbols,n=this.find(e.id);return n?(i[i.indexOf(n)]=e,!1):(i.push(e),!0)},v.prototype.remove=function(e){var t=this,i=t.symbols,n=this.find(e);return!!n&&(i.splice(i.indexOf(n),1),n.destroy(),!0)},v.prototype.find=function(e){return this.symbols.filter(function(t){return t.id===e})[0]||null},v.prototype.has=function(e){return null!==this.find(e)},v.prototype.stringify=function(){var e=this.config,t=e.attrs,i=this.symbols.map(function(e){return e.stringify()}).join("");return g(i,t)},v.prototype.toString=function(){return this.stringify()},v.prototype.destroy=function(){this.symbols.forEach(function(e){return e.destroy()})};var y=function(e){var t=e.id,i=e.viewBox,n=e.content;this.id=t,this.viewBox=i,this.content=n};y.prototype.stringify=function(){return this.content},y.prototype.toString=function(){return this.stringify()},y.prototype.destroy=function(){var e=this;["id","viewBox","content"].forEach(function(t){return delete e[t]})};var _,S=function(e){var t=!!document.importNode,i=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;return t?document.importNode(i,!0):i},b=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={isMounted:{}};return i.isMounted.get=function(){return!!this.node},t.createFromExistingNode=function(e){return new t({id:e.getAttribute("id"),viewBox:e.getAttribute("viewBox"),content:e.outerHTML})},t.prototype.destroy=function(){this.isMounted&&this.unmount(),e.prototype.destroy.call(this)},t.prototype.mount=function(e){if(this.isMounted)return this.node;var t="string"==typeof e?document.querySelector(e):e,i=this.render();return this.node=i,t.appendChild(i),i},t.prototype.render=function(){var e=this.stringify();return S(g(e)).childNodes[0]},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(t.prototype,i),t}(y),w={autoConfigure:!0,mountTo:"body",syncUrlsWithBaseTag:!1,listenLocationChangeEvent:!0,locationChangeEvent:"locationChange",locationChangeAngularEmitter:!1,usagesToUpdate:"use[*|href]",moveGradientsOutsideSymbol:!1},C=function(e){return Array.prototype.slice.call(e,0)},x=navigator.userAgent,T={isChrome:/chrome/i.test(x),
- isFirefox:/firefox/i.test(x),isIE:/msie/i.test(x)||/trident/i.test(x),isEdge:/edge/i.test(x)},I=function(e,t){var i=document.createEvent("CustomEvent");i.initCustomEvent(e,!1,!1,t),window.dispatchEvent(i)},P=function(e){var t=[];return C(e.querySelectorAll("style")).forEach(function(e){e.textContent+="",t.push(e)}),t},L=function(e){return(e||window.location.href).split("#")[0]},A=function(e){angular.module("ng").run(["$rootScope",function(t){t.$on("$locationChangeSuccess",function(t,i,n){I(e,{oldUrl:n,newUrl:i})})}])},k=function(e,t){return void 0===t&&(t="linearGradient, radialGradient, pattern"),C(e.querySelectorAll("symbol")).forEach(function(e){C(e.querySelectorAll(t)).forEach(function(t){e.parentNode.insertBefore(t,e)})}),e},M=a.xlink.uri,E="xlink:href",O=/[{}|\\\^\[\]`"<>]/g,$=["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke","style"],R=$.map(function(e){return"["+e+"]"}).join(","),D=function(e,t,i,r){var a=o(i),l=o(r);n(e.querySelectorAll(R),function(e){var t=e.localName,i=e.value;return-1!==$.indexOf(t)&&-1!==i.indexOf("url("+a)}).forEach(function(e){return e.value=e.value.replace(a,l)}),s(t,a,l)},j={MOUNT:"mount",SYMBOL_MOUNT:"symbol_mount"},H=function(e){function t(t){var n=this;void 0===t&&(t={}),e.call(this,r(w,t));var o=i();this._emitter=o,this.node=null;var s=this,a=s.config;if(a.autoConfigure&&this._autoConfigure(t),a.syncUrlsWithBaseTag){var l=document.getElementsByTagName("base")[0].getAttribute("href");o.on(j.MOUNT,function(){return n.updateUrls("#",l)})}var c=this._handleLocationChange.bind(this);this._handleLocationChange=c,a.listenLocationChangeEvent&&window.addEventListener(a.locationChangeEvent,c),a.locationChangeAngularEmitter&&A(a.locationChangeEvent),o.on(j.MOUNT,function(e){a.moveGradientsOutsideSymbol&&k(e)}),o.on(j.SYMBOL_MOUNT,function(e){a.moveGradientsOutsideSymbol&&k(e.parentNode),(T.isIE||T.isEdge)&&P(e)})}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},t.prototype._autoConfigure=function(e){var t=this,i=t.config;void 0===e.syncUrlsWithBaseTag&&(i.syncUrlsWithBaseTag=void 0!==document.getElementsByTagName("base")[0]),void 0===e.locationChangeAngularEmitter&&(i.locationChangeAngularEmitter="angular"in window),void 0===e.moveGradientsOutsideSymbol&&(i.moveGradientsOutsideSymbol=T.isFirefox)},t.prototype._handleLocationChange=function(e){var t=e.detail,i=t.oldUrl,n=t.newUrl;this.updateUrls(i,n)},t.prototype.add=function(t){var i=this,n=e.prototype.add.call(this,t);return this.isMounted&&n&&(t.mount(i.node),this._emitter.emit(j.SYMBOL_MOUNT,t.node)),n},t.prototype.attach=function(e){var t=this,i=this;if(i.isMounted)return i.node;var n="string"==typeof e?document.querySelector(e):e;return i.node=n,this.symbols.forEach(function(e){e.mount(i.node),t._emitter.emit(j.SYMBOL_MOUNT,e.node)}),C(n.querySelectorAll("symbol")).forEach(function(e){var t=b.createFromExistingNode(e);t.node=e,i.add(t)}),this._emitter.emit(j.MOUNT,n),n},t.prototype.destroy=function(){var e=this,t=e.config,i=e.symbols,n=e._emitter;i.forEach(function(e){return e.destroy()}),n.off("*"),window.removeEventListener(t.locationChangeEvent,this._handleLocationChange),this.isMounted&&this.unmount()},t.prototype.mount=function(e,t){void 0===e&&(e=this.config.mountTo),void 0===t&&(t=!1);var i=this;if(i.isMounted)return i.node;var n="string"==typeof e?document.querySelector(e):e,o=i.render();return this.node=o,t&&n.childNodes[0]?n.insertBefore(o,n.childNodes[0]):n.appendChild(o),this._emitter.emit(j.MOUNT,o),o},t.prototype.render=function(){return S(this.stringify())},t.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},t.prototype.updateUrls=function(e,t){if(!this.isMounted)return!1;var i=document.querySelectorAll(this.config.usagesToUpdate);return D(this.node,i,L(e)+"#",L(t)+"#"),!0},Object.defineProperties(t.prototype,n),t}(v),B=e(function(e){!function(t,i){e.exports=function(){var e,t=[],i=document,n=i.documentElement.doScroll,o=(n?/^loaded|^c/:/^loaded|^i|^c/).test(i.readyState);return o||i.addEventListener("DOMContentLoaded",e=function(){for(i.removeEventListener("DOMContentLoaded",e),o=1;e=t.shift();)e()}),function(e){o?setTimeout(e,0):t.push(e)}}()}()});!window.__SVG_SPRITE__?(_=new H({attrs:{id:"__SVG_SPRITE_NODE__"}}),window.__SVG_SPRITE__=_):_=window.__SVG_SPRITE__;var W=function(){var e=document.getElementById("__SVG_SPRITE_NODE__");e?_.attach(e):_.mount(document.body,!0)};return document.body?W():B(W),_}()}()}).call(t,i("698d75b157f24ae829cc"))}}),define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js",function(){}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/illustrations-js/visualization-widget_128",["@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([3],{"12f7eb33bd32cb77e74d":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("6ecce6eea40a7ece8355"));t.default=o.a},"3865314c5959606874d4":function(t,i){t.exports=e},"6ecce6eea40a7ece8355":function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"visualization-widget_128_v6",use:"visualization-widget_128_v6-usage",viewBox:"0 0 128 128",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" id="visualization-widget_128_v6"><circle class="ba-graphics-gray1" cx="44" cy="54" r="36" /><path class="ba-graphics-gray20" d="M35 102V42h-2v62h83v-2z" /><path class="ba-graphics-white" d="M68 54h14v40H68z" /><path class="ba-graphics-highlight" d="M42 74h18v22H42V74zm24-22h18v44H66V52zm2 42h14V54H68v40zm23-31v3h18v-3H91zm0 9h18v-3H91v3zm0 6h18v-3H91v3zm0 6h18v-3H91v3zm0 6h18v-3H91v3zm0 6h18v-3H91v3z" /></symbol>'});r.a.add(a),t.a=a}},["12f7eb33bd32cb77e74d"])}),define("storytelling/views/FilmStripView",["baglass/core-client/js/core-client/ui/core/View","baglass/core-client/js/core-client/utils/BrowserUtils","baglass/core-client/js/core-client/utils/ContentFormatter","baglass/core-client/js/core-client/utils/dom-utils","baglass/core-client/js/core-client/utils/Utils","text!./templates/FilmStripView.html","text!./templates/SceneCell.html","text!./templates/AddSceneCell.html","text!./templates/OverviewCell.html","jquery","underscore","doT","../nls/StringResources","gemini/app/ui/dialogs/RenameDialog","text!../layout/templates/sceneLayoutListing.json","storytelling-ui/storytelling-ui.min","./TimelineView","gemini/app/ui/dnd/DnDHelper","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/chevron-down_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/add_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/maximize_16","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/overflow-menu--horizontal_16","../lib/@ba-ui-toolkit/ba-graphics/dist/illustrations-js/visualization-widget_128","react","react-dom","hammerjs","jquery.hammer"],function(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,p,m,v,y,_,S,b,w,C,x){var T=e.extend({templateString:s,collapseDuration:400,enlargeDuration:400,events:{"keydown .scene, .overview, .addScene":"onKeydown"},init:function(e){T.inherited("init",this,arguments),this.dashboardApi=e.dashboardApi,this.controller=e.controller,this.timelineController=this.controller.getTimelineController(),this.canvasController=this.timelineController.canvasController,this.glassContext=e.glassContext,this.dndManager=e.dndManager,this.services=e.services,this._dropZones=[],this.logger=this.dashboardApi.getGlassCoreSvc(".Logger"),this.translationService=this.dashboardApi.getDashboardCoreSvc("TranslationService"),this.nextPreviousDuration=900,this.nextPreviousDelay=this.nextPreviousDuration/6,this.forceReFocus=!1,this.flyoutHolder=document.createElement("div"),this.flyoutHolder.classList.add("flyout-holder")},render:function(){var e=this;this.$el.addClass("filmstrip"),this.contentEl=this.el.parentNode,this.controller.on("change:pageSize",this.onPageSizeChange,this),this.controller.on("change:showOverviews",this.onShowOverviewsChanged,this),this.controller.on("layoutType:changed",this.onLayoutTypeChanged,this),this.controller.on("mode:change",this.onModeChanged,this),this.controller.on("scene:add",this.onSceneAdded,this),this.controller.on("scene:collapse",this.onSceneCollapse,this),this.controller.on("scene:expand",this.onSceneExpand,this),this.controller.on("scene:remove",this.onSceneRemoved,this),this.controller.on("scene:select",this.onSceneSelected,this),this.controller.model.on("change:layout",this.onChangeLayout,this),this.timelineController.on("scene:reorder",this.onSceneReorder,this),this.canvasController.addRemoveNotifier.on("widget:addDone",this.onWidgetAdded,this),this.canvasController.addRemoveNotifier.on("widget:removeDone",this.onWidgetRemoved,this);var t=this.dotTemplate({});return this.$el.html(t),this.$sceneSequencer=this.$el.find(".sceneSequencer"),this.$sceneList=this.$el.find(".sceneList"),this.$sceneSequencer.hammer().on("mousedown",".scene",this.onSceneContextMenu.bind(this)).on("clicktap",".scene",this.onSceneClick.bind(this)).on("dragstart",".scene",this.onSceneDragStart.bind(this)).on("hold",".scene",this.onSelectedSceneHold.bind(this)).on("primaryaction","span.overflow",this.onSceneOverflowClick.bind(this)).on("primaryaction","span.expandScene",this.onExpandSceneClick.bind(this)),this.cellTemplate=h.template(r),this.controller.getScenes().forEach(function(t,i){var n=e.renderSceneCell(t,i);e.$sceneList.append(n),e.middleShortenSceneTitle(e._getSceneSelector(t.id))}),this.updateOverviewButton(),this._setupFilmStripDropZone(),this._toggleModeChanged(this.controller.isAuthoring()),Promise.all([this._addExpandSceneCoachmark(),this._addOverviewSceneCoachmark()])},_scaleCell:function(e,t){if(t&&t.width&&t.height){e.css({width:125*t.width/t.height+"px",height:"125px"})}},renderSceneCell:function(e,t){var i=this,n=this.cellTemplate({id:e.id,index:t,title:e.get("title"),expandSceneLabel:u.get("storySceneExpand"),sceneActionMenuLabel:u.get("storySceneActionMenu"),selected:t===this.controller.getSelectedSceneIndex(),widgetIndicated:this.controller.isScenePopulated(e.id)}),s=c(n);return this.translationService.registerView({view:s,model:e}),o.setIcon(s.find(".expandScene"),S.default.id),o.setIcon(s.find(".overflow"),b.default.id),o.setIcon(s.find(".widgetIndicator"),w.default.id),e.on("change:title",function(){i.onSceneLabelChange(e)}),this._scaleCell(s,this.controller.model.layout.pageSize),this._setupDropZones(s),s},_setupDropZones:function(e){var t=this,i=e[0],n=this.dndManager.addDropTarget(i,{accepts:function(e){return"sceneCell"===e.type||"widget"===e.type},onDragEnter:function(e,t){"widget"===e.type&&t.classList.add("dropZone")},onDragMove:function(e,i){if("sceneCell"===e.type){t._dropNodeModelId=i.dataset.modelId;var n=t.controller.getSceneIndex(t._dropNodeModelId);t._dragModelIndex>n?t.$sceneList[0].insertBefore(t._cloneDragEl,i):t.$sceneList[0].insertBefore(t._cloneDragEl,i.nextSibling)}},onDrop:function(i){"widget"===i.type&&(v.handleWidgetDrop(t.dashboardApi.getCanvas(),e.attr("data-model-id"),i),e[0].classList.remove("dropZone"))},onDragLeave:function(e,t){"widget"===e.type&&t.classList.remove("dropZone")}});this._dropZones.push({dropZone:n,node:i})},_setupFilmStripDropZone:function(){var e=this,t=this.el,i=this.$sceneList[0],n=this.dndManager.addDropTarget(t,{accepts:function(e){return"sceneCell"===e.type},onDragStart:function(){e.sceneListBounds=i.getBoundingClientRect()},onDragMove:function(t){var n=i.firstChild,o=i.lastChild;t.position.x<e.sceneListBounds.left?n!==e._cloneDragEl&&(e._dropNodeModelId=n.dataset.modelId,i.insertBefore(e._cloneDragEl,n)):t.position.x>e.sceneListBounds.left+e.sceneListBounds.width&&o!==e._cloneDragEl&&(e._dropNodeModelId=o.dataset.modelId,i.appendChild(e._cloneDragEl))}});this._dropZones.push({dropZone:n,node:t})},renderAddSceneCell:function(){var e=h.template(a),t=e({addTitle:u.get("addSceneBtnTitle"),chevronTitle:u.get("addSceneChevronBtnTitle")});this.$addSceneCell=c(t),this.$sceneSequencer.after(this.$addSceneCell),this._scaleCell(this.$addSceneCell,this.controller.model.layout.pageSize);var i=this.$addSceneCell.find(".addContainer");o.setIcon(i,_.default.id),i.on("click",this.onAddSceneClick.bind(this));var n=this.$addSceneCell.find(".chevron");o.setIcon(n,y.default.id),n.on("primaryaction",this.onAddSceneOverflowClick.bind(this))},onSceneLabelChange:function(e){var t=this._getSceneSelector(e.id);this._getTitleEl(t).textContent=e.get("title")||"",this.middleShortenSceneTitle(t)},middleShortenSceneTitle:function(e){var t=this._getTitleEl(e);i.middleShortenString(t)},_getTitleEl:function(e){return this.el.querySelector(e+" .pageTitle")},onShowOverviewsChanged:function(){this.updateOverviewButton()},updateOverviewButton:function(e){if(this.controller.showAuthoringOverview()){this._$overviewStart?e&&this._updateOverviewIcon(this.$el.find(".overview.start .layoutIcon"),-1):(this._$overviewStart=this._renderOverviewButton(-1),this.$el.prepend(this._$overviewStart),this._scaleCell(this._$overviewStart,this.controller.model.layout.pageSize));var t=this._$overviewStart.find(".sceneSubContainer .pageInfo");this.controller.showStartOverview()?t.show():t.hide()}else this._$overviewStart&&(this._$overviewStart.remove(),this._$overviewStart=null);this.controller.showEndOverview()?this._$overviewEnd?e&&this._updateOverviewIcon(this.$el.find(".overview.end .layoutIcon"),-2):(this._$overviewEnd=this._renderOverviewButton(-2),this.$el.append(this._$overviewEnd),this._scaleCell(this._$overviewEnd,this.controller.model.layout.pageSize)):this._$overviewEnd&&(this._$overviewEnd.remove(),this._$overviewEnd=null)},_renderOverviewButton:function(e){var t=this._getOverviewLabel(e);this.overviewCellTemplate||(this.overviewCellTemplate=h.template(l));var i=this.overviewCellTemplate({title:t,selected:e===this.controller.getSelectedSceneIndex(),index:this._getOverviewIndex(e)}),n=c(i);return-1===e?n.addClass("start").on("primaryaction",this.onOverviewStartClick.bind(this)):-2===e&&n.addClass("end").on("primaryaction",this.onOverviewEndClick.bind(this)),this._updateOverviewIcon(n.find(".layoutIcon"),e),n},_getOverviewLabel:function(e){return-1===e?u.get("sceneListStart"):-2===e?u.get("sceneListEnd"):u.get("overviewBtnLabel")},_getOverviewIndex:function(e){var t=this.$sceneList.children(),i=null;return-1===e?i=0:-2===e&&(i=t.length+1),i},_updateOverviewIcon:function(e,t){var i=this.controller.getNavModel(),n=i.indexOf("panAndZoom")>=0?"dashboard-"+i:null,s=this._getOverviewLabel(t);n&&(e.empty(),o.setIcon(e,n,s))},remove:function(){var e=this;if(this.controller){this.controller.off("change:pageSize",this.onPageSizeChange,this),this.controller.off("change:showOverviews",this.onShowOverviewsChanged,this),this.controller.off("layoutType:changed",this.onLayoutTypeChanged,this),this.controller.off("mode:change",this.onModeChanged,this),this.controller.off("scene:add",this.onSceneAdded,this),this.controller.off("scene:collapse",this.onSceneCollapse,this),this.controller.off("scene:expand",this.onSceneExpand,this),this.controller.off("scene:remove",this.onSceneRemoved,this),this.controller.off("scene:select",this.onSceneSelected,this);(this.controller.getScenes()||[]).forEach(function(t){t.off("change:title",null,e)}),this.controller.model&&this.controller.model.off("change:layout",this.onChangeLayout,this)}this.timelineController.off("scene:reorder",this.onSceneReorder,this),this.canvasController&&this.canvasController.addRemoveNotifier&&(this.canvasController.addRemoveNotifier.off("widget:addDone",this.onWidgetAdded,this),this.canvasController.addRemoveNotifier.off("widget:removeDone",this.onWidgetRemoved,this)),this._dropZones&&(this._dropZones.forEach(function(t){t.dropZone&&t.node&&(t.dropZone.remove(),t.node!==e.el&&t.node.parentNode.removeChild(t.node))}),this._dropZones=[]),T.inherited("remove",this,arguments)},onAddSceneClick:function(){var e=this;this.controller.addScene().catch(function(t){e.logger.error("Unable to add new scene to story",t)})},onSceneClick:function(e){e.stopPropagation(),this._closeFlyout();var t=this.$sceneList.children().index(e.currentTarget),i=e.currentTarget.dataset.modelId;this.controller.selectScene({index:t,modelId:i})},onOverviewStartClick:function(e){e.stopPropagation(),this.controller.selectScene({index:-1})},onOverviewEndClick:function(e){e.stopPropagation(),this.controller.selectScene({index:-2})},onExpandSceneClick:function(e){e.stopPropagation(),this.controller.expandScene()},onModeChanged:function(e){this._toggleModeChanged(e.authoring),this.updateOverviewButton()},onSceneAdded:function(e){this._addScene(e.scene,e.index,e.insertBefore),this._refreshCellPageNumbers()},onSceneRemoved:function(e){this._removeScene(e.id),this._refreshCellPageNumbers(),this.updateOverviewButton()},onSceneSelected:function(e){this._selectScene(e),this._refreshTimeline()},onSceneExpand:function(e){this._expandScene(this.$sceneList.children().eq(e.index))},onSceneCollapse:function(e){this._collapseScene(this.$sceneList.children().eq(e.index))},onLayoutTypeChanged:function(){this.updateOverviewButton(!0)},onPageSizeChange:function(e){var t=this;this.$sceneList.children().each(function(i,n){t._scaleCell(c(n),e)}),this._scaleCell(this.$addSceneCell,e),this._$overviewStart&&this._scaleCell(this._$overviewStart,e),this._$overviewEnd&&this._scaleCell(this._$overviewEnd,e)},onSceneContextMenu:function(e){3===e.which&&this.onSceneOverflowClick(e)},onSceneOverflowClick:function(e){if(e.stopPropagation(),this.preventContext||!this.controller.isAuthoring())this.preventContext=!1;else{if(this._flyout)return void this._closeFlyout();var t=c(e.currentTarget).closest("[data-model-id]"),i=t.data("modelId"),n={name:this.controller.getScene(this.controller.getSceneIndex(i)).get("title"),type:"Scene",allowEmpty:!0,id:d.uniqueId("renameDialog")},o=new g(n,function(e){this.controller.renameScene(i,e)}.bind(this)),s=function(){o.open()},r=e.currentTarget;r.parentNode.id===i+"_tablabel"&&(r=r.parentNode),this.$el.append(this.flyoutHolder),this._flyout=C.createElement(p.SceneCellFlyout,{sceneId:i,controller:this.controller,anchorElement:r,closeFlyout:this._closeFlyout.bind(this),renameDialog:s}),x.render(this._flyout,this.flyoutHolder)}},onAddSceneOverflowClick:function(e){var t=e.currentTarget.children[0],i={target:e.currentTarget,onOpen:function(){t.setAttribute("class","svgIcon selected")},onClose:function(){t.setAttribute("class","svgIcon"),this._closeFlyout()}.bind(this)};this._flyout?i.onClose():this._showContextMenu(i)},_showContextMenu:function(e){this.preventContext||!this.controller.isAuthoring()?this.preventContext=!1:this.controller.isAuthoring()&&(this.$el.append(this.flyoutHolder),this._flyout=C.createElement(p.AddSceneFlyout,{anchorElement:e.target,closeFlyout:e.onClose,onOpen:e.onOpen,onLayoutSelection:this.controller.addScene.bind(this.controller),stringResources:this.services.getSvcSync(".StringResources"),sceneLayoutListing:JSON.parse(f).sceneLayouts}),x.render(this._flyout,this.flyoutHolder))},_closeFlyout:function(){this._flyout&&(x.unmountComponentAtNode(this.flyoutHolder),this.$el.find(".flyout-holder").remove(),this._flyout=null,this.preventContext=!1)},onSceneReorder:function(e){var t=function(e,t){if(e!==t){var i=e.parentNode,n=i.insertBefore(document.createTextNode(""),e);i.insertBefore(e,t),i.insertBefore(t,n),i.removeChild(n)}},i=e.model.getParent().items;d.each(i,function(e,i){var n=this.$sceneList.children().eq(i),o=this.$sceneList.find(this._getSceneSelector(e.id));t(o[0],n[0])},this),this.$sceneList.find("#"+e.model.id+"_tablabel>.expandScene").find(".coachMark").remove(),this._refreshCellPageNumbers()},onSceneDragStart:function(e){!n.isPointerTouch(e)&&this.controller.isAuthoring()&&this._startReorderScenes(e)},onSelectedSceneHold:function(e){e.currentTarget.classList.contains("selected")&&this.controller.isAuthoring()&&(this._shakeOnHold(e.currentTarget),this._startReorderScenes(e))},_startReorderScenes:function(e){var i=this,o=e.currentTarget,s=c(o),r=this._makeAvatar(s);this._cloneDragEl=r[0].cloneNode(),this._cloneDragEl.classList.remove("sceneMoveAvatar"),this._cloneDragEl.classList.add("scenePlaceholder"),this._dragModelIndex=this.controller.getSceneIndex(e.currentTarget.dataset.modelId);var a=this.controller.getSceneById(e.currentTarget.dataset.modelId),l=o.classList.contains("selected"),d=s.offset(),h=n.getEventPos(e),u=d.top-h.pageY,g=d.left-h.pageX;this.dndManager.startDrag({event:e,type:"sceneCell",data:a,avatar:r[0],moveXThreshold:20,avatarYOffset:u,avatarXOffset:g,restrictToXAxis:!0,callerCallbacks:{onDragStart:function(){i.$el.addClass("noScroll"),i._dropNodeModelId=null,i.$sceneList[0].insertBefore(i._cloneDragEl,o),o.style.display="none",o.classList.remove("selected"),o.classList.remove("shake")},onDragDone:function(){if(i._dropNodeModelId){var e=i.controller.getSceneIndex(i._dropNodeModelId),n=i.controller.getSceneById(i._dropNodeModelId);i.beforeModelId=n.getNextSiblingId(),i._dragModelIndex>e&&(i.beforeModelId=n.id)}return i.$sceneList[0].insertBefore(o,i._cloneDragEl),t.isIE11()?i.$sceneList[0].removeChild(i._cloneDragEl):i._cloneDragEl.remove(),o.style.display="",l&&o.classList.add("selected"),i.el.classList.remove("noScroll"),i._dropNodeModelId&&i.controller.moveViewBefore(a,i.beforeModelId),i.beforeModelId=null,i._cloneDragEl=null,i._dropNodeModelId=null,!0}}})},_makeAvatar:function(e){var t=e.clone().addClass("sceneMoveAvatar"),i=t[0];return i.removeAttribute("id"),i.removeAttribute("tabindex"),i.removeAttribute("role"),i.removeAttribute("data-model-id"),t.find(".overflow").remove(),t.find(".expandScene").remove(),t.find(".pageInfo").remove(),document.body.appendChild(i),t},onWidgetAdded:function(e){var t=this._getWidgetSceneId(e.id);this._widgetIndicated(t)},onWidgetRemoved:function(e){var t=this._getWidgetSceneId(e.id);this._widgetIndicated(t)},_getWidgetSceneId:function(e){var t=void 0;if(this.controller&&this.controller.model){var i=this.controller.model.layout.findTopLevelParentItem(e);i&&(t=this.controller.getSceneIndex(i.id)>-1?i.id:null)}return t},_widgetIndicated:function(e){var t;e?(t=this.controller.isScenePopulated(e),this.$el.find(this._getSceneSelector(e)+" .widgetIndicator").toggleClass("widgetIndicated",t)):(t=this.timelineController.getTimelineEpisodeCount()>0,this.$el.find(".scene.selected .widgetIndicator").toggleClass("widgetIndicated",t))},_widgetIndicatedMove:function(e,t){this._widgetIndicated();var i=this.controller.isScenePopulated(e);t.find(".widgetIndicator").toggleClass("widgetIndicated",i)},_findTopLevelParentItem:function(e){var t=[];if(e&&e.parameter&&e.parameter.updateArray){var i=e.parameter.updateArray;t=d.map(i,function(e){var t=this.controller.model.layout.findTopLevelParentItem(e.parentId);return t&&t.id&&!this.controller.isOverview()?t.id:e.parentId}.bind(this))}return t},onChangeLayout:function(e){this._updateWidgetIndicator(e),this.timelineView&&this._showTimeline(0)},_updateWidgetIndicator:function(e){var t=this._findTopLevelParentItem(e.prevValue),i=this._findTopLevelParentItem(e.value);if(0!==t.length&&0!==i.length&&0===d.intersection(t,i).length){for(var n=0;n<t.length;n++)this._widgetIndicated(t[n]);for(n=0;n<i.length;n++)this._widgetIndicated(i[n])}},_toggleModeChanged:function(e){this.$el.toggleClass("authoring",e);var t=this.$el.find(".addScene");e?0===t.length&&this.renderAddSceneCell():t.off().remove(),!e&&this.timelineView&&this.controller.collapseScene()},_getSceneSelector:function(e){return"#"+e+"_tablabel"},_addScene:function(e,t,i){var n=this.renderSceneCell(e,t);i?this.$sceneList.find(this._getSceneSelector(i)).before(n):this.$sceneList.find(".scene:last-child").after(n),this._addExpandSceneCoachmark()},_removeScene:function(e){this.forceReFocus=!0;var t=this._getSceneSelector(e),i=this.$sceneList[0].querySelector(t);this._dropZones=this._dropZones.filter(function(e){return e.node!==i||(e.dropZone.remove(),e.node.parentNode.removeChild(e.node),!1)}),this.translationService.deregisterView(e)},_refreshCellPageNumbers:function(){for(var e=this.$sceneList.children(),t=0;t<e.length;t++)e.eq(t).find(".pageNumber")[0].setAttribute("data-index",t+1);var i=this.$el.find(".overview");i.length>=2&&(i.eq(0).find(".pageNumber")[0].setAttribute("data-index",0),i.eq(1).find(".pageNumber")[0].setAttribute("data-index",e.length+1))},_createAnimationDummyDiv:function(){return c("<div />").css({width:"100%",height:"1px",display:"inline-block"})},_expandScene:function(e){var t=this,i=this.$el.scrollLeft(),n=e.position(),o=parseInt(e.css("margin-left"),10),s=e.css("width"),r=e.css("height"),a=e.find(".sceneOverlay, .widgetIndicator"),l=this.enlargeDuration,c=this._createAnimationDummyDiv().appendTo(this.$el);this._removeExpandSceneCoachmark(),this._closeFlyout(),this.$el.scrollLeft(i).css("overflow-x","hidden"),e.addClass("animating"),a.fadeOut(l/3),e.animate({width:this.$el.outerWidth(!0),height:this.$el.outerHeight(!0),opacity:0},{duration:l,complete:function(){t._showTimeline(l/4,function(){t.$el.hide(),e.removeClass("animating"),e.css({width:s,height:r,opacity:1}),a.css("display",""),c.remove()})}}),this.$el.animate({scrollLeft:n.left+o+i},l)},_collapseScene:function(e){var t=this;this.$el.show();var i=this.$el.scrollLeft(),n=this.$el.outerWidth(!0),o=this.$el.outerHeight(!0),s=parseInt(e.css("margin-left"),10),r=e.css("width"),a=e.css("height"),l=this.collapseDuration,c=this._createAnimationDummyDiv().appendTo(this.$sceneList);this.$el.scrollLeft(i),e.addClass("animating"),this.timelineView&&this.timelineView.fadeOut({complete:function(){t.timelineView.remove(),t.timelineView=null},duration:l/4}),e.find(".sceneOverlay, .widgetIndicator").css({transform:"scale(0)",opacity:0}).delay(l).animate({transform:1,opacity:1},{step:function(e,t){"transform"===t.prop&&(this.style.transform="scale("+e+")")},complete:function(){this.style.transform=null,this.style.opacity=null},duration:l/2}),e.css({width:n,height:o,opacity:0}),i=this.$el.scrollLeft(),this.$el.scrollLeft(e.position().left+s+i),e.animate({width:r,height:a,opacity:1},{duration:l,complete:function(){e.removeClass("animating"),t.$el.css("overflow-x","auto"),c.remove()}}),this.$el.animate({scrollLeft:i-parseInt(this.$sceneList.css("margin-left"),10)},l)},_refreshTimeline:function(){var e=this;this.timelineView&&this.timelineView.fadeOut({complete:function(){e.timelineView&&e._showTimeline(e.enlargeDuration/4)}})},_showTimeline:function(e,t){if(this.timelineView&&(this.timelineView.remove(),this.timelineView=null),null!==this.timelineController.getCurrentScene())this._createTimeline(),this.timelineView.renderFadeIn({complete:t,duration:e});else{var i=this.controller.currentSceneIndex;-1===i?i=0:-2===i&&(i=this.controller.getSceneCount()-1),this._collapseScene(this.$sceneList.children().eq(i))}},_createTimeline:function(){var e=document.createElement("div");this.contentEl.appendChild(e),this.timelineView=new m({el:e,storyController:this.controller,controller:this.timelineController,dashboardApi:this.dashboardApi,dndManager:this.dndManager,glassContext:this.glassContext,services:this.services})},_removeExpandSceneCoachmark:function(){var e=c(".expandScene.coachMarkContainer");if(e.find(".coachMark:visible").length){var t=e.attr("id");this.dashboardApi.getGlassCoreSvc(".CoachMarkService").getPersistence().marksAsRead(t),e.find(".coachMark").hide()}},_addExpandSceneCoachmark:function(){var e=this.$sceneList.find(".expandScene").first(),t={id:"com.ibm.bi.dashboard.filmstrip.expandScene",domElement:e[0],title:u.get("expandSceneCoachmarkTitle"),contents:u.get("expandSceneCoachmarkContents")};return this.dashboardApi.prepareGlassOptions(t),this.dashboardApi.getFeature("CoachMark").addCoachMark(t)},_addOverviewSceneCoachmark:function(){var e=this.$el.find(".overview").first();if(1===e.length){var t={id:"com.ibm.bi.dashboard.filmstrip.overview",domElement:e[0],title:u.get("overviewCoachmarkTitle"),contents:u.get("overviewCoachmarkContents")};this.dashboardApi.prepareGlassOptions(t);return this.dashboardApi.getFeature("CoachMark").addCoachMark(t)}return Promise.resolve()},_selectScene:function(e){this._closeFlyout();var t=e.scene&&e.scene.id;if(t){var i=void 0;if(i="start"===t||"end"===t?this.$el.find(".overview."+t):this.$sceneList.find(this._getSceneSelector(t)),1===i.length){this.$el.find(".overview.selected, .scene.selected").removeClass("selected").attr("tabindex",-1),i.addClass("selected").attr("tabindex",0),(this.forceReFocus||c.contains(this.el,document.activeElement)&&i.is(":visible"))&&(i.focus(),this.forceReFocus=!1);var n=this._getSceneScrollPosition(i);this.$el.scrollLeft(n.scrollLeft).animate({scrollLeft:n.position},400)}}},_shakeOnHold:function(e){this._closeFlyout(),this.preventContext=!0,e.classList.add("shake"),this.el.classList.add("noScroll"),c(e).one("mouseup touchup",function(){e.classList.remove("shake"),this.el.classList.remove("noScroll"),this.preventContext=!1}.bind(this))},_wrapEvent:function(e){return{code:e.keyCode||e.charCode,modifier:e.ctrlKey||e.metaKey,altKey:e.altKey,shiftKey:e.shiftKey,originalEvent:e}},onKeydown:function(e){var t=this._wrapEvent(e);if(this._shouldMoveSceneLeft(t))this._moveSceneLeft(this._getSceneIdFromElement(e));else if(this._shouldMoveSceneRight(t))this._moveSceneRight(this._getSceneIdFromElement(e));else if(this._shouldNavigateLeft(t))this.controller.previousScene();else if(this._shouldNavigateRight(t))this.controller.nextScene();else if(this._shouldShowContextMenu(t))this.onSceneOverflowClick(e);else if(this._shouldDeleteScene(t))this.controller.deleteScene(this._getSceneIdFromElement(e));else if(this._shouldPerformEnter(t))c(e.target).click();else if(this._shouldPerformExpand(t))this.controller.expandScene();else{if(!this._shouldPerformTogglePlayPause(t))return;this.controller.togglePlayPause()}e.stopPropagation(),e.preventDefault()},_getSceneIdFromElement:function(e){return e.currentTarget.dataset.modelId},_shouldMoveSceneLeft:function(e){return e.modifier&&(37===e.code||38===e.code)},_shouldMoveSceneRight:function(e){return e.modifier&&(39===e.code||40===e.code)},_shouldNavigateLeft:function(e){return 37===e.code||38===e.code},_shouldNavigateRight:function(e){return 39===e.code||40===e.code},_shouldDeleteScene:function(e){var t=this._getSceneIdFromElement(e.originalEvent),i=t&&this.controller.isAuthoring()&&this.controller.getSceneCount()>1,n=46===e.code||8===e.code,o=!e.modifier&&!e.altKey;return n&&o&&i},_shouldShowContextMenu:function(e){return e.shiftKey&&121===e.code},_shouldPerformEnter:function(e){return 13===e.code&&!c(e.originalEvent.target).hasClass("coachMark")},_shouldPerformExpand:function(e){return 121===e.code},_shouldPerformTogglePlayPause:function(e){return 32===e.code},_moveSceneLeft:function(e){this.controller.isAuthoring()&&e&&this.controller.moveSceneLeft(e)},_moveSceneRight:function(e){this.controller.isAuthoring()&&e&&this.controller.moveSceneRight(e)},_getSceneScrollPosition:function(e){var t=this.$el.scrollLeft(),i=e.position(),n=parseInt(e.css("margin-left"),10),o=this.$el.outerWidth(),s=i.left,r=i.left+e.outerWidth(!0);return s<0?s+=t-n-30:s=r>o?t+n+30+(r-o):t,e.index()===this.$sceneList.children().length-1&&(s+=2*e.width()),{position:s,scrollLeft:t}}});return T}),function(e,t){
- if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define("storytelling/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/catalog_32",["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"],t);else{var i=t("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"):e["@ba-ui-toolkit/ba-graphics/dist/icons-js/ba-graphics-icons-commons.js"]);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}("undefined"!=typeof self?self:this,function(e){return webpackJsonPBaGraphics([1511],{"08a643d7fc7720e9457a":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("3865314c5959606874d4"),o=(i.n(n),i("e9e00e251cd62b5bba01"));t.default=o.a},"3865314c5959606874d4":function(t,i){t.exports=e},e9e00e251cd62b5bba01:function(e,t,i){"use strict";var n=i("9689a9c94ae38b47fa2c"),o=i.n(n),s=i("9ce58a7deea14f49ef01"),r=i.n(s),a=new o.a({id:"catalog_32_v6",use:"catalog_32_v6-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="catalog_32_v6"><path d="M26 2H8a2 2 0 00-2 2v4H4v2h2v5H4v2h2v5H4v2h2v4a2 2 0 002 2h18a2 2 0 002-2V4a2 2 0 00-2-2zm0 26H8v-4h2v-2H8v-5h2v-2H8v-5h2V8H8V4h18z" /><path d="M14 8h8v2h-8zm0 7h8v2h-8zm0 7h8v2h-8z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});r.a.add(a),t.a=a}},["08a643d7fc7720e9457a"])}),define("storytelling/views/StoryPaneView",["baglass/core-client/js/core-client/ui/core/View","text!./templates/StoryPaneView.html","./FilmStripView","../nls/StringResources","../lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/catalog_32"],function(e,t,i,n,o){var s=e.extend({templateString:t,init:function(e){s.inherited("init",this,arguments),this.dashboardApi=e.dashboardApi,this.services=e.services,this.minimumSize=200},initialize:function(){return this._setupEvents()},_setupEvents:function(){var e=this;return this.dashboardApi.getDashboardSvc(".LifeCycleManager").then(function(t){t.registerLifeCycleHandler("post:dashboard.focus",function(){e.dashboardApi.getCurrentContentView().isAuthorMode()&&e.trigger("openPane")}),t.registerLifeCycleHandler("post:mode.edit",function(){e.trigger("openPane")}),e.dashboardApi.on("widget:maximize",e._disableAndSwitchHandlerListener,e),e.dashboardApi.on("widget:restore",e._restoreHandlerListener,e)})},_disableAndSwitchHandlerListener:function(){this.trigger("disableAndSwitchHandle")},_restoreHandlerListener:function(){this.trigger("restoreHandle")},getSplitterOpts:function(){return Promise.resolve({handleClass:"storyHandle",handleIcon:o.default.id,handleOpenTitle:n.get("filmstripHandleOpenLabel"),handleCloseTitle:n.get("filmstripHandleCloseLabel"),hidden:!1,view:this,initialSize:200,overrideGlobalMaxSize:200})},render:function(){var e=this.dotTemplate();return this.$el.addClass("storytelling blockOnExpandView").html(e),this._createFilmStrip()},remove:function(){this.filmStripView&&this.filmStripView.remove(),this.dashboardApi.off("widget:maximize",this._disableAndSwitchHandlerListener,this),this.dashboardApi.off("widget:restore",this._restoreHandlerListener,this),s.inherited("remove",this,arguments)},_createFilmStrip:function(){var e=this,t=document.createElement("div");return this.el.querySelector(".content").appendChild(t),Promise.all([this.dashboardApi.getDashboardSvc(".DndManager"),this.dashboardApi.getDashboardSvc(".StoryPaneService")]).then(function(n){var o=n[0],s=n[1];return e.filmStripView=new i({el:t,dashboardApi:e.dashboardApi,controller:s,dndManager:o,glassContext:e.services.biGlass.glassContext,services:e.services}),e.filmStripView.render()})}});return s}),define("text!storytelling/glass/templates/ExportView.html",[],function(){return'<div class="saveAsView"><div class="selectFolderView"></div><div class="fileNameSection"><div class="saveAsLabel">{{!it.saveAsLabel}}</div><input class="fileName" type="text" value="{{!it.defaultNameValue}}" aria-label="{{!it.saveAsLabel}}" tabindex="0"></div><div class="loadAfterExportContainer propertyUIControl"></div></div>'}),define("storytelling/glass/ExportView",["bacontentnav/ui/views/SaveAsView","baglass/core-client/js/core-client/ui/properties/CheckBox","text!./templates/ExportView.html","../nls/StringResources"],function(e,t,i,n){var o=e.extend({templateString:i,events:{},init:function(){o.inherited("init",this,arguments)},render:function(){o.inherited("render",this,arguments),this._oLoadCheckBox=new t({id:"load_after_export",el:this.$(".loadAfterExportContainer"),name:"loadAfterExport",label:n.get("loadAfterExportLabel"),ariaLabel:n.get("loadAfterExportLabel"),checked:!0,controlOnLeft:!0}),this._oLoadCheckBox.doRender()},getLoadAfterExport:function(){return this._oLoadCheckBox.isChecked()},remove:function(){this._oLoadCheckBox.remove(),o.inherited("remove",this,arguments)}});return o}),define("storytelling/glass/ExportToStoryDialog",["bacontentnav/ui/dialogs/SaveAsDialog","storytelling/nls/StringResources","./ExportView","underscore"],function(e,t,i,n){var o=e.extend({init:function(e){this.options=e,this.options.service=this.options.service||{},this.options.service.save=this.onSave.bind(this);var s=n.defaults(this.options,{buttons:[{text:t.get("exportLabel"),handler:this.ok.bind(this),type:"primary",defaultId:"save_button"},"cancel"],viewClass:i,className:"exportToStoryDialog",id:"exportDialogTitle",title:t.get("exportDialogTitle")});o.inherited("init",this,[s])},onOpen:function(){o.inherited("onOpen",this),this._container().find("footer").attr("role","contentinfo").attr("aria-label",t.get("exportDialogFooter"))},onSave:function(e,t,i,n){return this.options.service.export(e,t,i,n,this.view.getLoadAfterExport())}});return o}),define("storytelling/baseBundle",function(){});
|