/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2018 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2018 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

define("pdmplugins/activity-badge/js/ac-activity-badge",["plugins-common/ac-plugins"],function(t){var e=t.ActivityBadge;return e||(e=t.ActivityBadge={}),e.PLUGIN_ID||(e.PLUGIN_ID="activity_badge"),e}),define("pdmplugins/activity-badge/js/ops/op-factory",["core/ac-core-init","pdmplugins/activity-badge/js/ac-activity-badge"],function(t,e){e.OpFactory=t.Op.extend({create:function(t,i){var n=e[t];return n?new n(i):void LOG(0,"AcActivityBadge.OpFactory.create: Unrecognized class: "+t)}})}),define("pdmplugins/activity-badge/js/templates/activity-badge-template",[],function(){var t='<div id="root" style="position:fixed; width: 100%"><div class="unc-container"><div class="spectrum spectrum--light"><div class="unc-overlay-container"><div class="spectrum-Popover spectrum-Popover--dialog spectrum-Dialog--default is-open notifications-widget notifications-widget-light en_US" offset="0" style="position: absolute; top: 0px;"><div class="spectrum-Dialog-content ui-theme bell-background-theme"><div class="notifications-data-wrapper"><div class="welcome-section"></div><div class="banner-header-section"><div class="scroll-top-button hide"><button class="spectrum-Button spectrum-Button--cta"><svg viewBox="0 0 48 48" focusable="false" aria-hidden="true" role="img" class="spectrum-Icon spectrum-Icon--sizeXS scroll-top-icon"><path d="M32 22v22a2 2 0 0 1-2 2H18a2 2 0 0 1-2-2V22H7.481a1 1 0 0 1-.707-1.707L24 3.067l17.226 17.226A1 1 0 0 1 40.519 22z"></path></svg><span></span></button></div></div><div class="requests-section hide"></div><div class="notifications-section hide"></div><div class="tab-end key-focus" tabIndex="-1"></div></div></div></div></div></div></div></div>';return t}),define("pdmplugins/activity-badge/js/templates/requests-template",[],function(){var t='<div class="notifications-container"><div class="notifications-title notifications-accordion notifications-title-fixed-top ui-theme bell-header-theme bell-border-theme" id="requestHeader"tabIndex="0" aria-label="<%= requestsHeading %>" ><span class="ui-theme bell-dark-text"><b><%= requestsHeading %></b></span></div><div class="normal-notifications-container" id="requestBody"></div><div class="notifications-title notifications-accordion requests-show-more hide ui-theme bell-show-more-background bell-border-theme bell-blue-text"  id="showMoreRequestsButton" tabIndex="0" aria-label="<%= showMore %>" ><span id="showMoreRequestsButtonText"><%= showMore %></span></div></div>';return t}),define("pdmplugins/activity-badge/js/templates/cta-notification-template",[],function(){var t='<div class="notification-container ui-theme bell-notification-theme bell-border-theme" tabIndex="<%= tabIndex %>"aria-label="<%= message_text %>. <%= document %>. <%= deadline %>. <%= action %>. <%= timestamp %>. <%= pressEnter %>"><div class="invite-comment-timeline"><div class="avatar"><div class="image-container"><img class="avatar-icon" src= <%= avatar %>></div></div><div class="notification-body"><div class="content ui-theme bell-theme-text" title = "<%= message_text %>"><div> <%= message %> </div></div><div class="comment-container ui-theme bell-comment-theme bell-comment-container-border-theme"><div class="comment-icon bell-thumbnail-border-theme"><div role="img" class="collection-item-thumb <%= iconCls %>"></div><img class="thumbnail-preview hide"></div><div class="comment-content"><div class="content-text ui-theme bell-dark-text-no-hover" title = "<%= document %>"><span><%= document %></span></div><div class="action-container"><div class="action-content"><div class="deadline-container ui-theme bell-dark-text-no-hover"><span title="<%= deadline %>"><%= deadline %></span></div><div class="buttons-container"><button class="cta-button spectrum-Button spectrum-Button--quiet--primary ui-theme bell-button-theme"  tabIndex="-1"><span class="spectrum-Button-label ui-theme bell-button-text" title="<%= actionLabel %>"><%= action %></span></button></div></div></div></div></div><div class="time-string ui-theme bell-timestamp-text"><span><%= timestamp %></span></div></div></div></div>';return t}),define("pdmplugins/activity-badge/js/nls/ui-strings",{root:!0,"xx-xx":!0,"ar-ae":!0,"ca-es":!0,"cs-cz":!0,"da-dk":!0,"de-de":!0,"en-ae":!0,"en-gb":!0,"en-il":!0,"es-es":!0,"eu-es":!0,"fi-fi":!0,"fr-fr":!0,"fr-ma":!0,"he-il":!0,"hr-hr":!0,"hu-hu":!0,"it-it":!0,"ja-jp":!0,"ko-kr":!0,"nb-no":!0,"nl-nl":!0,"pl-pl":!0,"pt-br":!0,"ro-ro":!0,"ru-ru":!0,"sk-sk":!0,"sl-si":!0,"sl-sl":!0,"sv-se":!0,"tr-tr":!0,"uk-ua":!0,"zh-cn":!0,"zh-tw":!0,"bg-bg":!0}),define("pdmplugins/activity-badge/js/nls/root/ui-strings",{REQUESTS:"REQUESTS",NOTIFICATIONS:"NOTIFICATIONS",NO_NOTIFICATIONS:"No Notifications",SHOW_MORE:"Show More",MARKUP_ADDED:"Markup added",NO_NOTIFICATIONS_HEADING:"Your notifications will appear here.",NO_NOTIFICATIONS_SUBHEADING:"You'll get updates about files shared for viewing, comments, and signature.",UNREAD_NOTIFICATION:"<%= count %> Unread Notification",UNREAD_NOTIFICATIONS:"<%= count %> Unread Notifications",SIGN:"Sign",APPROVE:"Approve",FILL:"Fill",FILL_FORM:"Fill Form",ACKNOWLEDGE:"Acknowledge",DELEGATE:"Delegate",CLOSE:"Close",ACCEPT:"Accept",VIEW:"View",REVIEW:"Review",OPEN:"Open",VIEW_SIGN:"View & Sign",VIEW_APPROVE:"View & Approve",VIEW_FILL:"View & Fill Form",VIEW_ACKNOWLEDGE:"View & Acknowledge",VIEW_DELEGATE:"View & Delegate",VIEW_ACCEPT:"View & Accept",SIGNED:"Signed",E_SIGNED:"e-Signed",APPROVED:"Approved",FILLED:"Filled",ACKNOWLEDGED:"Acknowledged",DELEGATED:"Delegated",ACCEPTED:"Accepted",VIEW_SIGN_LABEL:"View & Sign this agreement",VIEW_APRROVE_LABEL:"View & Approve this agreement",VIEW_DELEGATE_LABEL:"View & Delegate this agreement",VIEW_ACKNOWLEDGE_LABEL:"View & Acknowledge this agreement",VIEW_ACCEPT_LABEL:"View & Accept this agreement",VIEW_FILL_FORM_LABEL:"View & Fill this agreement",SIGN_DOC_RECEIVED:"<b><%= sender %></b> shared a document for you to <%= action %>",SIGN_EMAIL_VIEWED:"Email for <b><%= document %></b> was opened by <b><%= signer %></b>",SIGN_DOC_SIGNED:"<b><%= document %></b> was <%= action %> by <b><%= signer %></b>",SIGN_EXPIRED_SENDER_ONE_SIGNER:"The deadline for <b><%= document %></b> waiting for <b><%= signer %></b> has expired <%= deadline %>",SIGN_EXPIRED_SENDER_MANY_SIGNERS:"The deadline for <%= document %> waiting for <b><%= signer %></b> and others has expired <%= deadline %>",SIGN_EXPIRED_SIGNER:"The deadline for you to <%= action %> <b><%= document %></b> from <b><%= sender %></b> has expired",SIGN_EMAIL_BOUNCED:"Email to <b><%= signer %></b> to <%= action %> <b><%= document %></b> bounced. Please check the email address.",SIGN_CANCELLED_SIGNER:"<b><%= sender %></b> has cancelled <b><%= document %></b>",SIGN_REMINDER_SIGNER:"Reminder: <b><%= sender %></b> is waiting for you to <%= action %> <b><%= document %></b>",SIGN_REMINDER_DEADLINE_SIGNER:"Reminder: <b><%= sender %></b> is waiting for you to <%= action %> <b><%= document %></b> by <%= deadline %>",SIGN_DOC_DECLINED:"<b><%= document %></b> was declined by <b><%= signer %></b>",SIGN_DELEGATE:"<b><%= document %></b> was delegated by <b><%= delegator %></b> to <b><%= delegatee %></b>",FILL_SIGN_DOC_RECEIVED:"<b><%= signer %></b> filled, e-signed, and sent you <%= document %>",FILL_SIGN_DOC_OPENED:"Email for <%= document %> was opened by <b><%= signer %></b>","S&T_DOC_RECEIVED":"<%= sender %> shared a copy of <%= document %>  with you","S&T_DOC_OPENED":"<%= document %> was opened and viewed by <%= recipient %>","S&T_DOC_DOWNLOADED":"<%= document %> was downloaded by <%= recipient %>",EUREKA_DOC_RECEIVED:"<b><%= sender %></b> shared a document for you to review by <%= time %> on <%= date %>",EUREKA_DOC_RECEIVED_NO_DEADLINE:"<b><%= sender %></b> shared a document for you to review",FEW_SECONDS_AGO:"Few seconds ago",ONE_MINUTE_AGO:"1 minute ago",N_MINUTES_AGO:"<%= n %> minutes ago",ONE_HOUR_AGO:"1 hour ago",N_HOURS_AGO:"<%= n %> hours ago",ONE_DAY_AGO:"1 day ago",N_DAYS_AGO:"<%= n %> days ago",DUE_DATE:"Due <%= date %>",PRESS_ENTER_SPACE:"Press Space or Enter to open the document."}),define("pdmplugins/activity-badge/js/constants/css-constants",{NOTIFICATIONS_WRAPPER_SECTION:".notifications-data-wrapper",WELCOME_SECTION:".welcome-section",REQUESTS_SECTION:".requests-section",NOTIFICATIONS_SECTION:".notifications-section",NORMAL_NOTIFICATIONS_CONTAINER:".normal-notifications-container",NOTIFICATIONS_CONTAINER:".notifications-container",NOTIFICATION_CLICK_AREA:".notification-container",NOTIFICATION_BOX:".notification-container",SPINNER:".widget-wait",NEW_NOTIFICATION_CLASSNAME:"new-notification",TIMESTAMP:".time-string span",THUMBNAIL_DEFAULT_ICON:".comment-icon .collection-item-thumb",THUMBNAIL_IMG:".comment-icon .thumbnail-preview",AVATAR_IMG:".avatar-icon",TAB_END:".tab-end",SCROLL_TOP_BUTTON:".scroll-top-button",SCROLL_TOP_BUTTON_TEXT:".scroll-top-button >button >span",REQUEST_BODY_ID:"#requestBody",ARROW_KEY_FOCUS:".notification-container:visible, *[tabindex = 0]:visible, .key-focus",TAB_ORDER:"*[tabindex = 0]:visible"}),define("pdmplugins/activity-badge/js/constants/enum-constants",{EMPTY_STATE:0,ONLY_NOTIFICATIONS:1,ONLY_REQUESTS:2,BOTH_REQUESTS_AND_NOTIFICATIONS:3,NOTIFICATION_SECTION:10,REQUEST_SECTION:11,NEW:20,HISTORICAL:21,COMMENT_TEMPLATE:30,INFO_TEMPLATE:31,CTA_TEMPLATE:32,NO_TEMPLATE:39,EUREKA_WORKFLOW:40,SIGN_WORKFLOW:41,SEND_AND_TRACK_WORKFLOW:42,ANS_DATATYPE:50,DATA_MODEL_DATATYPE:51,ACCORDION_DEFAULT:60,ACCORDION_EXPANDED:61}),define("pdmplugins/activity-badge/js/constants/string-constants",{newNotificationEvent:"custom:newNotificationsEvent",historicalNotificationEvent:"custom:historicalNotificationsEvent",workflowDataEvent:"custom:fetchWorkflowDataEvent",clearDataEvent:"custom:clearNotificationsEvent",popupStateChangeEvent:"custom:popupStateChangeEvent",setEndOfNotificationsEvent:"custom:setEndOfNotificationsEvent",setEndOfRequestsEvent:"custom:setEndOfRequestsEvent",updateNotificationStateEvent:"custom:updateNotificationStateEvent",POPUP_OPENED:"POP_OPENED",POPUP_CLOSED:"POP_CLOSED",DM_EUREKA_SERVICE:0,DM_SIGN_SERVICE:1,DM_SEND_AND_TRACK_SERVICE:2,END_OF_NOTIFICATIONS_MARKER:"0",COMMENT_ADD:"com.adobe.redhawk.comment_add",COMMENT_DELETE:"com.adobe.redhawk.comment_delete",COMMENT_MODIFY:"com.adobe.redhawk.comment_modify",COMMENT_REPLY:"com.adobe.redhawk.comment_reply",COMMENT_RESOLVE:"com.adobe.redhawk.comment_resolve",COMMENT_MENTION:"com.adobe.redhawk.comment_mention",REVIEW_FINISHED:"activity.inform.review.participant_status.version1",REVIEW_DEADLINE_REMINDER:"activity.inform.review.deadline_reminder.version1",COMMENT_NOTIFY_HIDDEN:"com.adobe.redhawk.comment_notify",EMAIL_VIEWED_SENDER:"emailViewed.sender.participant",SIGNED_SENDER:"esigned.sender.participant",DELEGATED_SENDER:"delegated.sender.participant",EXPIRED_SENDER:"expired.sender.participant",EXPIRED_TARGET:"expired.target.participant",REMINDER_CREATED_TARGET:"reminderCreated.target.participant",AGREEMENT_EMAIL_BOUNCED_SENDER:"agreementEmailBounced.sender.participant",RECALLED_TARGET:"recalled.target.participant",REJECTED_SENDER:"rejected.sender.participant",SIGNATURE_REQUESTED_SENDER_HIDDEN:"signatureRequested.sender.participant",SIGNATURE_REQUESTED_TARGET:"signatureRequested.target.participant",COMPLETED_EXPOSED_HIDDEN:"completed.exposed.participant",DELEGATED_TARGET_HIDDEN:"delegated.target.participant",REMINDER_SENT_SENDER_HIDDEN:"reminderSent.sender.participant",RECALLED_SENDER_HIDDEN:"recalled.sender.participant",PARCEL_FOLLOWED:"parcel.followed",FILE_DOWNLOADED:"file.downloaded",PARCEL_COMPLETED:"parcel.completed",PARCEL_FAILED:"parcel.failed",PARCEL_CREATED_HIDDEN:"parcel.created",PARCEL_DELETED_HIDDEN:"parcel.deleted",PARCEL_UNSHARED_HIDDEN:"parcel.unshared",PARCEL_NOTIFICATION_OFF_HIDDEN:"parcel.notification_off",SHARING_INVITE:"sharing.invite.autoaccept",WAITING_FOR_MY_SIGNATURE:"WAITING_FOR_MY_SIGNATURE",WAITING_FOR_MY_APPROVAL:"WAITING_FOR_MY_APPROVAL",WAITING_FOR_MY_DELEGATION:"WAITING_FOR_MY_DELEGATION",WAITING_FOR_MY_ACKNOWLEDGEMENT:"WAITING_FOR_MY_ACKNOWLEDGEMENT",WAITING_FOR_MY_ACCEPTANCE:"WAITING_FOR_MY_ACCEPTANCE",WAITING_FOR_MY_FORM_FILLING:"WAITING_FOR_MY_FORM_FILLING",OPEN:"open",NOTIFICATION_NEW:"NEW",NOTIFICATION_READ:"READ",NOTIFICATION_EXPIRED:"EXPIRED",BELLUI:"BellUI",REQUEST_:"Request_",NOTIFICATION_:"Notification_",REVIEW_:"Review_",SIGN_:"Sign_",SEND_TRACK_:"SendTrack_",SHOW_MORE_REQUESTS:"ShowMoreRequests",FETCH_MORE_NOTIFICATIONS:"FetchMoreNotifications",BELL_WINDOW:"BellWindow",ERROR:"Error",SHOWN:"Shown",CLICKED:"Clicked",CALLED:"Called"}),define("pdmplugins/activity-badge/js/utils/activity-badge-util",["core/ac-core","pdmplugins/activity-badge/js/ac-activity-badge","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/string-constants","core/utils/date-util","moment"],function(t,e,i,n,a,s,o){return e.ActivityBadgeUtil={getDateObject:function(t,e){var i;if(t)return i=e?o.utc(t,e).toDate():o.utc(t).toDate()},getDateFromEpoch:function(t){return t?o.unix(t).toDate():void 0},getElapsedTime:function(t){var e=Date.now()-t,n=Math.floor(e/1e3/60),a=Math.floor(e/1e3/60/60);return 1>n?i.FEW_SECONDS_AGO:2>n?i.ONE_MINUTE_AGO:60>n?_.template(i.N_MINUTES_AGO,{n:n}):2>a?i.ONE_HOUR_AGO:24>a?_.template(i.N_HOURS_AGO,{n:a}):s.formatDateWithFormat(t,null,!0)},getDateInfo:function(t){return t&&""!=t&&"Invalid Date"!=t?{date:t.toDateString(),localeTime:t.toLocaleTimeString(),localeDate:t.toLocaleDateString(),locale:t.toLocaleString(),date_ll:o(t).format("ll")}:{date:"",localeTime:"",localeDate:"",locale:"",date_ll:""}},hasNotificationExpired:function(t){var e=30,i=864e5*e,n=new Date;return t.getTime()<n.getTime()-i?!0:!1},getEurekaAssetIdFromUrl:function(t){var e=t.split("/");return e.length?e[e.length-1]:void 0},getEurekaAssetIdFromUri:function(t){var e=t.split(":");return e.length>1?e[e.length-1]:(e=t.split("/id/"),e.length?e[e.length-1]:void 0)},getSendTrackInvitationIdFromUrl:function(t){var e=t.split("uri=");return e.length>1?e=e[e.length-1]:(e=t.split("/id/"),e.length?e=e[e.length-1]:void 0)},logAnalytics:function(t,e,i,n){n.appApi.rnaApi.done(function(n){n.analyticsAPI({methodName:"logAnalyticsEvent",methodArgs:[t,e,i]})})},logNotificationOnView:function(t,e){var i="";switch(t.attributes.section==n.NOTIFICATION_SECTION?i+=a.NOTIFICATION_:t.attributes.section==n.REQUEST_SECTION&&(i+=a.REQUEST_),t.attributes.workflowType){case n.SIGN_WORKFLOW:i+=a.SIGN_;break;case n.EUREKA_WORKFLOW:i+=a.REVIEW_;break;case n.SEND_AND_TRACK_WORKFLOW:i+=t.attributes.isReview?a.REVIEW_:a.SEND_TRACK_}i+=t.attributes.workflowState||t.attributes.subtype,this.logAnalytics(a.BELLUI,i,a.SHOWN,e)}},e.ActivityBadgeUtil}),define("pdmplugins/activity-badge/js/utils/notification-classification",["core/ac-core","pdmplugins/activity-badge/js/ac-activity-badge","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/string-constants","pdmplugins/activity-badge/js/utils/activity-badge-util","core/models/workflow-status-strings","core/utils/date-util"],function(t,e,i,n,a,s,o,c){return e.NotificationClassification={fillTemplateDataForANSNotification:function(t,e){var o=e.fullpayload||{};switch(t.subtype){case a.COMMENT_ADD:case a.COMMENT_MODIFY:case a.COMMENT_REPLY:case a.COMMENT_RESOLVE:case a.COMMENT_DELETE:case a.COMMENT_MENTION:t.workflowType=n.EUREKA_WORKFLOW,t.templateType=n.COMMENT_TEMPLATE,t.comment=_.escape(o.comment);break;case a.REVIEW_DEADLINE_REMINDER:t.workflowType=n.EUREKA_WORKFLOW,t.templateType=n.INFO_TEMPLATE;break;case a.REVIEW_FINISHED:t.workflowType=n.EUREKA_WORKFLOW,t.templateType=n.INFO_TEMPLATE;break;case a.EMAIL_VIEWED_SENDER:case a.SIGNED_SENDER:case a.DELEGATED_SENDER:case a.EXPIRED_SENDER:case a.EXPIRED_TARGET:case a.REMINDER_CREATED_TARGET:case a.AGREEMENT_EMAIL_BOUNCED_SENDER:case a.RECALLED_TARGET:case a.REJECTED_SENDER:t.workflowType=n.SIGN_WORKFLOW,t.templateType=n.INFO_TEMPLATE,t.message="";break;case a.SIGNATURE_REQUESTED_TARGET:t.workflowType=n.SIGN_WORKFLOW,t.templateType=n.CTA_TEMPLATE,t.message="";break;case a.PARCEL_FOLLOWED:case a.FILE_DOWNLOADED:case a.PARCEL_FAILED:t.workflowType=n.SEND_AND_TRACK_WORKFLOW,t.templateType=n.INFO_TEMPLATE;break;case a.SHARING_INVITE:case a.PARCEL_COMPLETED:t.workflowType=n.SEND_AND_TRACK_WORKFLOW,t.templateType=n.CTA_TEMPLATE,t.isReview=o.isReview,o.isReview?(t.action=i.OPEN,(o.review||{}).dueDate&&(t.deadline=s.getDateObject(o.review.dueDate))):t.action=i.OPEN,t.actionLabel=t.action;break;case a.END_OF_NOTIFICATIONS_MARKER:case a.PARCEL_CREATED_HIDDEN:case a.PARCEL_UNSHARED_HIDDEN:case a.PARCEL_DELETED_HIDDEN:case a.PARCEL_NOTIFICATION_OFF_HIDDEN:case a.SIGNATURE_REQUESTED_SENDER_HIDDEN:case a.COMPLETED_EXPOSED_HIDDEN:case a.DELEGATED_TARGET_HIDDEN:case a.REMINDER_SENT_SENDER_HIDDEN:case a.RECALLED_SENDER_HIDDEN:case a.COMMENT_NOTIFY_HIDDEN:t.templateType=n.NO_TEMPLATE;break;default:t.templateType=n.INFO_TEMPLATE}switch((t.readState===a.NOTIFICATION_EXPIRED||s.hasNotificationExpired(t.timestamp))&&(t.templateType=n.NO_TEMPLATE),t.workflowType){case n.EUREKA_WORKFLOW:t.workflowId=(o.links||{}).reviewURI,t.avatar=(o.user||{}).avatar;var r=(o.links||{}).invitationURI;r&&""!==r&&(t.assetId=r),t.deadline=s.getDateFromEpoch((o.review_info||{}).deadline_date),t.subtype==a.REVIEW_DEADLINE_REMINDER&&(t.message=_.template(t.message,{deadline:c.formatDateOnly(t.deadline,null,"DATE_MMM_DD_YYYY")}));break;case n.SEND_AND_TRACK_WORKFLOW:t.workflowId=o.ctaUrl,t.avatar=(o.user||{}).avatarIconUrl;var d=o.ctaUrl;t.invitationId=s.getSendTrackInvitationIdFromUrl(d);break;case n.SIGN_WORKFLOW:t.workflowId=(o.agreementInfo||{}).id}return t},getSignMessageFromService:function(t,e,n){var o,r,d,l="",E="",u="",h="",g="",p="",m="";switch(t){case a.SIGNATURE_REQUESTED_TARGET:var I="",N="";return E=i.SIGN_DOC_RECEIVED,r=e.senderParticipantId,g=this._getParticipantFromApiData(n,r),I=n.name,p=this._getSignAction(e.role).MESSAGE,m=this._getSignAction(e.role).CTA,N=this._getSignAction(e.role).LABEL,n.expire_date&&(d=s.getDateObject(n.expire_date,"YYYYMMDDHHmmssZ"),l=c.formatDateOnly(d,null,"DATE_MMM_DD_YYYY")),u=_.template(E,{sender:g,action:p.toLowerCase()}),{message:u,document:I,action:m,actionLabel:N,deadline:l};case a.EMAIL_VIEWED_SENDER:E=i.SIGN_EMAIL_VIEWED,o=e.signerParticipantId,h=this._getParticipantFromApiData(n,o),u=_.template(E,{document:n.name,signer:h});break;case a.SIGNED_SENDER:E=i.SIGN_DOC_SIGNED,p=this._getSignAction(e.role).PAST_TENSE.toLowerCase(),o=e.signerParticipantId,h=this._getParticipantFromApiData(n,o),u=_.template(E,{document:n.name,action:p,signer:h});break;case a.DELEGATED_SENDER:E=i.SIGN_DELEGATE;var A=e.delegatorParticipantId,T=e.delegateeParticipantId,f=this._getParticipantFromApiData(n,A),v=this._getParticipantFromApiData(n,T);u=_.template(E,{document:n.name,delegator:f,delegatee:v});break;case a.EXPIRED_SENDER:E=e.signersParticipantInfo.length<=1?i.SIGN_EXPIRED_SENDER_ONE_SIGNER:i.SIGN_EXPIRED_SENDER_MANY_SIGNERS;var O=e.signersParticipantInfo[0].participantId;h=this._getParticipantFromApiData(n,O),n.expire_date&&(d=s.getDateObject(n.expire_date,"YYYYMMDDHHmmssZ"),l=c.formatDateOnly(d,null,"DATE_MMM_DD_YYYY")),u=_.template(E,{document:n.name,signer:h,deadline:l});break;case a.EXPIRED_TARGET:E=i.SIGN_EXPIRED_SIGNER,p=this._getSignAction(e.role).MESSAGE.toLowerCase(),r=e.senderParticipantId,g=this._getParticipantFromApiData(n,r),u=_.template(E,{action:p,document:n.name,sender:g}),n.expire_date&&(d=s.getDateObject(n.expire_date,"YYYYMMDDHHmmssZ"),l=c.formatDateOnly(d,null,"DATE_MMM_DD_YYYY"),u=u+" "+l);break;case a.REMINDER_CREATED_TARGET:p=this._getSignAction(e.role).MESSAGE.toLowerCase(),r=e.senderParticipantId,g=this._getParticipantFromApiData(n,r),n.expire_date?(E=i.SIGN_REMINDER_DEADLINE_SIGNER,d=s.getDateObject(n.expire_date,"YYYYMMDDHHmmssZ"),l=c.formatDateOnly(d,null,"DATE_MMM_DD_YYYY")):E=i.SIGN_REMINDER_SIGNER,u=_.template(E,{sender:g,action:p,document:n.name,deadline:l});break;case a.AGREEMENT_EMAIL_BOUNCED_SENDER:E=i.SIGN_EMAIL_BOUNCED,p=this._getSignAction(e.role).MESSAGE.toLowerCase(),o=e.signerParticipantId,h=this._getParticipantFromApiData(n,o),u=_.template(E,{signer:h,action:p,document:n.name});break;case a.RECALLED_TARGET:E=i.SIGN_CANCELLED_SIGNER,r=e.senderParticipantId,g=this._getParticipantFromApiData(n,r),u=_.template(E,{sender:g,document:n.name});break;case a.REJECTED_SENDER:E=i.SIGN_DOC_DECLINED,o=e.signerParticipantId,h=this._getParticipantFromApiData(n,o),u=_.template(E,{signer:h,document:n.name})}return{message:u}},_getParticipantFromApiData:function(t,e){if(!e||""==e)return{};var i=t.participant_list;for(var n in i){var a=i[n];if(e===a.id)return a.label?a.label:a.address}return{}},_getSignAction:function(t){switch(t){case o.SIGNER:return{CTA:i.SIGN,MESSAGE:i.SIGN,VIEW_ACTION:i.VIEW_SIGN,PAST_TENSE:i.E_SIGNED,LABEL:i.VIEW_SIGN_LABEL};case o.APPROVER:return{CTA:i.APPROVE,MESSAGE:i.APPROVE,VIEW_ACTION:i.VIEW_APPROVE,PAST_TENSE:i.APPROVED,LABEL:i.VIEW_APRROVE_LABEL};case o.CERTIFIED_RECIPIENT:return{CTA:i.ACKNOWLEDGE,MESSAGE:i.ACKNOWLEDGE,VIEW_ACTION:i.VIEW_ACKNOWLEDGE,PAST_TENSE:i.ACKNOWLEDGED,LABEL:i.VIEW_ACKNOWLEDGE_LABEL};case o.ACCEPTOR:return{CTA:i.ACCEPT,MESSAGE:i.ACCEPT,VIEW_ACTION:i.VIEW_ACCEPT,PAST_TENSE:i.ACCEPTED,LABEL:i.VIEW_ACCEPT_LABEL};case o.FORM_FILLER:return{CTA:i.FILL_FORM,MESSAGE:i.FILL,VIEW_ACTION:i.VIEW_FILL,PAST_TENSE:i.FILLED,LABEL:i.VIEW_FILL_FORM_LABEL};case o.DELEGATOR_TO_SIGNER:case o.DELEGATOR_TO_APPROVER:case o.DELEGATOR_TO_ACCEPTOR:case o.DELEGATOR_TO_CERTIFIED_RECIPIENT:case o.DELEGATOR_TO_FORM_FILLER:return{CTA:i.DELEGATE,MESSAGE:i.DELEGATE,VIEW_ACTION:i.VIEW_DELEGATE,PAST_TENSE:i.DELEGATED,LABEL:i.VIEW_DELEGATE_LABEL};default:return{CTA:i.SIGN,MESSAGE:i.SIGN,VIEW_ACTION:i.VIEW_SIGN,PAST_TENSE:i.E_SIGNED,LABEL:i.VIEW_SIGN_LABEL}}},getSignMessageFromDataModel:function(t,e){var n,o,r,d="",l="",E="",_={},u="",h={},g="",p="",m="",I=t.fullpayload||{};switch(t.subtype){case a.SIGNATURE_REQUESTED_TARGET:var N="",A="";return l=i.SIGN_DOC_RECEIVED,g=e.getSenderName()||e.getSenderEmail(),N=e.getSingleFileName(),p=this._getSignAction(I.role).MESSAGE,m=this._getSignAction(I.role).CTA,A=this._getSignAction(I.role).LABEL,e.getDeadline()&&(r=s.getDateObject(e.getDeadline(),"YYMMDDHHmmssZ"),d=c.formatDateOnly(r,null,"DATE_MMM_DD_YYYY")),E=this.buildMessageString(l,{sender:g,action:p.toLowerCase()}),{message:E,document:N,action:m,actionLabel:A,deadline:d};case a.EMAIL_VIEWED_SENDER:l=i.SIGN_EMAIL_VIEWED,n=I.signerParticipantId,h=e.getParticipantById(n),u=h.name||h.email,E=this.buildMessageString(l,{document:e.getSingleFileName(),signer:u});break;case a.SIGNED_SENDER:l=i.SIGN_DOC_SIGNED,p=this._getSignAction(I.role).PAST_TENSE.toLowerCase(),n=I.signerParticipantId,h=e.getParticipantById(n),u=h.name||h.email,E=this.buildMessageString(l,{document:e.getSingleFileName(),action:p,signer:u});break;case a.DELEGATED_SENDER:l=i.SIGN_DELEGATE;var T=I.delegatorParticipantId,f=I.delegateeParticipantId,v=e.getParticipantById(T),O=e.getParticipantById(f),b=v.name||v.email,S=O.name||O.email;E=this.buildMessageString(l,{document:e.getSingleFileName(),delegator:b,delegatee:S});break;case a.EXPIRED_SENDER:l=I.signersParticipantInfo.length<=1?i.SIGN_EXPIRED_SENDER_ONE_SIGNER:i.SIGN_EXPIRED_SENDER_MANY_SIGNERS;var D=I.signersParticipantInfo[0].participantId;h=e.getParticipantById(D),u=h.name||h.email,_={document:e.getSingleFileName(),signer:u},e.getDeadline()&&(r=s.getDateObject(e.getDeadline(),"YYMMDDHHmmssZ"),d=c.formatDateOnly(r,null,"DATE_MMM_DD_YYYY"),_.deadline=d),E=this.buildMessageString(l,_);break;case a.EXPIRED_TARGET:l=i.SIGN_EXPIRED_SIGNER,p=this._getSignAction(I.role).MESSAGE.toLowerCase(),o=I.senderParticipantId,g=e.getSenderName()||e.getSenderEmail(),E=this.buildMessageString(l,{action:p,document:e.getSingleFileName(),sender:g}),e.getDeadline()&&(r=s.getDateObject(e.getDeadline(),"YYMMDDHHmmssZ"),d=c.formatDateOnly(r,null,"DATE_MMM_DD_YYYY"),E=E+" "+d);break;case a.REMINDER_CREATED_TARGET:p=this._getSignAction(I.role).MESSAGE.toLowerCase(),o=I.senderParticipantId,g=e.getSenderName()||e.getSenderEmail(),_={sender:g,action:p,document:e.getSingleFileName()},e.getDeadline()?(l=i.SIGN_REMINDER_DEADLINE_SIGNER,r=s.getDateObject(e.getDeadline(),"YYMMDDHHmmssZ"),d=c.formatDateOnly(r,null,"DATE_MMM_DD_YYYY"),_.deadline=d):l=i.SIGN_REMINDER_SIGNER,E=this.buildMessageString(l,_);break;case a.AGREEMENT_EMAIL_BOUNCED_SENDER:l=i.SIGN_EMAIL_BOUNCED,p=this._getSignAction(I.role).MESSAGE.toLowerCase(),n=I.signerParticipantId,h=e.getParticipantById(n),u=h.name||h.email,E=this.buildMessageString(l,{signer:u,action:p,document:e.getSingleFileName()});break;case a.RECALLED_TARGET:l=i.SIGN_CANCELLED_SIGNER,o=I.senderParticipantId,g=e.getSenderName()||e.getSenderEmail(),E=this.buildMessageString(l,{sender:g,document:e.getSingleFileName()});break;case a.REJECTED_SENDER:l=i.SIGN_DOC_DECLINED,n=I.signerParticipantId,h=e.getParticipantById(n),u=h.name||h.email,E=this.buildMessageString(l,{signer:u,document:e.getSingleFileName()})}return{message:E}},buildMessageString:function(t,e){for(var i in e)if(!e[i]||""==e[i])return"";return _.template(t,e)}},e.NotificationClassification}),define("pdmplugins/activity-badge/js/views/base-notification-view",["core/ac-core-init","backbone","pdmplugins/activity-badge/js/ac-activity-badge","core/utils/view-util","core/utils/focus-util","core/utils/truncate","core/utils/css-util","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/constants/css-constants","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/string-constants","pdmplugins/activity-badge/js/utils/activity-badge-util","pdmplugins/activity-badge/js/utils/notification-classification","core/constants/thumbnail-constants","core/views/plugin-content-view"],function(t,e,i,n,a,s,o,c,r,d,l,E,u,h){return i.BaseNotificationView=t.View.extend({events:{"click .notification-container":"_onClick","keydown .notification-container":"_onKeyDown"},initialize:function(){t.View.prototype.initialize.call(this),this.listenTo(this,"remove",this.teardown),this.model.on("change",this._updateView),this.model.on("updateModel",this.updateModel),this._defaultAvatar="/static/js/plugins/activity-badge/images/avatar.jpg"},teardown:function(){this.remove()},setFocus:function(){this.$(r.NOTIFICATION_BOX).focus()},removeFocus:function(){this.$(r.NOTIFICATION_BOX).blur()},updateModel:function(t){for(var e in t)this.model.set(e,t[e]);this.render()},_commonRender:function(){this._initWrappers(),this._getAttribute("workflowType")===d.SIGN_WORKFLOW&&this._getAttribute("datatype")===d.ANS_DATATYPE&&""===this._getAttribute("message"),this._getAttribute("readState")===l.NOTIFICATION_NEW&&this.$(r.NOTIFICATION_BOX).addClass(r.NEW_NOTIFICATION_CLASSNAME),n.setElementFontByLocale(this.$el,"div"),""===this._getAttribute("message")?this.$el.addClass("empty-notification"):this.$el.hasClass("empty-notification")&&this.$el.removeClass("empty-notification")},_initWrappers:function(){this.$(r.THUMBNAIL_IMG).on("error",this._onThumbnailError),this.$(r.AVATAR_IMG).on("error",this._onAvatarError)},_fetchAvatarFromService:function(){if(this._getAttribute("workflowType")===d.EUREKA_WORKFLOW){var t=this._getAttribute("workflowId"),e=this.options.context.appApi.pluginsApi.callPluginMethod("reviews","getReviewAvatar",t,this._getResolvedPromise(),!0);e.done(_.bind(function(t){_.each(t,function(t){t.adobe_id===this._getAttribute("senderId")&&t.hasOwnProperty("img")&&(this.$(".avatar-icon").attr("src",t.img),this.model.set("avatar",t.img))},this)},this))}},_fetchThumbnailFromService:function(){if(this._getAttribute("workflowType")==d.SIGN_WORKFLOW);else if(this._getAttribute("workflowType")==d.EUREKA_WORKFLOW){var t=this._getAttribute("assetId");if(""!=t){var e=this.options.context.appApi.pluginsApi.callPluginMethod("reviews","_getThumbnailForReview",{invitationId:t,ThumbnailType:h.THUMBNAIL},this._getResolvedPromise(),!0);e.done(_.bind(function(t){t&&(this._setThumbnail(t),this.model.set("thumbnail",t))},this))}}else if(this._getAttribute("workflowType")==d.SEND_AND_TRACK_WORKFLOW){var i=this._getAttribute("invitationId");if(""!=i){var e=this.options.context.appApi.pluginsApi.callPluginMethod("sentfiles","getSendTrackThumbnail",{invitationId:i,ThumbnailType:h.THUMBNAIL},this._getResolvedPromise(),!0);e.done(_.bind(function(t){t&&(this._setThumbnail(t),this.model.set("thumbnail",t))},this))}}},_fetchSignThubmnail:function(){var t=this._getAttribute("workflowId");if(""!=t){var e={workflowId:t,size:"FIXED_WIDTH_50px"},i=this.options.context.appApi.pluginsApi.callPluginMethod("signatures","getSignThumbnail",e,this._getResolvedPromise(),!0);i.done(_.bind(function(t){t&&t.FIXED_WIDTH_50px&&(this._setThumbnail(t),this.model.set("thumbnail",t))},this))}},_setThumbnail:function(t){this.$(r.THUMBNAIL_DEFAULT_ICON).addClass("hide"),this.$(r.THUMBNAIL_IMG).removeClass("hide"),this.$(r.THUMBNAIL_IMG).attr("src",t)},_onThumbnailError:function(){this.$(r.THUMBNAIL_IMG).addClass("hide"),this.$(r.THUMBNAIL_DEFAULT_ICON).removeClass("hide")},_onAvatarError:function(){this.$(r.AVATAR_IMG).attr("src",this._defaultAvatar)},_onClick:function(){this.removeFocus(),this._getAttribute("readState")===l.NOTIFICATION_NEW&&this.model.set("readState",l.NOTIFICATION_READ),this.options.context.appApi.rnaApi.done(_.bind(function(t){if(t.rnaActivityBadgeAPI.hidePopUp(),this.model.attributes.datatype===d.ANS_DATATYPE)t.rnaActivityBadgeAPI.onNotificationClick(this.model.attributes.notificationId);else if(this.model.attributes.datatype===d.DATA_MODEL_DATATYPE)if(this.model.attributes.workflowType==d.SIGN_WORKFLOW){var i=new e.Model({signature_info:{state:this.model.attributes.workflowState},resources:[{name:this.model.attributes.document,id:this.model.attributes.workflowId}]});this.options.context.appApi.pluginsApi.callPluginMethod("signatures","openSignAgreement",i,$.Deferred().reject(),!0)}else if(this.model.attributes.workflowType==d.EUREKA_WORKFLOW){var n={};void 0!=this.model.attributes&&(n.reviewUrl=this.model.attributes.model.id,void 0!=this.model.attributes.model.resources&&1==this.model.attributes.model.resources.length&&(n.invitationId=this.model.attributes.model.resources[0].id,n.closeExistingDoc=!1,t.assetApi({methodName:"openEurekaFile",methodArgs:n})))}},this)),this._logOnClick()},_onKeyDown:function(t){var e;if(13===t.which||32===t.which)this._onClick();else if(9===t.which){e=$(r.TAB_ORDER);var i=e.index(t.target);0==i&&t.shiftKey?(e.eq(e.length-1).focus(),this._consumeEvent(t)):i!=e.length-1||t.shiftKey||(e.eq(0).focus(),this._consumeEvent(t))}else e=$(r.ARROW_KEY_FOCUS),a.nextElem(t,e)},_getAttribute:function(t){return void 0!=this.model.attributes[t]&&""!=this.model.attributes[t]?this.model.attributes[t]:""},_getAvatar:function(){return""!=this._getAttribute("avatar")?this._getAttribute("avatar"):this._defaultAvatar},_getTabIndex:function(){return 1==this.options.index?0:-1},_clearHtmlTags:function(t){return t?(t=t.toString(),t.replace(/<[^>]*>/g,"")):""},_updateView:function(){this.model.hasChanged("timeString")&&this.$(r.TIMESTAMP).text(this._getAttribute("timeString")),this.model.hasChanged("readState")&&(this._getAttribute("readState")===l.NOTIFICATION_READ?this.$(r.NOTIFICATION_BOX).removeClass(r.NEW_NOTIFICATION_CLASSNAME):this._getAttribute("readState")===l.NOTIFICATION_EXPIRED&&(this.teardown(),this.model.destroy()))},_logOnClick:function(){var t="";switch(t=this._getAttribute("templateType")===d.CTA_TEMPLATE?l.REQUEST_:l.NOTIFICATION_,this._getAttribute("workflowType")){case d.SIGN_WORKFLOW:t+=l.SIGN_;break;case d.EUREKA_WORKFLOW:t+=l.REVIEW_;break;case d.SEND_AND_TRACK_WORKFLOW:t+=""!=this._getAttribute("isReview")?l.REVIEW_:l.SEND_TRACK_}t+=this._getAttribute("workflowState")||this._getAttribute("subtype"),E.logAnalytics(l.BELLUI,t,l.CLICKED,this.options.context)},_getSignDataFromService:function(){var t={agreementId:this._getAttribute("workflowId")},e=this.options.context.appApi.pluginsApi.callPluginMethod("signatures","getSignAgreementDataForNotifications",t,this._getResolvedPromise(),!0);
e.then(_.bind(function(t){if(this.model.set("apiData",t.response.result_set),t.response.result_set.length>0){var e=u.getSignMessageFromService(this._getAttribute("subtype"),this._getAttribute("fullpayload"),t.response.result_set[0]);this.updateModel(e)}else console.log("No data returned from Sign Api for workflow id ",this._getAttribute("workflowId"))},this))}}),i.BaseNotificationView}),define("pdmplugins/activity-badge/js/views/cta-notification-view",["core/ac-core-init","backbone","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/templates/cta-notification-template","core/utils/view-util","core/utils/focus-util","core/utils/truncate","core/utils/css-util","core/utils/date-util","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/views/base-notification-view","pdmplugins/activity-badge/js/constants/css-constants","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/string-constants","pdmplugins/activity-badge/js/utils/activity-badge-util","core/views/plugin-content-view"],function(t,e,i,n,a,s,o,c,r,d,l,E,u){return i.CTANotificationView=l.extend({render:function(){this._template=_.template(n);var t=this._getAttribute("message");return this.$el.html(this._template({avatar:this._getAvatar(),message:t,message_text:this._clearHtmlTags(t),action:this._getAttribute("action"),actionLabel:this._getAttribute("actionLabel"),document:this._getAttribute("document"),timestamp:this._getAttribute("timeString"),deadline:this._getDeadline("deadline"),iconCls:this._getIconCls(),pressEnter:d.PRESS_ENTER_SPACE,tabIndex:this._getTabIndex()})),""===this._getAttribute("avatar")&&this._fetchAvatarFromService(),""===this._getAttribute("thumbnail")?this._fetchThumbnailFromService():this._setThumbnail(this._getAttribute("thumbnail")),this.options.index>2&&($("#showMoreRequestsButton").hasClass("hide")&&$("#showMoreRequestsButton").removeClass("hide"),this.$el.addClass("request-hide-toggle")),this._commonRender(),this},_getDeadline:function(){if(""!=this._getAttribute("deadline")){var t=this._getAttribute("deadline"),e=r.formatDateOnly(t,null,"DATE_MMM_DD_YYYY");return _.template(d.DUE_DATE,{date:e})}return""},_getIconCls:function(){return this._getAttribute("workflowType")==u.SIGN_WORKFLOW?"s_agreementfiletype":"file-icon-pdf"}}),i.CTANotificationView}),define("pdmplugins/activity-badge/js/views/requests-view",["core/ac-core-init","backbone","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/templates/requests-template","pdmplugins/activity-badge/js/views/cta-notification-view","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/css-constants","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/utils/activity-badge-util"],function(t,e,i,n,a,s,o,c,r){return i.RequestsView=t.View.extend({events:{},initialize:function(){t.View.prototype.initialize.call(this),this._addListeners(),this._template=_.template(n),this._requestsLogged=new Set,setTimeout(this.logTopRequests.bind(this),5e3)},render:function(){return this.requestIndex=0,this.$el.html(this._template({requestsHeading:c.REQUESTS,showMore:c.SHOW_MORE})),_.each(this.collection.models,this._renderItem,this),this},teardown:function(){this&&this._removeListeners()},_addListeners:function(){this.collection.bind("reset",this.render,this),this.collection.bind("add",this._renderItem,this)},_removeListeners:function(){this.collection.unbind("reset",this.render,this),this.collection.unbind("add",this._renderItem,this)},_renderItem:function(t){var e=null;if(t){this.requestIndex++,t.set("section",s.REQUEST_SECTION);var i=t.attributes.templateType;i==s.CTA_TEMPLATE&&(e=new a({model:t,context:this.options,index:this.requestIndex})),e&&this.$(o.NORMAL_NOTIFICATIONS_CONTAINER).append(e.render().el),$("#showMoreRequestsButtonText").html(c.SHOW_MORE+" ("+String(this.requestIndex-2)+")"),$("#showMoreRequestsButton").attr("aria-label",c.SHOW_MORE+" "+String(this.requestIndex-2))}},logTopRequests:function(){for(var t=0;2>t&&t<this.collection.length;t++){var e=this.collection.models[t];this._requestsLogged.has(e.attributes.workflowId)||(r.logNotificationOnView(e,this.options),this._requestsLogged.add(e.attributes.workflowId))}},logRemainingRequests:function(){for(var t in this.collection.models){var e=this.collection.models[t];this._requestsLogged.has(e.attributes.workflowId)||(r.logNotificationOnView(e,this.options),this._requestsLogged.add(e.attributes.workflowId))}}}),i.RequestsView}),define("pdmplugins/activity-badge/js/templates/notifications-template",[],function(){var t='<div class="notifications-container"><div class="notifications-title notifications-accordion ui-theme bell-header-theme bell-border-theme" id="notificationHeader"tabIndex="0" aria-label="<%= notificationsHeading %>" ><span class="ui-theme bell-dark-text"><b><%= notificationsHeading %></b></span></div><div class="notifications-body" id="notificationBody"><div class="normal-notifications-container"></div><div class="widget-wait hide ui-theme bell-header-theme bell-border-theme"><div class="spectrum-Loader spectrum-Loader--indeterminate" variant="radial"></div></div></div></div>';return t}),define("pdmplugins/activity-badge/js/templates/comment-notification-template",[],function(){var t='<div class="notification-container ui-theme bell-notification-theme bell-border-theme" tabIndex="<%= tabIndex %>" aria-label="<%= message_text %>. <%= comment_text %>. <%= timestamp %>. <%= pressEnter %>"><div class="comment-timeline"><div class="avatar"><div class="image-container"><img class="avatar-icon" src= <%= avatar %>></div></div><div class="notification-body"><div class="content ui-theme bell-theme-text" title="<%= message_text %>"><div> <%= message %> </div></div><div class="comment-container comment-container-box ui-theme bell-comment-theme bell-comment-container-border-theme"><div class="comment-tip"></div><div class="comment-content" title="<%= comment_text %>"><div class="content-text ui-theme bell-theme-text-no-hover"><span class="contentTextSpan"> <%= comment %> </span></div></div></div><div class="time-string ui-theme bell-timestamp-text"><span><%= timestamp %></span></div></div></div></div>';return t}),define("pdmplugins/activity-badge/js/views/comment-notification-view",["core/ac-core-init","backbone","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/templates/comment-notification-template","core/utils/view-util","core/utils/focus-util","core/utils/truncate","core/utils/css-util","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/views/base-notification-view","pdmplugins/activity-badge/js/constants/css-constants","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/string-constants","pdmplugins/activity-badge/js/utils/activity-badge-util","core/views/plugin-content-view"],function(t,e,i,n,a,s,o,c,r,d){return i.CommentNotificationView=d.extend({render:function(){return this._template=_.template(n),this.$el.html(this._template({message:this._getAttribute("message"),message_text:this._clearHtmlTags(this._getAttribute("message")),comment:this.getComment(),comment_text:this._clearHtmlTags(this.getComment()),avatar:this._getAvatar(),timestamp:this._getAttribute("timeString"),pressEnter:r.PRESS_ENTER_SPACE,tabIndex:this._getTabIndex()})),this._commonRender(),this},getComment:function(){var t=this._getAttribute("comment");return""===t&&(t="<i>"+r.MARKUP_ADDED+"</i>"),t}}),i.CommentNotificationView}),define("pdmplugins/activity-badge/js/templates/info-notification-template",[],function(){var t='<div class="notification-container ui-theme bell-notification-theme bell-border-theme" tabIndex="<%= tabIndex %>" aria-label="<%= message_text %>. <%= timestamp %>. <%= pressEnter %>"><div class="simple-timeline"><div class="avatar"><div class="image-container"><img class="avatar-icon" src= <%= avatar%> ></div></div><div class="notification-body"><div class="content ui-theme bell-theme-text" title="<%= message_text %>"><div> <%= message %> </div></div><div class="time-string ui-theme bell-timestamp-text"><span><%= timestamp %></span></div></div></div></div>';return t}),define("pdmplugins/activity-badge/js/views/info-notification-view",["core/ac-core-init","backbone","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/templates/info-notification-template","core/utils/view-util","core/utils/focus-util","core/utils/truncate","core/utils/css-util","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/views/base-notification-view","pdmplugins/activity-badge/js/constants/css-constants","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/string-constants","pdmplugins/activity-badge/js/utils/activity-badge-util","core/views/plugin-content-view"],function(t,e,i,n,a,s,o,c,r,d){return i.InfoNotificationView=d.extend({render:function(){return this._template=_.template(n),this.$el.html(this._template({message:this._getAttribute("message"),message_text:this._clearHtmlTags(this._getAttribute("message")),avatar:this._getAvatar(),timestamp:this._getAttribute("timeString"),pressEnter:r.PRESS_ENTER_SPACE,tabIndex:this._getTabIndex()})),this._commonRender(),this}}),i.InfoNotificationView}),define("pdmplugins/activity-badge/js/templates/no-notification-template",[],function(){var t='<div class="no-notifications-screen ui-theme bell-background-theme"><div class="welcome-screen"><div class="welcome-screen-content"><div class="bellIcon"><img class="no-notifications-icon" src="./static/js/plugins/activity-badge/images/bell_empty.png"></div><div class="heading ui-theme theme-text"><span> <%= heading %> </span></div><div class="sub-heading ui-theme theme-text"><span> <%= subheading %> </span></div></div></div></div>';return t}),define("pdmplugins/activity-badge/js/views/no-notification-view",["core/ac-core-init","backbone","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/templates/no-notification-template","core/utils/view-util","core/utils/focus-util","i18n!pdmplugins/activity-badge/js/nls/ui-strings","core/views/plugin-content-view"],function(t,e,i,n,a,s,o){return i.NoNotificationView=t.View.extend({initialize:function(){t.View.prototype.initialize.call(this),this._template=_.template(n),this.listenTo(this,"remove",this.teardown)},render:function(){return this.$el.html(this._template({heading:o.NO_NOTIFICATIONS_HEADING,subheading:o.NO_NOTIFICATIONS_SUBHEADING})),this},teardown:function(){this.remove()}}),i.NoNotificationView}),define("pdmplugins/activity-badge/js/views/notifications-view",["core/ac-core-init","backbone","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/templates/notifications-template","pdmplugins/activity-badge/js/views/comment-notification-view","pdmplugins/activity-badge/js/views/info-notification-view","pdmplugins/activity-badge/js/views/no-notification-view","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/css-constants","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/utils/activity-badge-util"],function(t,e,i,n,a,s,o,c,r,d,l){return i.NotificationsView=t.View.extend({events:{},initialize:function(){t.View.prototype.initialize.call(this),this._addListeners(),this._template=_.template(n),this._notificationsLogged=new Set},render:function(){return this.notificationIndex=0,this.$el.html(this._template({notificationsHeading:d.NOTIFICATIONS})),_.each(this.collection.models,this._renderItem,this),this},teardown:function(){this.remove()},_addListeners:function(){this.collection.bind("reset",this.render,this),this.collection.bind("add",this._renderItem,this)},_removeListeners:function(){this.collection.unbind("reset",this.render,this),this.collection.unbind("add",this._renderItem,this)},_renderItem:function(t){if(t){var e=null;this.notificationIndex++,t.set("section",c.NOTIFICATION_SECTION);var i=t.attributes.templateType;i==c.COMMENT_TEMPLATE?e=new a({model:t,context:this.options,index:this.notificationIndex}):i==c.INFO_TEMPLATE&&(e=new s({model:t,context:this.options,index:this.notificationIndex})),e&&(this.$(r.NORMAL_NOTIFICATIONS_CONTAINER).append(e.render().el),this._notificationsLogged.has(t.attributes.notificationId)||(l.logNotificationOnView(t,this.options),this._notificationsLogged.add(t.attributes.notificationId)))}}}),i.NotificationsView}),define("pdmplugins/activity-badge/js/collections/activity-badge-sorted-collection",["core/ac-core","pdmplugins/activity-badge/js/ac-activity-badge"],function(t,e){e.ActivityBadgeSortedCollection=Backbone.Collection.extend({initialize:function(t,e){Backbone.Collection.prototype.initialize.call(this,t,e),this.sortField="timestamp"},comparator:function(t){return-t.get(this.sortField)}})}),define("pdmplugins/activity-badge/js/collections/request-collection",["core/ac-core","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/collections/activity-badge-sorted-collection","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/constants/enum-constants"],function(t,e,i,n,a){e.RequestCollection=e.ActivityBadgeSortedCollection.extend({add:function(t){Backbone.Collection.prototype.add.call(this,t);var e=new Backbone.Collection(t);for(var i in e.models){var n=e.models[i],a=this.where({workflowId:n.get("workflowId")});if(a.length>1)for(var s=1;s<a.length;s++)this.remove(a[s])}},reRender:function(){this.models.length>0&&this.reset(this.models)},clearPreviousDataModelRequests:function(){var t=this.where({datatype:a.DATA_MODEL_DATATYPE});this.remove(t)}})}),define("pdmplugins/activity-badge/js/collections/notification-collection",["core/ac-core","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/collections/activity-badge-sorted-collection","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/string-constants","pdmplugins/activity-badge/js/utils/activity-badge-util"],function(t,e){e.NotificationCollection=Backbone.Collection.extend({})}),define("pdmplugins/activity-badge/js/views/plugin-view",["core/ac-core-init","core/utils/focus-util","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/templates/activity-badge-template","pdmplugins/activity-badge/js/views/requests-view","pdmplugins/activity-badge/js/views/notifications-view","pdmplugins/activity-badge/js/views/no-notification-view","pdmplugins/activity-badge/js/constants/enum-constants","pdmplugins/activity-badge/js/constants/string-constants","pdmplugins/activity-badge/js/constants/css-constants","i18n!pdmplugins/activity-badge/js/nls/ui-strings","pdmplugins/activity-badge/js/utils/notification-classification","pdmplugins/activity-badge/js/utils/activity-badge-util","pdmplugins/activity-badge/js/collections/request-collection","pdmplugins/activity-badge/js/collections/notification-collection"],function(t,e,i,n,a,s,o,c,r,d,l,E,u){return i.PluginView=t.PluginContentView.extend({events:{"click .notifications-accordion":"_onAccordionClick","touchstart .notifications-accordion":"_onAccordionClick","keydown .notifications-accordion":"_onKeyDown","click .scroll-top-button":"_scrollToTop"},initialize:function(){this._waitingForFetchResults=!1,this._requests=new i.RequestCollection,this._notifications=new i.NotificationCollection,this._signWorkflowData=new t.ParcelCollection([],{wfType:"Signature"}),this._accordionState=c.ACCORDION_DEFAULT,this._endOfNotifications=!1,this._unreadNotificationsCount=0,this._bellWindowOpen=!0,t.PluginContentView.prototype.initialize.call(this),this._template=_.template(n)},teardown:function(){this.$el.empty()},render:function(){return t.PluginContentView.prototype.render.call(this),this.$el.html(this._template()),this.$el.addClass("activity-badge-container theme-container"),this._initWrappers(),this._renderNoNotificationView(),this._renderRequestsView(),this._renderNotificationsView(),this._setupListener(),this._renderComplete(),u.logAnalytics(r.BELLUI,r.BELL_WINDOW,r.SHOWN,this.options),this},selectPlugin:function(){this.options.appApi.displayApi.applyUIThemeStyles(this.$el).then(_.bind(function(){this.render(),this.options.appApi.displayApi.showSpinner(!1)},this))},_initWrappers:function(){this._notifications.on("add remove",this._viewStateUpdate),this._requests.on("add remove",this._viewStateUpdate),this.$(d.NOTIFICATIONS_WRAPPER_SECTION).on("scroll",this._onNotificationsScroll),this.$(d.TAB_END).on("focus",this._setFocusOnLastNotification),$(document).keydown(this._hidePopUp)},_viewStateUpdate:function(){this._requests.length>0?this.$(d.REQUESTS_SECTION).hasClass("hide")&&this.$(d.REQUESTS_SECTION).removeClass("hide"):this.$(d.REQUESTS_SECTION).hasClass("hide")||this.$(d.REQUESTS_SECTION).addClass("hide"),this._notifications.length>0?this.$(d.NOTIFICATIONS_SECTION).hasClass("hide")&&this.$(d.NOTIFICATIONS_SECTION).removeClass("hide"):this.$(d.NOTIFICATIONS_SECTION).hasClass("hide")||this.$(d.NOTIFICATIONS_SECTION).addClass("hide"),this._requests.length>0||this._notifications.length>0?this.$(d.WELCOME_SECTION).hasClass("hide")||this.$(d.WELCOME_SECTION).addClass("hide"):this.$(d.WELCOME_SECTION).hasClass("hide")&&this.$(d.WELCOME_SECTION).removeClass("hide")},_setupListener:function(){this.options.appApi.rnaApi.done(_.bind(function(t){t.rnaActivityBadgeAPI.initListener().done(_.bind(function(t){t._addEventListener("all",_.bind(function(t,e){if(-1!=$.inArray(t,[r.historicalNotificationEvent,r.newNotificationEvent])){var i=!1;for(var n in e.params)try{var a={},s=e.params[n],o=JSON.parse(s.payload);a.notificationId=s.notificationId,a.timestamp=u.getDateObject(s.timestamp),a.timeString=u.getElapsedTime(a.timestamp),a.subtype=s.subtype,a.readState=s.readState,a.message=o.hasOwnProperty("bellUi")?o.bellUi:(o.ostray||{}).message,a.fullpayload=o.fullpayload;var d=((o.fullpayload||{}).asset||{}).name;if(a.document=_.escape(d),a=E.fillTemplateDataForANSNotification(a,o),a.datatype=c.ANS_DATATYPE,t===r.newNotificationEvent?(a.recency=c.NEW,this._unreadNotificationsCount+=1):t===r.historicalNotificationEvent&&(a.recency=c.HISTORICAL),a.workflowType==c.SIGN_WORKFLOW&&a.workflowId){var l=this._signWorkflowData.findWhere({id:a.workflowId});if(l){var h=E.getSignMessageFromDataModel(a,l);a=Object.assign(a,h)}}a.templateType===c.CTA_TEMPLATE?(this._requests.add(a),i=!0):(a.templateType===c.INFO_TEMPLATE||a.templateType===c.COMMENT_TEMPLATE)&&this._addToNotificationsCollection(a)}catch(g){u.logAnalytics(r.BELLUI,r.ERROR,g.stack,this.options)}this._waitingForFetchResults=!1,i&&this._requests.reRender(),this._setAccordionState(this._accordionState),this._updateSpinner(),this._updateScrollToTopButton(),this._notifications.length<10&&this._fetchMoreNotifications()}},this),null,null),t._addEventListener(r.workflowDataEvent,_.bind(function(t,e){this._signWorkflowData.reset(),this._signWorkflowData.pushData(e.params),this._checkForEmptySignNotifications()},this),null,null),t._addEventListener(r.clearDataEvent,_.bind(function(){this._notifications.reset(),this._requests.reset(),this._accordionState=c.ACCORDION_DEFAULT,this._endOfNotifications=!1,this._waitingForFetchResults=!1},this),null,null),t._addEventListener(r.setEndOfNotificationsEvent,_.bind(function(){this._waitingForFetchResults=!1,this._endOfNotifications=!0,this._updateSpinner()},this),null,null),t._addEventListener(r.popupStateChangeEvent,_.bind(function(t,e){e.params===r.POPUP_CLOSED?this._bellWindowOpen=!1:e.params===r.POPUP_OPENED&&(this._bellWindowOpen=!0,this._updateTimeStringForAllNotifications(),this._updateTimeStringForAllNotifications(),u.logAnalytics(r.BELLUI,r.BELL_WINDOW,r.SHOWN,this.options))},this),null,null),t._addEventListener(r.updateNotificationStateEvent,_.bind(function(t,e){for(var i in e.params){var n=null,a=e.params[i];n=this._getModelByNotificationId(i),n&&n.set("readState",a),n&&n.get("templateType")==c.CTA_TEMPLATE&&a==r.NOTIFICATION_EXPIRED&&(this._requests.reRender(),this._setAccordionState(this._accordionState))}},this),null,null)},this),this)},this))},_updateSpinner:function(){var t=this.$(d.NOTIFICATIONS_WRAPPER_SECTION),e=this.$(d.REQUESTS_SECTION),i=this.$(d.NOTIFICATIONS_SECTION),n=this.$(d.SPINNER);this._endOfNotifications?this.$(d.SPINNER).addClass("hide"):this.$(d.SPINNER).hasClass("hide")?t.scrollTop()+this.$el.height()>e.height()+i.height()&&this.$(d.SPINNER).removeClass("hide"):t.scrollTop()+this.$el.height()<e.height()+i.height()-n.height()&&this.$(d.SPINNER).addClass("hide"),this._fixHeaderWidth()},_addToNotificationsCollection:function(t){if(t.templateType!==c.NO_TEMPLATE)if(t.recency===c.NEW){var e=this._getModelByNotificationId(t.notificationId);e&&e.destroy();var i=this._notifications.models;this._notifications.reset(),this._notifications.add(t),this._notifications.add(i)}else t.recency===c.HISTORICAL&&this._notifications.add(t)},_renderComplete:function(){this.options.appApi.rnaApi.done(_.bind(function(t){t.rnaActivityBadgeAPI.renderComplete()},this))},_renderNotificationsView:function(){this._renderChildView("_NotificationsView",i.NotificationsView,this.$(d.NOTIFICATIONS_SECTION),{collection:this._notifications})},_renderRequestsView:function(){this._renderChildView("_RequestsView",i.RequestsView,this.$(d.REQUESTS_SECTION),{collection:this._requests})},_renderNoNotificationView:function(){var t=new o;this.$(d.WELCOME_SECTION).append(t.render().el)},_onNotificationsScroll:function(){var t=this.$(d.NOTIFICATIONS_WRAPPER_SECTION),e=this.$(d.REQUESTS_SECTION),i=this.$(d.NOTIFICATIONS_SECTION);this._checkAccordionHeaders(),t.scrollTop()+this.$el.height()>e.height()+i.height()&&(this._updateSpinner(),this._fetchMoreNotifications(),u.logAnalytics(r.BELLUI,r.FETCH_MORE_NOTIFICATIONS,r.CALLED,this.options)),0!=t.scrollTop()||this.$(d.SCROLL_TOP_BUTTON).hasClass("hide")||(this.$(d.SCROLL_TOP_BUTTON).addClass("hide"),this._unreadNotificationsCount=0)},_fetchMoreNotifications:function(){this._endOfNotifications||this._waitingForFetchResults||this.options.appApi.rnaApi.done(_.bind(function(t){t.rnaActivityBadgeAPI.fetchMoreNotifications(),this._waitingForFetchResults=!0},this))},_onAccordionClick:function(t){t.preventDefault();var e=$(t.currentTarget).attr("id");"showMoreRequestsButton"==e?(this._accordionState==c.ACCORDION_DEFAULT&&this._setAccordionState(c.ACCORDION_EXPANDED),u.logAnalytics(r.BELLUI,r.SHOW_MORE_REQUESTS,r.CLICKED,this.options),this._RequestsView.logRemainingRequests()):"notificationHeader"==e?this._accordionState==c.ACCORDION_EXPANDED&&(this._setAccordionState(c.ACCORDION_DEFAULT),this._scrollToTop()):"requestHeader"==e&&(this._accordionState==c.ACCORDION_EXPANDED&&this._setAccordionState(c.ACCORDION_DEFAULT),this._accordionState==c.ACCORDION_DEFAULT&&this._isNotificationHeaderFixedOnTop()&&(this.$(".notifications-data-wrapper").scrollTop(0),this._setAccordionState(c.ACCORDION_DEFAULT)))},_setAccordionState:function(t){if(this._accordionState=t,t==c.ACCORDION_EXPANDED)$("#showMoreRequestsButton").addClass("hide"),$(".request-hide-toggle").removeClass("hide"),$("#notificationHeader").addClass("notifications-title-fixed-bottom"),$(".requests-section > .notifications-container").addClass("notifications-container-padding-bottom");else if(t==c.ACCORDION_DEFAULT){if(this._checkAccordionHeaders(),this._requests.size()>2){if(this._getCurrentState()==c.ONLY_REQUESTS)return $("#showMoreRequestsButton").addClass("hide"),void $(".request-hide-toggle").removeClass("hide");$("#showMoreRequestsButton").removeClass("hide")}else $("#showMoreRequestsButton").addClass("hide");$(".request-hide-toggle").addClass("hide"),$("#notificationHeader").removeClass("notifications-title-fixed-bottom"),$(".requests-section > .notifications-container").removeClass("notifications-container-padding-bottom")}this._checkAccordionHeaders()},_checkAccordionHeaders:function(){var t=this.$(d.NOTIFICATIONS_WRAPPER_SECTION),e=this.$(d.REQUEST_BODY_ID),i=$("#notificationHeader");t.scrollTop()>=e.height()?this._isNotificationHeaderFixedOnTop()||$("#notificationHeader").addClass(this._requests.length>0?"notifications-title-fixed-below-requests-title":"notifications-title-fixed-top"):this._isNotificationHeaderFixedOnTop()&&($("#notificationHeader").removeClass("notifications-title-fixed-top"),$("#notificationHeader").removeClass("notifications-title-fixed-below-requests-title")),e.height()+i.height()>t.scrollTop()+this.$el.height()?this._isNotificationHeaderFixedAtBottom()||($("#notificationHeader").addClass("notifications-title-fixed-bottom"),$(".requests-section > .notifications-container").addClass("notifications-container-padding-bottom")):this._isNotificationHeaderFixedAtBottom()&&($("#notificationHeader").removeClass("notifications-title-fixed-bottom"),$(".requests-section > .notifications-container").removeClass("notifications-container-padding-bottom")),this._fixHeaderWidth()},_fixHeaderWidth:function(){var t=$(".notifications-container:visible").width();$("#requestHeader").width(t),$("#notificationHeader").width(t)},_isNotificationHeaderFixedOnTop:function(){return $("#notificationHeader").hasClass("notifications-title-fixed-below-requests-title")||$("#notificationHeader").hasClass("notifications-title-fixed-top")?!0:!1},_isNotificationHeaderFixedAtBottom:function(){return $("#notificationHeader").hasClass("notifications-title-fixed-bottom")?!0:!1},_getCurrentState:function(){return this._requests.length>0&&this._notifications.length>0?c.BOTH_REQUESTS_AND_NOTIFICATIONS:this._requests.length>0&&0==this._notifications.length?c.ONLY_REQUESTS:0==this._requests.length&&this._notifications.length>0?c.ONLY_NOTIFICATIONS:c.EMPTY_STATE},_updateTimeStringForAllNotifications:function(){_.each(this._requests.models,this._updateNotificationTimeString,this),_.each(this._notifications.models,this._updateNotificationTimeString,this)},_updateNotificationTimeString:function(t){var e=u.getElapsedTime(t.attributes.timestamp);t.set("timeString",e)},_getModelByNotificationId:function(t){var e=this._notifications.findWhere({notificationId:t});return e||(e=this._requests.findWhere({notificationId:t})),e},_setFocusOnLastNotification:function(t){var e=$(d.ARROW_KEY_FOCUS);if(!_.isUndefined(e)){var i=e.index(t.target);e.eq(i-1).focus()}},_onKeyDown:function(t){var i,n,a=$(t.currentTarget).attr("id");13===t.which||32===t.which?"showMoreRequestsButton"==a?(i=$(d.ARROW_KEY_FOCUS),n=i.index(t.target),this._onAccordionClick(t),i=$(d.ARROW_KEY_FOCUS),i.eq(n).focus()):this._onAccordionClick(t):9===t.which?(i=$(d.TAB_ORDER),n=i.index(t.target),0==n&&t.shiftKey?(i.eq(i.length-1).focus(),this._consumeEvent(t)):n!=i.length-1||t.shiftKey||(i.eq(0).focus(),this._consumeEvent(t))):(i=$(d.ARROW_KEY_FOCUS),e.nextElem(t,i))},_hidePopUp:function(t){27===t.keyCode&&this.options.appApi.rnaApi.done(_.bind(function(t){t.rnaActivityBadgeAPI.hidePopUp()},this))},_updateScrollToTopButton:function(){var t="",e=this.$(d.NOTIFICATIONS_WRAPPER_SECTION);this._unreadNotificationsCount>0&&(this._bellWindowOpen&&(e.scrollTop()>0||this._accordionState!=c.ACCORDION_DEFAULT)?(t=1==this._unreadNotificationsCount?_.template(l.UNREAD_NOTIFICATION,{count:this._unreadNotificationsCount}):_.template(l.UNREAD_NOTIFICATIONS,{count:this._unreadNotificationsCount}),this.$(d.SCROLL_TOP_BUTTON_TEXT).text(t),this._isNotificationHeaderFixedOnTop()?this.$(".banner-header-section").addClass("banner-under-second-header"):this.$(".banner-header-section").removeClass("banner-under-second-header"),this.$(d.SCROLL_TOP_BUTTON).removeClass("hide")):(this.$(d.SCROLL_TOP_BUTTON).addClass("hide"),this._scrollToTop(),this._unreadNotificationsCount=0))},_scrollToTop:function(){var t=300,e=this.$(d.NOTIFICATIONS_WRAPPER_SECTION),i=e.scrollTop()/(t/15),n=setInterval(function(){var t=e.scrollTop();t>0?e.scrollTop(t-i):(clearInterval(n),this.$(d.SCROLL_TOP_BUTTON).addClass("hide"),this._unreadNotificationsCount=0,this._setAccordionState(c.ACCORDION_DEFAULT))}.bind(this),15)},_checkForEmptySignNotifications:function(){var t=!1,e=this._requests.models.concat(this._notifications.models);for(var i in e){var n=e[i];if(n.get("workflowType")==c.SIGN_WORKFLOW&&""===n.get("message")){var a=this._signWorkflowData.findWhere({id:n.get("workflowId")});if(a){var s=E.getSignMessageFromDataModel(n.attributes,a);n.trigger("updateModel",s),t=!0}}}t&&this._setAccordionState(this._accordionState)}}),i.PluginView}),define("pdmplugins/activity-badge/js/activity-badge",["pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/ops/op-factory","pdmplugins/activity-badge/js/views/plugin-view"],function(t){_.extend(t,{init:function(){t.opFactory=new t.OpFactory}})}),define("pdmplugins/activity-badge/js/plugin",["core/ac-core-init","files/ac-files-init","pdmplugins/activity-badge/js/ac-activity-badge","pdmplugins/activity-badge/js/activity-badge"],function(t,e,i){i.init()});