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

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

define("pdmplugins/mip/js/ac-mip",["plugins-common/ac-plugins"],function(e){var t=e.Mip;return t||(t=e.Mip={}),t.PLUGIN_ID||(t.PLUGIN_ID="mip"),t}),define("pdmplugins/esign/js/ac-esign",["plugins-common/ac-plugins"],function(e){var t=e.EchoSign;return t||(t=e.EchoSign={}),t}),define("pdmplugins/mip/js/models/autocomplete-model",["core/ac-core","pdmplugins/mip/js/ac-mip","core/models/model"],function(e,t){return t.AutocompleteModel=e.Model.extend({idAttribute:"email",initialize:function(t,i){e.Model.prototype.initialize.call(this,t,i),this.rootUrl="",i.collection&&(this.rootUrl=i.collection.rootUrl),i.rootUrl&&(this.rootUrl=i.rootUrl)},url:function(){return this.rootUrl+"a/api/autoc/emails"}}),t.AutocompleteModel}),define("pdmplugins/mip/js/collection/autocomplete-collection",["pdmplugins/mip/js/ac-mip","core/utils/http-util","pdmplugins/mip/js/models/autocomplete-model"],function(e,t){return e.AutocompleteCollection=Backbone.Collection.extend({model:e.AutocompleteModel,initialize:function(e,t){Backbone.Collection.prototype.initialize.call(this,e,t),this.rootUrl=t.rootUrl,this.set({models:[]})},url:function(){return this.rootUrl+"/a/api/autoc/email"},fetch:function(e){return e=t.customizeOptions("GET",e),Backbone.Collection.prototype.fetch.call(this,e)},fetchNext:function(){var e={};return this.next_context&&(e.data=_.extend({},{context:this.next_context,sofar:this.length},e.data)),e.global=!1,e.remove=!1,this.fetch(e)},fetchAll:function(){this.fetchNext().then(_.bind(this.fetchComplete,this))},fetchComplete:function(){this.next_context&&this.fetchAll()},parse:function(e){e.emails;return this.next_context=e.next_context,e.emails},setRUrl:function(e){this.rootUrl=e}}),e.AutocompleteCollection}),define("pdmplugins/mip/js/ops/plugin/starting-plugin-op",["core/ac-core","pdmplugins/mip/js/ac-mip","pdmplugins/esign/js/ac-esign","core/ops/op","pdmplugins/mip/js/collection/autocomplete-collection"],function(e,t,i){t.StartingPluginOp=e.Op.extend({run:function(){var e,s=this.options,n=i.opFactory;return _.extend(s,{autoCCollection:new t.AutocompleteCollection([],{rootUrl:e})}),n.create("InitializingOp",s).run(),$.Deferred().resolve().promise()}})}),define("pdmplugins/mip/js/utils/ts-utils",[],function(){var e={extractRootUrl:function(e){var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.host}};return e}),define("pdmplugins/mip/js/ops/desktop-fetching-autocomplete-list-op",["core/ac-core","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/utils/ts-utils","core/ops/op"],function(e,t,i){t.DesktopFetchingAutocompleteListOp=e.Op.extend({run:function(){var e,t=this.options.userInformationModel.get("enable_autocomplete");return t?this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){return e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=i.extractRootUrl(e),this.options.rootUrl=e,this.options.autoCCollection.setRUrl(this.options.rootUrl),this._getResolvedPromise()},this)):void 0}})}),define("pdmplugins/mip/js/ops/get-from-addressbook-op",["core/ac-core","pdmplugins/mip/js/ac-mip"],function(e,t){return t.GetFromAddressbookOp=e.Op.extend({run:function(){var e=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(t){t.stApi.resolveAddressBookApi().then(_.bind(function(t){t._addEventListener("custom:onAddressesAdded",_.bind(function(t,i){var s=i.params;s.length?e.resolve(s):e.reject()},this))},this),_.bind(function(){e.reject()},this))},this)),e.promise()}}),t.GetFromAddressbookOp}),define("pdmplugins/mip/js/ops/op-factory",["core/ac-core-init","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/ops/plugin/starting-plugin-op","pdmplugins/mip/js/ops/desktop-fetching-autocomplete-list-op","pdmplugins/mip/js/ops/get-from-addressbook-op"],function(e,t){t.OpFactory=e.Op.extend({create:function(e,i){var s=t[e];return s?new s(i):void LOG(0,"AcMip.OpFactory.create: Unrecognized class: "+e)}})}),define("pdmplugins/mip/js/nls/ui-strings",{root:!0,"xx-xx":!0,"ca-es":!0,"cs-cz":!0,"da-dk":!0,"de-de":!0,"en-ae":!0,"en-il":!0,"es-es":!0,"eu-es":!0,"fi-fi":!0,"fr-fr":!0,"fr-ma":!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/mip/js/nls/root/ui-strings",{SENSITIVITY_LABEL:"Select a sensitivity label",CANCEL_BUTTON_TEXT:"Cancel",UPDATE_BUTTON_TEXT:"Update",APPLY_BUTTON_TEXT:"Apply",BACK_BUTTON_TEXT:"Back",SUBMIT_BUTTON_TEXT:"Submit",SAVE_BUTTON_TEXT:"Save",ADD_BUTTON_TEXT:"Add",JUSTIFICATION_REQUIRED:"Justification required",JUSTIFICATION_HEAD_TEXT:"Your organization requires justification for changing sensitivity label.",JUSTIFICATION_OPTION_1:"The previous label no longer applies",JUSTIFICATION_OPTION_2:"Previous label was incorrect",JUSTIFICATION_OPTION_OTHER:"Other (explain) - Do not enter sensitive data",ENTER_JUSTIFICATION:"Enter justification",DELETE_LABEL:"Delete label",LABEL_DETAILS_TOOLTIP:"Sensitivity label details",SPECIFY_USER_OR_GROUP:"Specify user, group or domain",DEFINE_LABEL_PERMISSION:"Define label permission",MORE_OPTIONS:"More options",CAN_READ:"Can read",CAN_CHANGE:"Can change",CAN_FULL_CONTROL:"Can full control",READ:"Read",READ_COPY:"Read (can copy)",READ_PRINT:"Read (can print)",READ_COPY_PRINT:"Read (can copy and print)",CHANGE:"Change",CHANGE_PRINT:"Change (can print)",FULL_CONTROL:"Full control",DELETE:"Delete",CUSTOM:"Custom",OWNER:"Owner",OWNER_SIGNAL:"(you)",DOCUMENT_EXPIRY:"This document expires on ",READ_PERMISSION_TEXT:"People with read permission are also allowed to",COPY_CHECKBOX:"Copy this document",CHANGE_PERMISSION_TEXT:"People with read or change permission are also allowed to",PRINT_CHECKBOX:"Print this document",MMDDYYYY_PLACEHOLDER:"mm/dd/yyyy",EXPIRY_DATE_ERROR:"Enter a valid expiry date",UDP_EDIT_LABEL:"Edit label permissions",GENERIC_ARIA_LABEL_STRING:"<%= prefix %>. <%= suffix %>",ADDED_RECIPIENT_NO_COUNT:"ADDED RECIPIENTS",GET_MS_GRAPH_CONTACTS_MSG:"Sign in with your Office account to access Outlook contacts.",GET_MS_GRAPH_CONTACTS_MSG_1:"Sign in with your ",GET_MS_GRAPH_CONTACTS_MSG_2:" account to access ",GET_MS_GRAPH_CONTACTS_MSG_3:" contacts.",EMAIL_REMOVE:"Remove email"}),define("pdmplugins/mip/js/templates/edit-sensitivity-label-template",[],function(){return'<div class="ui-theme theme-text sensitivity-label-container sensitivity-label-container-background"><div id="sensitivity-label-header-id" class="sensitivity-label-header"><div class = "sensitivityLabelDialogHeading sensitivityLabelDialogHeadingLocation theme-text"><%= SENSITIVITY_LABEL %></div><button class="spectrum-ActionButton" id="button-info-icon" tabIndex="-1"><span id="info-icon" title="<%= LABEL_DETAILS_TOOLTIP %>" class="ui-theme theme-hyperlink" tabindex="1" aria-label="<%= LABEL_DETAILS_TOOLTIP %>"></span></button></div><div class="horizontal-rule"><hr color="#E8E8E8" border-width:"thin" ></div><div id="mip-sensitivity-label-body-scrollable-div" class="ui-theme theme-mip-container"><div class="label-info"></div></div><div class="sensitivity-label-btns-group"><div id = "sensitivity-label-footer-id" class="sensitivity-label-footer" ><div class="sensitivity-label-btn-left"><input class="sens-label-dlg-delete-btn  			theme-button-gray-label theme-hoverable" 			id="sens-label-dlg-delete-btn-id" 			type="button" tabindex="10" 			aria-label="<%= DELETE_LABEL_TEXT %>" 			value="<%= DELETE_LABEL_TEXT %>" /></div><div class="sensitivity-label-btn-right"><input  class="sens-label-dlg-cancel-btn 				 control-button button-grey 				 theme-button-gray-label" 				 id="sens-label-dlg-cancel-btn" 				 type="button" tabindex="11" 				 aria-label= "<%=CANCEL_BUTTON_TEXT%>" 				 value="<%=CANCEL_BUTTON_TEXT%>"  /><input class="sens-label-dlg-update-btn cta-focus				 control-button 				 theme-button-label" 				 id="sens-label-dlg-update-btn" 				 type="button" tabindex="12" 				 style ="margin-left: 16px;"				 aria-label="<%=UPDATE_BUTTON_TEXT%>"				 value="<%=UPDATE_BUTTON_TEXT%>" /><input class="sens-label-dlg-apply-btn cta-focus				 control-button 				 theme-button-label" 				 id="sens-label-dlg-apply-btn" 				 type="button" tabindex="13" 				 style ="margin-left: 16px;"				 aria-label="<%=APPLY_BUTTON_TEXT%>"				 value="<%=APPLY_BUTTON_TEXT%>" /></div></div></div></div>'}),define("pdmplugins/mip/js/templates/edit-sensitivity-label-child-template",[],function(){return'<div class = "sensitivity-label-content-body sensitivity-label-content-child-txt-light-theme" title="<%= labelDescription %>" tabindex=-1 aria-labelledby="checkmark-<%=labelID%>" id="<%=labelID%>"><table id="sensitivity-label-content-child-txt-id" class="ui-theme theme-text"><tr class="sensitivity-label-content-child"><td width="0%" class="remove-padding-top-sec-col"><svg id="child-img-<%=labelID%>" class="root-row-icon" style=<%=labelColor%> > </svg></td><td width="90%" class="label-name-description"><label for="checkmark-<%=labelID%>" class="label-row mip-child-label ui-theme theme-text" id="label-info-<%=labelID%>" align="left" maxlength="255"> <%= labelName %> </label><button class="spectrum-ActionButton btn-udp-edit hidden" id="button-udp-edit-<%=labelID%>" tabIndex="-1"><span id="udp-edit-<%=labelID%>" title="<%=udpEditIconTooltip%>" class="ui-theme theme-hyperlink udp-edit-icon" tabindex="1" aria-label="<%=udpEditIconTooltip%>" align="left"></span></button></td><td width="10%" class="remove-padding-top-first-col"><label id="checkmark-container-<%=labelID%>" class="checkmark-container"><input type="checkbox" id="checkmark-<%=labelID%>" tabindex=-1 class="sens-checkmark" name="checkbox-button" value=<%=labelID%>><span class="checkmark"></span></label></td></tr></table></div>'}),define("pdmplugins/mip/js/templates/edit-sensitivity-label-parent-template",[],function(){return'<div class = "parent-label-data mip-option-item"><div class="parent-label sensitivity-label-content-body mip-accodian mip-actions-item cb-active-text-theme" title="<%= labelDescription %>" id="<%=labelID%>" tabindex="-1"><table class="sensitivity-label-content-parent" id="<%=labelID%>" class="ui-theme theme-text"><tr><td class="label-name-description" id="name-desc-col-<%=labelID%>"><div class="label-row mip-parent-label ui-theme theme-text" id="name-<%=labelID%>" align="left" maxlength="255"> <%= labelName %> </div></td></tr></table></div><div class="parent-label-expanded-<%=labelID%> mip-parent-label-expanded" id="parent-label-expanded-<%=labelID%>"><div class="sub-child-labels-info-<%=labelID%>" id="sub-child-labels-info-id"></div></div></div>'}),define("pdmplugins/mip/js/views/edit-sensitivity-label-view",["core/ac-core","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/templates/edit-sensitivity-label-template","pdmplugins/mip/js/templates/edit-sensitivity-label-child-template","pdmplugins/mip/js/templates/edit-sensitivity-label-parent-template","core/utils/view-util","i18n!pdmplugins/mip/js/nls/ui-strings"],function(e,t,i,s,n,o,a){t.SensitivityLabelDialog=e.View.extend({events:{"click   .sens-label-dlg-cancel-btn":"_closeSensLabelDialog","keydown .sens-label-dlg-cancel-btn":"_onButtonKeyDown","click   .sens-label-dlg-update-btn":"_updateLabel","keydown .sens-label-dlg-update-btn":"_onButtonKeyDown","click   .sens-label-dlg-apply-btn":"_applyLabel","keydown .sens-label-dlg-apply-btn":"_onButtonKeyDown","click   .sens-label-dlg-delete-btn":"_deleteLabel","keydown .sens-label-dlg-delete-btn":"_onButtonKeyDown","click   #info-icon":"_learnMore","keydown #info-icon":"_onButtonKeyDown","keydown .sensitivity-label-content-body":"_onButtonKeyDown"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(i)},render:function(){e.PluginContentView.prototype.render.call(this),this.$el.children().length>0||(0===this.$el.children().length&&(this.$el.html(this._template({SENSITIVITY_LABEL:a.SENSITIVITY_LABEL,CANCEL_BUTTON_TEXT:a.CANCEL_BUTTON_TEXT,UPDATE_BUTTON_TEXT:a.UPDATE_BUTTON_TEXT,APPLY_BUTTON_TEXT:a.APPLY_BUTTON_TEXT,DELETE_LABEL_TEXT:a.DELETE_LABEL,LABEL_DETAILS_TOOLTIP:a.LABEL_DETAILS_TOOLTIP})),this._initWrappers(),this._isMIPDeleteLabelEnabled(),this._showApplyOrUpdateButton(),this._showMIPHelpURL()),this._renderMIPLabels())},_renderMIPLabels:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"fetchUserLabels",methodArgs:""}).done(_.bind(function(e){console.log("Labels-Response");var t=[],i="";if(e&&e.length>0){for(var o,l=0;l<e.length;l++){var r=e[l],d="--color:"+r.labelColor+";",c=r.childrenIDs;0==r.hasParent&&(c.length>0?(o=_.template(n)({labelID:r.labelID,labelName:r.labelName,labelDescription:r.labelDescription,labelColor:d}),t.push(l),i+=o):(o=_.template(s)({labelID:r.labelID,labelName:r.labelName,labelDescription:r.labelDescription,labelColor:d,udpEditIconTooltip:a.UDP_EDIT_LABEL}),i+=o))}this.$labelInfo.html(i);for(var p=0;p<t.length;p++){var r=e[t[p]],u=r.labelID,h=document.getElementById(u),c=r.childrenIDs;this._renderMIPLabelsChildren(e,c,t[p])}for(var p=0;p<e.length;p++){var r=e[p],c=r.childrenIDs;if(0==c.length){var m=r.labelID,h=document.getElementById(m);h.addEventListener("click",this._labelSelected)}}this._initWrappers(),this._checkAppliedLabel(),this._isApplyUpdateButtonEnabled(),this._showUDPEditIcon();var E=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));"DarkTheme"==E.theme&&(this.$labelContainer.removeClass("sensitivity-label-container-background"),this.$sensitivityLabelBody.removeClass("sensitivity-label-content-child-txt-light-theme"),this.$sensitivityLabelBody.addClass("sensitivity-label-content-child-txt-dark-theme")),this.$sensitivityLabelBody.show()}else this.$sensitivityLabelBody.hide()},this))},this))},_renderMIPLabelsChildren:function(e,t,i){var n=".sub-child-labels-info-"+e[i].labelID;this.$subChildLabelsInfo=this.$(n);for(var o="",l=0;l<t.length;l++)for(var r=0;r<e.length;r++)if(t[l]===e[r].labelID){var d,c=e[r],p="--color:"+c.labelColor+";";d=_.template(s)({labelID:c.labelID,labelName:c.labelName,labelDescription:c.labelDescription,labelColor:p,udpEditIconTooltip:a.UDP_EDIT_LABEL}),o+=d;break}this.$subChildLabelsInfo.html(o)},_checksAfterLabelIsSelected:function(){var e=this.$("input[name='checkbox-button']").is(":checked");o.enableInput(this.$applyButton,e);var t=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?"))),i=t.appliedLabelId,s=$("input[name='checkbox-button']:checked").val();if(i==s?o.enableInput(this.$sensLabelUpdateBtn,!1):o.enableInput(this.$sensLabelUpdateBtn,!0),"update-button"===t.isApplyButton){var t=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));o.enableInput(this.$sensLabelDelBtn,"true"===t.isDelLabelEnabled&&e),"true"===t.isDelLabelEnabled&&"true"===e?(this.$sensLabelDelBtn.addClass("sens-del-button-hover-class"),this.$sensLabelDelBtn.addClass("theme-hoverable")):(this.$sensLabelDelBtn.removeClass("sens-del-button-hover-class"),this.$sensLabelDelBtn.removeClass("theme-hoverable"))}},_labelSelected:function(e){var t=e.currentTarget.id,i=document.getElementsByName("checkbox-button");Array.prototype.forEach.call(i,function(e){{var i="checkmark-"+e.value;document.getElementById(i).checked}document.getElementById(i).checked=t==e.value?!0:!1}),this._checksAfterLabelIsSelected()},_isApplyUpdateButtonEnabled:function(e){var t=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));if("apply-button"===t.isApplyButton){var i=this.$("input[name='checkbox-button']").is(":checked");o.enableInput(this.$applyButton,i)}else{var s=t.appliedLabelId,n=$("input[name='checkbox-button']:checked").val();s==n&&o.enableInput(this.$sensLabelUpdateBtn,!1)}$(this).off(e)},_isMIPDeleteLabelEnabled:function(){var e=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));"true"===e.isDelLabelEnabled?(o.enableInput(this.$sensLabelDelBtn,!0),this.$sensLabelDelBtn.addClass("sens-del-button-hover-class"),this.$sensLabelDelBtn.addClass("theme-hoverable")):(o.enableInput(this.$sensLabelDelBtn,!1),this.$sensLabelDelBtn.removeClass("sens-del-button-hover-class"),this.$sensLabelDelBtn.removeClass("theme-hoverable"))},_checkAppliedLabel:function(){var e=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?"))),t=e.appliedLabelId,i="checkmark-"+t;void 0!=t&&(document.getElementById(i).checked=!0)},_showApplyOrUpdateButton:function(){var e=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));"apply-button"===e.isApplyButton?(this.$sensLabelApplyBtn.show(),this.$sensLabelUpdateBtn.hide()):(this.$sensLabelApplyBtn.hide(),this.$sensLabelUpdateBtn.show())},_editMIPUDPLabel:function(){var e=$("input[name='checkbox-button']:checked").val();this.options.appApi.rnaApi.done(_.bind(function(t){t.invokeMethod({methodName:"editMIPUDPLabelModal",methodArgs:e})},this))},_showUDPEditIcon:function(){var e=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?"))),t=e.appliedLabelId,i="#button-udp-edit-"+t;if(this.$udpEditLabelPermsBtn=this.$(i),"true"===e.isUDPLabel){this.$udpEditLabelPermsBtn.removeClass("hidden");var s=document.getElementById("button-udp-edit-"+t);s.addEventListener("click",this._editMIPUDPLabel)}},_showMIPHelpURL:function(){var e=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));"true"===e.MIPHelpURL?(this.$helpURL.show(),this.$sensDialogHeading.addClass("sensitivityLabelDialogHeadingLocation")):(this.$helpURL.hide(),this.$sensDialogHeading.removeClass("sensitivityLabelDialogHeadingLocation"))},_initWrappers:function(){this.$labelContainer=this.$(".sensitivity-label-container"),this.$scrollableDivContainer=this.$("#mip-sensitivity-label-body-scrollable-div"),this.$applyButton=this.$(".sens-label-dlg-apply-btn"),this.$labelInfo=this.$(".label-info"),this.$sensLabelCloseButton=this.$("#sens-label-dlg-cancel-btn"),this.$sensLabelUpdateBtn=this.$("#sens-label-dlg-update-btn"),this.$sensLabelApplyBtn=this.$("#sens-label-dlg-apply-btn"),this.$sensLabelDelBtn=this.$(".sens-label-dlg-delete-btn"),this.$rootRowIcon=this.$("#root-row-icon"),this.$helpURL=this.$("#button-info-icon"),this.$sensDialogHeading=this.$(".sensitivityLabelDialogHeading"),this.$sensitivityLabelBody=this.$(".sensitivity-label-content-body"),this.$parentChildMainDiv=this.$(".parent-label-data"),this.parentLabelExpandedView=this.$(".parent-label-expanded"),this.$rootLabelRow=this.$(".sensitivity-label-content-child-txt")},_toggleParentLabelData:function(e){var t=e.currentTarget.id,i="#dropdown-"+t;this.$expandParentLabelIcon=this.$(i),this.$expandParentLabelIcon.hasClass("rotated")?this._collapseParentLabelData(t):this._expandParentLabelData(t)},_expandParentLabelData:function(e){var t="#dropdown-"+e,i="#parent-label-expanded-"+e;this.$expandParentLabelIcon=this.$(t),this.$parentLabelExpandedView=this.$(i),this.$expandParentLabelIcon.addClass("rotated"),this.$parentLabelExpandedView.removeClass("invisible")},_collapseParentLabelData:function(e){var t="#dropdown-"+e,i="#parent-label-expanded-"+e;this.$expandParentLabelIcon=this.$(t),this.$parentLabelExpandedView=this.$(i),this.$expandParentLabelIcon.removeClass("rotated"),this.$parentLabelExpandedView.addClass("invisible")},_resizeDialog:function(){var e=312,t=480,i=this.options.docWindowWidth,s=this.options.docWindowHeight;e=Math.min(e,s),t=Math.min(t,i);var n=$.Deferred();return $(document).ready(_.bind(function(){this.options.appApi.rnaApi.done(_.bind(function(i){i.cefBrowserApi({methodName:"setContainerSize",parameters:[Math.floor(t),Math.floor(e)]}).done(function(){n.resolve()})},this))},this)),n.promise()},_renderChildViews:function(){this._closeOnESC(),this._renderIdentityViews(),this._UpdateControls()},_learnMore:function(){var e="MIPSensitivityLabel",t="LEARN_MORE",i="Clicked";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"redirectToMIPLabelsCustomHelpPage",methodArgs:""})},this))},_closeSensLabelDialog:function(){var e="MIPSensitivityLabel",t="CANCEL_BUTTON_TEXT",i="Cancelled";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"closeMIPSensitivityLabelModal",methodArgs:""})},this))},_updateLabel:function(){var e="MIPSensitivityLabel",t="UPDATE_BUTTON_TEXT",i="Clicked";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]);var s=$("input[name='checkbox-button']:checked").val();this.options.appApi.rnaApi.done(void 0==s?_.bind(function(e){e.invokeMethod({methodName:"deleteMIPSensitivityLabelModal"})},this):_.bind(function(e){e.invokeMethod({methodName:"updateMIPSensitivityLabelModal",methodArgs:s})},this))},_applyLabel:function(){var e="MIPSensitivityLabel",t="APPLY_BUTTON_TEXT",i="Clicked";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]);var s=$("input[name='checkbox-button']:checked").val();this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"applyMIPSensitivityLabelModal",methodArgs:s})},this))},_deleteLabel:function(){var e="MIPSensitivityLabel",t="DELETE_LABEL_TEXT",i="Clicked";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]);var s=$("input[name='checkbox-button']:checked").val(),n="checkmark-"+s;void 0!=s&&(document.getElementById(n).checked=!1);var a=this.$("input[name='checkbox-button']").is(":checked");o.enableInput(this.$sensLabelDelBtn,a),"true"===a?(this.$sensLabelDelBtn.addClass("sens-del-button-hover-class"),this.$sensLabelDelBtn.addClass("theme-hoverable")):(this.$sensLabelDelBtn.removeClass("sens-del-button-hover-class"),this.$sensLabelDelBtn.removeClass("theme-hoverable"),o.enableInput(this.$sensLabelUpdateBtn,!0))},_labelSelectArrowDown:function(e){for(var t=e.currentTarget.id,i=document.getElementsByName("checkbox-button"),s=!0,n=0;n<i.length;n++){var o=i[n],a="checkmark-"+o.value,l=document.getElementById(a).checked;s===!0&&n!=i.length-1?(1==l&&(document.getElementById(a).checked=!1),t==o.value&&(s=!1)):s===!1&&(document.getElementById(o.value).focus(),document.getElementById(a).checked=!0,s=!0)}this._checksAfterLabelIsSelected()},_labelSelectArrowUp:function(e){for(var t=e.currentTarget.id,i=document.getElementsByName("checkbox-button"),s=!0,n=i.length-1;n>=0;n--){var o=i[n],a="checkmark-"+o.value,l=document.getElementById(a).checked;s===!0&&0!=n?(1==l&&(document.getElementById(a).checked=!1),t==o.value&&(s=!1)):s===!1&&(document.getElementById(o.value).focus(),document.getElementById(a).checked=!0,s=!0)}this._checksAfterLabelIsSelected()},_labelSelectOnTab:function(){var e,t=this.$("input[name='checkbox-button']").is(":checked"),i=document.getElementsByName("checkbox-button");e=t?$("input[name='checkbox-button']:checked").val():i[0].value;var s="checkmark-"+e;document.getElementById(e).focus(),document.getElementById(s).checked=!0,this._checksAfterLabelIsSelected()},_onButtonKeyDown:function(e){var t=e.which,i=e.currentTarget,s=e.target;if(13===t||32===t){if("sens-label-dlg-apply-btn"===i.id)return this._consumeEvent(e),this._applyLabel();if("sens-label-dlg-update-btn"===i.id)return this._consumeEvent(e),this._updateLabel();if("sens-label-dlg-cancel-btn"===i.id)return this._consumeEvent(e),this._closeSensLabelDialog();if("sens-label-dlg-delete-btn"===i.id)return this._consumeEvent(e),this._deleteLabel();if("info-icon"===i.id)return this._consumeEvent(e),this._learnMore()}else if(9===t){var n=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?"))),o=n.isDelLabelEnabled,a=n.MIPHelpURL;(e.shiftKey&&"sens-label-dlg-delete-btn-id"===s.id||e.shiftKey&&"false"===o&&"sens-label-dlg-cancel-btn"===s.id||!e.shiftKey&&"info-icon"===s.id||!e.shiftKey&&"false"===a&&("sens-label-dlg-apply-btn"===s.id||"sens-label-dlg-update-btn"===s.id))&&(this._consumeEvent(e),this._labelSelectOnTab())}else 38===t?"sensitivity-label-content-body"===s.classList[0]&&(this._consumeEvent(e),this._labelSelectArrowUp(e)):40===t&&"sensitivity-label-content-body"===s.classList[0]&&(this._consumeEvent(e),this._labelSelectArrowDown(e))}})}),define("pdmplugins/mip/js/templates/justification-template",[],function(){return'<div class="ui-theme theme-text justification-container sensitivity-label-container-background"><div id="justification-header-id" class="justification-header"><div class = "justification-dialog-heading theme-text"><%= JUSTIFICATION_REQUIRED %></div><div class="horizontal-rule"><hr color="#E8E8E8" border-width:"thin" ></div></div><div id ="justification-choice"><table class="justification-table"><tr class="justify-row"><td class="justification-dialog-text ui-theme theme-text" colspan="2"><%= JUSTIFICATION_HEAD_TEXT %></td></tr><tr class="justify-row"><td class="justify-radio-cell"><input type="radio" checked class="justify-radio-button" id="radio_button_1" name = "radio-button" value="<%=JUSTIFICATION_OPTION_1%>"></td><td><label for="radio_button_1" id="radio_button_2_label" class="justify-radio-selector-label ui-theme theme-text" aria-label="<%=JUSTIFICATION_REQUIRED%><%=JUSTIFICATION_OPTION_1%>"><%= JUSTIFICATION_OPTION_1 %></label></td></tr><tr class="justify-row"><td class="justify-radio-cell"><input type="radio" class="justify-radio-button" id="radio_button_2" name = "radio-button" value="<%=JUSTIFICATION_OPTION_2%>" ></td><td><label for="radio_button_2" id="radio_button_2_label" class="justify-radio-selector-label ui-theme theme-text" aria-label="<%=JUSTIFICATION_REQUIRED%><%=JUSTIFICATION_OPTION_2%>" ><%= JUSTIFICATION_OPTION_2 %></label></td></tr><tr class="justify-row"><td class="justify-radio-cell"><input type="radio" class="justify-radio-button" id="radio_button_other" name = "radio-button" value="<%=JUSTIFICATION_OPTION_OTHER%>" ></td><td><label for="radio_button_other" id="radio_button_other_label" class="justify-radio-selector-label ui-theme theme-text" aria-label="<%=JUSTIFICATION_REQUIRED%><%=JUSTIFICATION_OPTION_OTHER%>" ><%= JUSTIFICATION_OPTION_OTHER %></label></td></tr><tr class ="justify-row"><td></td><td class="justify-text-box" style="padding-top: 6px;"><input type="text" style="width: 248px;height: 32px;" placeholder="<%=ENTER_JUSTIFICATION%>" class="justify-input theme-mip-container theme-input-box theme-text" id="justify-other-text" aria-labelledby="radio_button_other_label"></textarea></td> </tr></table></div><div id = "justification-footer-id" class="justification-footer" ><input  class="justify-dialog-back-btn 				 control-button button-grey 				 theme-button-gray-label" 				 id="justify-dialog-back-btn-id" 				 type="button" 				 aria-label= "<%=CANCEL_BUTTON_TEXT%>" 				 value="<%=CANCEL_BUTTON_TEXT%>"  /><input class="justify-dialog-submit-btn cta-focus				 control-button 				 theme-button-label" 				 id="justify-dialog-submit-btn-id" 				 type="button"				 style ="margin-left: 16px;"				 aria-label="<%=SUBMIT_BUTTON_TEXT%>"				 value="<%=SUBMIT_BUTTON_TEXT%>" /></div></div>'}),define("pdmplugins/mip/js/views/justification-view",["core/ac-core","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/templates/justification-template","core/utils/view-util","i18n!pdmplugins/mip/js/nls/ui-strings"],function(e,t,i,s,n){t.JustificationDialog=e.View.extend({events:{"click   .justify-dialog-back-btn":"_cancelJustificationDialog","keydown .justify-dialog-back-btn":"_onButtonKeyDown","click   .justify-dialog-submit-btn":"_submitJustification","keydown .justify-dialog-submit-btn":"_onButtonKeyDown","change   input#justify-other-text":"_justifyOptionOrTextValueChanged","input    input#justify-other-text":"_justifyOptionOrTextValueChanged","paste    #justify-other-text":"_justificationTextPaste","change  .justify-radio-button":"_justifyOptionOrTextValueChanged","keydown .justify-radio-button":"_onButtonKeyDown"},initialize:function(){console.log("justification dialog initialize"),e.View.prototype.initialize.call(this),this._template=_.template(i)},render:function(){if(e.PluginContentView.prototype.render.call(this),console.log("justification dialog render"),!(this.$el.children().length>0)){0===this.$el.children().length&&(this.$el.html(this._template({JUSTIFICATION_REQUIRED:n.JUSTIFICATION_REQUIRED,JUSTIFICATION_HEAD_TEXT:n.JUSTIFICATION_HEAD_TEXT,JUSTIFICATION_OPTION_1:n.JUSTIFICATION_OPTION_1,JUSTIFICATION_OPTION_2:n.JUSTIFICATION_OPTION_2,JUSTIFICATION_OPTION_OTHER:n.JUSTIFICATION_OPTION_OTHER,BACK_BUTTON_TEXT:n.BACK_BUTTON_TEXT,CANCEL_BUTTON_TEXT:n.CANCEL_BUTTON_TEXT,SUBMIT_BUTTON_TEXT:n.SUBMIT_BUTTON_TEXT,ENTER_JUSTIFICATION:n.ENTER_JUSTIFICATION})),this._initWrappers(),this._updateControls());var t=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));"DarkTheme"==t.theme&&this.$justifyLabelContainer.removeClass("sensitivity-label-container-background")}},_initWrappers:function(){this.$justifyLabelContainer=this.$(".justification-container"),this.$submitButton=this.$("#justify-dialog-submit-btn-id"),this.$justifyInput=this.$("#justify-other-text")},_updateControls:function(){var e=this.$("input[name='radio-button']").is(":checked"),t=$("input[name='radio-button']:checked").val(),i=!1;t==n.JUSTIFICATION_OPTION_OTHER?(i=!0,document.getElementById("justify-other-text").disabled=!1,document.getElementById("justify-other-text").setAttribute("maxlength",250)):(document.getElementById("justify-other-text").value="",document.getElementById("justify-other-text").disabled=!0);var o=!1;this.$justifyInput.val().length>=1&&(o=!0);var a=document.getElementById("justify-other-text").getAttribute("maxlength");this.$justifyInput.val().length>a&&(document.getElementById("justify-other-text").value=this.$justifyInput.val().slice(0,a));var l=e&&(!i||i&&o);s.enableInput(this.$submitButton,l)},_justifyOptionOrTextValueChanged:function(){this._updateControls()},_justificationTextPaste:function(){setTimeout(_.bind(function(){this._justifyOptionOrTextValueChanged()},this),100)},_renderChildViews:function(){this._closeOnESC(),this._renderIdentityViews(),this._UpdateControls()},_cancelJustificationDialog:function(){var e="MIPSensitivityLabel",t="JustificationDialog",i="Cancelled";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"cancelJustificationDialog",methodArgs:""})},this))},_submitJustification:function(){if(!this.$submitButton.prop("disabled")){var e="MIPSensitivityLabel",t="JustificationDialog",i="SubmitClicked";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]);var s={},o=$("input[name='radio-button']:checked").val(),a=this.$justifyInput.val();s.JustifyInput=o==n.JUSTIFICATION_OPTION_OTHER?a:o,this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"submitJustification",methodArgs:s})},this))}},_checkRadioOnTabEnter:function(e){document.getElementById(e.target.id).checked=!0,this._justifyOptionOrTextValueChanged()},_onButtonKeyDown:function(e){var t=e.which,i=e.currentTarget;if(13===t||32===t){if(i=e.currentTarget,"justify-dialog-back-btn"===i.id)return this._consumeEvent(e),this._cancelJustificationDialog();if("justify-dialog-submit-btn"===i.id)return this._consumeEvent(e),this._submitJustification();if("justify-radio-button"===i.className)return this._consumeEvent(e),this._checkRadioOnTabEnter(e)}}})}),define("pdmplugins/mip/js/templates/udp-template",[],function(){return'<div class="ui-theme theme-text udp-container"><div id="udp-header-id" class="udp-header"><div class = "udp-dialog-heading theme-text"><%= DEFINE_LABEL_PERMISSION %></div><button class="spectrum-ActionButton" id="more-options-icon-id" tabIndex="-1"><span id="more-options-icon" title="<%= MORE_OPTIONS %>" class="ui-theme theme-hyperlink" tabindex="1" aria-label="<%= MORE_OPTIONS %>"></span></button></div><div class = udp-medium-container><div class="udp-address-input-container"><div class = "udp-tool-frame ui-theme theme-share-container theme-share-popup-border theme-mip-container"><div class="udp-email-list theme-mip-container" role="grid" aria-labelledby="share-heading"><div class = "udp-email-input-box theme-mip-container"><input tabindex="2" type="text" class="udp-address-input ui-theme theme-text theme-share-container theme-mip-container" placeholder="<%= SPECIFY_USER_OR_GROUP %>"id="udp-address-input-id"aria-autocomplete="list"aria-label="<%= SPECIFY_USER_OR_GROUP %>"aria-owns="udp-share-auto-c-list" autocomplete="false" autofocus /></div></div></div></div><div class="udp-autocomplete-box-parent ui-theme theme-share-container"><div class="udp-autocomplete-box ui-theme theme-share-popup-border theme-share-container theme-text"></div></div><div class="add-buttons" id="add-buttons-id"><button class="udp-dialog-add-btn button-grey ui-theme theme-button-gray-label" tabindex="10" id="udp-dialog-add-btn-id" aria-label= "<%= ADD_BUTTON_TEXT %>" aria-describedby="udp-dialog-add-btn" ><%= ADD_BUTTON_TEXT %></button><div class="add-permissions-dropdown" id= "add-permissions-dropdown-id" ><input  class="add-permissions-btn 				 theme-button-gray-label" 				 id="add-permissions-btn-id" 				 type="button" tabindex="9" 				 aria-label= "<%=CAN_READ%>" 				 value="<%=CAN_READ%>"  /><div class= "core-down-triangle  permissions-dropdown-icon" id="carot-id"></div><div class=" add-permissions-menu-container theme-mip-container hide theme-input-box theme-text" id="add-permissions-menu"><table id="add-permissions-list-id" class="add-permissions-list ui-theme theme-text"><tr class="theme-hoverable read-permission-row" id="read-permission"><td width="90%" class="add-permission-text" id="read-permission"><label for="checkmark-read-permission" class=" ui-theme theme-text" id="read-permission-label" align="left" maxlength="255"> <%= READ %> </label></td><td width="10%" class="add-permission-checkmark" id="read-permission"><label id="read-permission" class="udp-checkmark-container"><input type="checkbox" class="permission-checkmark" id="checkmark-read-permission" checked tabindex=-1 name="checkbox-button" value=<%=READ%>><span class="udp-checkmark" id="read-permission"></span></label></td></tr><tr class="theme-hoverable change-permission-row" id="change-permission"><td width="90%" class="add-permission-text" id="change-permission"><label for="checkmark-change-permission" class=" ui-theme theme-text" id="change-permission-label" align="left" maxlength="255"><%=CHANGE%></label></td><td width="10%" class="add-permission-checkmark" id="change-permission"><label id="change-permission" class="udp-checkmark-container"><input type="checkbox" class="permission-checkmark" id="checkmark-change-permission" tabindex=-1  name="checkbox-button" value=<%=CHANGE%>><span class="udp-checkmark" id="change-permission"></span></label></td></tr><tr class="theme-hoverable full-control-permission-row" id="full-control-permission"><td width="90%" class="add-permission-text" id="full-control-permission"><label for="checkmark-full-control-permission" class=" ui-theme theme-text" id="full-control-permission-label" align="left" maxlength="255"> <%=FULL_CONTROL%> </label></td><td width="10%" class="add-permission-checkmark" id="full-control-permission"><label id="full-control-permission" class="udp-checkmark-container"><input type="checkbox" class="permission-checkmark" id="checkmark-full-control-permission" tabindex=-1 name="checkbox-button" value=<%=FULL_CONTROL%>><span class="udp-checkmark" id="full-control-permission"></span></label></td></tr></table></div></div></div><div class="added-users-block-scrollable-div ui-theme theme-text theme-share-popup-border theme-mip-container"><div class="users-permission-info"></div></div></div><div class="udp-expiry-date-text ui-theme theme-text" id="udp-expiry-date-id"></div><div id = "udp-footer-id" class="udp-footer" ><input  class="udp-dialog-cancel-btn 				 control-button button-grey 				 theme-button-gray-label" 				 id="udp-dialog-cancel-btn-id" 				 type="button" tabindex="11" 				 aria-label= "<%=CANCEL_BUTTON_TEXT%>" 				 value="<%=CANCEL_BUTTON_TEXT%>"  /><input class="udp-dialog-save-btn cta-focus				 control-button 				 theme-button-label" 				 id="udp-dialog-save-btn-id" 				 type="button" tabindex="11" 				 style ="margin-left: 16px;"				 aria-label="<%=SAVE_BUTTON_TEXT%>"				 value="<%=SAVE_BUTTON_TEXT%>" /></div></div>'
}),define("pdmplugins/mip/js/templates/udp-users-permission-template",[],function(){return'<div class = "users-permisisons-info "><table class="users-permission-table" id="<%=userEmailAddressID%>" class="ui-theme theme-text"><tr><td class="user-name" id="user-<%=userEmailAddressID%>"><div class="user-name-row ui-theme theme-text" id="name-<%=userEmailAddressID%>" align="left" maxlength="255"> <%= userName %> </div></td><div class="user-permissions-dropdown" id= "<%=userEmailAddressID%>-permissions-dropdown-id" ><td class="user-permission" id="<%=userEmailAddressID%>-user-permission" rowspan="2"><input class="<%=userEmailAddressID%>-user-permissions-btn user-permissions-btn 				 theme-button-gray-label" 				 id="<%=userEmailAddressID%>-permissions-btn-id" 				 type="button" tabindex="10" 				 aria-label= "<%=selectedPermission%>" 				 value="<%=selectedPermission%>"  /></td><td class="user-dropdown-icon" id="<%=userEmailAddressID%>-user-dropdown-icon" rowspan="2"><div class= "core-down-triangle  user-permissions-dropdown-icon" id="<%=userEmailAddressID%>-carot-id" ></div><div class="user-permissions-menu-container theme-mip-container hide theme-input-box theme-text" id="<%=userEmailAddressID%>-permissions-menu"><table id="<%=userEmailAddressID%>-permissions-list" class="user-permissions-list ui-theme theme-text"><tr class="theme-hoverable read-permission-row" id="<%=userEmailAddressID%>-read-permission"><td width="90%" class="user-permission-text" id="<%=userEmailAddressID%>-read-permission"><label for="<%=userEmailAddressID%>-checkmark-read-permission" class="ui-theme theme-text" id="<%=userEmailAddressID%>-read-permission-label" align="left" maxlength="255"> <%= READ_DROPDOWN %> </label></td><td width="10%" class="user-permission-checkmark" id="<%=userEmailAddressID%>-read-permission"><label id="<%=userEmailAddressID%>-read-permission" class="udp-checkmark-container"><input type="checkbox" class="permission-checkmark" id="<%=userEmailAddressID%>-checkmark-read-permission" checked tabindex=-1 name="checkbox-button" value=<%=READ_DROPDOWN%>><span class="udp-checkmark" id="<%=userEmailAddressID%>-read-permission"></span></label></td></tr><tr class="theme-hoverable change-permission-row" id="<%=userEmailAddressID%>-change-permission"><td width="90%" class="user-permission-text" id="<%=userEmailAddressID%>-change-permission"><label for="<%=userEmailAddressID%>-checkmark-change-permission" class="ui-theme theme-text" id="<%=userEmailAddressID%>-change-permission-label" align="left" maxlength="255"><%=CHANGE_DROPDOWN%></label></td><td width="10%" class="user-permission-checkmark" id="<%=userEmailAddressID%>-change-permission"><label id="<%=userEmailAddressID%>-change-permission" class="udp-checkmark-container"><input type="checkbox" class="permission-checkmark" id="<%=userEmailAddressID%>-checkmark-change-permission" tabindex=-1  name="checkbox-button" value=<%=CHANGE_DROPDOWN%>><span class="udp-checkmark" id="<%=userEmailAddressID%>-change-permission"></span></label></td></tr><tr class="theme-hoverable full-control-permission-row" id="<%=userEmailAddressID%>-full-control-permission"><td width="90%" class="user-permission-text" id="<%=userEmailAddressID%>-full-control-permission"><label for="<%=userEmailAddressID%>-checkmark-full-control-permission" class="ui-theme theme-text" id="<%=userEmailAddressID%>-full-control-permission-label" align="left" maxlength="255"> <%=FULL_CONTROL%> </label></td><td width="10%" class="user-permission-checkmark" id="<%=userEmailAddressID%>-full-control-permission"><label id="<%=userEmailAddressID%>-full-control-permission" class="udp-checkmark-container"><input type="checkbox" class="permission-checkmark" id="<%=userEmailAddressID%>-checkmark-full-control-permission" tabindex=-1 name="checkbox-button" value=<%=FULL_CONTROL%>><span class="udp-checkmark" id="<%=userEmailAddressID%>-full-control-permission"></span></label></td></tr><tr class="theme-hoverable delete-permission-row" id="<%=userEmailAddressID%>-delete-permission"><td width="90%" class="user-permission-text" id="<%=userEmailAddressID%>-delete-permission"><label for="<%=userEmailAddressID%>-checkmark-delete-permission" class="" ui-theme theme-text" id="<%=userEmailAddressID%>-delete-permission" align="left" maxlength="255"> <%=DELETE%> </label></td><td width="10%" class="user-permission-checkmark" id="<%=userEmailAddressID%>-delete-permission"><label id="<%=userEmailAddressID%>-delete-permission" class="udp-checkmark-container"><input type="checkbox" class="permission-checkmark" id="<%=userEmailAddressID%>-checkmark-delete-permission" tabindex=-1 name="checkbox-button" value=<%=DELETE%>><span class="udp-checkmark" id="<%=userEmailAddressID%>-delete-permission"></span></label></td></tr></table></div></td></div></tr><tr><td class="user-email-address" id="user-<%=userEmailAddressID%>"><div class="user-email-row ui-theme theme-text" id="name-<%=userEmailAddressID%>" align="left" maxlength="255"> <%= userEmailAddress %> </div></td></tr></table></div>'}),define("pdmplugins/mip/js/templates/udp-owner-permission-template",[],function(){return'<div class = "users-permisisons-info "><table class="users-permission-table owner-table" id="<%=userEmailAddressID%>" class="ui-theme theme-text"><tr><td class="user-name" id="user-<%=userEmailAddressID%>"><div class="user-name-row ui-theme theme-text" id="name-<%=userEmailAddressID%>" align="left" maxlength="255"> <%= userName %> <%=OWNER_SIGNAL%> </div></td><td class="owner-col" rowspan="2"><div class="owner ui-theme theme-text"> <%=OWNER%> </div></td><td class="empty" rowspan="2"> </td></tr><tr><td class="user-email-address" id="user-<%=userEmailAddressID%>"><div class="user-email-row ui-theme theme-text" id="name-<%=userEmailAddressID%>" align="left" maxlength="255"> <%= userEmailAddress %> </div></td></tr></table></div>'}),define("pdmplugins/mip/js/templates/udp-email-list-item-template",[],function(){return'    <div class="udp-email-list-item  theme-hoverable ui-theme theme-share-container" title="<%= email %>">       <div class="udp-email-list-name theme-text" tabindex="-1"><%= name %></div>       <div           aria-labelledby="udp-email-list-name">           <button class="udp-email-list-close core-remove-x"                 tabindex="1"                 data-asset-id="<%= asset_id %>"                aria-label="<%= ariaRemoveLabel %>"></button>       </div>   </div> '}),define("pdmplugins/mip/js/templates/udp-autocomplete-template",[],function(){return' <div class="udp-popup-share-auto-c-list"     role="listbox" id="udp-share-auto-c-list"></div><div class="us-ms-graph-get-contacts-banner ui-theme theme-list-item theme-share-container">   <button id="us-get-ms-graph-contacts-message" class= "ui-theme theme-share-add-files" tabindex="0" aria-label ="<%= GET_MS_GRAPH_CONTACTS_MSG %>" title="<%= GET_MS_GRAPH_CONTACTS_MSG %>"><%= GET_MS_GRAPH_CONTACTS_MSG %></button></div>'}),define("pdmplugins/mip/js/templates/udp-autocomplete-item-template",[],function(){return'<div class="us-share-auto-address <%=specialClass%> ui-theme theme-list-item" aria-label = "<%-email %>" role="option" tabindex="-1" title="<%-email %>" name="<%-name%>"><div id="email-list-name" class= "ui-theme theme-text" title="<%-email %>" name="<%-name%>"><%-name%></div><div id="email-list-email" class= "ui-theme theme-text" title="<%-email %>" name="<%-name%>"><%-email%></div></div>'}),define("pdmplugins/unified-share/js/utils/sc-constants",["plugins-common/ac-plugins"],function(e){e.AcUnifiedShare||(e.AcUnifiedShare={});var t=e.AcUnifiedShare;return t.ScConstants={ACTION:"Action",ACTIONS:"Actions",ADD_FILES_TO_SHARE:"AddFilesToShare",ADDRESS_BOOK:"AddressBook",ATTEMPTED_TO_SHARE_FORM:"AttemptedToShareForm",AUTOCOMPLETE:"Autocomplete",AVOIDED:"Avoided",BROWSER_CLOSE:"BrowserClosed",BRANDING:"Branding",CANCEL:"Cancel",CHECKED:"Checked",CHICKLET_ADDED:"ChickletAdded",CLICKED:"Clicked",CLICK_BRANDING:"ClickBranding",CLICK_BRANDING_IN_READER:"ClickBrandingInReader",CLICK_BRANDING_IN_ACROBAT:"ClickBrandingInAcrobat",CLOSE:"Close",COLOR_INPUT:"ColorInput",COLOR_MENU_BUTTON:"ColorMenuButton",COLOR_WELL:"ColorWell",CONTINUE:"Continue",DATE_VIEWED:"DateViewed",DEFAULT:"Default",DIALOG:"Dialog",DISABLED:"Disabled",DISALLOWED:"Disallowed",DISCOVER:"Discover",DOWNLOAD:"Download",DOWNLOAD_ALL:"DownloadAll",DOWNLOAD_ONE:"DownloadOne",DRAG_FILES:"DragFiles",DURATION:"Duration",EDIT_BRANDING_ONLINE:"ContinueOnline",EMAIL:"Email",EMAIL_LINK:"EmailLink",ENABLED:"Enabled",ENTERED:"Entered",EUREKA_SHARE:"Eureka:Share",EVENTUAL_CLICK:"EventualClick",FILE:"File",FILE_LIST:"FileList",FILE_NAME:"FileName",FILES_SHARED_DLG:"FilesSharedDlg",FORWARD:"Forward",FULL_ACTIVITY:"FullActivity",HIDDEN:"Hidden",IMMEDIATE_CLICK:"ImmediateClick",INCLUDE_MESSAGE_TEXT:"IncludeMessageText",INCLUDE_REPLY_TO:"IncludeReplyTo",IPM:"IPM",LATER:"Later",LOGO_BUTTON:"LogoButton",LOGO_CANCEL:"LogoCancel",LOGO_SAVE:"LogoSave",MESSAGE:"Message",MULTI:"Multi",NO_PARCELS:"NoParcels",NOTIFY_WHEN_VIEWED:"NotifyWhenViewed",NUM_FILES_CHECKED:"NumFilesChecked",PERSONAL:"Personal",PERSONAL_AND_PUBLIC:"PersonalANDPublic",PREVIEW:"Preview",PUBLIC:"Public",PUBLIC_LINK:"PublicLink",RECVIEW:"RecView",REPLY:"Reply",REMOVE:"Remove",REPORT_ABUSE:"ReportAbuse",REVIEW_NOT_PERMITTED:"ReviewNotPermitted",RHP:"RHP",SCROLL:"Scroll",SAVE_AS:"SaveAs",SELECT_ALL:"SelectAll",SELECT_FILES:"SelectFiles",SEND_FOR_REVIEW:"Send for Review",SENT_FILES:"SentFiles",SHARE:"Share",SHARE_MODAL:"ShareModal",SHARE_BUTTON:"ShareButton",SHARE_FILE_BUTTON:"ShareFileButton",SHARE_ICON:"ShareIcon",SHARE_WITH:"ShareWith",SHARED:"Shared",SHOWN:"Shown",SINGLE:"Single",SORT:"Sort",SUBJECT:"Subject",SUCCESS:"Success",SURVEY:"Survey",SURVEY_CANCEL:"SurveyCancel",SURVEY_FIELD_FOCUS:"SurveyFieldFocus",SURVEY_LINK:"SurveyLink",SURVEY_SEND:"SurveySend",TOOLS:"Tools",TRACK:"Track",TRASH:"Trash",TURN_OFF_BRANDING:"TurnOffBranding",TURN_ON_BRANDING:"TurnOnBranding",UNCHECKED:"Unchecked",UNSHARE:"Unshare",UPGRADE:"Upgrade",URL_HIGHLIGHT:"UrlHighlight",URL_KEY_COPY:"UrlKeyCopy",USE:"Use",VIEW:"View",VIEW_ALL_SHARED_FILES:"ViewAllSharedFiles",VIEW_FULL_ACTIVITY:"ViewFullActivity",WARNED_BEFORE_CLOSING:"WarnB4Close",WARNING:"Warning",WITH_REPLY:"wReply",NO_CONNECTIVITY:"NoConnectivity",ERROR_UPLOAD:"ErrorUpload",UNKNOWN_SERVICE_ERROR:"UnknownServiceError",API_SUBPATH_NEW:"/api/rest/v6",API_SUBPATH_OLD:"/api/rest/v3",API_VERSION_V6:"v6",1:"1","2_TO_5":"2to5","6_TO_10":"6to10","11_OR_MORE":"11orMore","11_TO_20":"11to20","21_TO_40":"21to40","41_TO_120":"41to120","121_OR_MORE":"121orMore",FSS:"FSS",FORM:"Form",OUTPUT:"Output",SAVE_TO_PDF:"SaveToPDF","1_STARTED":"1-Started","2_COMPLETED":"2-Completed",ERROR:"Error",SEND_TAB:"SendTab",COMPLETED:"Completed",SUPPORTED_EXTNS_SIGN:["pdf","doc","docx","rtf","xls","xlsx","ppt","pptx","txt","html","htm","tiff","tif","bmp","gif","jpg","jpeg","png"],SUPPORTED_EXTNS_REVIEW:["pdf"],BASICMAIL:0,GMAIL:1,CONFIGURED:2,FILE_LIST_ERROR:"file_list_error",CREATE_LINK_ERROR:"create_link_error",INVITE_PEOPLE_ERROR:"invite_people_error",UNSUPPORTED_FILE_ERROR:"unsupported_file_error",DEADLINE_ERROR:"deadline_error",REMINDER_ERROR:"reminder_error",UNSUPPORTED_FILES:"NonPDFOrMultipleFiles",GET_SIG:"USGetSig",GET_STARTED_CLICKED:"GetStartedClicked",SIGNED_IN:"SignedIn",MORE_OPTIONS:"MoreOptions",SIGN_TOOL_SHOWN:"Adobesigntoolshown",SIGN_TOOL_NOT_SHOWN:"Adobesigntoolnotshown",SHARE_POPUP:"SharePopup",TRACK_BUTTON:"TrackButton",SHARE_AGAIN_BUTTON:"ShareAgainButton",INFO_TOOLTIP:"InfoTooltip",SHARE_UPSELL_DIALOG:"ShareUpsellDialog",CREATE_LINK_UPSELL_DIALOG:"CreateLinkUpsellDialog",OPEN:"Open",LEARN_MORE:"LearnMore",GET_STARTED:"GetStarted",ALLOW_COMMENTS:"AllowComments",ALLOW_COMMENTS_TOGGLED:"AllowCommentsToggledTo",ALLOW_COMMENTS_DEFAULT:"AllowCommentsDefaultMode",CREATE_LINK_MODE:"CreateLinkMode",INVITE_MODE:"InviteMode",SEND_MAIL_MODE:"SendMailMode",INSTANT_LINK:"InstantLink",INSTANT_LINK_DEFAULT:"InstantLinkDefault",INSTANT_LINK_TOGGLED:"InstantLinkToggledTo",ERROR_BUBBLE_SHOWN:"ErrorBubbleShown",OPEN_REVIEW:"OpenReview",START_COMMENTING:"StartCommenting",SEND_MAIL_LINK:"SendMailWithLink",SEND_MAIL_FILE:"SendMailWithFile",BUTTON_NEXT:"ButtonNext",DEFAULT_EMAIL_APPLICATION:"DefaultEmailApplication",WEBMAIL_APPLICATION:"WebmailApplication",COPY_LINK:"CopyLink",MS_OUTLOOK:"MSOutlook"},t.ScConstants}),define("pdmplugins/mip/js/views/udp-autocomplete-view",["core/ac-core","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/templates/udp-autocomplete-template","pdmplugins/mip/js/templates/udp-autocomplete-item-template","pdmplugins/unified-share/js/utils/sc-constants","i18n!pdmplugins/mip/js/nls/ui-strings"],function(e,t,i,s,n,o){return t.UDPAutoCompleteView=e.View.extend({events:{"mousedown .us-share-auto-address":"_onAddressClick","mousedown .us-ms-graph-get-contacts-banner":"_onGetMSGraphContactsClick"},initialize:function(){var t,n=this.options,o=n.autoCCollection;e.View.prototype.initialize.call(this),this._template=_.template(i),this._localAddressTemplate=_.template(s),this._addressTemplate=_.template("<div class='us-share-auto-address <%=specialClass%> ui-theme theme-list-item theme-hoverable'title='<%-email %>' role='option' tabindex='-1' aria-label ='<%-email %>' name='<%-name%>'><div id='email-list-email-only' class= 'ui-theme theme-text' title='<%-email %>' name='<%-name%>'><span title='<%-email %>'><%-email%></span></div></div>"),this._editControl=n.emailView,this.isMSGraphBannerInFocus=!1,t=new Backbone.Collection,this.filteredCollection=t,t.on("all",_.debounce(_.bind(this._onFilteredCChange,this),50)),o.on("all",_.debounce(_.bind(this._onCollectionChange,this),300))},render:function(){return e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({GET_MS_GRAPH_CONTACTS_MSG:o.GET_MS_GRAPH_CONTACTS_MSG_1+"Office"+o.GET_MS_GRAPH_CONTACTS_MSG_2+"Outlook"+o.GET_MS_GRAPH_CONTACTS_MSG_3})),this._initWrappers(),this.$autoCList.on("scroll",this._onAddressScroll),this.$getMSGraphContacts.hide(),e.Util.isCEF()&&this.$autoCList.css("overflow","auto")),this._renderAddressList(),this},setFilter:function(e){e&&(e=$.trim(e.toLowerCase()),e.length<1&&(e=void 0)),e||(this.selectedID=void 0),this.fragment=e,this._updateFilteredCollection()},makeChoice:function(e){console.log("make choice");{var t,i,s;this.options,this.options.userInformationModel}return this.isMSGraphBannerInFocus?this._onGetMSGraphContactsClick():(e?this.selectedID&&(t=this.filteredCollection.get(this.selectedID)):t=this.selectedID?this.filteredCollection.get(this.selectedID):this.filteredCollection.at(0),t&&(i=t.get("email"),s=t.get("name"),this._insertEmail(i,s),this._editControl.clear())),t},selectDown:function(){var t,i,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),l=$(".us-share-auto-address").outerHeight(),r=6,d=6;e.Util.isCEF&&(r=n.length),s=this.options.userInformationModel.get("enable_autoc_arrows"),s&&(o?(r>n.length&&(r=n.length),i=n.get(o),t=n.indexOf(i),-1===t?o=void 0:(r>t&&(t+=1,r>d&&this._keyboardScrollTo(a+l)),t>=r?(o=void 0,this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus&&(this.isMSGraphBannerInFocus=!0)):(i=n.at(t),o=i?i.id:void 0))):this.isMSGraphBannerInFocus?this.isMSGraphBannerInFocus=!1:(i=n.at(0),i?(o=i.id,this._keyboardScrollTo(0)):o=void 0),this.selectedID=o,this._renderAddressList())},selectUp:function(){var t,i,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),l=6,r=6,d=$(".us-share-auto-address").outerHeight();e.Util.isCEF&&(l=n.length),s=this.options.userInformationModel.get("enable_autoc_arrows"),s&&(o?(i=n.get(o),t=n.indexOf(i),-1===t?o=void 0:(t>=0&&(t-=1,l>r&&this._keyboardScrollTo(a-d)),0>t?o=void 0:(i=n.at(t),o=i?i.id:void 0))):this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus?(o=void 0,this.isMSGraphBannerInFocus=!0):(this.isMSGraphBannerInFocus=!1,l>n.length&&(l=n.length),l-=1,i=n.at(l),i?(o=i.id,l>=r&&this._keyboardScrollTo(l*d)):o=void 0),this.selectedID=o,this._renderAddressList())},_keyboardScrollTo:function(t){e.Util.isCEF()&&(this.$autoCList.stop(!0,!0),this.$autoCList.animate({scrollTop:t},1))},_initWrappers:function(){this.$autoCList=this.$(".udp-popup-share-auto-c-list"),this.$getMSGraphContacts=this.$(".us-ms-graph-get-contacts-banner")},_renderAddressList:function(){var e,t,i=this.filteredCollection,s=this.$autoCList,n=this.selectedID;e=this._localAddressTemplate,t=this._addressTemplate,i.length&&this.$el.show(),s.empty(),i.each(function(i){var o,a="";i.id===n&&(a="selected"),o=_.isUndefined(i.get("name"))||""===i.get("name")?t({email:i.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}):e({name:i.get("name"),email:i.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}),s.append(o)}),this._renderGetMSGraphBanner(),i.length||this.$el.hide()},_renderGetMSGraphBanner:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().then(_.bind(function(){this.options.appApi.sessionApi.isSignedInReader()&&e.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().then(_.bind(function(e){e?this.$getMSGraphContacts.hide():(this.$getMSGraphContacts.show(),this.isMSGraphBannerInFocus?this.$getMSGraphContacts.addClass("selected"):this.$getMSGraphContacts.removeClass("selected"))},this),_.bind(function(){this.$getMSGraphContacts.hide()},this))},this),_.bind(function(){this.$getMSGraphContacts.hide()},this))},this))},_updateFilteredCollection:function(){var e,t=this.options.autoCCollection,i=this.filteredCollection,s=[],n="",o="",a=!1,l=this.options.userInformationModel.get("pgcSuggestionsCollection");return l&&t.add(l.toJSON(),{merge:!0}),e=this.fragment,e&&e.length&&(s=t.filter(function(t){if(o=t.get("email"),a=0===o.indexOf(e),a===!1&&(n=t.get("name"),void 0!==n&&(n=n.toLowerCase(),a=0===n.indexOf(e.toLowerCase()),a===!1)))for(var i=n.split(" "),s=0;s<i.length&&(a=0===i[s].indexOf(e.toLowerCase()),a!==!0);++s);return a})),i.set(s),s},_onFilteredCChange:function(){if(this.filteredCollection.length>0){var e=this.filteredCollection.at(0);this.selectedID=e.id,this.isMSGraphBannerInFocus=!1}this._renderAddressList()},_onCollectionChange:function(){this._renderAddressList()},_onAddressClick:function(e){var t,i,s=$(e.target),o=this.options,a=this.options.userInformationModel;t=s.attr("title"),i=s.attr("name"),this._insertEmail(t,i),this._editControl.clear(),a.get("autocomplete_eventual_click")||(o.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SHARE,n.EMAIL,n.AUTOCOMPLETE,n.EVENTUAL_CLICK]),a.set("autocomplete_eventual_click",!0),a.set("autocomplete_avoided",!0)),a.get("autocomplete_immediate_click")||(o.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SHARE,n.EMAIL,n.AUTOCOMPLETE,n.IMMEDIATE_CLICK]),a.set("autocomplete_immediate_click",!0))},_onGetMSGraphContactsClick:function(){this.options.appApi.rnaApi.done(_.bind(function(t){var i=n.SHARE,s=n.USE,o="Sign In to MSGraph";this.options.appApi.siteCatalystApi.logScEvent([i,s,o]),t.rnaMicrosoftGraphAPI.loginToMicrosoftGraph().then(_.bind(function(){var t=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),i=n.SHARE,s=n.USE,o="Get MSGraph Contacts After Sign In";this.options.appApi.siteCatalystApi.logScEvent([i,s,o]),t.run().then(_.bind(function(e){var t=this.options.autoCCollection;t.add(e.toJSON(),{merge:!0}),this._renderGetMSGraphBanner()},this),_.bind(function(){},this))},this),_.bind(function(){this.isMSGraphBannerInFocus=!1},this))},this))},_onAddressScroll:function(){var e=this.options,t=this.options.userInformationModel;t.get("autocomplete_scroll")||(e.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SHARE,n.EMAIL,n.AUTOCOMPLETE,n.SCROLL]),t.set("autocomplete_scroll",!0),t.set("autocomplete_immediate_click",!0),t.set("autocomplete_avoided",!0))},_insertEmail:function(e,t){this.options.emailView.abortPGCRequest(),this.options.emailView._setRecipientsFromText(e,t),this.setFilter(void 0),_.delay(_.bind(function(){this._editControl.focus(!0)},this),10)}}),t.UDPAutoCompleteView}),define("pdmplugins/mip/js/constants/udp-constants",{READ:"Read",CHANGE:"Change",FULL_CONTROL:"FullControl",CUSTOM:"Custom"}),define("pdmplugins/mip/js/templates/udp-more-options-template",[],function(){return'<div class="ui-theme theme-text udp-container" id = "udp-more-options-dialog"><div id="udp-header-id" class="udp-more-options-header"><button class="spectrum-ActionButton" id="back-chevron-icon" tabIndex="-1"><span id="back-options-id" class="ui-theme core-down-triangle theme-hyperlink" tabindex="0" aria-label="<%= BACK_BUTTON_TEXT %>"></span></button><div class = "udp-more-options-dialog-heading ui-theme theme-text"><%= MORE_OPTIONS %></div></div><br><div class = "ui-theme" id= "udp-more-options-content"> <div class = "ui-theme" id = "mip-expiry-id"><div class = "inline-class ui-theme theme-text" id= "mip-deadline-selector-text"><%= DOCUMENT_EXPIRY %> </div><input tabindex="0" type="text" class="dateInput inline-class ui-theme theme-share-container theme-text"placeholder="<%= MMDDYYYY_PLACEHOLDER %>" aria-label="<%= DOCUMENT_EXPIRY %><%= MMDDYYYY_PLACEHOLDER %>" id="mip-deadline-text-input"/><div class = "expiry-date-caution-img hidden" tabindex="0"></div><div class = "mip-calender-image" tabindex="0"></div><div class = "mip-calender-container"></div></div><div class="expiry_date_error_msg hidden" tabindex="0" id="expiry_date_error_msg-id" > <%=EXPIRY_DATE_ERROR%> </div><div class="read-permission-text ui-theme theme-text"> <%= READ_PERMISSION_TEXT %> </div><div class="mip-checkbox-cell" id="mip-checkbox-copy-document"><input type="checkbox" id="mip-copy-document-checkbox" class="mip-checkbox ui-theme" name="udp-copy-checkbox-button" value=<%=COPY_CHECKBOX%> role="checkbox" ><label for="mip-copy-document-checkbox" tabindex="0" class="mip-checkbox-copy ui-theme theme-text" aria-label="<%= READ_PERMISSION_TEXT %><%= COPY_CHECKBOX %>" ></label><div class="theme-text mip-checkbox-copy-document-label">  <%=COPY_CHECKBOX%> </div></div><div class="print-permission-text ui-theme theme-text"> <%= CHANGE_PERMISSION_TEXT %> </div><div class="mip-checkbox-cell" id="mip-checkbox-print-document"><input type="checkbox" id="mip-print-document-checkbox" class="mip-checkbox ui-theme" name="udp-print-checkbox-button" value=<%=PRINT_CHECKBOX%> role="checkbox" ><label for="mip-print-document-checkbox" tabindex="0" class="mip-checkbox-print ui-theme theme-text" aria-label="<%= CHANGE_PERMISSION_TEXT %><%= PRINT_CHECKBOX %>"></label><div class="theme-text mip-checkbox-print-document-label">  <%=PRINT_CHECKBOX%> </div></div></div></div>'}),define("pdmplugins/mip/js/templates/calender-template",[],function(){return'<div class="ui-theme theme-text date-calender popup-date-calendar mip-calender" id="mip-date-calender"><table><tr><td><div id="date-calender-month-view"><div class="header"><button class="left navButton usNavButton core-down-triangle" id="prev" style="font-size: 8px;" tabindex="0" title = "<%- prevMonth %>" aria-label = "<%- prevMonth %>" ></button><span class="left hook"></span><span class="month-year"></span><span class="right hook" id=""></span><button class="right navButton usNavButton core-down-triangle" id="next" style="font-size: 8px;" tabindex="0" title = "<%- nextMonth %>" aria-label = "<%- nextMonth %>" ></button></div><table id="week-days"><tr><td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr></table><div class="month-dates"><table class="curr"><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr></table></div></div></td></tr></table></div>'}),define("pdmplugins/mip/js/utils/mip-utils",["i18n!core/nls/ui-strings"],function(e){var t={getMonthName:function(t){switch(t){case 0:return e.JANUARY_S;case 1:return e.FEBRUARY_S;case 2:return e.MARCH_S;case 3:return e.APRIL_S;case 4:return e.MAY_S;case 5:return e.JUNE_S;case 6:return e.JULY_S;case 7:return e.AUGUST_S;case 8:return e.SEPTEMBER_S;case 9:return e.OCTOBER_S;case 10:return e.NOVEMBER_S;case 11:return e.DECEMBER_S}},getDayName:function(t){switch(t){case 0:return e.SUNDAY_S;case 1:return e.MONDAY_S;case 2:return e.TUESDAY_S;case 3:return e.WEDNESDAY_S;case 4:return e.THURSDAY_S;case 5:return e.FRIDAY_S;case 6:return e.SATURDAY_S}}};return t}),define("pdmplugins/mip/js/views/udp-calender",["core/ac-core","core/utils/view-util","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/templates/calender-template","i18n!pdmplugins/mip/js/nls/ui-strings","i18n!core/nls/ui-strings","pdmplugins/mip/js/utils/mip-utils"],function(e,t,i,s,n,o,a){return i.MipCalenderPopup=e.CustomRangeSelectorView.extend({initialize:function(){console.log("Calender initialize called"),e.DialogView.prototype.initialize.call(this),this._template=_.template(s)({prevMonth:o.PREVIOUS_MONTH,nextMonth:o.NEXT_MONTH}),this._currentMonthView=null,this._currentYearView=null,this._currentActiveDateElement=1},render:function(){return console.log("Calender render called"),e.DialogView.prototype.render.call(this),this._appendToDialog(this._template),this._initWrappers(),this._initAdditionalWrappers(),this._fillCurrentMonthCalender(),this._updateLocalDates(),this._setCss(),this._setDefaultDate(),this._addUiEventListeners(),this._goToSetDateMonth(),this},_initAdditionalWrappers:function(){this.$day=this.$(".day"),this.$moreOptionsContainer=this.$("#udp-more-options-dialog")},_setCss:function(){this.$dlg.width("272px"),this.$dlg.css("height","290px"),this.$dlg.css("min-width","272px"),this.$dlg.css("padding","32px 24px 33px 24px"),this.$dlg.css("font-size","12px"),this.$dlg.css("box-shadow","0px 1px 4px rgba(0, 0, 0, 0.15)"),this.$dlg.css("margin-left","-70px"),this.$dlg.css("margin-top","-145px"),this.$titleBar.hide()},_onDateHover:function(e){var t,i,s=this._currentYearView,n=this._currentMonthView;t=e.currentTarget.innerHTML,t&&(i=this._getTitleForDate(s,n,t),e.currentTarget.title=i)},_addUiEventListeners:function(){this.$day.hover(this._onDateHover,void 0),$("#modal-mask").on("click",this._closeCalender)},_updateDateBeenSelected:function(){console.log("Updating date in model: ",this.getLocalDate()),this.options.userInformationModel.set("expiry_date",this.getLocalDate()),this._closeCalender()},_closeCalender:function(){this.close(!1)},_goToSetDateMonth:function(){var e=this.getLocalDate();e&&this._createMonthCalender(e.getMonth(),e.getFullYear())},_showSelection:function(){var e,t,i=this._currentYearView,s=this._currentMonthView,n=(this.options.mode,new Date),o=new Date(n.getFullYear(),n.getMonth(),n.getDate()),a=this._getTitleForDate;e=this.getLocalDate(),e&&(isNaN(e)||$(".curr tr").each(function(){$("td",this).each(function(){var n=this;if($(this).removeClass("disabled"),$(this).removeClass("selected"),$(this).removeClass("today"),$(this).removeClass("ui-theme theme-calendar-day"),$(this).removeClass("theme-keyboard-focus"),""!=n.innerHTML){t=a(i,s,n.innerHTML),$(this).attr("aria-label",t),$(this).addClass("ui-theme theme-calendar-day");var l=new Date(i,s,n.innerHTML);l.valueOf()==o.valueOf()&&$(this).addClass("today"),l.getDate()==e.getDate()&&l.getMonth()==e.getMonth()&&l.getFullYear()==e.getFullYear()?($(this).addClass("selected"),$(this).focus()):o>=l?($(this).addClass("disabled"),$(this).removeClass("ui-theme theme-calendar-day")):($(this).removeClass("disabled"),$(this).removeClass("selected"))}})}))},_getMonth:function(e){return a.getMonthName(e)},_getDayName:function(e){return a.getDayName(e)},_getTitleForDate:function(e,t,i){var s,n,o,a,l={day:"numeric"},r=this.options.appApi.localeApi.getLocale();return s=new Date(e,t,i),n=s.getDay(),o=s.toLocaleDateString(r,l),a=this._getDayName(n)+", "+this._getMonth(t)+" "+o+", "+e},_onCalFrameDblClick:function(e){console.log("_onCalFrameDblClick called");var t=e.target;t.className.includes("day")&&0==t.className.includes("disabled")&&this._updateDateBeenSelected()},_setDefaultDate:function(){if(!this.getLocalDate()||"Invalid Date"==this.getLocalDate()){var e=new Date;e.setDate(e.getDate()+1),this.setLocalDate(e)}this._showSelection()},_onCalFrameClick:function(e){console.log("_onCalFrameClick called");var t=$(e.target);if(t.attr("title")){var i=new Date(this._currentYearView,this._currentMonthView,t.text()),s=new Date,n=new Date(s.getFullYear(),s.getMonth(),s.getDate()),o=n;o.setDate(o.getDate()+1),console.log("date_entered",i),console.log("allowedMinDate ",o),i>=o&&this.setLocalDate(i),this._showSelection(),this._onCalFrameDblClick(e)}},setLocalDate:function(e){this.selectedDate=e},getLocalDate:function(){return this.selectedDate},clearLocalDate:function(){this.selectedDate=""},_updateLocalDates:function(){this.clearLocalDate(),this.selectedDate=this.options.userInformationModel.get("expiry_date"),console.log("Previous selected date [from models] is : ",this.selectedDate)},_onAnyKeyDown:function(e){console.log("_onAnyKeyDown called..");var t=$(e.target);if(console.log("event is : ",e),27===e.which)this._consumeEvent(e),this._closeCalender();else if("Enter"==e.key)this._onCalBodyClick(e);else if(e.target.className.includes("day")){var i;if("ArrowDown"==e.key){var s=t.closest("tr"),n=s.next();void 0!=n&&(i=$(n.find("td")[e.target.cellIndex]))}else if("ArrowUp"==e.key){var s=t.closest("tr"),o=s.prev();void 0!=o&&(i=$(o.find("td")[e.target.cellIndex]))}else"ArrowLeft"==e.key?i=t.prev():"ArrowRight"==e.key&&(i=t.next());void 0!=i&&""!=i.text()&&(i.focus(),t.removeClass("theme-keyboard-focus"),i.addClass("theme-keyboard-focus"))}else(69==e.which||187==e.which||189==e.which||190==e.which)&&this._consumeEvent(e)}}),i.MipCalenderPopup}),define("pdmplugins/mip/js/views/udp-calender-container",["core/ac-core","core/utils/view-util","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/views/udp-calender"],function(e,t,i){return i.MipDateSelectorContainer=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this)},render:function(){e.View.prototype.render.call(this),this._showCalender()},_showCalender:function(){var t=e.uiModelFactory.create("DialogsUiModel"),s=_.extend({},this.options,{dialogsUiModel:t,parentView:this}),n=new i.MipCalenderPopup(s);n.open(s.parentView)}}),i.MipDateSelectorContainer}),define("pdmplugins/mip/js/views/udp-more-options-view",["core/ac-core","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/templates/udp-more-options-template","core/utils/view-util","i18n!pdmplugins/mip/js/nls/ui-strings","pdmplugins/mip/js/views/udp-calender-container","moment"],function(e,t,i,s,n){t.UDPMoreOptionsDialog=e.View.extend({events:{"click   #back-options-id":"_backToUDPDialog","keydown #back-options-id":"_onButtonKeyDown","click   .mip-calender-image":"_openCalendar","keydown .mip-calender-image":"_onButtonKeyDown","keydown .mip-checkbox-copy":"_onButtonKeyDown","keydown .mip-checkbox-print":"_onButtonKeyDown"},initialize:function(){console.log("UDP dialog initialize"),e.View.prototype.initialize.call(this),this._template=_.template(i)},render:function(){e.PluginContentView.prototype.render.call(this),this.$el.children().length>0||(0===this.$el.children().length&&(this.$el.html(this._template({MORE_OPTIONS:n.MORE_OPTIONS,BACK_BUTTON_TEXT:n.BACK_BUTTON_TEXT,DOCUMENT_EXPIRY:n.DOCUMENT_EXPIRY,READ_PERMISSION_TEXT:n.READ_PERMISSION_TEXT,COPY_CHECKBOX:n.COPY_CHECKBOX,CHANGE_PERMISSION_TEXT:n.CHANGE_PERMISSION_TEXT,PRINT_CHECKBOX:n.PRINT_CHECKBOX,MMDDYYYY_PLACEHOLDER:n.MMDDYYYY_PLACEHOLDER,EXPIRY_DATE_ERROR:n.EXPIRY_DATE_ERROR})),this._initWrappers(),this._addUiModelEventListeners()),this.$errorCautionImg.hide())
},_initWrappers:function(){this.$expiryDateField=this.$("#mip-deadline-text-input"),this.$copyDocumentCheckbox=this.$("#mip-copy-document-checkbox"),this.$printDocumentCheckbox=this.$("#mip-print-document-checkbox"),this.$errorExpiryString=this.$(".expiry_date_error_msg"),this.$errorCautionImg=this.$(".expiry-date-caution-img"),this.uiModel=this.options.userInformationModel,this.$copyDocumentCheckbox.attr("checked",this.uiModel.get("copyCheckBox")),this.$printDocumentCheckbox.attr("checked",this.uiModel.get("printCheckBox")),this._onExpiryDateChange()},_addUiModelEventListeners:function(){var e=this.options.userInformationModel;e.on("change:expiry_date",this._onExpiryDateChange),this.$copyDocumentCheckbox.on("change",this.onCopyDocumentCheckboxChangeEvent),this.$printDocumentCheckbox.on("change",this.onPrintDocumentCheckboxChangeEvent)},_onExpiryDateChange:function(){var e=this.options.userInformationModel.get("expiry_date");document.getElementById("mip-deadline-text-input").value=this._formatDate(e)},_showExpiryErrors:function(){this.$errorExpiryString.show(),this.$errorCautionImg.show(),this.$expiryDateField.css("border-bottom-color","#D7373F"),document.getElementById("udp-expiry-date-id").innerHTML=""},_validateAndSetUserInputDate:function(){var e,t=document.getElementById("mip-deadline-text-input");t&&(e=t.value);var i=document.getElementById("mip-deadline-text-input"),s=i.getBoundingClientRect();if(this.$errorExpiryString.css("padding-left",s.left-30),null!=e&&""!=e){if(10!=e.length)return this._showExpiryErrors(),!1;var o=moment(e,"MM/DD/YYYY").isValid();if(!o||void 0==o)return this._showExpiryErrors(),!1;var a=e.split("/"),l=parseInt(a[0]),r=parseInt(a[1]),d=parseInt(a[2]),c=new Date(d,l-1,r),p=new Date;if(!(c>p))return this._showExpiryErrors(),!1;this.options.userInformationModel.set("expiry_date",c),this.options.userInformationModel.set("expiry_date_mmddyyyy",e),document.getElementById("udp-expiry-date-id").innerHTML=n.DOCUMENT_EXPIRY+e}else document.getElementById("udp-expiry-date-id").innerHTML="";return this.$errorExpiryString.hide(),this.$errorCautionImg.hide(),this.$expiryDateField.css("border-bottom-color","#4B4B4B"),!0},_formatDate:function(e){if(null!=e&&""!=e&&"Invalid Date"!=e){var t=e.getFullYear(),i=(1+e.getMonth()).toString();i=i.length>1?i:"0"+i;var s=e.getDate().toString();return s=s.length>1?s:"0"+s,i+"/"+s+"/"+t}return""},_renderChildViews:function(){this._closeOnESC(),this._renderIdentityViews(),this._UpdateControls()},_backToUDPDialog:function(){this._validateAndSetUserInputDate()&&(this.$el.hide(),window.$el.find("#mip-sensitivity-label-dialog").show())},_openCalendar:function(){this.removeAllChildViews(),this._validateAndSetUserInputDate(),this._renderChildView("_MipDateSelectorContainer",t.MipDateSelectorContainer,window.$el.find(".mip-calender-container"),this.options)},onCopyDocumentCheckboxChangeEvent:function(){var e=this.$("input[name='udp-copy-checkbox-button']").is(":checked");this.uiModel.set("copyCheckBox",e)},onPrintDocumentCheckboxChangeEvent:function(){var e=this.$("input[name='udp-print-checkbox-button']").is(":checked");this.uiModel.set("printCheckBox",e)},_onButtonKeyDown:function(e){var t=e.which,i=e.currentTarget;if(13===t||32===t){if("back-options-id"===i.id)return this._consumeEvent(e),this._backToUDPDialog();if(i.className.includes("mip-calender-image"))return this._openCalendar();"mip-checkbox-copy"==i.classList[0]?(this._consumeEvent(e),document.getElementById("mip-copy-document-checkbox").checked=this.$("input[name='udp-copy-checkbox-button']").is(":checked")?!1:!0,this.onCopyDocumentCheckboxChangeEvent()):"mip-checkbox-print"==i.classList[0]&&(this._consumeEvent(e),document.getElementById("mip-print-document-checkbox").checked=this.$("input[name='udp-print-checkbox-button']").is(":checked")?!1:!0,this.onPrintDocumentCheckboxChangeEvent())}}})}),define("pdmplugins/mip/js/models/email-addr-model",["core/ac-core","pdmplugins/mip/js/ac-mip","core/models/model"],function(e,t){t.EmailAddrModel=e.Model.extend({})}),define("pdmplugins/mip/js/collection/email-addr-collection",["pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/models/email-addr-model"],function(e){return e.EmailAddrCollection=Backbone.Collection.extend({model:e.EmailAddrModel}),e.EmailAddrCollection}),define("pdmplugins/mip/js/models/ui/udp-user-information-ui-model",["core/ac-core","pdmplugins/mip/js/ac-mip","i18n!pdmplugins/mip/js/nls/ui-strings","pdmplugins/mip/js/collection/email-addr-collection"],function(e,t,i){return t.UserInformationModel=e.Model.extend({idAttribute:"userEmailAddress",recognized:{ownerId:{type:"string",optional:!1},ownerName:{type:"string",optional:!1},userInformationArray:{type:"array",optional:!1},expiry_date:{type:"string",optional:!0},expiry_date_mmddyyyy:{type:"string",optional:!0},copyCheckBox:{type:"boolean",optional:!0},printCheckBox:{type:"boolean",optional:!0},userShowPermission:{type:"string",optional:!1,choices:[i.READ,i.CHANGE,i.FULL_CONTROL,i.CUSTOM]},readPermisison:{type:"string",optional:!1,choices:[i.READ,i.READ_COPY,i.READ_PRINT,i.READ_COPY_PRINT]},changePermission:{type:"string",optional:!1,choices:[i.CHANGE,i.CHANGE_PRINT]},email_addr_collection:{type:"object",optional:!0},enable_autocomplete:{type:"boolean",optional:!1},autocomplete_local_contacts_imported:{type:"boolean",optional:!1},autocomplete_cloud_contacts_imported:{type:"boolean",optional:!1},autocomplete_msgraph_contacts_imported:{type:"boolean",optional:!1},autocomplete_scroll:{type:"boolean",optional:!1},autocomplete_eventual_click:{type:"boolean",optional:!1},autocomplete_immediate_click:{type:"boolean",optional:!1},autocomplete_avoided:{type:"boolean",optional:!1},default_email_client:{type:"string",optional:!1},enable_autoc_arrows:{type:"boolean",optional:!1}},defaults:{ownerId:"",ownerName:"",userInformationArray:[],expiry_date:"",expiry_date_mmddyyyy:"",copyCheckBox:!1,printCheckBox:!1,userShowPermission:i.READ,readPermisison:i.READ,changePermission:i.CHANGE,enable_autocomplete:!0,autocomplete_local_contacts_imported:!1,autocomplete_cloud_contacts_imported:!1,autocomplete_msgraph_contacts_imported:!1,autocomplete_scroll:!1,autocomplete_eventual_click:!1,autocomplete_immediate_click:!1,autocomplete_avoided:!1,default_email_client:"",enable_autoc_arrows:!0},initialize:function(){console.log("initializing the model ");var i;e.UiModel.prototype.initialize.call(this),i=new t.EmailAddrCollection,this.set({email_addr_collection:i})},initializeFromCohorts:function(e){e&&(e["ts-autocomplete"]&&this.set({enable_autocomplete:"enabled"===e["ts-autocomplete"]}),e["ts-autoc-arrows"]&&this.set({enable_autoc_arrows:"enabled"===e["ts-autoc-arrows"]}))},resetTodefaults:function(){this.resetEmailCollection(),this.resetAutocomplete()},resetUITodefault:function(){this.resetEmailCollection(),this.resetAutocomplete()},resetEmailCollection:function(){this.get("email_addr_collection").reset()},_resetModelElementsToDefaults:function(){this.set({autocomplete_local_contacts_imported:!1,autocomplete_cloud_contacts_imported:!1,autocomplete_msgraph_contacts_imported:!1,s_message_text:"",default_email_client:""})},resetAutocomplete:function(){this.set({autocomplete_scroll:!1,autocomplete_eventual_click:!1,autocomplete_immediate_click:!1,autocomplete_avoided:!1})},parseEmailArray:function(e,i){var s=/^\S+@\S+\.\S+$/,n=/[\]\)\"\'\}]$/,o=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,a=_.reduce(e,function(e,a){var l,r,d,c=a,p=a.match(/\s*<(\S+)>/),u=i?i:"";return(a=$.trim(a))?(p?(c=p[1],r=a.substring(0,p.index),r=r.replace(/^\s+/,"")):c=$.trim(c),d=c.match(s)?!0:!1,d&&(d=c.match(n)?!1:!0,d=d?o.test(c):!1),l=new t.EmailAddrModel({email:c,friendly:r,valid:d,name:u}),e.push(l),e):e},[]);return a},addRecipientsToCollection:function(e){var t=this.get("email_addr_collection");t.add(e,{silent:!0}),t.trigger("set",{})},setRecipientsCollection:function(e,t){var i=this.get("email_addr_collection");i.set(e,{silent:!0}),i.trigger("set",t)},getRecipientsArray:function(){var e=this.get("email_addr_collection"),t=e.map(function(e){return e.get("friendly")?e.get("friendly")+" <"+e.get("email")+">":e.get("email")});return t},isSenderOnlyRecipient:function(e){for(var t=this.getRecipientsArray(),i=0;i<t.length;++i)if(t[i]!==e)return!1;return!0},isEmailBoxEmpty:function(){var e=this.getRecipientsArray();return _.isUndefined(e)||0===e.length?!0:!1},addUserDataObjects:function(e){var t=this.get("userInformationArray"),i=t.concat(e);this.set("userInformationArray",i)},fetch:function(){return $.Deferred().resolve().promise()},save:function(){return $.Deferred().resolve().promise()},destroy:function(){return $.Deferred().resolve().promise()},close:function(){this.get("email_addr_collection").reset()}}),t.UserInformationModel}),define("pdmplugins/mip/js/views/udp-view",["core/ac-core","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/templates/udp-template","pdmplugins/mip/js/templates/udp-users-permission-template","pdmplugins/mip/js/templates/udp-owner-permission-template","pdmplugins/mip/js/templates/udp-email-list-item-template","core/utils/view-util","i18n!pdmplugins/mip/js/nls/ui-strings","pdmplugins/mip/js/views/udp-autocomplete-view","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/mip/js/constants/udp-constants","core/utils/truncate","core/utils/event-util","pdmplugins/mip/js/ops/get-from-addressbook-op","pdmplugins/mip/js/views/udp-more-options-view","pdmplugins/mip/js/models/ui/udp-user-information-ui-model","core/views/input-placeholder-view"],function(e,t,i,s,n,o,a,l,r,d,c,p,u,h){var m,E="";t.UDPDialog=e.View.extend({events:{"click   .udp-dialog-cancel-btn":"_cancelUDPDialog","keydown .udp-dialog-cancel-btn":"_onButtonKeyDown","click   .udp-dialog-save-btn":"_saveUDPLabelInfo","keydown .udp-dialog-save-btn":"_onButtonKeyDown","click   .udp-dialog-add-btn":"_addUDPLabelUserInfo","keydown .udp-dialog-add-btn":"_onButtonKeyDown","click    #add-permissions-dropdown-id":"_addPermissionDropdownClicked","keydown  #add-permissions-dropdown-id":"_onButtonKeyDown","change   input#udp-address-input-id":"_updateControlsDropdownAndAddButton","input    input#udp-address-input-id":"_updateControlsDropdownAndAddButton","paste    #udp-address-input-id":"_emailIdsPasted","click    #more-options-icon":"_moveToMoreOptionsDialog","keydown  #more-options-icon":"_onButtonKeyDown","input   .udp-address-input":"_onRecipientsInput","paste   .udp-address-input":"_onRecipientsPaste","blur    .udp-address-input":"_onRecipientsBlur","focus   .udp-address-input":"_onInputFocus","blur   .udp-address-input":"_onInputBlur","click   .udp-tool-frame":"_onUDPAddressClick","click   .udp-email-list-close":"_onEmailListClose","click   .udp-address-book":"_onAddressBookClick","click   .udp-email-list-name":"_onInputFocus"},initialize:function(){console.log("UDP dialog initialize"),e.View.prototype.initialize.call(this),this._template=_.template(i),this._localAddressTemplate=_.template(o),this._uiModel=new t.UserInformationModel,this.options.userInformationModel=this._uiModel,t.opFactory.create("StartingPluginOp",this.options).run();var s=_.extend({},this.options,{searchString:""});this.PGCOp=e.opFactory.create("GettingPGCSuggestionsOp",s)},render:function(){var t;if(e.PluginContentView.prototype.render.call(this),console.log("udp dialog render"),!(this.$el.children().length>0)){0===this.$el.children().length&&(this.$el.html(this._template({CANCEL_BUTTON_TEXT:l.CANCEL_BUTTON_TEXT,SAVE_BUTTON_TEXT:l.SAVE_BUTTON_TEXT,ADD_BUTTON_TEXT:l.ADD_BUTTON_TEXT,SPECIFY_USER_OR_GROUP:l.SPECIFY_USER_OR_GROUP,DEFINE_LABEL_PERMISSION:l.DEFINE_LABEL_PERMISSION,MORE_OPTIONS:l.MORE_OPTIONS,READ:l.READ,CHANGE:l.CHANGE,FULL_CONTROL:l.FULL_CONTROL,CAN_READ:l.CAN_READ,CAN_CHANGE:l.CAN_CHANGE,CAN_FULL_CONTROL:l.CAN_FULL_CONTROL,READ_COPY_PRINT:l.READ_COPY_PRINT,CHANGE_PRINT:l.CHANGE_PRINT,DELETE:l.DELETE,CUSTOM:l.CUSTOM,OWNER_SIGNAL:l.OWNER_SIGNAL,OWNER:l.OWNER,DOCUMENT_EXPIRY:l.DOCUMENT_EXPIRY})),this._initWrappers(),t=document.createElement("input"),void 0!==t.placeholder?this.$addressHeading.hide():this.$addressHeading.show(),e.Util.isCEF()&&(this.$addressHelpMsg.css("z-index","1000"),this.$autocompleteBox.css("z-index","1001")));var i=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?"))),s=i.isUDPEditWorkflow;if("true"===s)this._renderUDPData();else{var i=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));this.options.userInformationModel.set("ownerId",i.ownerId),this.options.userInformationModel.set("ownerName",i.ownerName),this._addOwner()}return this._onUsersChange(),this._updateControlsDropdownAndAddButton(),this._addUiModelEventListeners(),this._addKeyEventListener(),this._renderChildViews(),$(".udp-address-input").one("focus",this._initialiseEmailAddFetching),this._updateEmailFields(),this._processRecipients(!0,!0),this}},stopListening:function(t,i,s){e.View.prototype.stopListening.call(this,t,i,s),this.applyMethodRecursively("undelegateEvents"),this._removeUiModelEventListeners()},_initWrappers:function(){this.$saveButtonId=this.$("#udp-dialog-save-btn-id"),this.$addUserButtonId=this.$("#udp-dialog-add-btn-id"),this.$addUserButton=this.$(".udp-dialog-add-btn"),this.$cancelButtonId=this.$("#udp-dialog-cancel-btn-id"),this.$addPermissionsDropdownId=this.$("#add-permissions-btn-id"),this.$addPermissionsDropdown=this.$(".add-permissions-btn"),this.$addPermissionsContainer=this.$("#add-permissions-menu"),this.$usersPermissionInfo=this.$(".users-permission-info"),this.$carotIcon=this.$(".permissions-dropdown-icon"),this.$addedMembers=this.$("#added-members"),this.$addedMembersMessage=this.$("#share-added-members-message"),this.$addedMembersListContainer=this.$("#added-members-list-container"),this.$userPermissionsMenuContainer=this.$(".user-permissions-menu-container"),this.$addPermissionsMenuContainer=this.$(".add-permissions-menu-container"),this.$addressHeading=this.$(".share-address-heading"),this.$addressHelpMsg=this.$(".share-address-help-msg"),this.$autocompleteBox=this.$(".udp-autocomplete-box"),this.$udpEmailList=this.$(".udp-email-list"),this.$removeButton=this.$(".udp-email-list-close"),this.$inputContainer=this.$(".udp-address-input-container"),this.$input=this.$(".udp-address-input"),this.$inputMask=this.$(".share-address-input-mask"),this.$udpEmailInputBox=this.$(".udp-email-input-box"),this.$udpAddressBookButton=this.$(".udp-address-book"),this.$placeholder=this.$input.attr("placeholder")},_showExpiryDate:function(e){var t=new Date(e);this.options.userInformationModel.set("expiry_date",t),this.options.userInformationModel.set("expiry_date_mmddyyyy",e);var i=new Date;t>i&&(document.getElementById("udp-expiry-date-id").innerHTML=l.DOCUMENT_EXPIRY+e)},_showUDPLabelUserInfo:function(){this._addOwner();for(var e=this._uiModel.get("userInformationArray"),t=0;t<e.length;t++){var i,n=e[t].userEmailAddress.replace(/[&\/\\#\\@,+()$~%.'":*?<>{}]/g,"");i=_.template(s)({userName:e[t].userName,userEmailAddressID:n,userEmailAddress:e[t].userEmailAddress,selectedPermission:e[t].userShowPermission,READ_DROPDOWN:this._uiModel.get("readPermisison"),CHANGE_DROPDOWN:this._uiModel.get("changePermission"),FULL_CONTROL:l.FULL_CONTROL,DELETE:l.DELETE,CUSTOM:l.CUSTOM}),E+=i,this.$usersPermissionInfo.html(E)}for(var t=0;t<e.length;t++){var n=e[t].userEmailAddress.replace(/[&\/\\#\\@,+()$~%.'":*?<>{}]/g,""),o=n,a=document.getElementById(o);a.addEventListener("click",this._userPermissionDropdownClicked),a.addEventListener("keydown",this._onButtonKeyDown)}this._uiModel.resetEmailCollection(),this._updateControlsDropdownAndAddButton()},_renderUDPData:function(){var e="UDP",t="Edit_UDP_Permissions",i="Clicked";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"listUserIdsUDPDialog",methodArgs:""}).done(_.bind(function(e){this.options.userInformationModel.set("ownerId",e.ownerId),this.options.userInformationModel.set("ownerName",e.ownerId),this._showExpiryDate(e.expiry_date),this.options.userInformationModel.set("copyCheckBox",Boolean(e.copyCheckBox)),this.options.userInformationModel.set("printCheckBox",Boolean(e.printCheckBox));for(var t=e.userInformationArray,i="",s="",n=0;n<t.length;n++){"READ"==t[n].userMacroPermission?(i=c.READ,s=l.READ):"CHANGE"==t[n].userMacroPermission?(i=c.CHANGE,s=l.CHANGE):"FULL CONTROL"==t[n].userMacroPermission?(i=c.FULL_CONTROL,s=l.FULL_CONTROL):(i=c.CUSTOM,s=l.CUSTOM);var o={userEmailAddress:t[n].userEmailAddress,userName:t[n].userEmailAddress,userShowPermission:s,userMacroPermission:i};this._uiModel.addUserDataObjects(o)}this._showUDPLabelUserInfo()},this))},this))},_renderChildViews:function(){var e,t=this.options.userInformationModel;t.get("enable_autocomplete")?(e=_.extend({},this.options,{emailView:this}),this.$autocompleteBox.show(),this._renderChildView("_autocompleteControl",r,this.$autocompleteBox,e)):(this._autocompleteControl&&this.removeChildView(this._autocompleteControl),this.$autocompleteBox.hide())},_detachChildViewsAndClear:function(){this._autocompleteControl&&this.removeChildView(this._autocompleteControl);var e=this.options.userInformationModel.get("email_addr_collection");e.length>0&&e.reset()},_updateEmailFields:function(){this.options.userInformationModel;this.$el.removeClass("disabled"),this.$addressHeading.removeAttr("disabled"),this.enable(!0)},_onEmailListClose:function(e){var t,i,s=$(e.target),n=this.options.userInformationModel.get("email_addr_collection"),o=d.SHARE,a=d.USE,l="Remove User";this.options.appApi.siteCatalystApi.logScEvent([o,a,l]),t=s.data("asset-id"),t&&(i=n.get(t),n.remove(i)),this._updateAddedMembersText(n.length)},_processRecipients:function(e,t){var i=this.options.userInformationModel.get("email_addr_collection");i.length>0?(this._toggleSubjectAndMessageVisibility(!0),this.$input.css("margin-left","4px"),this.$input.removeAttr("placeholder")):(this.$input.css("margin-left","0px"),this.$input.attr("placeholder",this.$placeholder)),t===!0&&this.focus(!0),this._renderEmailList(i),this._updateInputEmailTextAreaWidth(),this._updateControlsDropdownAndAddButton()},_renderEmailList:function(t){var i,s,n,o,a,r=this.$udpEmailList,d=(this.options.userInformationModel,this.options,this._computeMaxAvailWidth());if(e.Util.isCEF()&&r.show(),r.children(".udp-email-list-item").remove(),t.each(_.bind(function(e){s=e.get(e.get("name")?"name":"email"),n=e.get("email"),a=e.get("valid"),o=this._localAddressTemplate({name:s,email:n,remove:l.EMAIL_REMOVE,asset_id:e.cid,ariaRemoveLabel:this._getRemoveAriaLabel(s)}),s&&a?0==r.children(".udp-email-list-item").length?r.prepend(o):r.children(".udp-email-list-item").last().after(o):a||t.remove(e)},this)),_.each(this.$(".udp-email-list-name"),function(e){i=$(e);var t={truncateFromRight:!0,truncateFromExt:!1,ellipsis:"...",maxIterations:10};p.truncateElementText(i,d-$(".udp-email-list-close").width(),t)}),this._updateAddedMembersText(t.length),this.$(".udp-email-input-box").last().offset()){var c=this.$(".udp-email-input-box").last().offset().top;r.scrollTop(c)}},_updateAddedMembersText:function(e){void 0!=e&&e>=0&&this.$addedMembers.html(l.ADDED_RECIPIENT_NO_COUNT+" ("+e+")")},_getRemoveAriaLabel:function(e){return _.template(l.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:l.EMAIL_REMOVE})},_initialiseEmailAddFetching:function(){var i=this.options,s=i.userInformationModel,n=this._getResolvedPromise();this._displayIPMToUser=!1,s.set({is_individual:!0}),e.Util.isCEF()&&s.get("autocomplete_local_contacts_imported")===!1&&(n=this._importLocalEmailContacts(),n.then(_.bind(function(){s.set({autocomplete_local_contacts_imported:!0})},this))),e.Util.isCEF()&&s.get("autocomplete_cloud_contacts_imported")===!1&&this.options.appApi.sessionApi.isSignedInReader()&&t.opFactory.create("DesktopFetchingAutocompleteListOp",this.options).run().then(_.bind(function(){s.set({autocomplete_cloud_contacts_imported:!0})},this)),e.Util.isCEF()&&s.get("autocomplete_msgraph_contacts_imported")===!1&&this.options.appApi.rnaApi.done(_.bind(function(t){t.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().done(_.bind(function(){t.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().done(_.bind(function(t){if(t){var i=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),n=d.SHARE,o=d.USE,a="Get MSGraph Contacts for SignedIn User";this.options.appApi.siteCatalystApi.logScEvent([n,o,a]),i.run().then(_.bind(function(e){var t=this.options.autoCCollection;t.add(e.toJSON(),{merge:!0}),s.set({autocomplete_msgraph_contacts_imported:!0})},this),_.bind(function(){},this))}},this))},this))},this))},_toggleSubjectAndMessageVisibility:function(e){e?(this.$addedMembers.show(),this.$addedMembersMessage.hide(),this.$addedMembersListContainer.show()):(this.$addedMembers.hide(),this.$addedMembersMessage.hide(),this.$addedMembersListContainer.hide())},_importLocalEmailContacts:function(){return this.options.appApi.rnaApi.then(_.bind(function(e){return e.stApi.getOutlookAutoCompleteListAtIdleAPI().then(_.bind(function(e){return e._addEventListener("custom:onOutlookAddressesFetchComplete",_.bind(function(e,t){var i=t.params,s=i.split(";"),n="",o="",a=-1,l=this.options.autoCCollection;s.pop(),_.each(s,function(e){a=_.lastIndexOf(e,"<"),-1===a?(o=e,n=""):(o=e.substring(a+1),n=e.substring(0,a)),">"===_.last(o)&&(o=o.slice(0,-1))," "===_.last(n)&&(n=n.slice(0,-1)),l.get(o)&&l.remove(o),l.add({email:o,name:n,isLocalContact:!0})})},this)),$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_addUiModelEventListeners:function(){var e=this.options.userInformationModel;e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:enable_autocomplete",this._onEnableAutocompleteChange),e.on("change:userInformationArray",this._onUsersChange)},_onUsersChange:function(){var e=this._uiModel.get("userInformationArray");e.length>0?a.enableInput(this.$saveButtonId,!0):a.enableInput(this.$saveButtonId,!1)},_removeUiModelEventListeners:function(){var e=this.options.userInformationModel;e.get("email_addr_collection").off("all",this._onRecipientsChange),e.off("change:enable_autocomplete",this._onEnableAutocompleteChange)},_onViewEvent:function(t,i){"CHICKLET_REMOVED"===t&&this._onChickletRemoved(),e.View.prototype._onViewEvent.call(this,t,i)},_onRecipientsChange:function(){this._onDebouncedRecipientsChange()},_onDebouncedRecipientsChange:function(){this._processRecipients(!0,!0)},_getAriaLabelForDesktop:function(e,t){return _.template(l.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:t})},_onEnableAutocompleteChange:function(){this._renderChildViews()},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var t=!1,i=e.which,s=!1,n=this.$input;return this.$input.is(":focus")?(this._updateInputEmailTextAreaWidth(),13===i?this._autocompleteControl&&(this._autocompleteControl.makeChoice(!1)||_.defer(_.bind(function(){this.abortPGCRequest(),this._setRecipientModels()},this))):9===i?this._autocompleteControl&&!e.shiftKey&&this._autocompleteControl.makeChoice()&&(t=!0):8===i?this.hasText()||(this.removeLastRecipient(),t=!0):40===i?this._autocompleteControl&&(this._autocompleteControl.selectDown(),s=!0,t=!0):38===i?this._autocompleteControl&&(this._autocompleteControl.selectUp(),s=!0,t=!0):27===i&&this._autocompleteControl&&(this._autocompleteControl.filteredCollection.length?(this._autocompleteControl.setFilter(void 0),t=!0):t=!1),s?n.attr("aria-activedescendant",this._autocompleteControl.$(".selected").attr("id")):n.removeAttr("aria-activedescendant"),t&&this._consumeEvent(e),t):t},_onKeyup:function(e){var t=!1,i=e.which;return this.$input.is(":focus")?(32===i&&(t=!0,_.defer(_.bind(function(){this._setRecipientModels(!0)},this))),t):t},_updateInputEmailTextAreaWidth:function(){var e=this.options.userInformationModel.get("email_addr_collection");if(0==e.length)return void this.$udpEmailInputBox.css("width","95%");var t,i=8*this.val().length+10,s=this.$udpEmailInputBox.width(),n=this.$udpEmailList.width()-25;i=i?i:10,i>s&&n>i&&(t=i+32,t>n&&(t=n),this.$udpEmailInputBox.css("width",t+"px"))},_restoreInputEmailTextAreaWidth:function(){var e=this.options.userInformationModel.get("email_addr_collection");if(0==e.length)return void this.$udpEmailInputBox.css("width","95%");{var t;this.$udpEmailList.width()}0==this.val().length&&(t=4,this.$udpEmailInputBox.css("width",t+"px"))},_changeTextColor:function(e){e?($("#udp-address-input-id").removeClass("theme-share-input-text"),$("#udp-address-input-id").addClass("theme-text")):($("#udp-address-input-id").removeClass("theme-text"),$("#udp-address-input-id").addClass("theme-share-input-text"))},_setAutocompleteFilterValue:function(e){this._autocompleteControl&&(this.options.appApi.sessionApi.isSignedInReader()?""!==e?(this._autocompleteControl.setFilter(e),this.PGCOp.updateSearchString(e),this.PGCOp.run().then(_.bind(function(t){t.length>0&&(this.options.userInformationModel.set("pgcSuggestionsCollection",t),this._autocompleteControl.setFilter(e))},this))):(this.abortPGCRequest(),this._autocompleteControl.setFilter(e)):this._autocompleteControl.setFilter(e))},abortPGCRequest:function(){this.options.appApi.sessionApi.isSignedInReader()&&(this.PGCOp.updateSearchString(""),this.PGCOp.run())},removeLastRecipient:function(){var e=this.options.userInformationModel.get("email_addr_collection");e.pop()},_onRecipientsInput:function(){var e=this.val();this._changeTextColor(e),this._setAutocompleteFilterValue(e)},_onRecipientsPaste:function(){setTimeout(_.bind(function(){var e=this.val();this._changeTextColor(!0),this._setRecipientModels(),e=this.val(),this._setAutocompleteFilterValue(),this._updateInputEmailTextAreaWidth()},this),10)},_onRecipientsBlur:function(){return this._setRecipientModels(),this._autocompleteControl&&this._autocompleteControl.setFilter(void 0),!0},_setRecipientModels:function(e){var t=this.val();_.isUndefined(e)||!e||t.match(/.*@.*/)||(t+=" "),this._setRecipientsFromText(t)},_setRecipientsFromText:function(t,i){var s,n,o=this.options,a=o.userInformationModel;if(e.Util.isCEF()&&t.match(/.+\s$/)&&0!==this._autocompleteControl.filteredCollection.length&&!t.match(/.*@.*|.+\s\s$/))return void this.setValue(t);if(t=t.replace(/(\r\n|\n|\r)/gm,""),s=t.split(t.match(/(<\S+>)/)?/\s*[,;]+\s*/:/\s*[,;\s]+\s*/),n=a.parseEmailArray(s,i),n.length>0)if(console.log(n[0].get("valid")),0==n[0].get("valid"));else{a.addRecipientsToCollection(n),this.clear();var l=d.SHARE,r=d.USE,c="Add user";o.appApi.siteCatalystApi.logScEvent([l,r,c]),o.appApi.siteCatalystApi.logScEvent([d.TOOLS,d.SHARE,d.EMAIL,d.CHICKLET_ADDED]),a.get("autocomplete_avoided")||(o.appApi.siteCatalystApi.logScEvent([d.TOOLS,d.SHARE,d.EMAIL,d.AUTOCOMPLETE,d.AVOIDED]),a.set("autocomplete_avoided",!0))}},_onInputFocus:function(){this.$input.addClass("focus"),this._updateInputEmailTextAreaWidth()},_onInputBlur:function(){this.$input.removeClass("focus"),this._restoreInputEmailTextAreaWidth()},_onAddressBookClick:function(){var e,t,i,s=d.SHARE,n=d.USE,o="Select Address Book";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),i=_.extend({},this.options),t=new h(i),e=t.run(),e.then(_.bind(function(e){this._setRecipientsFromText(e)},this),_.bind(function(){},this))},_focusOnEmailTextarea:function(){this.$("#udp-address-input-id-nv").focus()},_focusOnSubjectArea:function(){},_blurOnMessageArea:function(){},_focusOnMessageArea:function(){},_onShareAddrHelp:function(){var e=this.options.userInformationModel;e.set({display_individual_help:!0})},_onShareAddrMsgClose:function(){var e=this.options.userInformationModel;e.set({display_individual_help:!1}),this.focus(!0)},_onUDPAddressClick:function(){this.focus(!0)},_onChickletRemoved:function(){this.focus(!0)},_computeMaxAvailWidth:function(){return 200},val:function(){return this.$input.val()||""},hasText:function(){return this.$input.val().length>0},setValue:function(e){this.$input.val(e)},enable:function(e){e?(this.$input.removeAttr("disabled"),this.$inputMask.hide(),this.$(".udp-email-list-close").removeAttr("disabled"),this.$(".udp-email-list-item").removeClass("disabled")):(this.$input.attr({disabled:"disabled"}),this.$inputMask.show(),this.$(".udp-email-list-close").attr({disabled:"disabled"}),this.$(".udp-email-list-item").addClass("disabled"))},focus:function(){this.$input.addClass("focus"),this.$input.focus()},clear:function(){this.$input.val(""),this._restoreInputEmailTextAreaWidth()},_updateControlsDropdownAndAddButton:function(){this._uiModel.isEmailBoxEmpty()&&0==this.$input.val().length?(this.$addUserButton.hide(),this.$addPermissionsDropdown.hide(),this.$carotIcon.hide(),document.getElementById("add-buttons-id").style.display="none"):(this.$addUserButton.show(),this.$addPermissionsDropdown.show(),this.$carotIcon.show(),document.getElementById("add-buttons-id").style.display="block")},_emailIdsPasted:function(){setTimeout(_.bind(function(){this._updateControlsDropdownAndAddButton()},this),100)},_dropdownStrings:function(e){var t=e.currentTarget.id,i="#"+t+"-permissions-menu";this._uiModel.set({readPermisison:l.READ,changePermission:l.CHANGE});var s=0;"Y"==this.increaseWidthForLocale&&(s=40),this.$addPermissionsMenuContainer.css("width",174),this.$(i).css("width",174),1==this._uiModel.get("copyCheckBox")&&1==this._uiModel.get("printCheckBox")?(this._uiModel.set({readPermisison:l.READ_COPY_PRINT,changePermission:l.CHANGE_PRINT}),this.$addPermissionsMenuContainer.css("width",218+3*s),this.$(i).css("width",218+3*s)):1==this._uiModel.get("copyCheckBox")?(this._uiModel.set({readPermisison:l.READ_COPY}),this.$addPermissionsMenuContainer.css("width",218+s),this.$(i).css("width",218+s)):1==this._uiModel.get("printCheckBox")&&(this._uiModel.set({readPermisison:l.READ_PRINT,changePermission:l.CHANGE_PRINT}),this.$addPermissionsMenuContainer.css("width",218+s),this.$(i).css("width",218+s)),document.getElementById("read-permission-label").innerHTML=this._uiModel.get("readPermisison"),document.getElementById("change-permission-label").innerHTML=this._uiModel.get("changePermission"),null!=document.getElementById(t+"-read-permission-label")&&(document.getElementById(t+"-read-permission-label").innerHTML=this._uiModel.get("readPermisison"),document.getElementById(t+"-change-permission-label").innerHTML=this._uiModel.get("changePermission"))},_getEmailAddressInputValue:function(){var e=this.options.userInformationModel.get("email_addr_collection"),t=this._uiModel.get("readPermisison"),i=c.READ;this.$(".add-permissions-btn").prop("value")==l.CAN_READ?(t=this._uiModel.get("readPermisison"),this._uiModel.set({userShowPermission:l.READ}),i=c.READ):this.$(".add-permissions-btn").prop("value")==l.CAN_CHANGE?(t=this._uiModel.get("changePermission"),this._uiModel.set({userShowPermission:l.CHANGE}),i=c.CHANGE):this.$(".add-permissions-btn").prop("value")==l.CAN_FULL_CONTROL&&(t=l.FULL_CONTROL,this._uiModel.set({userShowPermission:l.FULL_CONTROL}),i=c.FULL_CONTROL);var s=this._uiModel.get("userInformationArray");e.each(_.bind(function(e){for(var t=!1,n=0;n<s.length;n++)if(e.get("email")==s[n].userEmailAddress){t=!0;break}if(0==t){var o=e.get(e.get("name")?"name":"email"),a={userEmailAddress:e.get("email"),userName:o,userShowPermission:this._uiModel.get("userShowPermission"),userMacroPermission:i};this._uiModel.addUserDataObjects(a)}},this))},_addOwner:function(){E="";var e=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));this.increaseWidthForLocale=e.adjWidth;var t,i=this._uiModel.get("ownerId").replace(/[&\/\\#\\@,+()$~%.'":*?<>{}]/g,"");t=_.template(n)({userName:this._uiModel.get("ownerName"),userEmailAddressID:i,userEmailAddress:this._uiModel.get("ownerId"),OWNER:l.OWNER,OWNER_SIGNAL:l.OWNER_SIGNAL}),E+=t,this.$usersPermissionInfo.html(E)
},_addUDPLabelUserInfo:function(){this._getEmailAddressInputValue(),this._showUDPLabelUserInfo()},_addPermissionDropdownEventListeners:function(){u.addDomEventListener(document.body,"click",this._onBodyClick,!0)},_removePermissionDropdownEventListeners:function(){u.removeDomEventListener(document.body,"click",this._onBodyClick,!0)},_onBodyClick:function(e){0===u.getEventTarget(e).closest("#add-permissions-dropdown-id").length&&(e.stopPropagation(),this._ClosePermissionsDropDown())},_ClosePermissionsDropDown:function(){this._removePermissionDropdownEventListeners(),this.$addPermissionsContainer.addClass("hide")},_addPermissionDropdownClicked:function(e){var t=e.target,i=t.parentElement.parentElement.getBoundingClientRect();this._dropdownStrings(e),document.getElementById("checkmark-read-permission").checked=!1,document.getElementById("checkmark-change-permission").checked=!1,document.getElementById("checkmark-full-control-permission").checked=!1,"read-permission"==e.target.id||"checkmark-read-permission"==e.target.htmlFor||"checkmark-read-permission"==e.target.id?(document.getElementById("checkmark-read-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_READ),this._ClosePermissionsDropDown()):"change-permission"==e.target.id||"checkmark-change-permission"==e.target.htmlFor||"checkmark-change-permission"==e.target.id?(document.getElementById("checkmark-change-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_CHANGE),this._ClosePermissionsDropDown()):"full-control-permission"==e.target.id||"checkmark-full-control-permission"==e.target.htmlFor||"checkmark-full-control-permission"==e.target.id?(document.getElementById("checkmark-full-control-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_FULL_CONTROL),this._ClosePermissionsDropDown()):("add-permissions-btn-id"==e.target.id||"carot-id"==e.target.id||"add-permissions-dropdown-id"==e.target.id)&&(this.$addPermissionsContainer.hasClass("hide")?(this._addPermissionDropdownEventListeners(),this.$addPermissionsContainer.removeClass("hide"),"add-permissions-dropdown-id"==e.target.id&&(i=t.parentElement.getBoundingClientRect()),this.$addPermissionsMenuContainer.css("top",i.bottom-3.2),this.$(".add-permissions-btn").prop("value")==l.CAN_READ?document.getElementById("checkmark-read-permission").checked=!0:this.$(".add-permissions-btn").prop("value")==l.CAN_CHANGE?document.getElementById("checkmark-change-permission").checked=!0:this.$(".add-permissions-btn").prop("value")==l.CAN_FULL_CONTROL&&(document.getElementById("checkmark-full-control-permission").checked=!0)):this._ClosePermissionsDropDown())},_addPermissionDropdownKeyUp:function(){var e=document.getElementById("checkmark-read-permission").checked,t=document.getElementById("checkmark-change-permission").checked,i=document.getElementById("checkmark-full-control-permission").checked;e===!0?(document.getElementById("checkmark-read-permission").checked=!1,document.getElementById("checkmark-full-control-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_FULL_CONTROL)):t===!0?(document.getElementById("checkmark-change-permission").checked=!1,document.getElementById("checkmark-read-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_READ)):i===!0&&(document.getElementById("checkmark-full-control-permission").checked=!1,document.getElementById("checkmark-change-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_CHANGE))},_addPermissionDropdownKeyDown:function(){var e=document.getElementById("checkmark-read-permission").checked,t=document.getElementById("checkmark-change-permission").checked,i=document.getElementById("checkmark-full-control-permission").checked;e===!0?(document.getElementById("checkmark-read-permission").checked=!1,document.getElementById("checkmark-change-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_CHANGE)):t===!0?(document.getElementById("checkmark-change-permission").checked=!1,document.getElementById("checkmark-full-control-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_FULL_CONTROL)):i===!0&&(document.getElementById("checkmark-full-control-permission").checked=!1,document.getElementById("checkmark-read-permission").checked=!0,this.$(".add-permissions-btn").prop("value",l.CAN_READ))},_deleteUserFromList:function(e){for(var t,i=this._uiModel.get("userInformationArray"),s=0;s<i.length;s++){var n=i[s].userEmailAddress.replace(/[&\/\\#\\@,+()$~%.'":*?<>{}]/g,"");if(n==e){t=s;break}}i.splice(s,1),this._uiModel.set("userInformationArray",i),this._onUsersChange(),this._addUDPLabelUserInfo()},_updateUserPermissionsInArray:function(e,t,i){for(var s=this._uiModel.get("userInformationArray"),n=0;n<s.length;n++){var o=s[n].userEmailAddress.replace(/[&\/\\#\\@,+()$~%.'":*?<>{}]/g,"");if(o==e){s[n].userMacroPermission=t,s[n].userShowPermission=i;break}}this._uiModel.set("userInformationArray",s)},_addUserPermissionDropdownEventListeners:function(){u.addDomEventListener(document.body,"click",this._onBodyClickUserDropDown,!0)},_removeUserPermissionDropdownEventListeners:function(){u.removeDomEventListener(document.body,"click",this._onBodyClickUserDropDown,!0)},_onBodyClickUserDropDown:function(e){var t="#"+m+"-permissions-menu";0===u.getEventTarget(e).closest(t).length&&(e.stopPropagation(),this._CloseUserPermissionsDropDown())},_CloseUserPermissionsDropDown:function(){this._removeUserPermissionDropdownEventListeners(),this.$userPermissionsContainer.addClass("hide")},_userPermissionDropdownClicked:function(e){var t=e.target,i=t.parentElement.parentElement.parentElement.getBoundingClientRect();this._dropdownStrings(e);var s=e.currentTarget.id;m=s;var n,o;if(document.getElementById(s+"-checkmark-read-permission").checked=!1,document.getElementById(s+"-checkmark-change-permission").checked=!1,document.getElementById(s+"-checkmark-full-control-permission").checked=!1,document.getElementById(s+"-checkmark-delete-permission").checked=!1,e.target.id==s+"-read-permission"||e.target.htmlFor==s+"-checkmark-read-permission"||e.target.id==s+"-checkmark-read-permission")document.getElementById(s+"-checkmark-read-permission").checked=!0,this.$("."+s+"-user-permissions-btn").prop("value",l.READ),n=c.READ,o=l.READ,this._updateUserPermissionsInArray(s,n,o),this._CloseUserPermissionsDropDown();else if(e.target.id==s+"-change-permission"||e.target.htmlFor==s+"-checkmark-change-permission"||e.target.id==s+"-checkmark-change-permission")document.getElementById(s+"-checkmark-change-permission").checked=!0,this.$("."+s+"-user-permissions-btn").prop("value",l.CHANGE),n=c.CHANGE,o=l.CHANGE,this._updateUserPermissionsInArray(s,n,o),this._CloseUserPermissionsDropDown();else if(e.target.id==s+"-full-control-permission"||e.target.htmlFor==s+"-checkmark-full-control-permission"||e.target.id==s+"-checkmark-full-control-permission")document.getElementById(s+"-checkmark-full-control-permission").checked=!0,this.$("."+s+"-user-permissions-btn").prop("value",l.FULL_CONTROL),n=c.FULL_CONTROL,o=l.FULL_CONTROL,this._updateUserPermissionsInArray(s,n,o),this._CloseUserPermissionsDropDown();else if(e.target.id==s+"-delete-permission"||e.target.id==s+"-checkmark-delete-permission")document.getElementById(s+"-checkmark-delete-permission").checked=!0,this.$("."+s+"-user-permissions-btn").prop("value",l.DELETE),this._deleteUserFromList(s),this._CloseUserPermissionsDropDown();else if(e.target.id==s+"-permissions-btn-id"||e.target.id==s+"-carot-id"||e.target.id==s+"-user-permission"){var a="#"+s+"-permissions-menu";if(this.$userPermissionsContainer=this.$(a),this.$userPermissionsContainer.hasClass("hide")){this._addUserPermissionDropdownEventListeners(),this.$userPermissionsContainer.removeClass("hide");var r=document.getElementById("mip-sensitivity-label-dialog").getBoundingClientRect().height;i.bottom<=.75*r?this.$(a).css("top",i.bottom-3.2):this.$(a).css("top",i.bottom-172.2),this.$("."+s+"-user-permissions-btn").prop("value")==l.READ?document.getElementById(s+"-checkmark-read-permission").checked=!0:this.$("."+s+"-user-permissions-btn").prop("value")==l.CHANGE?document.getElementById(s+"-checkmark-change-permission").checked=!0:this.$("."+s+"-user-permissions-btn").prop("value")==l.FULL_CONTROL&&(document.getElementById(s+"-checkmark-full-control-permission").checked=!0)}else this._CloseUserPermissionsDropDown()}},_userPermissionDropdownKeyDown:function(e){var t=e.currentTarget.id;m=t;{var i,s,n=document.getElementById(t+"-checkmark-read-permission").checked,o=document.getElementById(t+"-checkmark-change-permission").checked,a=document.getElementById(t+"-checkmark-full-control-permission").checked;document.getElementById(t+"-checkmark-delete-permission").checked}n?(document.getElementById(t+"-checkmark-read-permission").checked=!1,document.getElementById(t+"-checkmark-change-permission").checked=!0,this.$("."+t+"-user-permissions-btn").prop("value",l.CHANGE),i=c.CHANGE,s=l.CHANGE,this._updateUserPermissionsInArray(t,i,s)):o?(document.getElementById(t+"-checkmark-change-permission").checked=!1,document.getElementById(t+"-checkmark-full-control-permission").checked=!0,this.$("."+t+"-user-permissions-btn").prop("value",l.FULL_CONTROL),i=c.FULL_CONTROL,s=l.FULL_CONTROL,this._updateUserPermissionsInArray(t,i,s)):a&&(document.getElementById(t+"-checkmark-full-control-permission").checked=!1,this._deleteUserFromList(t),this._CloseUserPermissionsDropDown())},_userPermissionDropdownKeyUp:function(e){var t=e.currentTarget.id;m=t;{var i,s,n=document.getElementById(t+"-checkmark-read-permission").checked,o=document.getElementById(t+"-checkmark-change-permission").checked,a=document.getElementById(t+"-checkmark-full-control-permission").checked;document.getElementById(t+"-checkmark-delete-permission").checked}n?(document.getElementById(t+"-checkmark-read-permission").checked=!1,this._deleteUserFromList(t),this._CloseUserPermissionsDropDown()):o?(document.getElementById(t+"-checkmark-change-permission").checked=!1,document.getElementById(t+"-checkmark-read-permission").checked=!0,this.$("."+t+"-user-permissions-btn").prop("value",l.READ),i=c.READ,s=l.READ,this._updateUserPermissionsInArray(t,i,s)):a&&(document.getElementById(t+"-checkmark-full-control-permission").checked=!1,document.getElementById(t+"-checkmark-change-permission").checked=!0,this.$("."+t+"-user-permissions-btn").prop("value",l.CHANGE),i=c.CHANGE,s=l.CHANGE,this._updateUserPermissionsInArray(t,i,s))},_moveToMoreOptionsDialog:function(){this.$el.hide(),window.$el.find("#mip-udp-more-options-dialog").show(),this._renderChildView("_UDPMoreOptionsDialog",t.UDPMoreOptionsDialog,window.$el.find("#mip-udp-more-options-dialog"),this.options)},_removeUDPMoreOptionsView:function(){var e=window.$el.find("#mip-udp-more-options-dialog"),t=this.getChildViews();_.each(t,function(t){t.$el.is(e)&&this.removeChildViewById(t.options.viewId)},this)},_cancelUDPDialog:function(){var e="MIP_UDPDialog",t="CANCEL_BUTTON_TEXT",i="Cancelled";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"closeMIPSensitivityLabelModal",methodArgs:""})},this))},_saveUDPLabelInfo:function(){if(!this.$saveButtonId.prop("disabled")){var e="MIP_UDPDialog",t="SAVE_BUTTON_TEXT",i="Saved";this.options.appApi.siteCatalystApi.logScEvent([e,t,i]);var s={};s.expiry_date=this._uiModel.get("expiry_date_mmddyyyy"),s.copyCheckBox=this._uiModel.get("copyCheckBox"),s.printCheckBox=this._uiModel.get("printCheckBox"),s.userInformationArray=this._uiModel.get("userInformationArray"),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"saveUDPUsersInformation",methodArgs:s})},this))}},_onButtonKeyDown:function(e){{var t=e.which,i=e.currentTarget;e.target}if(13===t||32===t){if("more-options-icon"===i.id)return this._consumeEvent(e),this._moveToMoreOptionsDialog();if("add-permissions-dropdown-id"===i.id)return this._consumeEvent(e),this._addPermissionDropdownClicked(e);if("udp-dialog-add-btn-id"===i.id)return this._consumeEvent(e),this._addUDPLabelUserInfo();if("udp-dialog-cancel-btn-id"===i.id)return this._consumeEvent(e),this._cancelUDPDialog();if("udp-dialog-save-btn-id"===i.id)return this._consumeEvent(e),this._saveUDPLabelInfo()}else if(38===t){if("add-permissions-dropdown-id"===i.id)return this._consumeEvent(e),this._addPermissionDropdownKeyUp(e);if("users-permission-table"===i.classList[0])return this._consumeEvent(e),this._userPermissionDropdownKeyUp(e)}else if(40===t){if("add-permissions-dropdown-id"===i.id)return this._consumeEvent(e),this._addPermissionDropdownKeyDown(e);if("users-permission-table"===i.classList[0])return this._consumeEvent(e),this._userPermissionDropdownKeyDown(e)}}})}),define("pdmplugins/mip/js/views/plugin-view",["core/ac-core","pdmplugins/mip/js/ac-mip","i18n!pdmplugins/mip/js/nls/ui-strings","core/utils/view-util","core/utils/focus-util","core/utils/event-util","core/utils/sc-analytics","pdmplugins/mip/js/views/edit-sensitivity-label-view","pdmplugins/mip/js/views/justification-view","pdmplugins/mip/js/views/udp-view","core/views/plugin-content-view"],function(e,t){return t.PluginView=e.PluginContentView.extend({initialize:function(){e.PluginContentView.prototype.initialize.call(this)},teardown:function(){this.$el.empty()},render:function(){var t=this.$el;window.$el=t,e.PluginContentView.prototype.render.call(this),t.append(_.template('<div id="mip-sensitivity-label-dialog"></div><div id="mip-udp-more-options-dialog"></div>')),this._renderChildViews(this.options)},_renderChildViews:function(){var e=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));"user_sensitivity_labels"===e.app?($el.find("#mip-udp-more-options-dialog").hide(),this._renderChildView("_showSensitivityLabelDialog",t.SensitivityLabelDialog,this.$el.find("#mip-sensitivity-label-dialog"),this.options)):"justify"==e.app?($el.find("#mip-udp-more-options-dialog").hide(),this._renderChildView("_JustificationDialog",t.JustificationDialog,this.$el.find("#mip-sensitivity-label-dialog"),this.options)):"udp_dialog"==e.app&&($el.find("#mip-udp-more-options-dialog").hide(),this._renderChildView("_UDPDialog",t.UDPDialog,this.$el.find("#mip-sensitivity-label-dialog"),this.options))},_resizeDialog:function(e){var t=$.Deferred(),i=450,s=500;return i=Math.min(i,e.height),s=Math.min(s,e.width),this.options.appApi.rnaApi.done(_.bind(function(e){e.cefBrowserApi({methodName:"setContainerSize",parameters:[Math.floor(s),Math.floor(i)]}).done(function(){t.resolve()})},this)),t.promise()},selectPlugin:function(){{var e=this.options;e.appApi}this.options.appApi.displayApi.applyUIThemeStyles(this.$el).then(_.bind(function(){this.render(),this.options.appApi.displayApi.showSpinner(!1)},this))},_startPlugin:function(){var e=this._getResolvedPromise();return e}}),t.PluginView}),define("pdmplugins/mip/js/mip",["pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/ops/op-factory","pdmplugins/mip/js/views/plugin-view"],function(e){_.extend(e,{init:function(){e.opFactory=new e.OpFactory}})}),define("pdmplugins/mip/js/plugin",["core/ac-core-init","pdmplugins/mip/js/ac-mip","pdmplugins/mip/js/mip"],function(e,t){t.init()});