/*************************************************************************
* 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 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 may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

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

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

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

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

/*************************************************************************
 *
 * 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.
 *
*************************************************************************/

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

define("pdmplugins/send-for-sign/js/ac-send-for-sign",["plugins-common/ac-plugins"],function(e){var i=e.SendForSign;return i||(i=e.SendForSign={}),i.PLUGIN_ID||(i.PLUGIN_ID="send_for_sign"),i}),define("pdmplugins/esign/js/ac-esign",["plugins-common/ac-plugins"],function(e){var i=e.EchoSign;return i||(i=e.EchoSign={}),i}),define("pdmplugins/esign/js/models/es-limits-model",["pdmplugins/esign/js/ac-esign","aicx/ac-aicx","aicx/models/aicx-model"],function(e,i){return e.EchoSignLimitsModel=i.AicxModel.extend({url:function(){return i.baseAicUrisModel.get("users")+"users/me/limits/esign"}}),e.EchoSignLimitsModel}),define("pdmplugins/esign/js/models/model-factory",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/model","pdmplugins/esign/js/models/es-limits-model"],function(e,i){return i.ModelFactory=e.Model.extend({create:function(e,t,s){var n=i[e];return n?new n(t,s):void LOG(0,"AcEchoSign.ModelFactory.create: Unrecognized class: "+e)}}),i.ModelFactory}),define("pdmplugins/esign/js/models/ui/es-auth-ui-model",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/ui/ui-model"],function(e,i){return i.EchoSignAuthUiModel=e.UiModel.extend({recognized:{access_token:{type:"string",optional:!0},expiration_time:{type:"number",optional:!0},expiration_check_time:{type:"number",optional:!0},auth_status:{type:"string",optional:!0},api_access_point:{type:"string",optional:!0},web_access_point:{type:"string",optional:!0},signin_profile_id:{type:"string",optional:!0},signin_profile_name:{type:"string",optional:!0},loggedin_profile_name:{type:"string",optional:!0}},defaults:{expiration_check_time:12e4,expiration_time:0,auth_status:"",access_token:"",api_access_point:"",web_access_point:"",signin_profile_id:"",signin_profile_name:"",loggedin_profile_name:""},clearLastAuthState:function(){this.set("auth_status","",{silent:!0})},resetToDefaults:function(){this.set(this.defaults,{silent:!0})}}),i.EchoSignAuthUiModel}),define("pdmplugins/esign/js/models/ui/es-doc-upload-progress-ui-model",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/ui/ui-model"],function(e,i){return i.ESDocUploadProgressUiModel=e.UiModel.extend({recognized:{upload_response:{type:"object",optional:!0},progress_status:{type:"string",optional:!0},progress_obj:{type:"object",optional:!0},bytes_uploaded:{type:"number",optional:!0},bytes_total:{type:"number",optional:!0}},defaults:{upload_response:void 0,progress_status:"",progress_obj:void 0,bytes_uploaded:0,bytes_total:0}}),i.ESDocUploadProgressUiModel}),define("pdmplugins/esign/js/models/ui/es-offline-ui-model",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/ui/ui-model"],function(e,i){return i.EchoSignOfflineUiModel=e.UiModel.extend({recognized:{is_visible:{type:"boolean",optional:!0},user_action:{type:"string",optional:!0}},defaults:{is_visible:!1,user_action:""},resetToDefaults:function(){this.set(this.defaults,{silent:!0})}}),i.EchoSignOfflineUiModel}),define("pdmplugins/esign/js/models/ui/ui-model-factory",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/model","pdmplugins/esign/js/models/ui/es-auth-ui-model","pdmplugins/esign/js/models/ui/es-doc-upload-progress-ui-model","pdmplugins/esign/js/models/ui/es-offline-ui-model"],function(e,i){return i.UiModelFactory=e.Model.extend({create:function(e,t,s){var n=i[e];return n?new n(t,s):void LOG(0,"AcEchoSign.UiModelFactory.create: Unrecognized class: "+e)}}),i.UiModelFactory}),define("pdmplugins/esign/js/ops/fetch-existing-es-auth-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.FetchExistingESAuthSessionOp=i.Op.extend({run:function(){var e=(this.options,$.Deferred());return this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.invokeMethod({methodName:"fetchESAuthSession"}).then(function(i){e.resolve(i)},function(){e.reject()})},this)),e}}),e.FetchExistingESAuthSessionOp}),define("pdmplugins/esign/js/ops/creating-new-es-auth-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/utils/http-util","core/ops/op"],function(e,i,t){var s="";return s+="{",s+='"ims_client_id":"<%= imsClientId %>",',s+='"ims_access_token":"<%= imsAccessToken %>",',s+='"es_client_id":"<%= esClientId %>",',s+='"es_client_secret":"<%= esClientSecret %>"',s+="}",e.CreatingNewESAuthSessionOp=i.Op.extend({run:function(){var e=this.options,i=$.Deferred();return e.appApi.rnaApi.done(_.bind(function(t){e.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this.createNewSession(t,i)},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString?this.createNewSession(t,i):i.reject()},this))},this)),i},createNewSession:function(e,i){var n,o,a,r,l,d,p,c,h,u=this.options;if(o=e.esApi.getEchoSignServiceParams(),a=o.baseURL,r=o.esClientId,l=o.esClientSecret,d=u.appApi.options.sessionUiModel.get("primary_token"),p=o.imsClientId,_.isEmpty(a)||_.isEmpty(r)||_.isEmpty(l)||_.isEmpty(d)||_.isEmpty(p))return void i.reject();var g=t.getClientIdQueryParam(),f=g.lastIndexOf("=");n=a+"/api/rest/v6/baseUris",c=_.template(s,{imsAccessToken:d,imsClientId:p,esClientId:r,esClientSecret:l}),h={Authorization:"Bearer "+d,"x-api-client-id":g.substr(f+1)},$.ajax({url:n,modal:!1,global:!1,headers:h,contentType:"application/json",type:"GET",dataType:"json",success:function(e){i.resolve(e)},error:_.bind(function(e){var t=e.responseJSON||{};"INVALID_IMS_PROFILE"===t.code&&void 0!==t.details&&t.details.signProfile.authenticatingAccount===t.details.loggedInProfile.authenticatingAccount?(u.signProfileID=t.details.signProfile.profileId,u.signProfileName=t.details.signProfile.profileName,u.loggedInProfileName=t.details.loggedInProfile.profileName,u.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"GetEchoSignAccessTokenFromCluster",methodArgs:[t.details.signProfile.profileId,t.details.signProfile.profileName,t.details.loggedInProfile.profileName]}).then(_.bind(function(e){u.accessToken=e.accessToken;var t=(new Date).getTime()/1e3;u.expiresIn=e.expiryTime/1e3-t,h={Authorization:"Bearer "+e.accessToken,"x-api-client-id":g.substr(f+1)},$.ajax({url:n,modal:!1,global:!1,headers:h,contentType:"application/json",type:"GET",dataType:"json",success:_.bind(function(e){e.sign_profile_id=u.signProfileID,e.sign_profile_name=u.signProfileName,e.loggedin_profile_name=u.loggedInProfileName,e.access_token=u.accessToken,e.expires_in=u.expiresIn,i.resolve(e)},this),error:function(){i.reject()}})},this),function(){i.reject(t)})},this))):i.reject()},this)})}}),e.CreatingNewESAuthSessionOp}),define("pdmplugins/esign/js/ops/storing-es-auth-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.StoringESAuthSessionOp=i.Op.extend({run:function(){var e=this.options,i=$.Deferred(),t=e.esAuthUiModel.get("access_token"),s=e.esAuthUiModel.get("expiration_time"),n=e.esAuthUiModel.get("refresh_token"),o=e.esAuthUiModel.get("api_access_point"),a=e.esAuthUiModel.get("web_access_point"),r=e.esAuthUiModel.get("signin_profile_id"),l=e.esAuthUiModel.get("signin_profile_name"),d=e.esAuthUiModel.get("loggedin_profile_name");return this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setEchoSignApiURL(o),e.esApi.setEchoSignWebURL(a),e.esApi.invokeMethod({methodName:"storeESAuthSession",methodArgs:[n,t,s.toString(),o,a,r,l,d]}).then(function(){i.resolve()},function(){i.reject()})},this)),i}}),e.StoringESAuthSessionOp}),define("pdmplugins/esign/js/ops/upload-document-to-echosign-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.UploadDocumentToEchoSignOp=i.Op.extend({UPLOAD_STATES:{STARTED:0,FINISHED:1,QUEUED:2},run:function(){var e,i=this.options,t=$.Deferred();if(_.isEmpty(i.esAccessToken)||_.isEmpty(i.esUploadEndpoint))return this._getRejectedPromise();var s="false";if("true"==i.UploadFssSign)s=i.UploadFssSign;else if(_.isEmpty(i.docToUpload)||_.isEmpty(i.mimeType))return this._getRejectedPromise();var n="";return i.apiVersion&&(n=i.apiVersion),e={file:i.docToUpload._proxy,accessToken:i.esAccessToken,uploadEndpoint:i.esUploadEndpoint,mimeType:i.mimeType,fssSignUpload:s,ApiVersion:n},this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.invokeMethod({methodName:"uploadDocument",methodArgs:e}).then(function(e){t.resolve(e)},function(e){t.reject(e)})},this)),t}}),e.UploadDocumentToEchoSignOp}),define("pdmplugins/esign/js/ops/listening-for-es-doc-upload-progress-events-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){var t=e.UploadDocumentToEchoSignOp.prototype.UPLOAD_STATES;return e.ListeningForESDocUploadProgressEventsOp=i.Op.extend({run:function(){var e=this.options,i=e.esDocUploadProgressUiModel,s=i.get("upload_response"),n=i.get("progress_obj");return n?(n._addEventListener("custom:uploadProgress",function(e,n){n.params?(s.status=t.RUNNING,i.set("bytes_uploaded",n.params.bytesWritten),i.set("bytes_total",n.params.bytesTotal),i.set("progress_status","ongoing")):(s.errorSet=!0,s.status=t.FINISHED,i.set("progress_status","finished"))}),n._addEventListener("custom:uploadFinished",function(e,n){n.params?_.isUndefined(n.params.errorCode)||0===n.params.errorCode?(s.respStatusCode=n.params.httpRespCode,_.isEmpty(n.params.respBody)||201!==s.respStatusCode||(s.respBody=JSON.parse(n.params.respBody),void 0!=n.params.clusterTokenFetched&&(s.clusterTokenFetched=JSON.parse(n.params.clusterTokenFetched)))):(s.errorSet=!0,s.errorCode=n.params.errorCode,s.respBody=n.params.respBody,s.respStatusCode=n.params.httpRespCode):s.errorSet=!0,s.status=t.FINISHED,i.set("progress_status","finished")}),this._getResolvedPromise()):(s.errorSet=!0,s.status=t.FINISHED,void i.set("progress_status","finished"))}}),e.ListeningForESDocUploadProgressEventsOp}),define("pdmplugins/esign/js/ops/fetch-es-user-subscription-info-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.FetchESUserSubscriptionInfoOp=i.Op.extend({run:function(){var e=(this.options,$.Deferred());return this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this.fetchESUserSubscriptionInfo(e)},this),_.bind(function(i){i&&"NoAccessToPdfServices"===i.errorString?this.fetchESUserSubscriptionInfo(e):e.reject(!1)},this)),e},fetchESUserSubscriptionInfo:function(i){var t,s,n,o=this.options,a=e.opFactory,r=o.esLimitsModel,l=["pro","global","enterprise","team"];s=a.create("GettingESLimitsOp",o),s.run().then(function(){n=r.get("esign_access").toLowerCase(),t=$.inArray(n,l)>-1,i.resolve(t)},function(){i.reject()})}}),e.FetchESUserSubscriptionInfoOp}),define("pdmplugins/esign/js/ops/refreshing-es-auth-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.RefreshingESAuthSessionOp=i.Op.extend({run:function(){var e=this.options,i=$.Deferred(),t={};return 0!==e.esAuthUiModel.get("signin_profile_id").length&&0!==e.esAuthUiModel.get("signin_profile_name").length&&0!==e.esAuthUiModel.get("loggedin_profile_name").length?(t.access_token=e.esAuthUiModel.get("access_token"),t.expires_in=e.esAuthUiModel.get("expiration_time")/1e3):(t.access_token=e.appApi.options.sessionUiModel.get("primary_token"),t.expires_in=e.appApi.options.sessionUiModel.get("expiration_time")),t.token_type="Bearer",i.resolve(t),i}}),e.RefreshingESAuthSessionOp}),define("pdmplugins/esign/js/ops/getting-es-limits-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.GettingESLimitsOp=i.Op.extend({run:function(){return this.options.esLimitsModel.fetch({modal:!1,global:!1})}}),e.GettingESLimitsOp}),define("pdmplugins/esign/js/api/es-auth-api",["core/ac-core","pdmplugins/esign/js/ac-esign","core/apis/api"],function(e,i){return i.EchoSignAuthApi=e.Api.extend({initialize:function(){e.Api.prototype.initialize.call(this),this._authSessionClients=[],this._initStateMachine(),this._initializeOperationMap()},createAuthSession:function(e){var i=_.extend({},e),t=$.Deferred(),s={promise:t};return this._authSessionClients.push(s),this._fsm.handleEvent("CreateESAuthSession",i),t},clearESAuthSession:function(){this._fsm.handleEvent("ClearESAuthSession",_.extend({},this.options))},evaluateAuthStatus:function(e){var i=_.extend({},e),t=$.Deferred(),s={promise:t};return this._authSessionClients.push(s),this._fsm.handleEvent("CheckESAuthStatus",i),t},isLoggedIn:function(){var e=this.options.esAuthUiModel,i=e.get("access_token"),t=e.get("expiration_time");return this._isESAccessTokenValid(i,t)},handleSessionSignOut:function(){this._fsm.handleEvent("IMSUserLoggedOut",_.extend({},this.options))},handleSessionSignedIn:function(){this._fsm.handleEvent("IMSUserLoggedIn",_.extend({},this.options))},handleNetworkDisconnectedEvent:function(){this._fsm.handleEvent("NetworkDisconnectedEvent",_.extend({},this.options))},_initStateMachine:function(){var e=_.extend({controller:this},this.options);this._fsm=i.fsmFactory.create("EchoSignAuthFSM",e)},_initializeOperationMap:function(){this._opMap=this._opMap||{},this._opMap.FetchESAuthSessionOp=this._fetchESAuthSession,this._opMap.CreateNewESAuthSessionOp=this._createNewESAuthSession,this._opMap.ConvertExpiryTimeToAbsoluteTimeOp=this._convertExpiryTimeToAbsoluteTime,this._opMap.CheckESAuthSessionNeedsRefreshOp=this._checkESAuthSessionNeedsRefresh,this._opMap.RefreshESAuthSessionOp=this._refreshESAuthSession,this._opMap.StoreESAuthSessionOp=this._storeESAuthSession,this._opMap.MarkESAuthSessionInProgressOp=this._markESAuthSessionInProgress,this._opMap.MarkESUserAuthenticatedOp=this._markESUserAuthenticated,this._opMap.MarkESUserNotAuthenticatedOp=this._markESUserNotAuthenticated,this._opMap.NotifyESAuthSuccessToClientsOp=this._notifyESAuthSuccessToClients,this._opMap.NotifyESAuthFailureToClientsOp=this._notifyESAuthFailureToClients,this._opMap.ClearESAuthSessionOp=this._clearESAuthSession},_invokeOperation:function(e){var i=e.opName;if(this._opMap){var t=this._opMap[i];t.call(this,e)}},_fetchESAuthSession:function(e){i.opFactory.create("FetchExistingESAuthSessionOp",this.options).run().then(_.bind(function(i){this.options.appApi.rnaApi.done(_.bind(function(t){this.options.appApi.rnaApi.accessToken=i.accessToken,e.es_access_token=i.accessToken,e.es_refresh_token=i.refreshToken,e.es_token_expiry_time=i.expiryTime,e.es_api_access_point=i.signApiUrl,e.es_web_access_point=i.signWebUrl,e.es_t2e_signIn_profile_id=i.signProfileID,e.es_t2e_signIn_profile_name=i.signProfileName,e.es_t2e_loggedin_profile_name=i.loggedinProfileName,t.esApi.setEchoSignApiURL(i.signApiUrl),t.esApi.setEchoSignWebURL(i.signWebUrl),_.isEmpty(e.es_access_token)||_.isEmpty(e.es_api_access_point)?this._fsm.handleEvent("ESAuthSessionDoesNotExists",e):this._fsm.handleEvent("ESAuthSessionExists",e)},this))},this),_.bind(function(){this._fsm.handleEvent("ESAuthSessionDoesNotExists",e)},this))},_createNewESAuthSession:function(e){i.opFactory.create("CreatingNewESAuthSessionOp",this.options).run().then(_.bind(function(i){"undefined"!=typeof i.sign_profile_id&&0!==i.sign_profile_id.length&&"undefined"!=typeof i.sign_profile_name&&0!==i.sign_profile_name.length&&"undefined"!=typeof i.loggedin_profile_name&&0!==i.loggedin_profile_name.length?(e.es_access_token=i.access_token,e.es_refresh_token="",e.es_token_expiry_time=i.expires_in,e.es_t2e_signIn_profile_id=i.sign_profile_id,e.es_t2e_signIn_profile_name=i.sign_profile_name,e.es_t2e_loggedin_profile_name=i.loggedin_profile_name):(e.es_access_token=e.appApi.options.sessionUiModel.get("primary_token"),e.es_refresh_token="",e.es_token_expiry_time=e.appApi.options.sessionUiModel.get("expiration_time"),e.es_t2e_signIn_profile_id="",e.es_t2e_signIn_profile_name="",e.es_t2e_loggedin_profile_name=""),e.es_token_type="Bearer";var t=i.apiAccessPoint,s=i.webAccessPoint;"/"==t.charAt(t.length-1)&&(t=t.slice(0,-1)),"/"==s.charAt(s.length-1)&&(s=s.slice(0,-1)),e.es_api_access_point=t,e.es_web_access_point=s,this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setEchoSignApiURL(t),e.esApi.setEchoSignWebURL(s)},this)),e.es_error_code=i.error_code,e.es_error_msg=i.error_msg,this._fsm.handleEvent("ESAuthSessionCreateSuccess",e)},this),_.bind(function(){this._fsm.handleEvent("ESAuthSessionCreateFailure",e)},this))},_convertExpiryTimeToAbsoluteTime:function(e){var i=e.es_token_expiry_time,t=new Date;t.setTime(t.getTime()+1e3*i),e.es_token_expiry_time=t.getTime()},_checkESAuthSessionNeedsRefresh:function(e){var i=e.es_token_expiry_time;this._shouldRefreshESAccessToken(i)?this._fsm.handleEvent("ESAuthSessionNeedsRefresh",e):this._fsm.handleEvent("ESAuthSessionNeedsNoRefresh",e)},_refreshESAuthSession:function(e){var t=_.extend({},this.options,{es_refresh_token:e.es_refresh_token});i.opFactory.create("RefreshingESAuthSessionOp",t).run().then(_.bind(function(i){e.es_access_token=i.access_token,e.es_token_expiry_time=i.expires_in,e.es_token_type=i.token_type,this._fsm.handleEvent("ESAuthSessionRefreshSuccess",e)},this),_.bind(function(){this._fsm.handleEvent("ESAuthSessionRefreshFailure",e)},this))},_storeESAuthSession:function(){i.opFactory.create("StoringESAuthSessionOp",this.options).run()},_markESAuthSessionInProgress:function(){var e=this.options.esAuthUiModel;e.clearLastAuthState(),e.set("auth_status","in_progress")},_markESUserAuthenticated:function(e){var i=this.options.esAuthUiModel;i.clearLastAuthState(),i.set("access_token",e.es_access_token),i.set("expiration_time",e.es_token_expiry_time),i.set("refresh_token",e.es_refresh_token),i.set("signin_profile_id",e.es_t2e_signIn_profile_id),i.set("signin_profile_name",e.es_t2e_signIn_profile_name),i.set("loggedin_profile_name",e.es_t2e_loggedin_profile_name),i.set("api_access_point",e.es_api_access_point),i.set("web_access_point",e.es_web_access_point),i.set("auth_status","success")},_markESUserNotAuthenticated:function(){var e=this.options.esAuthUiModel;e.clearLastAuthState(),e.set("access_token",""),e.set("signin_profile_id",""),e.set("signin_profile_name",""),e.set("loggedin_profile_name",""),e.set("expiration_time",Number.NaN),e.set("auth_status","failure")},_notifyESAuthSuccessToClients:function(){_.each(this._authSessionClients,function(e){e.promise.resolve()})},_notifyESAuthFailureToClients:function(){_.each(this._authSessionClients,function(e){e.promise.reject()})},_clearESAuthSession:function(){this.options.esAuthUiModel.resetToDefaults(),this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"clearESAuthSession"})},this))},_isESAccessTokenValid:function(e,i){return _.isEmpty(e)?!1:this._getTimeDiffInESAccessTokenAndCurrentTime(i)>0},_shouldRefreshESAccessToken:function(e){var i=this._getTimeDiffInESAccessTokenAndCurrentTime(e);if(i>0){var t=this.options.esAuthUiModel,s=t.get("expiration_check_time");i-=s}return 0>=i},_getTimeDiffInESAccessTokenAndCurrentTime:function(e){var i=0,t=new Date;return 0>=e?i:i=e-t.getTime()}}),i.EchoSignAuthApi}),define("pdmplugins/esign/js/api/es-api",["core/ac-core","pdmplugins/esign/js/ac-esign","core/apis/api","pdmplugins/esign/js/api/es-auth-api"],function(e,i){return i.EchoSignApi=e.Api.extend({initialize:function(){var t=this.options;e.Api.prototype.initialize.call(this),this.authApi=new i.EchoSignAuthApi(t)}}),i.EchoSignApi}),define("pdmplugins/esign/js/ops/initializing-op",["pdmplugins/esign/js/ac-esign","core/ac-core","pdmplugins/esign/js/api/es-api","core/ops/op"],function(e,i){return e.InitializingOp=i.Op.extend({run:function(){var i=this.options,t=e.modelFactory,s=e.uiModelFactory;_.extend(i,{esLimitsModel:t.create("EchoSignLimitsModel"),esAuthUiModel:s.create("EchoSignAuthUiModel"),esOfflineUiModel:s.create("EchoSignOfflineUiModel")}),e.esApi=new e.EchoSignApi(i)}}),e.InitializingOp}),define("pdmplugins/esign/js/ops/logout-es-web-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.LogOutESWebSessionOp=i.Op.extend({run:function(){var e,i,t,s=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(n){return e=n.esApi.getEchoSignServiceParams(),i=e.webURL,console.log(i),_.isEmpty(i)?void s.reject():(t=i+"/public/logout",$("body").append("<div><iframe class='es-logout-frame' src='"+t+"'></iframe></div>"),void $(".es-logout-frame").load(_.bind(function(){n.esApi.invokeMethod({methodName:"unloadESLogoutWebFrame"})},this)))},this)),s}}),e.LogOutESWebSessionOp}),define("pdmplugins/esign/js/ops/cancel-upload-to-echosign-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.CancelUploadToEchoSignOp=i.Op.extend({run:function(){var e=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.invokeMethod({methodName:"cancelAllUploadWorkflows"}).then(function(){e.resolve()},function(){e.reject()})},this)),e}}),e.CancelUploadToEchoSignOp}),define("pdmplugins/esign/js/ops/op-factory",["core/ac-core","pdmplugins/esign/js/ac-esign","pdmplugins/esign/js/ops/fetch-existing-es-auth-session-op","pdmplugins/esign/js/ops/creating-new-es-auth-session-op","pdmplugins/esign/js/ops/storing-es-auth-session-op","pdmplugins/esign/js/ops/upload-document-to-echosign-op","pdmplugins/esign/js/ops/listening-for-es-doc-upload-progress-events-op","pdmplugins/esign/js/ops/fetch-es-user-subscription-info-op","pdmplugins/esign/js/ops/refreshing-es-auth-session-op","pdmplugins/esign/js/ops/getting-es-limits-op","pdmplugins/esign/js/ops/initializing-op","pdmplugins/esign/js/ops/logout-es-web-session-op","pdmplugins/esign/js/ops/cancel-upload-to-echosign-op"],function(e,i){return i.OpFactory=e.Op.extend({create:function(e,t){var s=i[e];return s?new s(t):void LOG(0,"AcEchoSign.OpFactory.create: Unrecognized class: "+e)}}),i.OpFactory}),define("pdmplugins/esign/js/fsm/fsm",["core/ac-core"],function(e){return e.FSM=Backbone.View.extend({SPECIAL_FSM_STATE:"*",initialize:function(){Backbone.View.prototype.initialize.call(this),this.cid=_.uniqueId("op"),delete this.options.viewId,delete this.$el,delete this.el,_.bindAll(this),this._stateEventTransitionTable=[],this._supportedStates=[],this._currentState=void 0,this._previousState=void 0,this._initFSM()},handleEvent:function(e,i){var t=this._getCurrentState(),s=!1;if(this._isSupportedState(t)){var n=this._getEventHandlerForState(t,e);return n?(n=_.bind(n,this),s=n(i)):s}},_initFSM:function(){},_getController:function(){return this.options.controller},_getSupportedStates:function(){return this._supportedStates},_setSupportedStates:function(e){this._supportedStates=e},_isSupportedState:function(e){var i=this._getSupportedStates(),t=_.contains(i,e);return t},_setPreviousState:function(e){this._previousState=e},_getPreviousState:function(){return this._previousState},_getCurrentState:function(){return this._currentState},_setCurrentState:function(e){this._isSupportedState(e)&&(this._setPreviousState(this._currentState),this._currentState=e)},_defineTransition:function(e,i,t){var s={state:e,eventName:i,eventHandler:t};this._stateEventTransitionTable.push(s)},_getEventHandlerForState:function(e,i){var t=_.find(this._stateEventTransitionTable,_.bind(function(t){return t.state===e&&t.eventName===i},this));return _.isEmpty(t)&&(t=_.find(this._stateEventTransitionTable,_.bind(function(e){return e.state===this.SPECIAL_FSM_STATE&&e.eventName===i},this))),t?t.eventHandler:void 0},_invokeController:function(e,i){i=i||{};var t=this._getController();if(t){var s=_.extend(i,{opName:e});t._invokeOperation(s)}}}),e.FSM}),define("pdmplugins/esign/js/fsm/es-auth-fsm",["core/ac-core","pdmplugins/esign/js/fsm/fsm","pdmplugins/esign/js/ac-esign"],function(e,i,t){var s={IDLE:0,FETCHING_EXISTING_ES_AUTH_SESSION_STATUS:1,WAITING_FOR_NEW_ES_AUTH_SESSION_TO_CREATE:2,CHECKING_ES_AUTH_SESSION_NEED_TO_REFRESH:3,WAITING_FOR_ES_AUTH_SESSION_TO_REFRESH:4};return t.EchoSignAuthFSM=i.extend({_initFSM:function(){this._setSupportedStates(_.values(s)),this._setCurrentState(s.IDLE),this._defineEventTransitions()},_defineEventTransitions:function(){this._defineTransition(s.IDLE,"CreateESAuthSession",function(e){e.creatingESAuthSession=!0,this._setCurrentState(s.FETCHING_EXISTING_ES_AUTH_SESSION_STATUS),this._invokeController("FetchESAuthSessionOp",e)}),this._defineTransition(s.IDLE,"CheckESAuthStatus",function(e){e.checkingESAuthSession=!0,this._setCurrentState(s.FETCHING_EXISTING_ES_AUTH_SESSION_STATUS),this._invokeController("FetchESAuthSessionOp",e)}),this._defineTransition(s.FETCHING_EXISTING_ES_AUTH_SESSION_STATUS,"ESAuthSessionExists",function(e){this._setCurrentState(s.CHECKING_ES_AUTH_SESSION_NEED_TO_REFRESH),this._invokeController("CheckESAuthSessionNeedsRefreshOp",e)}),this._defineTransition(s.FETCHING_EXISTING_ES_AUTH_SESSION_STATUS,"ESAuthSessionDoesNotExists",function(e){e.creatingESAuthSession?(this._setCurrentState(s.WAITING_FOR_NEW_ES_AUTH_SESSION_TO_CREATE),this._invokeController("MarkESAuthSessionInProgressOp",e),this._invokeController("CreateNewESAuthSessionOp",e)):e.checkingESAuthSession&&(this._setCurrentState(s.IDLE),this._invokeController("MarkESUserNotAuthenticatedOp",e),this._invokeController("NotifyESAuthFailureToClientsOp",e))}),this._defineTransition(s.CHECKING_ES_AUTH_SESSION_NEED_TO_REFRESH,"ESAuthSessionNeedsRefresh",function(e){e.creatingESAuthSession?(this._setCurrentState(s.WAITING_FOR_ES_AUTH_SESSION_TO_REFRESH),this._invokeController("RefreshESAuthSessionOp",e)):e.checkingESAuthSession&&(this._setCurrentState(s.IDLE),this._invokeController("MarkESUserNotAuthenticatedOp",e),this._invokeController("NotifyESAuthFailureToClientsOp",e))}),this._defineTransition(s.CHECKING_ES_AUTH_SESSION_NEED_TO_REFRESH,"ESAuthSessionNeedsNoRefresh",function(e){this._setCurrentState(s.IDLE),this._invokeController("MarkESUserAuthenticatedOp",e),this._invokeController("NotifyESAuthSuccessToClientsOp",e)}),this._defineTransition(s.WAITING_FOR_NEW_ES_AUTH_SESSION_TO_CREATE,"ESAuthSessionCreateSuccess",function(e){this._setCurrentState(s.IDLE),this._invokeController("ConvertExpiryTimeToAbsoluteTimeOp",e),this._invokeController("MarkESUserAuthenticatedOp",e),this._invokeController("StoreESAuthSessionOp",e),this._invokeController("NotifyESAuthSuccessToClientsOp",e)}),this._defineTransition(s.WAITING_FOR_NEW_ES_AUTH_SESSION_TO_CREATE,"ESAuthSessionCreateFailure",function(e){this._setCurrentState(s.IDLE),this._invokeController("MarkESUserNotAuthenticatedOp",e),this._invokeController("NotifyESAuthFailureToClientsOp",e),this._invokeController("ClearESAuthSessionOp",e)}),this._defineTransition(s.WAITING_FOR_ES_AUTH_SESSION_TO_REFRESH,"ESAuthSessionRefreshSuccess",function(e){this._setCurrentState(s.IDLE),this._invokeController("ConvertExpiryTimeToAbsoluteTimeOp",e),this._invokeController("MarkESUserAuthenticatedOp",e),this._invokeController("StoreESAuthSessionOp",e),this._invokeController("NotifyESAuthSuccessToClientsOp",e)}),this._defineTransition(s.WAITING_FOR_ES_AUTH_SESSION_TO_REFRESH,"ESAuthSessionRefreshFailure",function(e){this._setCurrentState(s.IDLE),this._invokeController("MarkESUserNotAuthenticatedOp",e),this._invokeController("NotifyESAuthFailureToClientsOp",e),this._invokeController("ClearESAuthSessionOp",e)}),this._defineTransition(s.IDLE,"ClearESAuthSession",function(e){this._setCurrentState(s.IDLE),this._invokeController("ClearESAuthSessionOp",e)}),this._defineTransition(this.SPECIAL_FSM_STATE,"SessionSignOut",function(){this._setCurrentState(s.IDLE)}),this._defineTransition(this.SPECIAL_FSM_STATE,"NetworkDisconnectedEvent",function(){this._setCurrentState(s.IDLE)})}}),t.EchoSignAuthFSM}),define("pdmplugins/esign/js/fsm/fsm-factory",["core/ac-core","pdmplugins/esign/js/ac-esign","pdmplugins/esign/js/fsm/fsm","pdmplugins/esign/js/fsm/es-auth-fsm"],function(e,i,t){return i.FSMFactory=t.extend({create:function(e,t){var s=i[e];return s?new s(t):void LOG(0,"AcEchoSign.OpFactory.create: Unrecognized class: "+e)}}),i.FSMFactory}),define("pdmplugins/esign/js/ac-esign-init",["pdmplugins/esign/js/ac-esign","pdmplugins/esign/js/models/model-factory","pdmplugins/esign/js/models/ui/ui-model-factory","pdmplugins/esign/js/ops/op-factory","pdmplugins/esign/js/fsm/fsm-factory"],function(e){return _.extend(e,{modelFactory:new e.ModelFactory,uiModelFactory:new e.UiModelFactory,opFactory:new e.OpFactory,fsmFactory:new e.FSMFactory}),e}),define("pdmplugins/send-for-sign/js/templates/send-for-sign-content",[],function(){return'<div class="send-for-sign-container"><div class="sfs-trial-bar-container" class="ui-theme theme-container"></div><div class="sfs-landing-page-container"></div><div class="sfs-app-progress-container"></div><div class="sfs-send-for-sign-page-container"></div><div class="sfs-offline-view-container"></div></div>'}),define("pdmplugins/send-for-sign/js/nls/ui-strings",{root:!0,"xx-xx":!0,"ar-ae":!0,"ca-es":!0,"cs-cz":!0,"da-dk":!0,"de-de":!0,"en-ae":!0,"en-gb":!0,"en-il":!0,"es-es":!0,"eu-es":!0,"fi-fi":!0,"fr-fr":!0,"fr-ma":!0,"he-il":!0,"hr-hr":!0,"hu-hu":!0,"it-it":!0,"ja-jp":!0,"ko-kr":!0,"nb-no":!0,"nl-nl":!0,"pl-pl":!0,"pt-br":!0,"ro-ro":!0,"ru-ru":!0,"sk-sk":!0,"sl-si":!0,"sl-sl":!0,"sv-se":!0,"tr-tr":!0,"uk-ua":!0,"zh-cn":!0,"zh-tw":!0,"bg-bg":!0}),define("pdmplugins/send-for-sign/js/nls/root/ui-strings",{SEND_FOR_SIGN:"Send For Sign",LP_TITLE:"Send for Signature Using Adobe Acrobat Sign",LP_SUBTITLE:"Send documents for signature in a few simple steps.",LP_SELECT_FILE_BTN_LABEL:"Select Files",LP_TITLE_NEW:"Send For Signature Using Adobe Acrobat Sign",LP_SUBTITLE_NEW:"Get documents signed instantly. Recipients will receive a unique link to view and sign online, with no purchase or sign-up required.",LP_SUBTITLE2_NEW:"Track when the document is viewed and signed. ",LP_SUBTITLE3_NEW:"Learn more.",LP_SUBTITLE4_NEW:"Learn more",LP_TO:"To",LP_ADD_CC:"Add CC",LP_MESSAGE:"Message",LP_FILES:"File(s)",LP_ACTION_BTN1_LABEL_NEW:"Continue",LP_INVALID_EMAIL_ERROR:" is an invalid email address.",LP_NO_EMAIL_ERROR:"Please add at least one recipient.",LP_TO_EMAIL_PLACEHOLDER:"Enter recipient email",LP_CC_EMAIL_PLACEHOLDER:"Enter CC’s emails",LP_ONLY_SENDER_EMAIL_ERROR:"You cannot send a document only to yourself to sign.",LP_NEXT_GUIDE_TEXT:"Click Next to specify where recipients need to fill and sign.",LP_SUBJECT_PLACEHOLDER:"Agreement Name",LP_MESSAGE_TEXT:"Please review and complete this document.",LP_MESSAGE_TEXT2:"Please review and sign this document.",LP_CC_LIMITS_ERROR:"Agreements can have at most 11 CCs.",LP_RECIPIENTS_LIMITS_ERROR:"Maximum number of recipients entered.",LP_AGREEMENT_CHARLIMITS_ERROR:"The Agreement Name must be 255 characters or less.",LP_SIGNER:"Signer",LP_APPROVER:"Approver",LP_SENDER_IN_CC_ERROR:"You cannot CC the same email address that you are sending from.",LP_HELP_ICON_TEXT:"Add recipients in the order you wish the document to be signed.",LP_OUTVITES_ERROR:"Please accept the Adobe Acrobat Sign invitation that we just emailed you to be able to start using Adobe Acrobat Sign subscription given by your administrator.",LP_CC:"CC",LP_HIDE:"Hide",LP_LEARN_MORE_GOURL:"http://www.adobe.com/go/DCSFS",LP_DISCLAIMER1:"Your document will be uploaded to Adobe Acrobat Sign.",LP_DISCLAIMER2:"Anyone with access to the link can view the document.",LP_GUIDE_ADD_SIGNERS_TITLE:"Add  signers",LP_GUIDE_ADD_SIGNERS_TEXT:"Recipients receive a link to sign online, with no purchase or sign-up required.",LP_GUIDE_LEARN_MORE:"Learn More",LP_GUIDE_SIGNING_ORDER:"Recipients will sign the documents sequentially in this order",LP_DOCUMENT_LIBRARY_:"Document Library",LP_DOCUMENT_LIBRARY_TITLE:"Add File from Document Library",LP_NAME:"Name",LP_LAST_MODIFIED:"Last Modified",LP_ATTACH:"Attach",LP_SHARED_DOCUMENTS:"Shared Documents",LP_ADOBE_SIGN_DOCUMENTS:"Adobe Acrobat Sign Documents",LP_RDR_ACTION_BTN1_LABEL:"Start",LP_RDR_APP_INFO_TXT_1:"Click Start to complete steps to send for signature:",LP_RDR_APP_INFO_TXT_2:"Step 1: Add recipients",LP_RDR_APP_INFO_TXT_3:"Step 2: Add fields and send",LP_ACR_ACTION_BTN1_LABEL:"Prepare Form",LP_ACR_ACTION_BTN2_LABEL:"Ready to Send",LP_ACR_ACTION_BTN_SEPARATOR:"or",LP_ACR_ACTION_BTN1_INFO:"Add fields before sending",LP_ACR_ACTION_BTN2_INFO:"Upload and add recipients",SFS_SUBSCRIBE_SIGN_IN:"Sign In",SFS_SUBSCRIBE_UPGRADE_NOW:"Upgrade now",SFS_SUBSCRIBE_START_NOW:"Start Now",SFS_SUBSCRIBE_TITLE:"Get documents e-signed fast",SFS_SUBSCRIBE_MSG_CONTENT_1:"Upgrade your plan to collect e-signatures from others online.",SFS_SUBSCRIBE_MSG_CONTENT_2:"Track results in real time.",SFS_SUBSCRIBE_MSG_CONTENT_3:"Create a professional customer experience",SFS_SUBSCRIBE_MSG_CONTENT_4:"Manage user preferences and settings",SFS_SUBSCRIBE_UPGRADE_NOT_SUBCRIBED:"Not Subscribed?",SFS_SUBSCRIBE_UPGRADE:"Upgrade",SFS_SUBSCRIBE_UPGRADE_ALREADY_SUBSCRIBED_EXPERIMENT:"Already Subscribed?",SFS_SUBSCRIBE_LEARN_MORE_EXPERIMENT:"Learn More",SFS_OFFLINE_ACCEPT_LABEL:"Close",GENERIC_ARIA_LABEL_STRING:"<%= prefix %>. <%= suffix %>",SFS_ADD_FILES:"Add Files",SELECTED_FILES:"Selected Files",FILE_SELECT_TITLE:"Select Files",FILE_SELECT_ACTION_BTN:"Continue",FILE_SELECT_FILTER_DESCR:"Adobe PDF files",SFS_PROGRESS_CANCEL_LABEL:"Cancel",DOC_PROGRESS_LABEL:"Uploading...",SFS_ERR_GENERIC_TITLE:"Could not Send",SFS_ERR_TITLE_FAILED_TO_SEND:'"<%= name %>" failed to send.',SFS_ERR_CLOSE_BTN:"Close",SFS_ERR_TIMEOUT_TITLE:"Timed out ",SFS_ERR_CONTENT_TIMEOUT_TITLE:"There has been no activity in the Adobe Acrobat Sign tool for a while.",SFS_ERR_CONTENT_TIMEOUT_BODY:"Any recent changes have been lost.",SFS_ACRO_UPDGRADE_GO_URL:"http://www.adobe.com/go/collectsigacro_12_0_0",SFS_RDR_UPGRADE_GO_URL:"http://www.adobe.com/go/collectsigrdr_12_0_0",SFS_RDR_UPGRADE_GO_URL_RDREXP:"http://www.adobe.com/go/rdr_sfs_tc_lm_dc112017",SFS_ERR_CONTENT_TITLE_UNSUPPORTED:'Unsupported file: "<%= name %>"',SFS_ERR_CONTENT_TITLE_UNSUPPORTED_N:'Unsupported files: "<%= name %>"',SFS_ERR_CONTENT_BODY_UNSUPPORTED:"Select another file and try again",SFS_ERR_GENERAL_WORKFLOW_FAILURE:"An error has occurred. Please try again.",SFS_ERR_LARGE_FILE_SIZE:"Your document exceeds the maximum size of file supported for your subscription level. Please try a different document or contact your account administrator.",SFS_ERR_ENTERPRISE_SERVICE_ACCS_DENIED:"You do not have access to this service. Please contact your IT Administrator to gain access, or try to sign in with an Adobe ID",SFS_ERR_PREPARE_FORM_MUL_FILES_SEL:"You have selected more than one file. To send multiple files for signature they must be combined into a single file.",SFS_ERR_ES_AUTO_LOGIN_DENIED:"Cannot login to the service to complete the Adobe Acrobat Sign process. Please contact support.",SFS_FILE_NOT_SENT:"File not sent",SFS_MULTIPLE_WORKFLOWS_DENIED:"Another file is being sent in a different window. Finish sending the other file then try again.",SFS_ERR_OK_BUTTON:"OK",SFS_ERR_ESAUTH_SESSION_CREATE:"Failed to create authentication session.",SFS_ERR_OPEN_SEND_PAGE:"Failed to open page.",SFS_ERR_FETCH_MANAGE_AGREEMENT_URL:"Failed to get agreement.",SFS_ERR_INAPP_SIGN_ESAUTH_SESSION_CREATE:"Failed to create authentication session for signing url.",SFS_ERR_INAPP_SIGN_FETCH_SIGNING_URL:"Failed to get signing url.",NO:"NO",YES:"YES",SFS_COMBINE_MESSAGE_TITLE:"Files will be combined",SFS_COMBINE_MESSAGE_TEXT:"You have selected more than one file. All files will be combined into one PDF for preparing form. Do you want to continue and combine all files?",SFS_FILES_NOT_COMBINED_ERROR_TITLE:"Error",SFS_FILES_NOT_COMBINED_ERROR:"An error was encountered while combining files. Please check the selected files and try again",SEND_REMOVE:"Remove",FSS_TITLE_CREATE_LINK:"Create link with Adobe Acrobat Sign",FSS_BODY_CREATE_LINK:"Get a link to a non-editable copy of your file and share it with others. Anyone with access to the link can view the file. Your file will be uploaded to Adobe Acrobat Sign.",FSS_BODY_LINK_CREATED:"Copy this link to share it with others. Anyone with access to the link can view the file, but they won’t be able to make changes to it.",FSS_COPY_BTN:"Copy Link",ADD_LINK_TO_EMAIL_BUTTON:"Attach link to Email",ADD_LINK_TO_EMAIL_MSG1:"You need to configure your default email client first from Preference > Email accounts.",ADD_LINK_TO_EMAIL_MSG2:'You can view "<%=FileName%>" at: ',FSS_CTA_BTN:"Create Link",FSS_TRY_AGAIN:"Try Again",FSS_LINK_COPIED:"Link copied",FSS_TITLE_LINK_CREATED:"Link created",FSS_LINK_CREATION_FAILED_BODY:"We weren’t able to create your link. Please try again later.",FSS_ERR_SIGN_IN_TITLE:"Sign in",FSS_ERR_SIGN_IN:"To send a copy of your file, you must be signed in.",FSS_ERR_TITLE:"Something went wrong",FSS_ESS_TITLE2:"Operation failed",FSS_SIGN_IN_BTN:"Sign In",FSS_GENERATING_LINK:"Creating link...",FSS_ERR_OFFLINE_TITLE:"No internet connection",FSS_ERR_OFFLINE_MSG:"To continue, please connect to the internet and try again.",FSS_ERR_LARGE_FILE_MSG:"Document upload failed. File size is too large.",FSS_ERR_FILE_SIZE_TOO_LARGE_MSG:"File size too large",FSS_ERR_AUTH_FAILED_MSG:"Authentication failed.",FSS_ERR_MIISSING_TRANSIENTIDS_MSG:"Transient id is missing for a document.",FSS_ERR_AGREEMENT_WAIT_EXCEEDED_MSG:"Failed to create agreement. Wait limit exceeded.",SFS_INAPP_SIGN_ERR_GENERIC_TITLE:"Could not open the agreement",SFS_INAPP_SIGN_ERR_GENERAL_WORKFLOW_FAILURE:"An error has occurred. Please try again.",SFS_INAPP_SIGN_ERR_CLOSE_BTN:"Close",SFS_INAPP_SIGN_ERR_RELOAD_BTN:"Reload",SFS_SIGNED_DOC_TITLE:"You have successfully completed the agreement ",SFS_SIGNED_DOC_SUBTITLE:"Copies will be e-mailed to all parties.",SFS_VIEW_DOCUMENT_BUTTON:"View agreement",SFS_MANAGE_DOC:"Manage this document",SFS_OPTION_SEND_FOR_SIGNATURE:"Send documents for signature",SFS_APPROVED_DOC_TITLE:"You have successfully approved ",LP_ADVANCED_SIGN:"Advanced",ADVANCED_BUTTON_TOOLTIP:"Send with advanced options including signer authentication, reminders and more.",USER_INTENT_TITLE:"Who need to Fill and Sign?",USER_INTENT_MYSELF:"MYSELF",USER_INTENT_MYSELF2:"Me",USER_INTENT_OTHERS:"Others",USER_INTENT_FSS_DESCRIPTION:"Easily fill out and add your signature to any document",USER_INTENT_SFS_DESCRIPTION:"Get Docuements signed instantly, in 3 simple steps. Recipients view and sign online",USER_INTENT_FSS_BTN:"Fill & Sign",USER_INTENT_SFS_BTN:"Get Others to Sign",SHARE_DIALOG_HEADING:"How do you want to send your file?",SHARE_GET_A_LINK:"Get a Link",SHARE_SEND_A_COPY:"Send a Copy",SHARE_GET_OTHERS_TO_SIGN:"Get Signatures",SHARE_GET_OTHERS_TO_SIGN2:"Request E-signatures",SHARE_ATTACH_TO_EMAIL:"Attach to Email",GET_A_LINK_HEADING:"Get a link to a read-only copy",GET_A_LINK_HEADING2:"Get a link to a copy",GET_A_LINK_ADVISORY:"Your file will be uploaded as an agreement for e-signing. Anyone with the link can view the file.",GET_A_LINK_ADVISORY2:"Your file will be uploaded for e-signing. Anyone you share the link with can view the file.",GET_A_LINK_DESCRIPTION:"Create a link to a read-only copy of your completed file to share with others. Recipients can view the file but can’t modify it.",GET_A_LINK_DESCRIPTION2:"Anyone with the link can view the file but can’t modify it.",GET_A_LINK_PROGRESS_TEXT:"Creating Link...",GET_A_LINK_ERR1:"Error creating link. Please try again.",SHARE_CREATE_LINK_BUTTON:"Create Link",SHARE_COPY_LINK_BUTTON:"Copy Link",LEARN_MORE:"Learn More",SHARE_SFS_HEADING:"Get Signatures with Adobe Acrobat Sign",SHARE_SFS_DESCRIPTION:"Quickly and easily get documents signed. Recipients will sign in browser with no download or install required.",SFS_WORKFLOW_STAGE_1_DESCRIPTION:"Send a file for signature",SFS_WORKFLOW_STAGE_2_DESCRIPTION:"Recipients open a link to sign",SFS_WORKFLOW_STAGE_3_DESCRIPTION:"get notifications when document is signed",SFS_ADD_SIGNERS_BUTTON:"Add Signers",SFS_SIGNIN_BUTTON:"Begin Trial now",SEND_A_COPY_HEADING:"Send a read-only copy",SEND_A_COPY_HEADING2:"Send a copy",SEND_A_COPY_BUTTON:"Send",SEND_A_COPY_STATUS_COMPLETED:"View Sent File",SEND_A_COPY_STATUS:"Sending...",SEND_A_COPY_MSG:"Uploading as an agreement",SEND_A_COPY_STATUS2:"Your file was sent",SEND_A_COPY_STATUS3:"Unable to send your file.",SEND_A_COPY_DESCRIPTION:"Send a read-only copy of your completed document by email. Recipients can view the file but can’t modify it.",SEND_A_COPY_DESCRIPTION2:"Send a copy of your completed document by email. Recipients can view the file but can’t modify it.",SEND_A_COPY_EMAIL_RECIPIENTS:"Enter email addresses...",SEND_A_COPY_OPTIONAL_MESSAGE:"Enter a personal message (optional)",ATTACH_EMAIL_TITLE:"Send file as an email atachment",ATTACH_EMAIL_MSG:"Attach using:",ATTACH_EMAIL_MSG1:"Default email application (Microsoft Outlook)",ATTACH_EMAIL_MSG2:"Webmail",ATTACH_EMAIL_MSG3:"Do you want to send a read-only copy instead?",ATTACH_EMAIL_MSG4:"Send a read-only copy of your file with Adobe Acrobat Sign that recipients can view but not modify.",ATTACH_EMAIL_MSG5:"Send a Read-Only Copy",SFS_TITLE1:"Get others to sign your document",SFS_MSG2:"Send your completed document to others to sign. Recipients sign online, with no purchase or sign-up needed.",SFS_MSG3:"Add signers and send for signing",SFS_MSG4:"Recipients open a link to sign online",SFS_MSG5:"Get notified when file is signed",SFS_MSG6:"Add Signers",SFS_LANDING_TITLE:"Get documents signed fast",SFS_LANDING_DESCRIPTION:"Add signers, specify where to sign, send and track progress.",SFS_LANDING_MSG:"Add signers, specify where you want them to fill and sign, and have recipients return the signed document electronically.",SFS_LANDING_STR:"Signers",SFS_LANDING_STR2:"Add signers",SFS_LANDING_MSG1:"Recipients receive a link to sign online, with no purchase or sign-up required",SFS_LANDING_BTN:"Specify where to sign",SFS_LANDING_MSG3:"Files",SFS_LANDING_MSG4:"More Options",SFS_LANDING_MSG5:"Subject & Message",SFS_LANDING_MSG6:"Please Sign",SFS_LANDING_MSG7:"Add recipient emails...",SFS_LANDING_MSG8:"Add name, email id, etc.",SFS_POST_SEND_MSG1:" has been sent for signature",SFS_POST_SEND_MSG3:" has been successfully sent for signature",SFS_POST_SEND_MSG2:"When the agreement is signed, all parties will receive a final PDF copy by email.",SFS_POST_SEND_BTN1:"Track Progress",SFS_POST_SEND_BTN2:"Send Another Document",SFS_TRIAL_TITLE:"Get documents signed for free",SFS_TRIAL_TITLE3:"Send up to five documents for signature for free every 30 days.",SFS_TRIAL_TITLE4:"Send up to <%=count%> documents for signature for free every 30 days*.",SFS_TRIAL_TITLE5:"Send up to ",SFS_TRIAL_TITLE6:" documents for signature for free every 30 days*.",SFS_TRIAL_TITLE7:"Send up to ",SFS_TRIAL_TITLE8:" documents for signature for free every 30 days on a rolling basis.",SFS_TRIAL_TITLE9:'Send up to "<%=count%>" documents for signature for free every 30 days on a rolling basis.',SFS_TRIAL_CONDITION:"*Issued on a rolling basis.",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.",SFS_TRIAL_MSG:"Send a file for signing",SFS_TRIAL_MSG1:"Recipients open a link to sign online",SFS_TRIAL_MSG2:"Get notified when file is signed",SFS_TRIAL_STR:"Get ",SFS_TRIAL_STR1:" documents signed electronically for free every 30 days.",SFS_TRIAL_STR2:"Get five documents signed electronically for free every 30 days.",SFS_TRIAL_STR3:'Get "<%=count%>" documents signed electronically for free every 30 days.',SFS_SIGNIN_BTN:"Get Started",SFS_SUBSCRIBE_UPGRADE1:"Upgrade Now",SFS_TRANSACTIONS_LEFT:"Left",FSS_LINK_COPIED2:"Link copied to clipboard",SFS_FEEDBACK:"Did you like this experience?",SFS_FEEDBACK1:"Send Feedback",FSS_UNSUPPORTEDFILE_TITLE:"Unsupported  Filetype",FSS_TRY_ANOTHER_FILE:"Try Another File",FSS_SIGNIN_BEGIN:"Sign In to Begin",FSS_TOOLTIP3:"Trying to fill and sign the form? Do it easily with Fill, Sign & Send tool.",FSS_UNSUPPORTED_ERR:'Currently you can only fill and sign PDF files. Please save your file "<%= name %>" as a PDF before trying to fill and sign yourself or select another file.',SFS_ERR_ACCESS_DENIED_TITLE:"Access Denied",SFS_ERR_ACCESS_DENIED:"You do not have access to this service. Please contact your IT Administrator to gain access.",SFS_HIGH_PAGE_LIMIT_ERR_TITLE:"Exceeded page limit",SFS_HIGH_PAGE_LIMIT_ERR_BODY:"This document cannot be sent out for e-signatures because it exceeds the page limit for your license.",SFS_FREE_TRANSACTION_BAR_UPGRADE:"http://www.adobe.com/go/adobesignrdr_upg_19_0_0",LANDING_PAGE_LEARN_MORE_RDR:"http://www.adobe.com/go/lmadobesignrdr_app_19_0_0",LANDING_PAGE_LEARN_MORE_ACRO:"http://www.adobe.com/go/lmadobesignacro_app_19_0_0",CM_LEARN_MORE_RDR:"http://www.adobe.com/go/lmadobesignrdr_cm_19_0_0",CM_LEARN_MORE_ACRO:"http://www.adobe.com/go/lmadobesignacro_cm_19_0_0",ACRO_WEB_SIGNATURE_PREFERENCES:"http://www.adobe.com/go/t2elearnmore_sign",EMAIL_CLIENT_OTHER:"unknown",UNKNOWN:"unknown",SFS_MODAL_SUBTITLE:"Add signers, mark where to fill and sign, send it and track progress",SFS_MODAL_TRIAL_TITLE:"You have <%=rem_trans%> free Request Signatures transactions remaining.",SFS_MODAL_TRIAL_TITLE_1:"You have <%=rem_trans%> free Request Signatures transaction remaining.",SFS_MODAL_UPGRADE:"Upgrade",SFS_MODAL_INFO_LABEL_DESC:"Send up to 2 documents for signature for free every 30 days on a rolling basis.",SFS_MODAL_T2E_TITLE:"You are signed in with <%=login_profile%> profile. Your Acrobat Sign license is for <%=sign_profile%> profile where all agreements you send for signing will be stored.",FSS_RHP_TITLE:"More options",FSS_RHP_GET_LINK:"Get a shareable link",FSS_RHP_SEND_A_COPY:"Send a copy",MANAGE_AGREEMENT:"Manage agreement",SIGN_ANOTHER_DOCUMENT:"Sign another document",SHARE_POPUP_HEADING:"What would you like to do?",SHARE_LOCKED_COPY_HEADING:"Save as a read-only copy",SHARE_LOCKED_COPY_CONTENT:"Save your file as a read-only copy no one can modify.",REQUEST_SIGNATURES_HEADING:"Request E-signatures",REQUEST_SIGNATURES_CONTENT:"Send a document to others for easy, trusted signing online.",AV2_REQUEST_SIGNATURES_CONTENT:"Get documents signed fast and securely.",SHARE_POPUP_OFFLINE_ERROR:"No internet connection. Please connect to the internet and try again.",SHARE_POPUP_CONTINUE_BUTTON:"Continue",SHARE_POPUP_SAVED_INFO:"Changes saved",SHARE_POPUP_CANCEL_BUTTON:"Cancel",GENERIC_SERVER_ERROR_TITLE:"Could not complete your request",GENERIC_SERVER_ERROR_CONTENT:"An error occurred while connecting to the service. Please try again later.",SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART1:"Get e-signatures",SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART2:"faster",SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART3:"than email",SFS_PROGRESSIVE_MODAL_CONTENT_1:"Recipients sign in minutes. No file printing or scanning required.",SFS_PROGRESSIVE_MODAL_CONTENT_2:"Recipients receive an email link to sign online for free without downloading Acrobat.",SFS_PROGRESSIVE_MODAL_CONTENT_3:"Documents are signed fast and securely.",SFS_SHARE_SIGN_ADVISORY_MSG:"Your file will be uploaded as an agreement for e-signing. Anyone with the link can view the file.",SFS_PROGRESSIVE_MODAL_TITLE_RIGHT:"Add recipients to e-sign this document",SFS_PROGRESSIVE_MODAL_ADD_EMAIL:"Add name or email",SFS_PROGRESSIVE_MODAL_ADD_EMAIL_NEW:"Add People's names or email IDs",SFS_PROGRESSIVE_MODAL_ADD_CC_EMAIL:"Add cc's emails",SFS_PROGRESSIVE_MODAL_ADD_CC:"Add Cc",SFS_PROGRESSIVE_MODAL_HIDE_CC:"Hide Cc",SFS_PROGRESSIVE_MODAL_SUBJECT:"Subject",SFS_PROGRESSIVE_MODAL_MESSAGE:"Message",SEE_HOW_IT_WORKS:"See how it works",REPLAY_VIDEO:"Replay video",PLAY_VIDEO:"Play video"}),define("pdmplugins/send-for-sign/js/constants/sfs-sc-constants",{TOOLS:"Tools",SEND_FOR_SIG:"SendForSig",SELECT_FILES:"SelectFiles",OPTION_DLG:"OptionDlg",SHOWN:"Shown",CLICKED:"Clicked",ADD_FILES:"AddFiles",PREPARE_FORM:"PrepareForm",READY_TO_SEND:"ReadyToSend",START:"Start",UPSELL_PAGE:"UpsellPg",SIGN_IN:"SignIn",UPGRADE:"Upgrade",CONVERSION:"Conversion",UPLOAD_STARTED:"1-Uploading",UPLOAD_COMPLETE:"2-UploadComplete",UPLOAD_ERROR:"UploadError",FETCH_SEND_PG_URL:"3-FetchingSendPageUrl",UPLOAD_CANCELLED:"UploadCancelled",OPERATION:"Op",SEND_ANOTHER:"SendAnother",MANAGE:"Manage",SUCCESS:"Success",COMBINE:"Combine",STARTED:"Started",FAILURE:"Failure",CANCELLED:"Cancelled",YES_CLICKED:"YesClicked",NO_CLICKED:"NoClicked",FILES:"Files",TO_EMAIL_COUNT:"EmailToCount",CC_EMAIL_COUNT:"EmailCCCount",FILE_COUNT:"FileCount",EMAIL_TO_ADDED:"EMailTOAdded",EMAIL_CC_ADDED:"EMailCCAdded",EMAIL_REMOVED:"EMailRemoved",MESSAGE_SUBJECT_EDITED:"MessageSubjectEdited",MESSAGE_BODY_EDITED:"MessageBodyEdited",EMAIL_TO_EDITED:"EmailToEdited",EMAIL_CC_EDITED:"EmailCCEdited",ADD_CC_CLICKED:"AddCCClicked",HIDE_CLICKED:"HideClicked",NEW_LANDING_PAGE:"SFSNewLandingPage",OLD_LANDING_PAGE:"SFSOldLandingPage",NEXT_GUIDE_SHOWN:"NextButtonGuideShown",POST_SEND_PAGE:"PostSendPage",AUTHORING_PAGE:"AuthoringPage",LOADED:"Loaded",SESSION_TIMEOUT:"SessionTimeout",ERROR:"Error",OPEN_SEND_PAGE_IN_APP:"OpenSendPageInApp",LEARN_MORE:"LearnMore",ADVANCED_WORKFLOW:"AdvancedWorkflow",ADVANCED_CLICKED:"AdvancedClicked",SIGN_COMPLETE:"SignWorkflowComplete",INVOCATION:"Invocation",FSS_SHARE_CLOSED:"Closed",FSS_USER_SIGNED_IN:"SignedIn",FSS_USER_ALREADY_SIGNED_IN:"AlreadySignedIn",T2E_BAR:"T2E Bar",LEARN_MORE_CLICKED:"LearnMoreClicked",GET_A_LINK:"FSSGetALink",GET_A_LINK_TAB:"Opened",GET_A_LINK_CREATE:"CreateClicked",GET_A_LINK_TRYAGAIN:"TryAgain",GET_A_LINK_SUCCESS:"Success",GET_A_LINK_FAILURE:"Failed",GET_A_LINK_COPIED:"LinkCopied",GET_A_LINK_FAILURE_REASON:"GetALinkFailure",GET_A_LINK_COPY:"Copy",GET_A_LINK_EMAIL:"AttachLinkToEmailClicked",GET_A_LINK_MAIL_LAUNCHED:"MailWindowLaunched",GET_A_LINK_MAIL_UNKNOWN:"MailNotConfigured",FSS_SHARE_POPUP:"FssSharePopup",FSS_SHARE_RHP:"FssShareRHP",EMAIL_CLIENT_EUDORA:"Eudora",EMAIL_CLIENT_LOTUS_NOTES:"Lotus Notes",EMAIL_CLIENT_NETSCAPE:"Netscape",EMAIL_CLIENT_OUTLOOK:"Microsoft Outlook",EMAIL_CLIENT_OUTLOOK_EXPRESS:"Outlook Express",EMAIL_CLIENT_ENTOURAGE:"Entourage",EMAIL_CLIENT_MAIL:"Mail",SEND_A_COPY_TAB:"Opened",SEND_A_COPY:"FSSSendACopy",SEND_A_COPY_CREATE:"CreateClicked",SEND_A_COPY_SUCCESS:"Success",SEND_A_COPY_FAILURE:"Failed",SEND_A_COPY_FAILURE_REASON:"SendACopyFailure",SEND_A_COPY_SUBJECT:"SubjectEntered",SEND_A_COPY_MSG:"MsgEntered",SEND_A_COPY_USER_COUNT:"SACUserCount",GET_SIG:"FSSGetSig",GET_SIG_TAB:"Opened",GET_SIG_BTN:"ButtonClicked",GET_SIG_LM:"LearnMoreClicked",GET_SIG_TRIAL:"TrialView",EDU_CARD:"EducationalCard",GET_STARTED_CLICKED:"GetStartedClicked",CANCEL_CLICKED:"CancelClicked",FREE_USER:"FreeUser",ENTITLED_USER:"EntitledUser",SPECIFY_WHERE_TO_SIGN:"SpecifyWhereToSign",SPECIFY_WHERE_TO_SIGN_CTA:"SpecifyWhereToSign_CTA",SIGN_EVENT:"SignEvent",COMPOSE_PAGE:"ComposePage",FREE_TRANS_BAR:"FreeTransactionBar",SIGN_TOOL_SHOWN:"Adobesigntoolshown",SIGN_TOOL_NOT_SHOWN:"Adobesigntoolnotshown",SEND_FOR_SIGN_NEW_EXP_READER_FREE_TRANS:"SendForSignNewExpReaderFreeTrans",UNSIGNED_USER:"UnsignedUser",SIGNED_USER:"SignedUser",SHOW_SIGN_IN_DIALOG:"ShowSignInDialog",SIGN_IN_SUCCESS:"SignInSuccess",SIGN_IN_FAILURE:"SignInFailure"}),define("pdmplugins/send-for-sign/js/templates/sfs-app-progress-template",[],function(){return'<div class="progress-container"><div class="progress-meter-box"><div class="progress-meter"></div></div><div class="progress-label"><div class="text"><%= progressLabel %></div><div class="percentage"></div><div class="terminator"></div></div><button id="sfs-progress-cancel"  class="progress-cancel-btn button-light-blue-small"  tabindex = 0><%= cancelLabel %></button></div>'
}),define("pdmplugins/send-for-sign/js/views/sfs-app-progress-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-app-progress-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings"],function(e,i,t,s){return i.SFSAppProgressView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},events:function(){return{"click .progress-cancel-btn":"_onProgressCancelBtnClick"}},render:function(){e.View.prototype.render.call(this);var i,t,n=this.options.sfsAppProgressUiModel,o=n.get("is_visible");return o?(this.$el.show(),0===this.$el.children().length&&(this.$el.html(this._template({progressLabel:this._getProgressLabel(),cancelLabel:s.SFS_PROGRESS_CANCEL_LABEL})),this._initWrappers(),this._listenForWindowResizeEvents()),i=n.getTotalProgressPercentage(),i=parseInt(i,10),isNaN(i)&&(i=0),t=i.toString()+"%",this.$progressMeter.width(t),this.$progressLabelPercentage.html(t),this._adjustMarginForProgressContainer(this.$progressMeterContainer.parent().width(),this.$progressMeterContainer.parent().height()),$("#sfs-progress-cancel").focus(),this):(this.$el.hide(),this)},_initWrappers:function(){this.$progressMeterContainer=this.$(".progress-container"),this.$progressMeter=this.$(".progress-container .progress-meter-box .progress-meter"),this.$progressLabelPercentage=this.$(".progress-container .progress-label .percentage")},_onProgressCancelBtnClick:function(){"UniShare"===this.options.sfsAppUiModel.getTriggerType()?this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"CloseSFSApp"})},this)):this.options.sfsAppProgressUiModel.set("abort_progress",!0)},_getProgressLabel:function(){return s.DOC_PROGRESS_LABEL},_listenForWindowResizeEvents:function(){setInterval(_.bind(function(){this._handleWindowResize()},this),250)},_handleWindowResize:function(){var e=this.$progressMeterContainer.parent().width(),i=this.$progressMeterContainer.parent().height();e&&i&&(this._oldWidth!==e||this._oldHeight!==i)&&(this._oldWidth=e,this._oldHeight=i,this._adjustMarginForProgressContainer(e,i))},_adjustMarginForProgressContainer:function(e,i){var t=this.$progressMeterContainer.height();this.$progressMeterContainer.css("margin-top",(i-t)/2)}}),i.SFSAppProgressView}),define("pdmplugins/send-for-sign/js/templates/sfs-send-for-sign-page-template",[],function(){return'<iframe class="send-page-iframe" frameborder="0"        name="send-page-iframe"></iframe>'}),define("pdmplugins/send-for-sign/js/views/sfs-send-for-sign-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-send-for-sign-page-template"],function(e,i,t){return i.SFSSendForSignPageView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},render:function(){e.View.prototype.render.call(this);var i=this.options.sfsAppSendPageUiModel,s=i.get("url"),n=i.get("is_visible"),o=i.get("is_loaded");return n?this.$el.show():this.$el.hide(),0===this.$el.children().length&&(this.$el.html(_.template(t)),this._initWrappers()),_.isEmpty(s)||o||this._loadSendPageURLInInframe(s),this},_initWrappers:function(){this.$sendPageIframe=this.$(".send-page-iframe")},_loadSendPageURLInInframe:function(e){_.isEmpty(e)||(this.$sendPageIframe.attr("src",e),this._addSendPageIframeLoadListener())},_addSendPageIframeLoadListener:function(){var e=this.options.sfsAppSendPageUiModel;this.$sendPageIframe.load(_.bind(function(){e.set("is_loaded",!0)},this))}}),i.SFSSendForSignPageView}),define("pdmplugins/send-for-sign/js/templates/sfs-landing-page-template",[],function(){return'<div id="sfs-landing-page-content" class="ui-theme theme-container">    <div class="sfs-service-spacer"></div>    <div class="sfs-service-title theme-text" ><%= title %></div>    <div class="sfs-service-subtitle theme-text"><%= subtitle %></div>    <div class="sfs-selected-files-heading-container">       <div class="sfs-selected-files-heading theme-text" tabindex=-1><%= selected_files %></div>       <div class="sfs-tool-options-add-files">           <button id="sfs-add-button" class="sfs-add-files button-light-blue-small addfile theme-hyperlink theme-hoverable" tabindex= 0><%= add_files %></button>       </div>    </div>    <div class="sfs-selected-files-container">       <div class="sfs-selected-files-list ui-theme theme-border"></div>       <div class="sfs-app-info-container">           <div class="info-txt 1"></div>           <div class="info-txt 2"></div>           <div class="info-txt 3"></div>       </div>    </div>    <div class="sfs-action-btns-group">       <div class="sfs-action-btns-group-container">           <div class="sfs-file-action-btn-and-descr">               <div><input type="button" id = "sfs-file-action-btn-1" class=" control-button sfs-file-action-btn 1 site-catalyst theme-button theme-button-label" tabindex="0"/></div>               <div class="description-text 1 theme-text"></div>           </div>           <div class="sfs-action-btn-separator theme-text"></div>           <div class="sfs-file-action-btn-and-descr">               <div><input type="button" id = "sfs-file-action-btn-2" class=" control-button sfs-file-action-btn 2 site-catalyst theme-button theme-button-label" tabindex="0"/></div>               <div class="description-text 2 theme-text"></div>           </div>           <div class="sfs-action-btns-terminator"></div>       </div>    </div></div>'}),define("pdmplugins/send-for-sign/js/templates/sfs-file-name-template",[],function(){return'<div class="sfs-selected-file-item ui-theme      theme-border theme-hoverable">    <div class="collection-item-thumb <%= iconCls %>"></div>    <div class="file-name theme-text"><%= fileName %></div>    <button class="file-remove core-remove-x sfs-file-remove"     tabindex = 0 aria-label="<%= ariaRemoveLabel %>"></button></div>'}),define("pdmplugins/send-for-sign/js/views/sfs-landing-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-landing-page-template","pdmplugins/send-for-sign/js/templates/sfs-file-name-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/utils/util","core/utils/truncate","core/utils/css-util","core/utils/file-types","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s,n,o,a,r,l,d){return i.SFSLandingPageView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._fileNameTemplate=_.template(s),this._landingPageUiModel=this.options.sfsAppLandingPageUiModel,this._addUiModelEventListeners(),this._addKeyEventListener(),this._LogSignActivity()},events:function(){return{"click .sfs-add-files":"_onAddFilesBtnClick","click .sfs-selected-file-item .file-remove":"_onSelectedFileItemRemoveClick","click .sfs-file-action-btn.1":"_onSFSFileActionBtn1Click","click .sfs-file-action-btn.2":"_onSFSFileActionBtn2Click"}},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var i=e.keyCode,t=$(e.target),s=$.Event("click");switch(i){case 13:case 32:t.trigger(s),e.preventDefault();break;case 9:e.shiftKey&&"sfs-add-button"==$(e.target).attr("id")?(o.isAcrobat()?$("#sfs-file-action-btn-2").focus():$("#sfs-file-action-btn-1").focus(),e.preventDefault()):"sfs-file-action-btn-1"==$(e.target).attr("id")&&this.$("#sfs-file-action-btn-1").removeClass("draw-button-focus-outline")}},_LogSignActivity:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.logSignServicesActivity()},this))},_addUiModelEventListeners:function(){this._landingPageUiModel.on("change:is_refreshed",this._refreshPageContent),this._landingPageUiModel.on("change:is_visible",this._onVisibilityChange)},render:function(){return e.View.prototype.render.call(this),this._landingPageUiModel.get("is_visible")?(this.$el.show(),0===this.$el.children().length&&(this.options.appApi.siteCatalystApi.logScEvent([d.SEND_FOR_SIG,d.OLD_LANDING_PAGE]),this.$el.html(this._template({title:n.LP_TITLE,subtitle:n.LP_SUBTITLE,add_files:n.SFS_ADD_FILES,selected_files:n.SELECTED_FILES})),this._initWrappers(),this._refreshPageContent()),this.$("#sfs-file-action-btn-1").addClass("draw-button-focus-outline"),this):(this.$el.hide(),this)},_initWrappers:function(){this.$fileItemsContainerElem=this.$(".sfs-selected-files-list"),this.$fileItemsHeadingElem=this.$(".sfs-selected-files-heading-container"),this.$actionBtnsGrpElem=this.$(".sfs-action-btns-group"),this.$actionBtnsContainerElem=this.$(".sfs-action-btns-group-container"),this.$actionBtn1Elem=this.$(".sfs-file-action-btn.1"),this.$actionBtn2Elem=this.$(".sfs-file-action-btn.2"),this.$actionBtn1DescrElem=this.$(".description-text.1"),this.$actionBtn2DescrElem=this.$(".description-text.2"),this.$actionBtnSeparatorElem=this.$(".sfs-action-btn-separator"),this.$appInfoContainer=this.$(".sfs-app-info-container"),this.$appInfoTxt1Elem=this.$(".sfs-app-info-container .info-txt.1"),this.$appInfoTxt2Elem=this.$(".sfs-app-info-container .info-txt.2"),this.$appInfoTxt3Elem=this.$(".sfs-app-info-container .info-txt.3")},_onVisibilityChange:function(){this.render()},_refreshPageContent:function(){this._updateFileItemsList(),this._updateActionButtonLabels(),this._updateActionButtonEnabledState(),this._updateActionButtonDescription(),this._updateAppInfoTexts(),this._adjustCSS(),this._focusOnSelectButton()},_updateActionButtonLabels:function(){this._landingPageUiModel.get("action_btn1_visible")?(this.$actionBtn1Elem.val(this._landingPageUiModel.get("action_btn1_label")),this.$actionBtn1Elem.removeClass("hidden")):this.$actionBtn1Elem.addClass("hidden"),this._landingPageUiModel.get("action_btn2_visible")?(this.$actionBtn2Elem.val(this._landingPageUiModel.get("action_btn2_label")),this.$actionBtnSeparatorElem.html(this._landingPageUiModel.get("action_btn_separator_label")),this.$actionBtn2Elem.removeClass("hidden"),this.$actionBtnSeparatorElem.removeClass("hidden")):(this.$actionBtn2Elem.addClass("hidden"),this.$actionBtnSeparatorElem.addClass("hidden"))},_updateActionButtonEnabledState:function(){this._landingPageUiModel.get("action_btn1_enabled")?this.$actionBtn1Elem.removeClass("disabled"):this.$actionBtn1Elem.addClass("disabled"),this._landingPageUiModel.get("action_btn2_enabled")?this.$actionBtn2Elem.removeClass("disabled"):this.$actionBtn2Elem.addClass("disabled")},_updateActionButtonDescription:function(){this._landingPageUiModel.get("action_btn_descr_visible")?(this.$actionBtn1DescrElem.html(this._landingPageUiModel.get("action_btn1_descr_txt")),this.$actionBtn2DescrElem.html(this._landingPageUiModel.get("action_btn2_descr_txt")),this.$actionBtn1DescrElem.removeClass("hidden"),this.$actionBtn2DescrElem.removeClass("hidden")):(this.$actionBtn1DescrElem.addClass("hidden"),this.$actionBtn2DescrElem.addClass("hidden"))},_updateAppInfoTexts:function(){this._landingPageUiModel.get("app_info_txt_visible")?(this.$appInfoTxt1Elem.html(this._landingPageUiModel.get("app_info_txt1")),this.$appInfoTxt1Elem.removeClass("hidden"),this.$appInfoTxt2Elem.html(this._landingPageUiModel.get("app_info_txt2")),this.$appInfoTxt2Elem.removeClass("hidden"),this.$appInfoTxt3Elem.html(this._landingPageUiModel.get("app_info_txt3")),this.$appInfoTxt3Elem.removeClass("hidden")):(this.$appInfoTxt1Elem.addClass("hidden"),this.$appInfoTxt2Elem.addClass("hidden"),this.$appInfoTxt3Elem.addClass("hidden"))},_getRemoveAriaLabel:function(e){return _.template(n.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:n.SEND_REMOVE})},_updateFileItemsList:function(){var e,i,t=this._landingPageUiModel.get("selected_files"),s=this._landingPageUiModel.get("file_collection_visible");s?(this.$fileItemsContainerElem.empty(),_.each(t,_.bind(function(t){e=t.get("name"),i=$(this._fileNameTemplate({fileName:e,iconCls:l.getFileInfo("",e).iconCls,ariaRemoveLabel:this._getRemoveAriaLabel(e)})),i.data("file",t),this.$fileItemsContainerElem.append(i)},this)),this.$fileItemsContainerElem.removeClass("hidden"),this.$fileItemsHeadingElem.removeClass("hidden")):(this.$fileItemsContainerElem.addClass("hidden"),this.$fileItemsHeadingElem.addClass("hidden"))},_adjustCSS:function(){this._adjustAppsInfoContainerCSS(),this._adjustFileItemsCSS(),this._adjustActionButtonsCSS()},_focusOnSelectButton:function(){$("#sfs-file-action-btn-1").focus()},_adjustAppsInfoContainerCSS:function(){var e=this.$fileItemsContainerElem.css("margin-left");this.$appInfoContainer.css("margin-left",e)},_adjustActionButtonsCSS:function(){var e=this.$actionBtn1Elem.width()+r.getCssNum(this.$actionBtn1Elem,"padding-left")+r.getCssNum(this.$actionBtn1Elem,"padding-left"),i=this.$actionBtn2Elem.width()+r.getCssNum(this.$actionBtn2Elem,"padding-left")+r.getCssNum(this.$actionBtn2Elem,"padding-left"),t=Math.max(e,parseInt(this.$actionBtn1Elem.css("min-width"),10)),s=Math.max(i,parseInt(this.$actionBtn2Elem.css("min-width"),10));this.$actionBtn1DescrElem.width(t),this.$actionBtn2DescrElem.width(s)},_adjustFileItemsCSS:function(){this.$fileItemsContainerElem.children().each(function(){var e=$(this),i=$(".file-name",e),t=$(".collection-item-thumb",e),s=$(".file-remove",e),n=e.innerWidth()-parseInt(i.css("text-indent"),10);n-=t.position().left+t.outerWidth()+s.outerWidth(),a.truncateElementText(i,n)});var e=this._getSelectedFilesCount();e>0?this.$actionBtn1Elem.removeClass("no-file-selected"):this.$actionBtn1Elem.addClass("no-file-selected")},_getSelectedFilesCount:function(){var e=this._landingPageUiModel.get("selected_files");return _.isEmpty(e)?0:e.length},_onAddFilesBtnClick:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+d.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([d.TOOLS,i,d.ADD_FILES,d.CLICKED]),this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","browse_file")},_onSelectedFileItemRemoveClick:function(e){var i=$(e.currentTarget).parents(".sfs-selected-file-item"),t=i.data("file");this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_removed_file",t),this._landingPageUiModel.set("user_action","removed_file"),e.stopPropagation()},_onSFSFileActionBtn1Click:function(){if(!this.$actionBtn1Elem.hasClass("disabled")){var e=this._getSelectedFilesCount();o.isAcrobat()&&e>0?this._handlePrepareFormClickEvent():e>0?this._handleSendClickEvent():this._handleSelectFileClickEvent(),this.$("#sfs-file-action-btn-1").removeClass("draw-button-focus-outline")}},_onSFSFileActionBtn2Click:function(){this.$actionBtn2Elem.hasClass("disabled")||this._handleSendClickEvent()},_handlePrepareFormClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","prepare_form_btn_clicked")},_handleSendClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","send_action_btn_clicked")},_handleSelectFileClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","select_action_btn_clicked")},_onSFSManageAgreementsBtnClick:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","manage_agreements_btn_clicked")}}),i.SFSLandingPageView}),define("pdmplugins/send-for-sign/js/templates/sfs-new-landing-page-template",[],function(){return'<div id="sfs-new-landing-page-content" class="ui-theme theme-container">    <div class="sfs-service-spacer-new"></div>    <div class="sfs-service-title-new theme-text" ><%= title %></div>    <div class="sfs-service-subtitle-new theme-text"><%= subtitle %>           <a class="learn-more theme-hyperlink" tabindex="11"><%= subtitle3 %></a>    </div><div class = "email-error-parent hidden"><div class = "email-error">   <div class="email-error-msg theme-text"></div>   <span id="close-button" class="theme-text" tabindex="12">x<span></div></div><div class="sfs-current-thumbnail-row" display="none"><figure class="sfs-recent-file-container"        style="position:relative" ><div class="sfs-recent-file" role="presentation"><img class="sfs-preview-image" draggable="false"     src="" alt=""/></div></figure></div><div class = "sfs-info-content-container">    <div>     <div class="sfs-general-heading theme-text"><%= totitle %></div>    <div class="sfs-general-heading-addcc " >           <a class = "email-addcc theme-hyperlink" tabindex= "2"><%= addcc %></a> |            <button class="core-help-icon email-address-help" tabindex= "3" aria-label="<%= help_icon_text %>"></button>    </div>    </div>     <div class="sfs-email-list">       <div class="sfs-to-email-block">         <button id="sfs-landing-page-new-search-email-img" tabindex="-1"/>         <div class ="sfs-to-email-ids-list"></div>           <textarea class="sfs-email-textarea ui-theme theme-container theme-text" placeholder="<%=to_email_placeholder%>" align="right" rows="1" tabindex="1" spellcheck="false"></textarea>       </div>       <div class="sfs-cc-email-fullblock hidden" >           <div class="sfs-general-heading theme-text"> <%= cc %> | <a class = "email-hidecc theme-hyperlink" tabindex="4"><%= hide %></a></div>           <div class="sfs-cc-email-block" >                 <div class ="sfs-cc-email-ids-list"></div>                 <textarea class="sfs-email-cc-textarea ui-theme theme-container theme-text" placeholder="<%=cc_email_placeholder%>" align="right" rows="1" tabindex="5" spellcheck="false"></textarea>           </div>       </div>       <div class = "role-dropdown hidden">           <ul id="dropdown-menu" >                 <li class="signer"><div id = "icon"><div class="signerImg posAbsolute"></div></div><span class="value" > <%=roledropdown_signer%></span></li>                 <li class="approver"><div id = "icon"><div class="approverImg posAbsolute"></div></div><span class="value"> <%=roledropdown_approver%></span></li>           </ul>       </div>       <div class="share-autocomplete-box"></div>    </div>    <div class="sfs-general-heading theme-text" ><%= toMessage %></div>   <textarea class="sfs-subject-list ui-theme theme-container theme-text"  placeholder ="<%=subject_placeholder%>" align="left" maxlength="255" tabindex="6"></textarea>   <textarea class="sfs-message-list ui-theme theme-container theme-text" align="left" tabindex="7"></textarea>    <div class="sfs-selected-files-heading-container-new.hidden">    <div class="sfs-selected-files-heading-container-new">       <div class="sfs-selected-files-heading-new theme-text" tabindex="-1"><%= selected_files %></div>       <div class="sfs-tool-options-add-files">           <button id="sfs-add-button" class="sfs-add-files addfile theme-hyperlink" tabindex="8"><%= add_files %></button>       </div>    </div>    <div class="sfs-selected-files-container-new">       <div class="sfs-selected-files-list-new ui-theme theme-border"></div>       <div class="sfs-app-info-container">           <div class="info-txt 1"></div>           <div class="info-txt 2"></div>           <div class="info-txt 3"></div>       </div>    </div>    <div class="sfs-disclaimer" ><%= disclaimer3 %></div>    <div class="sfs-action-btns-group-new">    <div class="row">           <div class="right">                 <div class="sfs-action-btns-group-new-container">                       <div class="sfs-file-action-new-btn-and-descr">                              <div class="right">                                      <a id = "sfs-file-action-btn-new-2" title = "<%= advanced_tooltip %>" class="ui-theme theme-hyperlink" tabindex="9"><%=advanced_sign%></a>                                      <input type="button" id = "sfs-file-action-btn-new-1" class=" control-button sfs-file-action-btn-new 1 site-catalyst theme-button theme-button-label" tabindex="10"/>                              </div>                        <div class="description-text 1 theme-text"></div>                 </div>           </div>           </div>    </div>    </div>    </div>    <div class="sfs-spacer-bottom"></div> </div> </div>'}),define("pdmplugins/send-for-sign/js/templates/sfs-new-file-name-template",[],function(){return'<div class="sfs-selected-file-item-new ui-theme      theme-border">    <div class="file-name theme-text"><%= fileName %></div>    <button class="file-remove-new hidden core-remove-x sfs-file-remove-new"     tabindex = 0 aria-label="<%= ariaRemoveLabel %>"></button></div>'}),define("pdmplugins/send-for-sign/js/templates/sfs-email-block-template",[],function(){return'<div class="sfs-email-id-item ui-theme theme-border theme-hoverable">     <div id="emailBlock">     <div id="dropdownMenu">	    <button  class="dropbtn signerImg"></button>	</div><div class="caret"></div>    </div>    <div class="email-id" title = "<%= emailID %>"><%= emailID %></div>    <button class="email-remove core-remove-x sfs-email-remove"     tabindex = 0 aria-label="<%= ariaRemoveLabel %>"></button></div>'}),define("pdmplugins/send-for-sign/js/templates/sfs-guide-template",[],function(){return'<div role="tooltip" class="sfs-guide <%= guideType %>"><div class="sfs-guide-content"><%= text %></div><div class="sfs-guide-arrow"></div></div>'}),define("pdmplugins/send-for-sign/js/templates/sfs-guide-template-new",[],function(){return'<div role="tooltip" class="sfs-guide-new <%= guideType %>"><div class="sfs-guide-new-inner"> <div class="sfs-guide-title-row"><div class="sfs-guide-title"><%= title %></div><div class="sfs-guide-new-close"></div></div><span class="sfs-guide-new-content"><%= text %> </span><span class="sfs-guide-lean-more-link"> <%= learn %></span><div class="sfs-guide-arrow"></div></div></div>'}),define("pdmplugins/send-for-sign/js/utils/sfs-ts-utils",["pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i){var t={extractRootUrl:function(e){var i=document.createElement("a");return i.href=e,i.protocol+"//"+i.host},getFillSignReaderFreeTransVariant:function(e){if(_.isUndefined(this.readerFreeTransVariant)){var t=e.appApi.rnaApiObj.esApi.fetchFillSignReaderFreeTransVariant();this.readerFreeTransVariant=1===t?i.SEND_FOR_SIGN_NEW_EXP_READER_FREE_TRANS:i.SEND_FOR_SIG}return this.readerFreeTransVariant}};return t}),define("pdmplugins/send-for-sign/js/templates/sfs-autocomplete-template",[],function(){return' <div class="share-auto-c-list"     role="listbox" id="share-auto-c-list"></div> '}),define("pdmplugins/send-for-sign/js/views/sfs-autocomplete-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-autocomplete-template","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t){return i.AutocompleteView=e.View.extend({events:{"mousedown .share-auto-address":"_onAddressClick"},initialize:function(){var i,s=this.options,n=s.autoCCollection;e.View.prototype.initialize.call(this),this._template=_.template(t),this._addressTemplate=_.template("<div class='share-auto-address <%=specialClass%>'     title='<%-email %>'     role='option' id='<%=id%>' tabindex='-1'     aria-selected='<%=ariaSelected%>'><%-email%></div>"),this._localAddressTemplate=_.template("<div class='share-auto-address <%=specialClass%>' title='<%-email %>' ><%-name%> &lt;<%-email%>&gt; </div>"),this._editControl=s.editControl,this._landingPageUiModel=s.sfsAppLandingPageUiModel,i=new Backbone.Collection,this.filteredCollection=i,i.on("all",_.debounce(_.bind(this._onFilteredCChange,this),50)),n.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()),this._initWrappers(),this.$autoCList.on("scroll",this._onAddressScroll),e.Util.isCEF()&&this.$autoCList.css("overflow","auto")),this._renderAddressList(),this},_initWrappers:function(){this.$autoCList=this.$(".share-auto-c-list")},setFilter:function(e){e&&(e=$.trim(e.toLowerCase()),e.length<3&&(e=void 0)),e||(this.selectedID=void 0),this.fragment=e,this._updateFilteredCollection()},makeChoice:function(e){{var i,t;this.options}return e||1!==this.filteredCollection.length?this.selectedID&&(i=this.filteredCollection.get(this.selectedID)):i=this.filteredCollection.at(0),i&&(t=i.get("email"),this._insertEmail(t)),i},selectDown:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),r=$(".share-auto-address").height(),l=6,d=6;e.Util.isCEF&&(l=n.length),s=this._landingPageUiModel.get("enable_autoc_arrows"),s&&(o?(l>n.length&&(l=n.length),t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(l>i&&(i+=1,l>d&&this._keyboardScrollTo(a+r)),i>=l?o=void 0:(t=n.at(i),o=t?t.id:void 0))):(t=n.at(0),t?(o=t.id,this._keyboardScrollTo(0)):o=void 0),this.selectedID=o,this._renderAddressList())},selectUp:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),r=6,l=6,d=$(".share-auto-address").height();e.Util.isCEF&&(r=n.length),s=this._landingPageUiModel.get("enable_autoc_arrows"),s&&(o?(t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(i>=0&&(i-=1,r>l&&this._keyboardScrollTo(a-d)),0>i?o=void 0:(t=n.at(i),o=t?t.id:void 0))):(r>n.length&&(r=n.length),r-=1,t=n.at(r),t?(o=t.id,r>l&&this._keyboardScrollTo(r*d)):o=void 0),this.selectedID=o,this._renderAddressList())},_keyboardScrollTo:function(i){e.Util.isCEF()&&(this.$autoCList.stop(!0,!0),this.$autoCList.animate({scrollTop:i},"fast"))},_renderAddressList:function(){var e,i,t=this.filteredCollection,s=this.$autoCList,n=this.selectedID,o=this.options.appApi.rnaApiObj.esApi.getFillSignVariant();e=this._localAddressTemplate,i=this._addressTemplate,t.length&&this.$el.show(),s.empty(),t.each(function(t){var a,r="";t.id===n&&(r="selected");var l=t.get("email"),d=t.get("name"),p="FSS_VARIANT_3"==o||"FSS_VARIANT_4"==o?!0:!1;a=_.isUndefined(t.get("name"))||""===t.get("name")||p&&d.toLowerCase()==l.toLowerCase()?i({email:t.get("email"),specialClass:r,id:_.uniqueId("share-auto-address-"),ariaSelected:""===r?"false":"true"}):e({name:t.get("name"),email:t.get("email"),specialClass:r,id:_.uniqueId("share-auto-address-"),ariaSelected:""===r?"false":"true"}),s.append(a)}),t.length||this.$el.hide()},_updateFilteredCollection:function(){var e,i=this.options.autoCCollection,t=this.filteredCollection,s=[],n="",o="",a=!1,r=this._landingPageUiModel.get("pgcSuggestionsCollection");return r&&i.add(r.toJSON(),{merge:!0}),e=this.fragment,e&&e.length&&(s=i.filter(function(i){return o=i.get("email"),a=0===o.indexOf(e),a===!1&&(n=i.get("name"),void 0!==n&&(n=n.toLowerCase(),a=0===n.indexOf(e.toLowerCase()))),a})),t.set(s),s},_onFilteredCChange:function(){if(this.filteredCollection.length>0){var e=this.filteredCollection.at(0);this.selectedID=e.id}this._renderAddressList()},_onCollectionChange:function(){this._renderAddressList()},_onAddressClick:function(e){var i,t=$(e.target);i=t.attr("title"),this._insertEmail(i),this._landingPageUiModel.get("autocomplete_eventual_click")||(this._landingPageUiModel.set("autocomplete_eventual_click",!0),this._landingPageUiModel.set("autocomplete_avoided",!0)),this._landingPageUiModel.get("autocomplete_immediate_click")||this._landingPageUiModel.set("autocomplete_immediate_click",!0)},_onAddressScroll:function(){this._landingPageUiModel.get("autocomplete_scroll")||(this._landingPageUiModel.set("autocomplete_scroll",!0),this._landingPageUiModel.set("autocomplete_immediate_click",!0),this._landingPageUiModel.set("autocomplete_avoided",!0))},_insertEmail:function(e){this.options.emailView.abortPGCRequest(),this.options.emailView._setRecipientsFromText(e),this.setFilter(void 0),_.delay(_.bind(function(){this._editControl.focus(!0)},this),10)}}),i.AutocompleteView}),define("pdmplugins/send-for-sign/js/ops/plugin/desktop-fetching-autocomplete-list-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/utils/sfs-ts-utils","core/ops/op"],function(e,i,t){i.DesktopFetchingAutocompleteListOp=e.Op.extend({run:function(){var e,i=this.options.sfsAppLandingPageUiModel.get("enable_autocomplete");return i?this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){return e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=t.extractRootUrl(e),this.options.rootUrl=e,this.options.autoCCollection.setRUrl(this.options.rootUrl),this._getResolvedPromise()},this)):void 0}})}),define("pdmplugins/send-for-sign/js/ops/plugin/desktop-getting-subscription-levels-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/utils/sfs-ts-utils","core/ops/op"],function(e,i,t){i.DesktopGettingSubscriptionLevels=e.Op.extend({run:function(){return this.validateRegistry().then(_.bind(function(){return this.readFromRegistry()},this),_.bind(function(){return this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){return this.authenticatingFirstTime()},this))},this))},authenticatingFirstTime:function(){return this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){return this.preModelFetchValues(),this.writeToRegistry()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},preModelFetchValues:function(){var e;e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=t.extractRootUrl(e),this.options.rootUrl=e,this.options.autoCCollection.setRUrl(this.options.rootUrl)},readFromRegistry:function(){return this.options.appApi.rnaApi.then(_.bind(function(e){var i={prefName:"SendForSignature"};return e.registryAPI.getRegistryContents(i).then(_.bind(function(e){return this.registryResponse=JSON.parse(e),this.populateAutoCCollectionFromRegistry(),this.options.readRegistry=!0,$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},writeToRegistry:function(){var e=this.makeRegistryHierarchy(),i=JSON.stringify(e),t={prefName:"SendForSignature",data:i};return this.options.appApi.rnaApi.then(_.bind(function(e){e.registryAPI.setRegistryContents(t).then(_.bind(function(e){return e?$.Deferred().resolve().promise():$.Deferred().reject().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},validateRegistry:function(){return this.options.readRegistry?this.options.appApi.rnaApi.then(_.bind(function(e){var i={prefName:"SendForSignature"};return e.registryAPI.checkIfRegistryExists(i).then(_.bind(function(e){return e?$.Deferred().resolve().promise():$.Deferred().reject().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this)):$.Deferred().reject().promise()},makeRegistryHierarchy:function(){var e={User:{accountType:_.isUndefined(this.options.appApi.usersMeApi.getUserIdentity().account_type)?"":this.options.appApi.usersMeApi.getUserIdentity().account_type,Email:_.isUndefined(this.options.appApi.usersMeApi.getUserIdentity().email)?"":this.options.appApi.usersMeApi.getUserIdentity().email,addressList:this.getEmailAddressListString()}};return e},getEmailAddressListString:function(){var e="";return _.each(this.options.autoCCollection.models,function(i){(_.isUndefined(i.get("isLocalContact"))||i.get("isLocalContact")===!1)&&(e+=i.id,e+=";")}),!_.isUndefined(this.options.recipientsAreFinalized)&&this.options.recipientsAreFinalized&&_.each(this.options.recipients,function(i){i&&-1===e.search(i)&&(e+=i,e+=";")}),e},populateAutoCCollectionFromRegistry:function(){var e,i=this.options.autoCCollection;_.isUndefined(this.registryResponse.User)||_.isUndefined(this.registryResponse.User.addressList)||(e=this.registryResponse.User.addressList.split(";"),e.pop(),_.each(e,function(e){i.add({email:e,isLocalContact:!1})}))}})}),define("pdmplugins/send-for-sign/js/views/sfs-new-landing-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-new-landing-page-template","pdmplugins/send-for-sign/js/templates/sfs-new-file-name-template","pdmplugins/send-for-sign/js/templates/sfs-email-block-template","pdmplugins/send-for-sign/js/templates/sfs-guide-template","pdmplugins/send-for-sign/js/templates/sfs-guide-template-new","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/utils/util","core/utils/truncate","core/utils/css-util","core/utils/file-types","pdmplugins/send-for-sign/js/utils/sfs-ts-utils","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/utils/image-loader","core/utils/http-util","pdmplugins/send-for-sign/js/views/sfs-autocomplete-view","pdmplugins/send-for-sign/js/ops/plugin/desktop-fetching-autocomplete-list-op","pdmplugins/send-for-sign/js/ops/plugin/desktop-getting-subscription-levels-op"],function(e,i,t,s,n,o,a,r,l,d,p,c,h,u,g,f){var S,m=!1,E=!1,A=25,v=11,C=255,I=!1,T=!1,O=!1,b=!1,w=!1,R=0,L=0,F=!0,N=[],P=[];
return i.SFSNewLandingPageView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._fileNameTemplate=_.template(s),this._emailIdTemplate=_.template(n),this._landingPageUiModel=this.options.sfsAppLandingPageUiModel,this.$currentVisibleThumbNail="fileName",this._addUiModelEventListeners(),this._addKeyEventListener();var i=_.extend({},this.options,{searchString:""});this.PGCOp=e.opFactory.create("GettingPGCSuggestionsOp",i)},events:function(){return{"click .learn-more":"_onLearnMoreBtnClick","click .sfs-guide-lean-more-link":"_onLearnMoreLinkClickAddSignersGuide","click .sfs-add-files":"_onAddFilesBtnClick","click .sfs-selected-file-item-new .file-remove-new":"_onSelectedFileItemRemoveClick","click .sfs-file-action-btn-new.1":"_onSFSNextBtnClick","click #sfs-file-action-btn-new-2":"_onSFSAdvancedSignBtnClick","keyup .sfs-email-textarea":"_onKeyUpEmaiTextarea","keydown .sfs-email-textarea":"_onKeyDownEmailTextarea","paste .sfs-email-textarea":"_onPasteEmailTextarea","focusout .sfs-email-textarea ":"_onFocusOutEmailTextarea","input .sfs-email-textarea ":"_onInputEmailTextarea","keyup .sfs-email-cc-textarea":"_onKeyUpCCEmaiTextarea","keydown .sfs-email-cc-textarea":"_onKeyDownCCEmailTextarea","paste .sfs-email-cc-textarea":"_onPasteCCEmailTextarea","focusout .sfs-email-cc-textarea ":"_onFocusOutCCEmailTextarea","input .sfs-email-cc-textarea ":"_onInputCCEmailTextarea","click .email-addcc":"_OnclickAddCC","click .email-hidecc":"_OnClickHideCC","click #close-button":"_closeError","click .dropbtn":"_roleDropdownClick","mouseenter .signer":"_OnMouseEnterSignerBlock","mouseleave .signer":"_OnMouseLeaveSignerBlock","mouseenter .approver":"_OnMouseEnterApproverBlock","mouseleave .approver":"_OnMouseLeaveApproverBlock","mouseenter .sfs-guide-new":"_OnMouseEnterGuideBlock","mouseleave .sfs-guide-new":"_OnMouseLeaveGuideBlock","click .sfs-email-id-item .email-remove":"_onSelectedEmailRemoveClick","keydown .sfs-subject-list":"_onKeyDownSubjectTextArea","keydown .sfs-message-list":"_onKeyDownMessageTextArea","mouseenter .sfs-selected-file-item-new":"_onMouseEnterSelectedFileItem","mouseleave .sfs-selected-file-item-new":"_onMouseLeaveSelectedFileItem","mouseenter .email-address-help":"_onMouseEnterEmailHelpIcon","mouseleave .email-address-help":"_onMouseLeaveEmailHelpIcon","click .sfs-to-email-block":"_onEmailToAreaClick","click .sfs-cc-email-block":"_onCCAreaClick","focus .sfs-to-email-block":"_getEmailContacts","focus .sfs-cc-email-block":"_getEmailContacts","click .sfs-guide-new-close":"_hideNewGuide"}},_OnMouseEnterGuideBlock:function(){F=!1},_OnMouseLeaveGuideBlock:function(){F=!0},_closeOpenDropdownandGuides:function(){this.$roleDropDown.hasClass("hidden")||(this.$roleDropDown.addClass("hidden"),this.$signerBlockInRoleDropDown.hasClass("SignerHover")&&(this.$signerBlockInRoleDropDown.removeClass("SignerHover"),this._roleDropdownSelectSignerClick(this.$signerBlockInRoleDropDown)),this.$approverBlockInRoleDropDown.hasClass("ApproverHover")&&(this.$approverBlockInRoleDropDown.hasClass("ApproverHover"),this._roleDropdownSelectApproverClick(this.$approverBlockInRoleDropDown)),event.stopPropagation()),this._hideButtonGuide(),this._autocompleteControl&&this._autocompleteControl.setFilter(void 0)},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var i=e.keyCode,t=$(e.target),s=$.Event("click");switch(i){case 13:t.trigger(s),e.preventDefault();break;case 9:var n=!this.$EmailErrorParent.hasClass("hidden"),o=n?this.$closeButton:this.$learnMore;this.$emailTextarea[0]==t[0]?e.shiftKey?(o.focus(),e.stopPropagation(),e.preventDefault()):n&&(this.$(".email-addcc").focus(),this.$(".email-addcc").focus(),e.stopPropagation(),e.preventDefault()):e.shiftKey||o[0]!=t[0]?this.$(".email-addcc")[0]==t[0]?this._onMouseEnterEmailHelpIcon():this.$(".email-address-help")[0]==t[0]&&this._onMouseLeaveEmailHelpIcon():(this.$emailTextarea.focus(),e.stopPropagation(),e.preventDefault())}},_addUiModelEventListeners:function(){this._landingPageUiModel.on("change:is_refreshed",this._refreshPageContent),this._landingPageUiModel.on("change:is_visible",this._onVisibilityChange)},render:function(){if(e.View.prototype.render.call(this),!this._landingPageUiModel.get("is_visible"))return this.$el.hide(),this;this.$el.show(),0===this.$el.children().length&&(this.$el.html(this._template({title:r.SFS_LANDING_TITLE,addcc:r.LP_ADD_CC,subtitle:r.SFS_LANDING_DESCRIPTION,subtitle3:r.LP_SUBTITLE3_NEW,totitle:r.SFS_LANDING_STR,toMessage:r.SFS_LANDING_MSG5,add_files:r.SFS_ADD_FILES,selected_files:r.LP_FILES,no_email_error:r.LP_NO_EMAIL_ERROR,invalid_email_error:r.LP_INVALID_EMAIL_ERROR,to_email_placeholder:r.SFS_LANDING_MSG7,cc_email_placeholder:r.LP_CC_EMAIL_PLACEHOLDER,subject_placeholder:r.LP_SUBJECT_PLACEHOLDER,roledropdown_signer:r.LP_SIGNER,roledropdown_approver:r.LP_APPROVER,help_icon_text:r.LP_HELP_ICON_TEXT,cc:r.LP_CC,hide:r.LP_HIDE,advanced_sign:r.SFS_LANDING_MSG4,advanced_tooltip:r.ADVANCED_BUTTON_TOOLTIP,disclaimer1:r.LP_DISCLAIMER1,disclaimer2:r.LP_DISCLAIMER2,disclaimer3:r.GET_A_LINK_ADVISORY2})),this._logLandingPageUsers(),this._updateSignedInStatusInModal(),this._initWrappers(),this._refreshPageContent(),this._UpdatePreviouslyUsedContacts()),this._renderChildViews(),this._registerEventsToCloseRoleDropDown(),this._LogSignActivity();var t=i.QueryParams.reqSignReengageBannerStatus;return void 0!=t&&"true"==t&&(this._prepopulateFields(),i.QueryParams.reqSignReengageBannerStatus="false"),this},_initWrappers:function(){this.$fileItemsContainerElem=this.$(".sfs-selected-files-list-new"),this.$emailBlock=this.$(".sfs-to-email-block"),this.$emailIdList=this.$(".sfs-to-email-ids-list"),this.$emailIdCCList=this.$(".sfs-cc-email-ids-list"),this.$emailTextarea=this.$(".sfs-email-textarea"),this.$emailCCTextarea=this.$(".sfs-email-cc-textarea"),this.$messageBody=this.$(".sfs-message-list"),this.$subject=this.$(".sfs-subject-list"),this.$fileItemsHeadingElem=this.$(".sfs-selected-files-heading-container-new"),this.$actionBtnsGrpElem=this.$(".sfs-action-btns-group-new"),this.$actionBtnsContainerElem=this.$(".sfs-action-btns-group-new-container"),this.$actionBtn1Elem=this.$(".sfs-file-action-btn-new.1"),this.$actionBtn2Elem=this.$(".sfs-file-action-btn-new.2"),this.$advancedSignBtn=this.$("#sfs-file-action-btn-new-2"),this.$actionBtn1DescrElem=this.$(".description-text.1"),this.$actionBtn2DescrElem=this.$(".description-text.2"),this.$actionBtnSeparatorElem=this.$(".sfs-action-btn-separator"),this.$appInfoContainer=this.$(".sfs-app-info-container"),this.$appInfoTxt1Elem=this.$(".sfs-app-info-container .info-txt.1"),this.$appInfoTxt2Elem=this.$(".sfs-app-info-container .info-txt.2"),this.$appInfoTxt3Elem=this.$(".sfs-app-info-container .info-txt.3"),this.$docThumbnail=this.$(".sfs-current-thumbnail-row"),this.$EmailError=this.$(".email-error"),this.$EmailErrorMsg=this.$(".email-error-msg"),this.$EmailErrorParent=this.$(".email-error-parent"),this.$addCCBlock=this.$(".sfs-cc-email-fullblock"),this.$autocompleteBox=this.$(".share-autocomplete-box"),this.$learnMore=this.$(".learn-more"),this.$closeButton=this.$("#close-button"),this.$previewImage=this.$(".sfs-preview-image"),this.$signerBlockInRoleDropDown=this.$(".signer"),this.$approverBlockInRoleDropDown=this.$(".approver"),this.$roleDropDown=this.$(".role-dropdown"),R=this._calculateUtf8Length(this.$emailTextarea[0].placeholder),L=this._calculateUtf8Length(this.$emailCCTextarea[0].placeholder),this.$emailTextarea.css("width",8*R+"px"),this.$emailCCTextarea.css("width",8*L+"px")},_logLandingPageUsers:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.getFillSignReaderFreeTransVariant(this.options);this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.sessionApi.isSignedInReader()?[i,u.NEW_LANDING_PAGE,u.SIGNED_USER]:[i,u.NEW_LANDING_PAGE,u.UNSIGNED_USER])},_updateSignedInStatusInModal:function(){this.options.appApi.sessionApi.isSignedInReader()?this._landingPageUiModel.set("landedAsSignedInUser",!0):this._landingPageUiModel.set("landedAsSignedInUser",!1)},_calculateUtf8Length:function(e){for(var i=0,t=0;t<e.length;t++){var s=e.charCodeAt(t);128>s?i++:i+=s>127&&2048>s?1.5:2}return i},_renderChildViews:function(){if(this._landingPageUiModel.get("enable_autocomplete")){var e=_.extend({},this.options,{editControl:this.$emailTextarea,emailView:this});this.$autocompleteBox.show(),this._renderChildView("_autocompleteControl",i.AutocompleteView,this.$autocompleteBox,e)}else this._autocompleteControl&&this.removeChildView(this._autocompleteControl),this.$autocompleteBox.hide()},_onVisibilityChange:function(){this.render()},_refreshPageContent:function(){this._updateFileItemsList(),w||(this._updateToListWithPrepareFormRecipients(),w=!0),this._updateActionButtonLabels(),this._updateActionButtonEnabledState(),this._updateActionButtonDescription(),this._updateAppInfoTexts(),this._adjustCSS(),this._focusOnSelectButton(),this._LogSignActivity()},_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,i){var t=i.params,s=t.split(";"),n="",o="",a=-1,r=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)),r.get(o)&&r.remove(o),r.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))},_adjustToEmailTextAreaMargin:function(){var e=$(".sfs-to-email-ids-list > div").length;e>0?this.$emailTextarea.css("margin-left","4px"):this.$emailTextarea.css("margin-left","24px")},_getEmailContacts:function(){this._showGuideonButton(r.LP_GUIDE_ADD_SIGNERS_TEXT);var t=this._getResolvedPromise();e.Util.isCEF()&&this._landingPageUiModel.get("autocomplete_local_contacts_imported")===!1&&(t=this._importLocalEmailContacts(),t.then(_.bind(function(){this._landingPageUiModel.set({autocomplete_local_contacts_imported:!0})},this))),e.Util.isCEF()&&this.options.appApi.sessionApi.isSignedInReader()&&i.opFactory.create("DesktopFetchingAutocompleteListOp",this.options).run(),e.Util.isCEF()&&this._landingPageUiModel.get("autocomplete_msgraph_contacts_imported")===!1&&this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().done(_.bind(function(){i.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().done(_.bind(function(i){if(i){var t=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),s=u.SEND_FOR_SIG,n=u.START,o="Get MSGraph Contacts for SignedIn User";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),t.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),this._landingPageUiModel.set({autocomplete_msgraph_contacts_imported:!0})},this),_.bind(function(){},this))}},this))},this))},this))},_hideNewGuide:function(){F=!0,this._hideButtonGuide()},_UpdatePreviouslyUsedContacts:function(){this._userSignedIn=this.options.appApi.sessionApi.isSignedInReader(),this._userConnected=this.options.appApi.networkConnectivityApi.isOnline(),this._userSignedIn&&this._userConnected&&(this.options.readRegistry=!0,i.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run())},_registerEventsToCloseRoleDropDown:function(){_.bindAll(this,"_closeOpenDropdownandGuides"),$("html").bind("mousewheel",this._closeOpenDropdownandGuides),$("body").bind("mousedown",this._closeOpenDropdownandGuides),$(window).on("resize",this._closeOpenDropdownandGuides)},_updateToListWithPrepareFormRecipients:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.prepareFormsEmailRecipients().then(_.bind(function(e){var i=0;if(e.length>0){var t=e.split(",");_.each(t,_.bind(function(e){e=$.trim(e);var t=this._validateEmail(e);if(t){var s=$(this._emailIdTemplate({emailID:e,ariaRemoveLabel:this._getRemoveAriaLabel(e)}));this._addToEmailIdList(this.$emailIdList,s,!1),i=1}},this)),i&&this._showGuideonButton(r.LP_NEXT_GUIDE_TEXT)}},this))},this))},_addToEmailIdList:function(e,i,t){i.appendTo(e),t?this.$emailCCTextarea[0].placeholder="":this.$emailTextarea[0].placeholder=""},_removeFromEmailIdList:function(e,i){e.children().last().remove(),i?(this.$emailCCTextarea[0].placeholder=r.LP_CC_EMAIL_PLACEHOLDER,0!=P.length&&P.pop()):(this.$emailTextarea[0].placeholder=r.SFS_LANDING_MSG7,0!=N.length&&N.pop()),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"storeEmailIdsList",methodArgs:{EmailVector:N,CCEmailVector:P}})},this))},_updateActionButtonLabels:function(){this._landingPageUiModel.get("action_btn1_visible")?(this.$actionBtn1Elem.val(this._landingPageUiModel.get("action_btn1_label")),this.$actionBtn1Elem.removeClass("hidden")):this.$actionBtn1Elem.addClass("hidden"),this._landingPageUiModel.get("action_btn2_visible")?(this.$actionBtn2Elem.val(this._landingPageUiModel.get("action_btn2_label")),this.$actionBtnSeparatorElem.html(this._landingPageUiModel.get("action_btn_separator_label")),this.$actionBtn2Elem.removeClass("hidden"),this.$actionBtnSeparatorElem.removeClass("hidden")):(this.$actionBtn2Elem.addClass("hidden"),this.$actionBtnSeparatorElem.addClass("hidden"))},_updateActionButtonEnabledState:function(){this._landingPageUiModel.get("action_btn1_enabled")?this.$actionBtn1Elem.removeClass("disabled"):this.$actionBtn1Elem.addClass("disabled"),this._landingPageUiModel.get("action_btn2_enabled")?this.$actionBtn2Elem.removeClass("disabled"):this.$actionBtn2Elem.addClass("disabled")},_updateActionButtonDescription:function(){this._landingPageUiModel.get("action_btn_descr_visible")?(this.$actionBtn1DescrElem.html(this._landingPageUiModel.get("action_btn1_descr_txt")),this.$actionBtn2DescrElem.html(this._landingPageUiModel.get("action_btn2_descr_txt")),this.$actionBtn1DescrElem.removeClass("hidden"),this.$actionBtn2DescrElem.removeClass("hidden")):(this.$actionBtn1DescrElem.addClass("hidden"),this.$actionBtn2DescrElem.addClass("hidden"))},_updateAppInfoTexts:function(){this._landingPageUiModel.get("app_info_txt_visible")?(this.$appInfoContainer.removeClass("hidden"),this.$appInfoTxt1Elem.html(this._landingPageUiModel.get("app_info_txt1")),this.$appInfoTxt1Elem.removeClass("hidden"),this.$appInfoTxt2Elem.html(this._landingPageUiModel.get("app_info_txt2")),this.$appInfoTxt2Elem.removeClass("hidden"),this.$appInfoTxt3Elem.html(this._landingPageUiModel.get("app_info_txt3")),this.$appInfoTxt3Elem.removeClass("hidden")):(this.$appInfoContainer.addClass("hidden"),this.$appInfoTxt1Elem.addClass("hidden"),this.$appInfoTxt2Elem.addClass("hidden"),this.$appInfoTxt3Elem.addClass("hidden"))},_getRemoveAriaLabel:function(e){return _.template(r.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:r.SEND_REMOVE})},_updateFileItemsList:function(){var e,i,t,s=this._landingPageUiModel.get("selected_files"),n=this._landingPageUiModel.get("file_collection_visible"),o="",a=this.$messageBody.val();if(T||(a=r.LP_MESSAGE_TEXT),n){if(!I){o=s[0].get("name");var l=o.lastIndexOf(".");-1!==l&&(o=o.substr(0,l)),this.$subject.val(o)}this.$fileItemsContainerElem.empty(),_.each(s,_.bind(function(s){e=s.get("name"),t=s.get("path"),i=$(this._fileNameTemplate({fileName:e,ariaRemoveLabel:this._getRemoveAriaLabel(e)})),i.data("file",s),this.$fileItemsContainerElem.append(i)},this)),this.$fileItemsContainerElem.removeClass("hidden"),this.$fileItemsHeadingElem.removeClass("hidden"),1===this.options.appApi.rnaApiObj.esApi.shouldShowAdvanceSign()?this.$advancedSignBtn.show():this.$advancedSignBtn.hide()}else this.$fileItemsContainerElem.addClass("hidden"),this.$fileItemsHeadingElem.addClass("hidden"),this.$advancedSignBtn.hide(),I||this.$subject.val("");this.$messageBody.val(a)},_adjustCSS:function(){this._adjustAppsInfoContainerCSS(),this._adjustFileItemsCSS(),this._adjustActionButtonsCSS()},_focusOnSelectButton:function(){this.$emailTextarea.focus()},_adjustAppsInfoContainerCSS:function(){var e=this.$fileItemsContainerElem.css("margin-left");this.$appInfoContainer.css("margin-left",e)},_adjustActionButtonsCSS:function(){var e=this.$actionBtn1Elem.width()+p.getCssNum(this.$actionBtn1Elem,"padding-left")+p.getCssNum(this.$actionBtn1Elem,"padding-left"),i=this.$actionBtn2Elem.width()+p.getCssNum(this.$actionBtn2Elem,"padding-left")+p.getCssNum(this.$actionBtn2Elem,"padding-left"),t=Math.max(e,parseInt(this.$actionBtn1Elem.css("min-width"),10)),s=Math.max(i,parseInt(this.$actionBtn2Elem.css("min-width"),10));this.$actionBtn1DescrElem.width(t),this.$actionBtn2DescrElem.width(s)},_adjustFileItemsCSS:function(){this.$fileItemsContainerElem.children().each(function(){var e=$(this),i=$(".file-name",e),t=$(".file-remove-new",e),s=e.innerWidth()-parseInt(i.css("text-indent"),10);s-=t.outerWidth(),d.truncateElementText(i,s)});var e=this._getSelectedFilesCount();e>0?this.$actionBtn1Elem.removeClass("no-file-selected"):this.$actionBtn1Elem.addClass("no-file-selected")},_getSelectedFilesCount:function(){var e=this._landingPageUiModel.get("selected_files");return _.isEmpty(e)?0:e.length},_onLearnMoreBtnClick:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,u.LEARN_MORE,u.CLICKED]);var t;t=l.isReader()?r.LANDING_PAGE_LEARN_MORE_RDR:r.LANDING_PAGE_LEARN_MORE_ACRO,_.isEmpty(t)||this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(t)},this))},_onLearnMoreLinkClickAddSignersGuide:function(){this.options.appApi.siteCatalystApi.logScEvent([u.SEND_FOR_SIG,u.LEARN_MORE,u.CLICKED]);var e;e=l.isReader()?r.CM_LEARN_MORE_RDR:r.CM_LEARN_MORE_ACRO,_.isEmpty(e)||this.options.appApi.rnaApi.done(_.bind(function(i){i.openDecoratedUrl(e)},this))},_onAddFilesBtnClick:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([u.TOOLS,i,u.ADD_FILES,u.CLICKED]),this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","browse_file")},_posAminusB:function(e,i){return{left:e.left-i.left,top:e.top-i.top}},_hideButtonGuide:function(e){if(e=e||S,F&&e)if(e.guide&&e===S)e.removeTimer&&(clearTimeout(e.removeTimer),delete e.removeTimer),e.guide.remove(),e.removeFunc&&e.removeFunc(),S=null,e.nextGuide&&this._showButtonGuide(e.nextGuide);else{for(var i=S;i&&i.nextGuide!==e;)i=i.nextGuide;i&&(i.nextGuide=e.nextGuide),e.removeFunc&&e.removeFunc()}},_findButtonGuide:function(e){for(var i=S;i&&e&&!e(i);)i=i.nextGuide;return i},_showButtonGuide:function(e){var i=this,t=!1,s=!1;if(e.text===r.LP_NEXT_GUIDE_TEXT?t=!0:e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT&&(s=!0),e=_.extend({top:0,left:0,text:"",parent:$(document),duration:5e3,arrowPosition:40,clickToRemove:!0,important:!1,getPreference:function(){if(t){var e=i.options.appApi.rnaApiObj.esApi.isSFSCoachmarkAlreadyDisplayed();return e||m}if(s){var e=i.options.appApi.rnaApiObj.esApi.isAddSignersCoachmarkAlreadyDisplayed();return e||E}return!1},setPreference:function(){t?(m=!0,i.options.appApi.rnaApiObj.esApi.setSFSCoachmarkAlreadyDisplayed()):s&&(E=!0)}},e),s&&(e.duration=1e4),e.force||e.redo||!e.getPreference()){if(t&&this.options.appApi.siteCatalystApi.logScEvent([u.SEND_FOR_SIG,u.NEXT_GUIDE_SHOWN]),S){if(e.noQueueIfShowing&&findGuide(function(i){return i.guideID===e.guideID}))return e;if(!e.important||S.important){for(var n=S;n.nextGuide;){if(e.important&&!n.nextGuide.important){e.nextGuide=n.nextGuide;break}n=n.nextGuide}return n.nextGuide=e,e}S.removeTimer&&(clearTimeout(S.removeTimer),delete S.removeTimer),S.guide.remove(),delete S.guide,S.redo=!0,e.nextGuide=S}e.redo||e.setPreference();var l;s?(l=e.guide=$(_.template(a,{title:r.LP_GUIDE_ADD_SIGNERS_TITLE,text:r.LP_GUIDE_ADD_SIGNERS_TEXT,learn:r.LP_GUIDE_LEARN_MORE,guideType:e.guideType||""})),e.arrowPosition=10):l=e.guide=$(_.template(o,{text:e.text,guideType:e.guideType||""}));var d=l.find(".sfs-guide-arrow");d.addClass(e.arrow),e.parent.append(l);var p="left";switch(e.arrow){case"up":e.initialPosition=s?{left:e.left-10,top:e.top+d.height()}:{left:e.left-l.outerWidth(),top:e.top+d.height()};break;case"down":e.initialPosition={left:e.left-l.outerWidth(),top:e.bottom-d.height()-l.outerHeight()};break;case"left":e.initialPosition={left:e.left+d.width(),top:e.top};break;case"right":e.initialPosition={left:e.right,top:e.top},p="right"}t?l.css("top",e.initialPosition.top+"px").css(p,e.initialPosition.left+"px"):l.css("top",e.initialPosition.top+"px").css(p,e.initialPosition.left+20+"px"),d.css("up"===e.arrow||"down"===e.arrow?"left":"top",s?e.arrowPosition:l.outerWidth()-e.arrowPosition),e.width&&l.css("width",e.width+"px"),e.maxWidth&&l.css("max-width",e.maxWidth+"px"),l.css("cursor","default"),S=e,e.clickToRemove&&(l.css("cursor","pointer"),l.click(function(){i._hideButtonGuide()})),e.addFunc&&!e.redo&&e.addFunc(l),e.duration&&(e.removeTimer=_.delay(function(e){delete e.removeTimer,l.fadeOut(function(){i._hideButtonGuide()})},e.duration,e)),delete e.redo}return e},_setGuidePlacement:function(e){var i,t,s,n=!1;t=this.$("#sfs-new-landing-page-content"),e.text===r.LP_NEXT_GUIDE_TEXT?(s=this.$(".sfs-action-btns-group-new"),i=this.$(".sfs-file-action-new-btn-and-descr")):e.text===r.LP_HELP_ICON_TEXT?(s=this.$(".sfs-general-heading-addcc"),i=this.$(".email-addcc")):e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT&&(s=this.$(".sfs-email-list"),i=this.$(".sfs-to-email-block"),n=!0);var o=(this._posAminusB(s.offset(),t.offset()),i.offset());e.left=s.position().left+s.outerWidth(),e.left=e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT?i.position().left:Math.max(10,e.left);var a=o.top+i.height()-$(window).scrollTop(),l=i.position().top;a>$(window).height()-e.guideHeight?(e.bottom=l,e.arrow="down",e.bottom=Math.min(t.height()-10,e.bottom)):(e.top=l+(i.height()||s.height()),e.arrow="up",e.top=Math.max(10,e.top))},_showGuideonButton:function(e){if(e===r.LP_NEXT_GUIDE_TEXT){if("Next"!=this.$actionBtn1Elem.val())return;if(!this.options.appApi.rnaApiObj.esApi.shouldShowSFSCoachmark())return}var i={preference:"",text:e,guideType:"",guideHeight:120,important:!0},t=(this._findButtonGuide(_.bind(function(e){return e.field===this&&e.text===i.text},this)),this),s=$.extend({field:t,parent:this.$("#sfs-new-landing-page-content")},i);this._setGuidePlacement(s),this._showButtonGuide(s)},_validateEmail:function(e){var i=/^(([^<>()[\]\\.,;:\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,}))$/;return i.test(e)},_setRecipientModels:function(e){var i;this.$emailTextarea.hasClass("activeEmailTextarea")?i=this.$emailTextarea.val():this.$emailCCTextarea.hasClass("activeEmailTextarea")&&(i=this.$emailCCTextarea.val()),this._setRecipientsFromText(i,e)},_removeLastEmailAddress:function(){},_parseRecipients:function(e){var i;return e=e.replace(/(\r\n|\n|\r)/gm,""),i=e.split(/\s*[,;\s]+\s*/)},_iterateAndValidateEmails:function(e){var i="",t="";t=e?this.$emailCCTextarea.val():this.$emailTextarea.val();for(var s=this._parseRecipients(t),n=s.length,o=0;n>o;o++){var a=s[o];if(a){var l=this._validateEmail(a);if(l){var d=$(this._emailIdTemplate({emailID:a,ariaRemoveLabel:this._getRemoveAriaLabel(a)}));if(e){d.find("#dropdownMenu").css("display","none"),d.find(".caret").css("display","none"),this._addToEmailIdList(this.$emailIdCCList,d,!0),this.$emailCCTextarea.val("");var p=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),c=p+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([c,u.EMAIL_CC_ADDED])}else{this._addToEmailIdList(this.$emailIdList,d,!1),1==this.$emailIdList.children().length&&this._showGuideonButton(r.LP_NEXT_GUIDE_TEXT),this.$emailTextarea.val("");var p=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),c=p+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([c,u.EMAIL_TO_ADDED])}}else 0!=i.length&&(i+=","),i+=a}}i.length>0&&(this._showErrorRedRibbon(i+r.LP_INVALID_EMAIL_ERROR,!1),e?this.$emailCCTextarea.val(i):this.$emailTextarea.val(i))},_onFocusOutEmailTextarea:function(){this._autocompleteControl&&this._autocompleteControl.setFilter(void 0),this._iterateAndValidateEmails(!1)},_onKeyUpEmaiTextarea:function(e){var i=e.which?e.which:e.keyCode;13==i&&(e.preventDefault(),this._onFocusOutEmailTextarea())},_showErrorRedRibbon:function(e,i){this.$EmailErrorMsg.html(e),this.$EmailErrorParent.removeClass("hidden"),this.$closeButton.focus(),i&&this.$emailBlock.css("border","1px solid red")},_onKeyDownEmailTextarea:function(e){this._hideButtonGuide(),O||(O=!0,this.options.appApi.siteCatalystApi.logScEvent([u.SEND_FOR_SIG,u.EMAIL_TO_EDITED]));var i=e.which?e.which:e.keyCode,t=$(".sfs-to-email-ids-list > div").length,s=8*this.$emailTextarea.val().length,n=this.$emailTextarea.width(),o=this.$emailBlock.width();if(s>n&&o>s&&this.$emailTextarea.css("width",s+32+"px"),8!=i&&46!=i&&t>=A)this._showErrorRedRibbon(r.LP_RECIPIENTS_LIMITS_ERROR,!1),e.preventDefault();else if(40===i)this._autocompleteControl&&this._autocompleteControl.selectDown();else if(38===i)this._autocompleteControl&&this._autocompleteControl.selectUp();else if(186===i||188===i){var a=e.key;_.defer(_.bind(function(){this._setRecipientModels(a)},this))}else if(13===i)this.$emailTextarea.css("width",8*R+"px"),this._autocompleteControl&&(this._autocompleteControl.makeChoice(!0)||_.defer(_.bind(function(){this.abortPGCRequest(),this._setRecipientModels()},this))),e.preventDefault();else{if(8!==i)return 13!=i;this.$emailTextarea.val()||this._removeFromEmailIdList(this.$emailIdList,!1)}this._adjustToEmailTextAreaMargin()},_onPasteEmailTextarea:function(e){O||(O=!0,this.options.appApi.siteCatalystApi.logScEvent([u.SEND_FOR_SIG,u.EMAIL_TO_EDITED]));var i=this.$emailBlock.width();this.$emailTextarea.css("width",i+"px");var t=$(".sfs-to-email-ids-list > div").length;t>=A&&(this._showErrorRedRibbon(r.LP_RECIPIENTS_LIMITS_ERROR,!1),e.preventDefault())},_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(i){i.length>0&&(this._landingPageUiModel.set("pgcSuggestionsCollection",i),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())},_onInputEmailTextarea:function(){var e;this.$emailCCTextarea.removeClass("activeEmailTextarea"),this.$emailTextarea.removeClass("activeEmailTextarea");var i=$(".sfs-landing-page-container").offset(),t=this.$emailTextarea.offset(),s=this.$emailTextarea.outerHeight();this.$autocompleteBox.css("top",t.top-i.top+s+10),this.$autocompleteBox.css("left",t.left),this._autocompleteControl&&(e=this.$emailTextarea.val(),this.$emailTextarea.addClass("activeEmailTextarea"),this._setAutocompleteFilterValue(e))},_onFocusOutCCEmailTextarea:function(){this._autocompleteControl&&this._autocompleteControl.setFilter(void 0);this._iterateAndValidateEmails(!0)},_onKeyUpCCEmaiTextarea:function(e){var i=e.which?e.which:e.keyCode;13==i&&(e.preventDefault(),this._onFocusOutCCEmailTextarea())},_onKeyDownCCEmailTextarea:function(e){b||(b=!0,this.options.appApi.siteCatalystApi.logScEvent([u.SEND_FOR_SIG,u.EMAIL_CC_EDITED]));var i=e.which?e.which:e.keyCode,t=$(".sfs-cc-email-ids-list > div").length,s=8*this.$emailCCTextarea.val().length,n=this.$emailCCTextarea.width(),o=this.$emailBlock.width();if(s>n&&o>s&&this.$emailCCTextarea.css("width",s+32+"px"),8!=i&&46!=i&&t>=v)this._showErrorRedRibbon(r.LP_CC_LIMITS_ERROR,!1),e.preventDefault();else if(40===i)this._autocompleteControl&&this._autocompleteControl.selectDown();else if(38===i)this._autocompleteControl&&this._autocompleteControl.selectUp();else if(186===i||188===i){var a=e.key;_.defer(_.bind(function(){this._setRecipientModels(a)},this))}else if(13===i)this.$emailCCTextarea.css("width",8*L+"px"),this._autocompleteControl&&(this._autocompleteControl.makeChoice(!0)||_.defer(_.bind(function(){this._setRecipientModels()},this)));else{if(8!==i)return 13!=i;this.$emailCCTextarea.val()||this._removeFromEmailIdList(this.$emailIdCCList,!0)}},_onPasteCCEmailTextarea:function(e){b||(b=!0,this.options.appApi.siteCatalystApi.logScEvent([u.SEND_FOR_SIG,u.EMAIL_CC_EDITED]));var i=this.$emailBlock.width();this.$emailCCTextarea.css("width",i+"px");var t=$(".sfs-cc-email-ids-list > div").length;t>=v&&(this._showErrorRedRibbon(r.LP_CC_LIMITS_ERROR,!1),e.preventDefault())},_onInputCCEmailTextarea:function(){var e;this.$emailCCTextarea.removeClass("activeEmailTextarea"),this.$emailTextarea.removeClass("activeEmailTextarea");var i=this.$emailCCTextarea.offset(),t=this.$emailCCTextarea.outerHeight();this.$autocompleteBox.css("top",i.top+t+10),this.$autocompleteBox.css("left",i.left),this._autocompleteControl&&(e=this.$emailCCTextarea.val(),this.$emailCCTextarea.addClass("activeEmailTextarea"),this._setAutocompleteFilterValue(e))},_OnclickAddCC:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,u.ADD_CC_CLICKED]),this.$addCCBlock.removeClass("hidden"),this.$emailCCTextarea.show().focus()},_OnClickHideCC:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,u.HIDE_CLICKED]),this.$addCCBlock.addClass("hidden")},_closeError:function(){this.$EmailErrorParent.addClass("hidden"),this.$emailBlock.css("border","1px solid #e1e1e1")},_setRecipientsFromText:function(e){this.$emailTextarea.hasClass("activeEmailTextarea")?(this.$emailTextarea.val(""),this.$emailTextarea.val(e),this._onFocusOutEmailTextarea(void 0),this.$emailTextarea.removeClass("activeEmailTextarea"),N.push(e)):this.$emailCCTextarea.hasClass("activeEmailTextarea")&&(this.$emailCCTextarea.val(""),this.$emailCCTextarea.val(e),this._onFocusOutCCEmailTextarea(void 0),this.$emailCCTextarea.removeClass("activeEmailTextarea"),P.push(e)),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"storeEmailIdsList",methodArgs:{EmailVector:N,CCEmailVector:P}})},this))},_prepopulateFields:function(){if(void 0!=i.QueryParams.toList&&(this.$emailTextarea.addClass("activeEmailTextarea"),this._setRecipientsFromText(i.QueryParams.toList),i.QueryParams.toList.split(",").length>=2&&"false"==i.QueryParams.reqSignReengageBannerStatus&&this._showGuideonButton(r.LP_GUIDE_SIGNING_ORDER)),void 0!=i.QueryParams.ccList&&(this.$addCCBlock.removeClass("hidden"),this.$emailCCTextarea.addClass("activeEmailTextarea"),this._setRecipientsFromText(i.QueryParams.ccList)),void 0!=i.QueryParams.subject){var e=this._decode(i.QueryParams.subject);this.$subject.val(e)}if(void 0!=i.QueryParams.body){var e=this._decode(i.QueryParams.body);this.$messageBody.val(e)}this.$(".sfs-file-action-btn-new.1").focus()},_onSelectedFileItemRemoveClick:function(e){var i=$(e.currentTarget).parents(".sfs-selected-file-item-new"),t=i.data("file");this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_removed_file",t),this._landingPageUiModel.set("user_action","removed_file"),e.stopPropagation()},_onSFSAdvancedSignBtnClick:function(){i.isAdvancedSign=!0,this._LogSignActivity();var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=e+"-"+u.SEND_FOR_SIG;return this.options.appApi.siteCatalystApi.logScEvent(i.IsTrialUser===!0?[t,u.ADVANCED_CLICKED,u.FREE_USER]:[t,u.ADVANCED_CLICKED]),this.options.sfsAppTrialBarUiModel.get("is_visible")&&0==this.options.sfsAppTrialBarUiModel.get("remaining_transaction")?void this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"}):void this._onSFSFileActionBtn1Click()
},_onSFSNextBtnClick:function(){i.isAdvancedSign=!1,this._LogSignActivity();var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=e+"-"+h.getFillSignReaderFreeTransVariant(this.options);return this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.sessionApi.isSignedInReader()?i.IsTrialUser===!0?[u.TOOLS,t,u.SPECIFY_WHERE_TO_SIGN_CTA,u.CLICKED,u.FREE_USER]:[u.TOOLS,t,u.SPECIFY_WHERE_TO_SIGN_CTA,u.CLICKED,u.ENTITLED_USER]:[u.TOOLS,t,u.SPECIFY_WHERE_TO_SIGN_CTA,u.CLICKED,u.UNSIGNED_USER]),this.options.sfsAppTrialBarUiModel.get("is_visible")&&0==this.options.sfsAppTrialBarUiModel.get("remaining_transaction")?void this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"}):void this._onSFSFileActionBtn1Click()},_onSFSFileActionBtn1Click:function(){if(!this.$actionBtn1Elem.hasClass("disabled")){var t=this._getSelectedFilesCount();if(t>0){var s=this.$emailTextarea.val();if(s&&!this._validateEmail(s))return void this._showErrorRedRibbon(s+r.LP_INVALID_EMAIL_ERROR,!1);if(s=this.$emailCCTextarea.val(),s&&!this._validateEmail(s))return void this._showErrorRedRibbon(s+r.LP_INVALID_EMAIL_ERROR,!1);var n=this.$el.find(".sfs-to-email-ids-list").children();if(0===n.length&&i.isAdvancedSign===!1)return void this._showErrorRedRibbon(r.LP_NO_EMAIL_ERROR,!0);if(1===n.length){var o=this.options.appApi.usersMeApi.getUserIdentity().email;if(void 0!==o&&n[0].children[1].innerText.toLowerCase()===o.toLowerCase())return void this._showErrorRedRibbon(r.LP_ONLY_SENDER_EMAIL_ERROR,!0)}var a,l=this.$el.find(".sfs-cc-email-ids-list").children(),d=this.$(".sfs-email-id-item"),p="",c="",h=[],g="",f=this;this.options.recipients=[],$.each(d,function(e,i){if(a=i.children[1].innerText,"none"==$(i.children[0].children).eq(0).css("display"))0!=g.length&&(g=g.concat(",")),g=g.concat(a);else if($(i.children[0].children[0].children).eq(0).hasClass("signerImg")){0!=p.length&&(p=p.concat(",")),p=p.concat(a);var t={};t.email=a,t.role="SIGNER",h.push(t)}else{0!=c.length&&(c=c.concat(",")),c=c.concat(a);var t={};t.email=a,t.role="APPROVER",h.push(t)}if(a){var i=$.trim(a.toLowerCase());f.options.autoCCollection.add({email:i}),f.options.recipients.push(a)}}),this._landingPageUiModel.set("user_added_approver_emails",c),this._landingPageUiModel.set("user_added_signer_emails",p),this._landingPageUiModel.set("user_added_cc_emails",g),this._landingPageUiModel.set("user_added_emails_in_order",h),this._landingPageUiModel.set("user_action","email_list_added");var S=_.union(c.split(","),p.split(","),g.split(",")),m=_.clone(this.options.autoCCollection),E=this.options.autoCCollection.filter(function(e){return _.contains(S,e.get("email"))});m.reset(E),_.each(S,function(e){m.add({email:e})}),this.options.appApi.sessionApi.isSignedInReader()&&this._acceptPGCRecipients(m);var A=this.$subject.val();A=A.replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n"),this._landingPageUiModel.set("user_added_subject",A),this._landingPageUiModel.set("user_action","subject_added");var v=this.$messageBody.val();v=v.replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n"),this._landingPageUiModel.set("user_added_message",v),this._landingPageUiModel.set("user_action","message_added");var C=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),I=C+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([I,u.TO_EMAIL_COUNT,n.length]),this.options.appApi.siteCatalystApi.logScEvent([I,u.CC_EMAIL_COUNT,l.length]),this.options.appApi.siteCatalystApi.logScEvent([I,u.FILE_COUNT,t]),this._handleSendClickEvent(),e.Util.isCEF()&&(this.options=_.extend({},this.options,{recipientsAreFinalized:!0})),this.options.appApi.sessionApi.isSignedInReader()&&(this.options.readRegistry=!1,i.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run()),this.options.appApi.rnaApiObj.esApi.setAddSignersCoachmarkAlreadyDisplayed()}else this._handleSelectFileClickEvent();this.$("#sfs-file-action-btn-new-1").removeClass("draw-button-focus-outline")}},_acceptPGCRecipients:function(i){var t=[];i.map(_.bind(function(i){if(_.isUndefined(i.get("token"))){var s=_.extend({},this.options,{newContactEmail:i.get("email")});e.opFactory.create("AcceptingNewPGCSuggestionOp",s).run()}else t.push(i.get("token"))},this));var s=_.extend({},this.options,{tokens:t});e.opFactory.create("AcceptingPGCSuggestionsOp",s).run()},_handlePrepareFormClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","prepare_form_btn_clicked")},_handleSendClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","send_action_btn_clicked")},_handleSelectFileClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","select_action_btn_clicked")},_onSFSManageAgreementsBtnClick:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","manage_agreements_btn_clicked")},_getRenditionUrl:function(e,i,t,s){var n=$.Deferred();return this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){var o=this.options.appApi.baseFilesUrisApi.getRenditionUri()+"assets/"+encodeURIComponent(t)+"/"+e;o+="?"+f.getClientIdQueryParam(),i&&(o+="&page="+i),s===!1&&(o+="&markup=false"),n.resolve(o)},this)),n.promise()},_loadUrl:function(i,t){var s=2200,n=$.Deferred();return this.options.appApi.rnaApi.done(function(o){o.fssApi({methodName:"getRenditionShm",methodArgs:[i,s,t]}).done(function(i){var t=new e.RNAModel(void 0,_.extend({_proxy:i,shouldCache:!1}));t.hasProperty("renditionURL")?n.resolve(t.get("renditionURL")):t.once("change:renditionURL",function(){n.resolve(t.get("renditionURL"))})})}),n.promise()},_loadDocthumbnail:function(){var e=this._landingPageUiModel.get("file_collection_visible");if(e){var i=this._getSelectedFilesCount();if(i>0){var t=this._landingPageUiModel.get("selected_files"),s=t[0].get("name"),n=t[0].get("path");if(this.$currentVisibleThumbNail===n)return;this.$docThumbnail.removeClass("hidden"),this.$currentVisibleThumbNail=n;var o=l.getExtension(s),a=t[0].get("isNonPlatformFile"),r=t[0].get("assetId");this.$previewImage.css("border",""),this.$previewImage.attr("src",""),this.$previewImage.attr("alt",""),this.$previewImage.attr("class","sfs-preview-image");var d=$("<img>").addClass("sfs-preview-image");if(this.$previewImage.replaceWith(d),this.$previewImage=d,this.$(".sfs-recent-file").hasClass("collection-thumb-view")&&this.$(".sfs-recent-file").removeClass("collection-thumb-view"),a)this.$docThumbnail.addClass("hidden"),this._getRenditionUrl("thumbnail",0,r).then(_.bind(function(e){g.cancelPendingRequests(),this.options.appApi.rnaApi.then(_.bind(function(i){i.logIn(!1).then(_.bind(function(i){if(i.get("primary_token")){var t=this.options.sfsAppUiModel;_.each(Ac.Core,function(e){e.HttpUtil.setSessionAttrs(t,i.attributes)});var s=this;g.loadImage(this.$previewImage,e,void 0,!0).then(_.bind(function(){s.$(".sfs-preview-image").css("border","solid 1px rgba(0,0,0,0.2)")},this))}},this))},this))},this));else if("pdf"==o){var p=0,h=this;this._loadUrl(p,n).then(function(e){return h.$(".sfs-preview-image").attr("src",e),h.$(".sfs-preview-image").attr("alt",s),h.$(".sfs-preview-image").css("border","solid 1px rgba(0,0,0,0.2)"),$.Deferred().resolve().promise()})}else{var u=c.getFileInfo("",s).iconCls;this.$(".sfs-recent-file").addClass("collection-thumb-view");var f=$("<div>").addClass("sfs-preview-image");this.$previewImage.replaceWith(f),this.$previewImage=f,this.$previewImage.addClass("collection-item-thumb"),this.$previewImage.addClass(u),this.$previewImage.attr("alt",s),this.$previewImage.css("border","solid 1px rgba(0,0,0,0.2)")}}else this.$docThumbnail.addClass("hidden")}else this.$docThumbnail.addClass("hidden")},_roleDropdownClick:function(e){var i=e.target,t=i.parentElement.parentElement.parentElement.getBoundingClientRect(),s=($(i).attr("class"),this.$(".sfs-email-id-item"));$.each(s,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&$(t).removeClass("clicked")});var n=$(".sfs-landing-page-container").offset();this.$roleDropDown.hasClass("hidden")?(this.$roleDropDown.removeClass("hidden"),this.$roleDropDown.css("top",t.bottom-n.top),this.$roleDropDown.css("left",t.left),$(i).addClass("clicked")):(this.$roleDropDown.addClass("hidden"),$(i).removeClass("clicked")),e.stopPropagation()},_OnMouseEnterSignerBlock:function(e){$(e.currentTarget).addClass("SignerHover")},_OnMouseLeaveSignerBlock:function(e){$(e.currentTarget).removeClass("SignerHover")},_OnMouseEnterApproverBlock:function(e){$(e.currentTarget).addClass("ApproverHover")},_OnMouseLeaveApproverBlock:function(e){$(e.currentTarget).removeClass("ApproverHover")},_roleDropdownSelectSignerClick:function(e){var i=$(e)[0],t=this.$(".sfs-email-id-item");$.each(t,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&($(t).removeClass("clicked"),$(t).hasClass("signerImg")&&$(t).removeClass("signerImg"),$(t).hasClass("approverImg")&&$(t).removeClass("approverImg"),$(t).addClass("signerImg"))}),$(i.parentElement.parentElement).addClass("hidden")},_roleDropdownSelectApproverClick:function(e){var i=$(e)[0],t=this.$(".sfs-email-id-item");$.each(t,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&($(t).removeClass("clicked"),$(t).hasClass("signerImg")&&$(t).removeClass("signerImg"),$(t).hasClass("approverImg")&&$(t).removeClass("approverImg"),$(t).addClass("approverImg"))}),$(i.parentElement.parentElement).addClass("hidden")},_onSelectedEmailRemoveClick:function(e){var i=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=i+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([t,u.EMAIL_REMOVED]);{var s=$(e.currentTarget).parents(".sfs-email-id-item");s.data("email")}s.remove(),e.stopPropagation()},_onKeyDownSubjectTextArea:function(e){var i=e.which?e.which:e.keyCode;if(!I&&9!=i){I=!0;var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([s,u.MESSAGE_SUBJECT_EDITED])}var n=i>=37&&40>=i||8==i||46==i;if(!n&&e.target.textLength==C)return this._showErrorRedRibbon(r.LP_AGREEMENT_CHARLIMITS_ERROR,!1),void e.stopPropagation();var o;13==i&&e.preventDefault(),32==i&&(o=this.$subject.text()+" ",this.$subject.html(o)),e.stopPropagation()},_onKeyDownMessageTextArea:function(e){var i=e.which?e.which:e.keyCode;if(!T&&9!=i){T=!0;var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+u.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([s,u.MESSAGE_BODY_EDITED])}var n;13==i&&(n=this.$messageBody.text()+"\n",this.$messageBody.html(n)),32==i&&(n=this.$messageBody.text()+" ",this.$messageBody.html(n)),e.stopPropagation()},_onMouseEnterSelectedFileItem:function(e){var i=e.currentTarget,t=i.getElementsByClassName("file-remove-new");$(t).removeClass("hidden")},_onMouseLeaveSelectedFileItem:function(){var e=event.currentTarget,i=e.getElementsByClassName("file-remove-new");$(i).addClass("hidden")},_onMouseEnterEmailHelpIcon:function(){this._showGuideonButton(r.LP_HELP_ICON_TEXT)},_onMouseLeaveEmailHelpIcon:function(){this._hideButtonGuide()},_onEmailToAreaClick:function(){this.$emailTextarea.focus()},_onCCAreaClick:function(){this.$emailCCTextarea.focus()},_LogSignActivity:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.logSignServicesActivity()},this))}}),i.SFSNewLandingPageView}),define("pdmplugins/send-for-sign/js/templates/fss-app-send-page-template",[],function(){return'<div id="fss-page-content" class="ui-theme fss-background-theme">   <div class="fss-create-a-link-container ">    <div class="fss-create-a-link-title ui-theme fss-header-text-theme" ><%= title %></div> 	 <div class="fss-close-img" tabindex = 1 aria-label="<%= close %>"> </div>    <div class="fss-service-spacer-new"></div>    <div class="fss-body-text ui-theme fss-normal-text-theme" ><%= bodytext1 %></div>    <div class="fss-service-spacer-new"></div>    <button class="fss-button ui-theme fss-button-theme fss-normal-text-theme" id="fss-cta" tabindex= 2> <%= createlink %></button>   </div>   <div class="fss-progress-container hidden"><div class="fss-inprogress" >	 <div class="create-link-loader"/>    <div class="fss-progress-text fss-body-text ui-theme fss-normal-text-theme" ><%= progresstext %></div>    <div class="fss-service-spacer-new"></div></div>   </div>   <div class="fss-error-container hidden">    <div class="ui-theme fss-err-header-theme fss-create-a-link-title fss-err-title" ><%= errtitle %></div> 	 <div class="fss-caution-img" > </div>	 <div class="fss-close-img" tabindex = 1 aria-label="<%= close %>"> </div>    <div class="fss-service-spacer-new"></div>    <div class="fss-err-msg ui-theme fss-normal-text-theme" ><%= errtext %></div>    <div class="fss-service-spacer-new"></div>    <div class="fss-service-spacer-new"></div>    <button class="fss-button ui-theme fss-button-theme fss-normal-text-theme" id="fss-error-button" tabindex= 2> <%= errbtn %></button>   </div>   <div class="fss-copy-link-container hidden">    <div class="fss-create-a-link-title ui-theme fss-header-text-theme" ><%= copyLinkTitle %></div>    <div class="fss-service-spacer-new"></div> 	 <div class="fss-close-img" tabindex = 1 aria-label="<%= close %>"> </div>    <div class="fss-body-text ui-theme fss-normal-text-theme" ><%= bodytext2 %></div>    <div class="fss-service-spacer-new"></div>    <textarea class="fss-link-text-area theme-container ui-theme fss-background-theme fss-normal-text-theme" readonly="true" align="left" tabindex=2></textarea>    <div class="fss-service-spacer-new"></div>	 <div class="fss-copy-btn-div">    <div class="fss-link-copied hidden ui-theme fss-normal-text-theme" ><%= bodytext3 %></div>    <button class="fss-button ui-theme fss-button-theme fss-normal-text-theme" id="fss-copy-button" tabindex=3> <%= copylink %></button>    </div>   </div></div>'}),define("pdmplugins/send-for-sign/js/views/fss-Send-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/fss-app-send-page-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/views/plugin-content-view"],function(e,i,t,s,n,o){return s.FSSView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._landingPageUiModel=this.options.sfsAppLandingPageUiModel,this._addKeyEventListener()},events:function(){return{"click #fss-cta":"_onBtnClick","click #fss-copy-button":"_onCopyBtnClick","click #fss-error-button":"_onBtnClick","click .fss-link-text-area":"_onTxtAreaClick","click .fss-close-img":"_closeWindow","keydown .fss-close-img":"_keyDownOnCross"}},render:function(){var i=this.$el;return e.PluginContentView.prototype.render.call(this),e.View.prototype.render.call(this),this.$el.show(),console.log("rendering fss view"),0===i.children().length&&(i.html(_.template(n,{title:o.FSS_TITLE_CREATE_LINK,bodytext1:o.FSS_BODY_CREATE_LINK,bodytext2:o.FSS_BODY_LINK_CREATED,bodytext3:o.FSS_LINK_COPIED,createlink:o.FSS_CTA_BTN,copylink:o.FSS_COPY_BTN,errtitle:o.FSS_ERR_TITLE,errtext:o.FSS_LINK_CREATION_FAILED_BODY,errbtn:o.FSS_TRY_AGAIN,progresstext:o.FSS_GENERATING_LINK,copyLinkTitle:o.FSS_TITLE_LINK_CREATED,close:o.SFS_INAPP_SIGN_ERR_CLOSE_BTN})),this._initWrappers()),this._adjustElementWidth(),this},_onTxtAreaClick:function(){this.$fssTxtArea.select()},_keyDownOnCross:function(e){(13==e.which||32==e.which)&&this._closeWindow()},_closeWindow:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"FSSRegisterObject",methodArgs:{State:"closeWindow"}})},_onBtnClick:function(){console.log("CTA clicked"),this._getEventListener(),this.options.sfsAppSendACopyUiModel.reset(),this._hideAllViews(),this.$fssProgressContainer.removeClass("hidden"),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"FSSRegisterObject",methodArgs:{State:"createLinkClicked"}}),this._CreateLink(),this.options.sfsAppSendACopyUiModel.set("workflow_running",!0)},_workflowcomplete:function(){if(0==this.options.sfsAppSendACopyUiModel.get("workflow_running"))return void console.log("No workflow running");console.log("workflow complete");var e=this.options.sfsAppSendACopyUiModel,i=e.get("certified_email_link"),t=e.get("workflow_success_status");1!=t||_.isUndefined(i)||_.isEmpty(i)?(this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"FSSRegisterObject",methodArgs:{State:"LinkGenerationFailed"}}),this._showErrorScreen()):(this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"FSSRegisterObject",methodArgs:{State:"LinkGenerationSuccessful"}}),console.log("workflow::success"),this.$fssTxtArea.val(i),this._hideAllViews(),this.$fssLinkCreated.removeClass("hidden"))},_ValidateSession:function(){console.log("_ValidateSession");var e=this.options.sfsAppSendACopyUiModel.get("selectedFiles");return(_.isUndefined(e)||0==e.length)&&this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc"),this.options.appApi.networkConnectivityApi.isOnline()||this.options.sfsAppSendACopyUiModel.set("failed_workflow","UserOffline"),_.isEmpty(this.options.sfsAppSendACopyUiModel.get("failed_workflow"))?(console.log("ValidateSession: success"),!0):!1},_showErrorScreen:function(){var e=this.options.sfsAppSendACopyUiModel.get("failed_workflow");switch(e){case"NoDoc":this.$fssErrTitle.html(o.FSS_ERR_TITLE),this.$fssErrMsg.html(o.FSS_LINK_CREATION_FAILED_BODY);break;case"UserOffline":this.$fssErrTitle.html(o.FSS_ERR_OFFLINE_TITLE),this.$fssErrMsg.html(o.FSS_ERR_OFFLINE_MSG);break;case"LARGE_FILE_SIZE":this.$fssErrTitle.html(o.FSS_ERR_TITLE),this.$fssErrMsg.html(o.FSS_ERR_LARGE_FILE_MSG);break;default:this.$fssErrTitle.html(o.FSS_ERR_TITLE),this.$fssErrMsg.html(o.FSS_LINK_CREATION_FAILED_BODY)}"INVALID_API_ACCESS_POINT"==e&&t.esApi.authApi.clearESAuthSession(),console.log("workflow::failure"),this._hideAllViews(),this.$fssErrContainer.removeClass("hidden")},_CreateLink:function(){return console.log("create link"),this._ValidateSession()?void s.opFactory.create("SendCompletedCopyOp",_.extend({},this.options)).run().then(_.bind(function(){this._workflowcomplete()},this),_.bind(function(){this._workflowcomplete()},this)):this._showErrorScreen()},_onCopyBtnClick:function(){console.log("copy clicked"),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"FSSRegisterObject",methodArgs:{State:"copyLinkClicked"}}),this.$fssTxtArea.select(),this.options.appApi.rnaApi.done(_.bind(function(e){e.cefBrowserApi({methodName:"handleViewEvent",parameters:["CopyEvent",{}]})},this)),this.$fssLinkCopied.removeClass("hidden")},_adjustElementWidth:function(){var e=window.innerWidth,i=jQuery(":visible");i.each(function(){var i=jQuery(this);i.width()>e&&(console.log("Screen width is "+e+" and the following element is "+i.width(),i),i.css("min-width",e),i.css("width",e))})},_onSFSAppStateUpdatedChange:function(){this.render()},_hideAllViews:function(){this.$fssCreateLink.addClass("hidden"),this.$fssLinkCreated.addClass("hidden"),this.$fssErrContainer.addClass("hidden"),this.$fssProgressContainer.addClass("hidden"),this.$fssLinkCopied.addClass("hidden")},_initWrappers:function(){this.$fssLinkCreated=this.$(".fss-copy-link-container"),this.$fssCreateLink=this.$(".fss-create-a-link-container"),this.$sfsOfflinePage=this.$(".sfs-offline-view-container"),this.$fssLinkCopied=this.$(".fss-link-copied"),this.$fssTxtArea=this.$(".fss-link-text-area"),this.$fssErrContainer=this.$(".fss-error-container"),this.$fssErrTitle=this.$(".fss-err-title"),this.$fssErrMsg=this.$(".fss-err-msg"),this.$fssErrBtn=this.$("#fss-error-button"),this.$fssProgressContainer=this.$(".fss-progress-container")},_onVisibilityChange:function(){this.render()},_refreshPageContent:function(){},_registerEventListener:function(e){e._addEventListener("all",_.bind(function(e){0==e.localeCompare("custom:resetState")&&(console.log("Recieved fss send copy reset event"),this.__resetState())},this))},__resetState:function(){this._hideAllViews(),this.$fssCreateLink.removeClass("hidden"),this.options.sfsAppSendACopyUiModel.set("workflow_running",!1)},_getEventListener:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"FSSRegisterObject"}).done(this._registerEventListener)}}),s.FSSView}),define("pdmplugins/esign/js/templates/es-offline-view-template",[],function(){return'<div class="es-offline-view ui-theme theme-container"><div class="icon"></div><div class="title theme-text"><%= title %></div><div class="content theme-text"><%= content %></div><button class="ok-button control-button theme-button theme-button-label" tabindex= 0><%= ok_button %></button></div>'}),define("pdmplugins/esign/js/views/es-offline-view",["core/ac-core","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/esign/js/templates/es-offline-view-template"],function(e,i,t,s){var n={FULL_SCREEN:0,OVERLAY:1};i.AppOfflineView=e.View.extend({_offline_display_location:19,_offline_display_context:155,initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s),this.offlineTitle="",this.offlineContent="",this.acceptLabel="",this._offlineIPMFetched=!1},events:function(){return _.extend({},e.View.prototype.events,{"click .ok-button":"_onOKButtonClick"})},render:function(){e.View.prototype.render.call(this);var i=this.options.esOfflineUiModel,s=i.get("is_visible"),o=this.$el;if(!s)return o.hide(),this;var a,r=t.QueryParams.app;return a="invite_others"==r||"invite_others_progressive_fields"==r?n.OVERLAY:n.FULL_SCREEN,this._isOfflineIPMFetched()?this._showOfflineIPMView(a):this._fetchOfflineIPM(),$(".ok-button").focus(),this},_initWrappers:function(){this.$title=this.$(".title"),this.$content=this.$(".content"),this.$ok_button=this.$(".ok-button")},_isOfflineIPMFetched:function(){return this._offlineIPMFetched},_showOfflineIPMView:function(e){e===n.FULL_SCREEN?this._showOfflineIPMViewAsFullScreen():this._showOfflineIPMViewAsOverlay()},_showOfflineIPMViewAsFullScreen:function(){var e=this.options.esOfflineUiModel,i=e.get("is_visible");i&&this.$el.show(),0===this.$el.children().length&&(this._updateFullScreenViewContent(),this._initWrappers())},_showOfflineIPMViewAsOverlay:function(){var e=this.options.appApi.dialogApi,i=this.offlineTitle,t=this.offlineContent,s=this.acceptLabel,n=this.options.appApi.dialogApi.SEVERITY_ERROR,o=e.displayHtmlAlert(n,i,t,s);o.then(_.bind(function(){this.options.esOfflineUiModel.set("user_action","okay")},this))},_markOfflineIPMFetched:function(){this._offlineIPMFetched=!0},_onOKButtonClick:function(){this.options.esOfflineUiModel.set("user_action","okay"),"send_for_sign"!==this.options.pluginId&&this.options.appApi.networkConnectivityApi.resetNetworkStatusToOnline()},_updateFullScreenViewContent:function(){this.$el.html(this._template({title:this.offlineTitle,content:this.offlineContent,ok_button:this.acceptLabel}))},_fetchOfflineIPM:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.getIPMMessage([this._offline_display_location,this._offline_display_context]).done(_.bind(function(e){this.offlineTitle=e.get("title"),this.offlineContent=e.get("content"),this.acceptLabel=e.get("acceptLabel"),this._markOfflineIPMFetched(!0),this.$el.empty(),this.render()},this))},this))}})}),define("pdmplugins/send-for-sign/js/views/sfs-app-main-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/send-for-sign-content","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/views/sfs-app-progress-view","pdmplugins/send-for-sign/js/views/sfs-send-for-sign-page-view","pdmplugins/send-for-sign/js/views/sfs-landing-page-view","pdmplugins/send-for-sign/js/views/sfs-new-landing-page-view","pdmplugins/send-for-sign/js/views/fss-Send-view","pdmplugins/esign/js/views/es-offline-view","core/views/plugin-content-view"],function(e,i,t,s,n,o){return s.SFSAppMainView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._landingPageUiModel=this.options.sfsAppLandingPageUiModel,this._addUiModelEventListeners()},render:function(){var i=this.$el;return e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n)),this._initWrappers()),this._renderChildViews(),this},_addUiModelEventListeners:function(){this.options.sfsAppUiModel.on("change:app_state_updated",this._onSFSAppStateUpdatedChange)},_onSFSAppStateUpdatedChange:function(){this.render()},_initWrappers:function(){this.$sfsLandingPage=this.$(".sfs-landing-page-container"),this.$sfsAppProgress=this.$(".sfs-app-progress-container"),this.$sfsSendForSignPage=this.$(".sfs-send-for-sign-page-container"),this.$sfsOfflinePage=this.$(".sfs-offline-view-container"),this.$sfsCreateLinkPage=this.$(".sfs-createLink-container"),this.$sfsTrialBar=this.$(".sfs-trial-bar-container")},_renderChildViews:function(){if(this._landingPageUiModel.get("decidedWhichPageToShow"))this._landingPageUiModel.get("showSFSNewLandingPage")?this._renderSFSNewLandingPageView():this._renderSFSLandingPageView();else{var e=this.options.appApi.rnaApiObj.esApi.isSFSNativeLandingPageRegSet(),i=this.options.appApi.rnaApiObj.esApi.isSFSNewLandingPageIPMEnabled();if(e&&i){this._landingPageUiModel.set("decidedWhichPageToShow",!0),this._renderSFSNewLandingPageView()}else this._landingPageUiModel.set("showSFSNewLandingPage",!1),this._landingPageUiModel.set("decidedWhichPageToShow",!0),this._renderSFSLandingPageView()}this._renderSFSAppProgressView(),this._renderSFSSendForSignPageView(),this._renderSFSOfflineView(),this._renderSFSTrialBarView()},_renderSFSLandingPageView:function(){s.skipUploadingForSfsOldLandingPage=!0,this._renderChildView("_sfsLandingPageView",s.SFSLandingPageView,this.$sfsLandingPage)},_renderSFSNewLandingPageView:function(){s.skipUploadingForSfsOldLandingPage=!1,this._renderChildView("_sfsNewLandingPageView",s.SFSNewLandingPageView,this.$sfsLandingPage)},_renderSFSAppProgressView:function(){this._renderChildView("_sfsAppProgressView",s.SFSAppProgressView,this.$sfsAppProgress)},_renderSFSSendForSignPageView:function(){this._renderChildView("_sfsSendForSignPageView",s.SFSSendForSignPageView,this.$sfsSendForSignPage)},_renderSFSOfflineView:function(){this._renderChildView("_sfsAppOfflineView",t.AppOfflineView,this.$sfsOfflinePage,{acceptLabel:o.SFS_OFFLINE_ACCEPT_LABEL})},_renderSFSTrialBarView:function(){this._renderChildView("_sfsTrialBarView",s.SFSAppTrialBarView,this.$sfsTrialBar)}}),s.SFSAppMainView}),define("pdmplugins/send-for-sign/js/templates/in-app-sign-page-content",[],function(){return'<div class="sfs-in-app-sign-container"></div><div class="sfs-in-app-offline-view-container"></div>'}),define("pdmplugins/send-for-sign/js/templates/sfs-sign-page-template",[],function(){return'<iframe class="sign-page-iframe" frameborder="0"        name="sign-page-iframe"></iframe>'}),define("pdmplugins/send-for-sign/js/views/sfs-sign-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-sign-page-template"],function(e,i,t){return i.SFSSignPageView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addKeyEventListener()},render:function(){e.View.prototype.render.call(this);var s=this.options.sfsAppSigningPageUiModel,n=s.get("url"),o=s.get("is_visible"),a=s.get("is_loaded");return o?(this.$el.show(),0===this.$el.children().length&&(this.$el.html(_.template(t)),this._initWrappers()),_.isEmpty(n)||a||(n+="&noChrome=true",this._loadSignPageURLInInframe(n),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"logHighbeamData_InAppSigning",methodArgs:{agreementId:i.QueryParams.AgreementId,HighbeamEvent:"FetchedSigningURL",HighbeamData:"True"}})),this):(this.$el.hide(),this)},_initWrappers:function(){this.$signPageIframe=this.$(".sign-page-iframe")},_loadSignPageURLInInframe:function(e){_.isEmpty(e)||(this.$signPageIframe.attr("src",e),this._addSignPageIframeLoadListener())},_addSignPageIframeLoadListener:function(){var e=this.options.sfsAppSigningPageUiModel;this.$signPageIframe.load(_.bind(function(){this.options.appApi.displayApi.showSpinner(!1),console.log("sfs-sign-page-view: is_loaded :  true"),e.set("is_loaded",!0)},this))},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)}}),i.SFSSignPageView}),define("pdmplugins/send-for-sign/js/templates/sfs-post-sign-page-template",[],function(){return'<div id="sfs-postsign-page-content" class="ui-theme theme-container">       <div class="sfs-postsign-page-top-padding">     </div>       <div class="theme-text sfs-postsign-page-title" ><%= title %> "<%= docname %>"</div>       <div class="sfs-postsign-page-spacer1"> </div>       <div class="sfs-postsign-image-div">       <div class="sfs-postsign-image-div1">			<div class="before-image-loader"></div>       	<img class="sfs-postsign-thumbnail-image" draggable="false" src="" alt=""/>           <div class="when-image-not-available"></div> 		</div>   </div>       <div class="sfs-postsign-page-spacer2"> </div>	    <div >           <button id="sfs-postsign-page-view-button" tabindex="8"> <%= viewdocument %></button>	    </div>       <div class="sfs-postsign-page-spacer"> </div></div>'}),define("pdmplugins/send-for-sign/js/views/sfs-post-sign-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-post-sign-page-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/utils/image-loader"],function(e,i,t,s){return i.SFSPostSignPageView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addKeyEventListener()},events:function(){return{"click #sfs-postsign-page-view-button":"_onViewDocBtnClick"}},render:function(){e.View.prototype.render.call(this),this.$el.html();var t=s.SFS_SIGNED_DOC_TITLE,n=(this.options.appApi.rnaApiObj.esApi.getAgreementType(),this.options.appApi.rnaApiObj.esApi.getAgreementName());return this.$el.html(this._template({title:t,docname:n,viewdocument:s.SFS_VIEW_DOCUMENT_BUTTON})),this._initWrappers(),this._loadDocthumbnail(),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"logHighbeamData_InAppSigning",methodArgs:{agreementId:i.QueryParams.AgreementId,HighbeamEvent:"PostSignPageDisplayed",HighbeamData:"True"}}),this},_initWrappers:function(){this.$thumbnailDiv=this.$(".sfs-postsign-image-div"),this.$signPageIframe=this.$(".sign-page-iframe"),this.$previewImage=this.$(".sfs-postsign-thumbnail-image"),this.$beforeImageSpinner=this.$(".before-image-loader"),this.$whenImageNotAvailable=this.$(".when-image-not-available")},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){{var i=e.keyCode;$(e.target),$.Event("click")}switch(i){case 13:case 27:}},_loadDocthumbnail:function(){this.$beforeImageSpinner.show(),this.$whenImageNotAvailable.hide(),this._getRenditionUrl().then(_.bind(function(e){this.$previewImage.attr("src",""),this.$previewImage.hide(),_.isEmpty(e)||(this.$previewImage.attr("src",e),this.$previewImage.load(_.bind(function(){this.$beforeImageSpinner.hide(),this.$previewImage.show()},this)))},this),_.bind(function(){this.$previewImage.hide(),this.$beforeImageSpinner.hide(),this.$whenImageNotAvailable.show(),this.$thumbnailDiv.css("border","none")},this))},_getRenditionUrl:function(){var e,t,s,n,o,a,r=$.Deferred(),l=this.options,d=l.appApi;return this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){d.rnaApi.done(_.bind(function(d){return n=d.esApi.getEchoSignServiceParams(),t=n.apiURL,s=l.esAuthUiModel.get("access_token"),a=i.QueryParams.AgreementId,_.isEmpty(t)||_.isEmpty(s)?void r.reject():(e=t+"/api/rest/v6/agreements/"+a+"/documents/imageUrls",o={Accept:"application/json",Authorization:"Bearer "+s},void $.ajax({url:e,type:"GET",modal:!1,headers:o,contentType:"application/json",dataType:"json",global:!1,success:_.bind(function(e){if(_.isEmpty(e))r.reject();
else{for(var i=e.originalDocumentsImageUrlsInfo[0].documentImageUrlsList,t=0;t<i.length;t++)if("FIXED_WIDTH_250px"===i[t].imageSize){var s=i[t].imageURLs[0].url;r.resolve(s)}r.reject()}},this),error:_.bind(function(e){403==e.status&&"INVALID_API_ACCESS_POINT"==e.responseJSON.code&&this.options.appApi.rnaApiObj.esApi.authApi.clearESAuthSession(),r.reject()},this)}))},this))},this)),r.promise()},_onViewDocBtnClick:function(){var e,t,s,n,o,a;this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"logHighbeamData_InAppSigning",methodArgs:{agreementId:i.QueryParams.AgreementId,HighbeamEvent:"ClickedViewSignedDoc",HighbeamData:"True"}}),this.options.appApi.rnaApi.done(_.bind(function(r){if(e=r.esApi.getEchoSignServiceParams(),t=e.apiURL,s=this.options.esAuthUiModel.get("access_token"),o=i.QueryParams.AgreementId,a=this.options.appApi.rnaApiObj.esApi.getAgreementName(),!_.isEmpty(t)&&!_.isEmpty(s)){n=t+"/api/rest/v6/agreements/"+o+"/combinedDocument";var l={requestURL:n,accessToken:s,agreementName:a,agreementId:o};r.esApi.invokeMethod({methodName:"viewSignedDoc",methodArgs:l}).then(function(){},function(){})}},this))},show:function(){$(".sfs-in-app-sign-container").empty(),this.render()}}),i.SFSPostSignPageView}),define("pdmplugins/send-for-sign/js/views/sfs-inapp-sign-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/in-app-sign-page-content","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/views/sfs-sign-page-view","pdmplugins/send-for-sign/js/views/sfs-post-sign-page-view","pdmplugins/esign/js/views/es-offline-view","core/views/plugin-content-view"],function(e,i,t,s,n){return s.SFSInAppSignView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addUiModelEventListeners()},render:function(){var i=this.$el;return e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n)),this._initWrappers()),this._renderChildViews(),this},_addUiModelEventListeners:function(){this.options.sfsAppUiModel.on("change:app_state_updated",this._onSFSAppStateUpdatedChange)},_onSFSAppStateUpdatedChange:function(){this.render()},_initWrappers:function(){this.$sfsInAppSignPage=this.$(".sfs-in-app-sign-container"),this.$sfsOfflinePage=this.$(".sfs-in-app-offline-view-container")},_renderChildViews:function(){console.log("InAppSignView : _renderChildViewsstart "),this._renderSignPageView(),this._renderSFSOfflineView1(),console.log("InAppSignView : _renderChildViewsend "),this.options.appApi.sessionApi.ensureSignedInV2()},_renderSignPageView:function(){this._renderChildView("_sfsSignPageView",s.SFSSignPageView,this.$sfsInAppSignPage)},_renderSFSOfflineView1:function(){this._renderChildView("_sfsAppOfflineView",t.AppOfflineView,this.$sfsOfflinePage,{})}}),s.SFSInAppSignView}),define("pdmplugins/send-for-sign/js/templates/unified-fss-intent-template",[],function(){return'<div id="unified-fss-container"><div class = "intent-page-header" ><%=title%> </div><div class = "intent-page-images" ><div class = "intent-page-image" id="image1"></div><div class = "intent-page-image" id="image2"></div></div><div class = "intent-page-subHeadings" ><div class = "intent-page-subHeading" id="Myself"><%=subHeading1%></div><div class = "intent-page-subHeading" id="others"><%=subHeading2%></div></div><div class = "intent-page-descriptions" ><div class = "intent-page-description" id="description1"><%=descriptions1%></div><div class = "intent-page-description" id="descriptions2"><%=description2%></div></div><div class = "intent-page-buttons"><button class = "intent-page-button" id="fss-btn"><%=button1%></button><button class = "intent-page-button" id="sfs-btn"><%=button2%></button></div></div>'}),define("pdmplugins/send-for-sign/js/views/unified-fss-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/unified-fss-intent-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/views/plugin-content-view"],function(e,i,t,s,n,o){return s.UnifiedFSSView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addUiModelEventListeners()},render:function(){var i=this.$el;return e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n,{title:o.USER_INTENT_TITLE,subHeading1:o.USER_INTENT_MYSELF,subHeading2:o.USER_INTENT_OTHERS,descriptions1:o.USER_INTENT_FSS_DESCRIPTION,description2:o.USER_INTENT_SFS_DESCRIPTION,button1:o.USER_INTENT_FSS_BTN,button2:o.USER_INTENT_SFS_BTN})),this._initWrappers()),this},events:function(){return{"click #fss-btn":"_LaunchFillSign","click #sfs-btn":"_LaunchSFS"}},_addUiModelEventListeners:function(){this.options.sfsAppUiModel.on("change:app_state_updated",this._onSFSAppStateUpdatedChange)},_onSFSAppStateUpdatedChange:function(){this.render()},_initWrappers:function(){},_LaunchFillSign:function(){console.log("Launching Fill Sign"),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"SwitchLayout",methodArgs:{Type:"FSS"}})},_LaunchSFS:function(){console.log("Launching SFS"),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"checkAndLaunchSFS",methodArgs:{Type:"SFS",Context:"IntentDialog"}})}}),s.UnifiedFSSView}),define("pdmplugins/send-for-sign/js/templates/share/share-dialog-view-template",[],function(){return'<div id="sfs-view-container" class="theme-text theme-share-grey-container" role="dialog"><div id="modal-share-heading" class ="ui-theme theme-share-container"><%= SHARE_DIALOG_HEADING %></div> 	 <div class="share-close-img" aria-label ="<%= CLOSE %>" title="<%= CLOSE %>" > </div><div id="us-success-view" class ="ui-theme theme-share-grey-container"></div><div class="sfs-modal-loader"><div class="loader" id="modal-loader"></div><div id="mode-text" class= "ui-theme theme-text"></div><div id="uploading-text" class= "ui-theme theme-text"></div></div><div class="sfs-modal-sac-error ui-theme theme-text theme-share-grey-container hidden"><div id="sfs-failure-img" class= "ui-theme theme-text"></div><div id="sac-error-text" class= "ui-theme theme-text"></div><div class="sfs-button-bar ui-theme theme-text theme-share-grey-container"><button class="close-button control-button theme-button theme-button-label" aria-label = "<%= CLOSE %>"  id="share-close-button"><%= CLOSE %></button></div></div><div id="share-view-container"><table class="share-table-view" cellspacing="0" cellpadding="0"><tr class="share-table-view-row"><td class="share-table-column-left ui-theme theme-share-grey-container" ><div id="share-tab-view-container" class =""></div></td><td class="share-table-column-right ui-theme theme-share-container"><div id="share-expansion-view-container" class ="ui-theme theme-share-container"></div></td></tr></table></div></div>'}),define("pdmplugins/send-for-sign/js/templates/share/share-tab-view-template",[],function(){return'<div id="us-modal-tab-view" class="ui-theme theme-share-grey-container" role="menubar"><div id="get-a-link-tab" class ="modal-view-tab ui-theme theme-tab-button cb-active-text-theme" role="button"><button id="get-a-link-img" tabindex="-1"></button><div class="modal-view-tab-text theme-text cb-active-text-theme" ><%= GET_A_LINK %></div></div><div id="send-a-copy-tab" class ="modal-view-tab ui-theme theme-tab-button cb-active-text-theme" role="button"><button id="send-a-copy-img" tabindex="-1"></button><div class="modal-view-tab-text theme-text cb-active-text-theme" ><%= SEND_A_COPY%></div></div><div id="get-others-to-sign-tab" class ="modal-view-tab ui-theme theme-tab-button cb-active-text-theme" role="button"><button id="get-others-to-sign-img" tabindex="-1"></button><div class="modal-view-tab-text theme-text cb-active-text-theme" id="get-others-to-sign-tab" ><%= GET_OTHER_TO_SIGN%></div></div><div class="sfs-logo-bar"></div></div>'}),define("pdmplugins/send-for-sign/js/views/Share/share-tab-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-tab-view-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/views/plugin-content-view"],function(e,i,t,s,n,o,a){return s.ShareTabView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addKeyEventListener()},events:function(){return{"click .modal-view-tab":"_selectTab","click #get-a-link-tab":"_SelectGetALink","click #send-a-copy-tab":"_SelectSendACopy","click #get-others-to-sign-tab":"_SelectGetOthersToSign","keyup #get-a-link-tab":"_OnPressGetALink","keyup #send-a-copy-tab":"_OnPressSendACopy","keyup #get-others-to-sign-tab":"_OnPressGetOthersToSign"}},render:function(){var t=this.$el;e.PluginContentView.prototype.render.call(this),0===t.children().length&&(t.html(_.template(n,{GET_A_LINK:o.SHARE_GET_A_LINK,SEND_A_COPY:o.SHARE_SEND_A_COPY,GET_OTHER_TO_SIGN:o.SHARE_GET_OTHERS_TO_SIGN2})),this._initWrappers(),i.isReader()&&this.$("#send-a-copy-tab").hide()),this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.isSendACopyEnabled()||this.$sendACopyTab.hide()},this));var s=this.options.sfsAppSendACopyUiModel.get("is_agreement_opened");s&&this.$getOthersToSignTab.hide();var a=this.options.sfsAppSendACopyUiModel.get("share_modal_workflow");return"get_link"==a?this._SelectGetALink():"send_a_copy"==a&&this.options.sfsAppShareUiModel.set("current_tab","send-a-copy"),this._selectDefaultTab(),this},_initWrappers:function(){this.$sendACopyTab=this.$("#send-a-copy-tab"),this.$getOthersToSignTab=this.$("#get-others-to-sign-tab")},_selectTab:function(e){var i=$(e.currentTarget),t=i.attr("id"),s=$("#"+t);$(".modal-view-tab.selected").children(".modal-view-tab-text").toggleClass("selected"),$(".modal-view-tab.selected").toggleClass("selected"),s.toggleClass("selected"),s.children(".modal-view-tab-text").toggleClass("selected"),$(".modal-view-tab.selected").attr("tabindex","0"),$(".modal-view-tab").not($(".modal-view-tab.selected")).attr("tabindex","-1")},_SelectGetALink:function(){this.options.sfsAppShareUiModel.set("current_tab","get-a-link");var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.GET_A_LINK;this.options.appApi.siteCatalystApi.logScEvent([i,a.GET_A_LINK_TAB]),this.options.sfsAppSendACopyUiModel.get("is_agreement_opened")&&!this.options.sfsAppSendACopyUiModel.get("is_link_generated")?($("#share-create-link-button").click(),this.options.sfsAppShareUiModel.set("is_link_generated","true")):$("#share-create-link-button").focus()},_SelectSendACopy:function(){this.options.sfsAppShareUiModel.set("current_tab","send-a-copy");var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.SEND_A_COPY;this.options.appApi.siteCatalystApi.logScEvent([i,a.SEND_A_COPY_TAB])},_SelectGetOthersToSign:function(){this.options.sfsAppShareUiModel.set("current_tab","get-others-to-sign");var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.GET_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,a.GET_SIG_TAB]),$("#sfs-add-signers-button").focus()},_selectDefaultTab:function(){var e=this.options.sfsAppShareUiModel.get("current_tab"),i={"get-a-link":"get-a-link-tab","send-a-copy":"send-a-copy-tab","get-others-to-sign":"get-others-to-sign-tab"};this._selectTab({currentTarget:"#"+i[e]})},_OnPressGetALink:function(e){var i=e.which?e.which:e.keyCode;(13==i||32==i)&&(this._SelectGetALink(),this._selectTab(e),e.preventDefault())},_OnPressSendACopy:function(e){var i=e.which?e.which:e.keyCode;(13==i||32==i)&&(this._SelectSendACopy(),this._selectTab(e),e.preventDefault())},_OnPressGetOthersToSign:function(e){var i=e.which?e.which:e.keyCode;(13==i||32==i)&&(this._SelectGetOthersToSign(),this._selectTab(e),e.preventDefault())},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){if(0==$(".modal-view-tab:focus").length)return!1;var i=!1,t=e.which;switch(t){case 13:case 32:this.makeChoice(),i=!0;break;case 40:this.selectDown(),i=!0;break;case 38:this.selectUp(),i=!0}return i},makeChoice:function(){var e=$(".modal-view-tab:focus").attr("id");this._selectTab({currentTarget:"#"+e})},selectUp:function(){var e=$(".modal-view-tab:focus").prev();e.length&&e.focus()},selectDown:function(){var e=$(".modal-view-tab:focus").next();e.length&&e.focus()}}),s.ShareTabView}),define("pdmplugins/send-for-sign/js/templates/share/share-expansion-view-template",[],function(){return'<div id="share-expansion-view"><div id="get-a-link-view-container" class ="ui-theme theme-share-container"></div><div id="send-a-copy-view-container" class ="ui-theme theme-share-container"></div><div id="request-sig-view-container" class ="ui-theme theme-share-container"></div></div>'}),define("pdmplugins/send-for-sign/js/templates/share/share-get-a-link-view-template",[],function(){return'<div class="ui-theme theme-share-container"><div id="get-a-link-heading" class="ui-theme theme-header-text expansion-view-heading"><%= GET_A_LINK_HEADING %></div><div id="get-a-link-description" class="modal-sfs-share-tab-summary ui-theme theme-text"><div id="get-a-link-summary" class="ui-theme theme-header-text"><%= GET_A_LINK_DESCRIPTION %></div></div>   <div class="fss-share-advisory-container">    <div class="fss-share-service-spacer-small"></div>    <div class="fss-share-service-spacer-small"></div>    <div class="fss-share-service-spacer-small"></div>       <div class="fss-share-advisory-msg ui-theme fss-normal-text-theme" ><%= ADVISORY_MSG %></div>   </div><div class="get-a-link-progress-container hidden">    <div class="fss-share-service-spacer"></div>    <div class="fss-share-service-spacer"></div> 	<div class="create-link-spinner"/>   <div class="spinner-text ui-theme theme-header-text" ><%= PROGRESS_TEXT %></div></div>    <div class="fss-share-service-spacer"></div>   <div class="fss-share-error-container hidden"><div class="fss-err-header-theme-img" > </div><div id="fss-share-err-msg" class="fss-err-header-theme ui-theme" ><%= errtext %></div>   </div>   <div class="fss-share-copy-link-container hidden">    <textarea class="fss-share-link-text-area theme-container ui-theme fss-background-theme fss-normal-text-theme" readonly="true" align="left" tabindex=2></textarea>    <div class="fss-share-service-spacer"></div>    <div class="fss-share-link-copied hidden ui-theme fss-normal-text-theme" ><%= bodytext3 %></div>    <div class="fss-share-service-spacer"></div>    <div class="fss-share-service-spacer"></div>    <div class="fss-share-add-link-to-email hidden">    <button class="add-link-to-email-icon" tabindex="-1"></button>    <div class="fss-share-add-link-to-email-msg ui-theme fss-normal-text-theme" ><%= ADD_LINK_TO_EMAIL_MSG1 %></div>   </div>   </div><div class="get-a-link-button-bar ui-theme theme-share-container"><button class="share-get-a-link-button control-button theme-button theme-button-label" tabindex = "3" aria-label = "<%= SHARE_CREATE_LINK_BUTTON %>"  id="share-create-link-button"><%= SHARE_CREATE_LINK_BUTTON %></button></div><div class="copy-link-button-bar ui-theme theme-share-container hidden"><button class="share-copy-link-button control-button theme-button theme-button-label" tabindex = "5" aria-label = "<%= SHARE_COPY_LINK_BUTTON %>"  id="share-copy-link-button_id"><%= SHARE_COPY_LINK_BUTTON %></button><button class="add-link-to-email-button control-button button-grey theme-button-gray-label" tabindex = "4" aria-label = "<%= ADD_LINK_TO_EMAIL_BUTTON %>"  id="add-link-to-email-button_id"><%= ADD_LINK_TO_EMAIL_BUTTON %></button></div></div>'}),define("pdmplugins/send-for-sign/js/models/ui/sfs-send-mail-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/utils/action-ids","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/models/ui/ui-model"],function(e,i){i.SendMailUiModel=e.UiModel.extend({recognized:{send_mail_mode:{type:"string",optional:!1,choices:["sm_default_mail","sm_webmail","invalid"]},default_email_client:{type:"string",optional:!1},email_addresses:{type:"object",optional:!0},selected_profile:{type:"string",optional:!1},default_mail_set:{type:"boolean",optional:!0}},defaults:{send_mail_mode:"sm_default_mail",default_email_client:"",email_addresses:{},selected_profile:"",default_mail_set:!1},initialize:function(){},resetTodefaults:function(){this.resetElementsTodefaults(),this.resetArrays()},resetArrays:function(){this.set("email_addresses",{},{silent:!0})},resetElementsTodefaults:function(){this.set({send_mail_mode:"sm_default_mail",default_email_client:"",selected_profile:"",default_mail_set:!1})}})}),define("pdmplugins/send-for-sign/js/views/Share/share-get-a-link-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-get-a-link-view-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/views/plugin-content-view","core/apis/api","pdmplugins/send-for-sign/js/models/ui/sfs-send-mail-ui-model"],function(e,i,t,s,n,o,a){return s.ShareGetALinkView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addUiModelEventListeners(),this.options.SendMailUiModel=new s.SendMailUiModel},render:function(){var i=this.$el;e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n,{GET_A_LINK_HEADING:o.GET_A_LINK_HEADING,GET_A_LINK_DESCRIPTION:o.GET_A_LINK_DESCRIPTION,LEARN_MORE:o.LEARN_MORE,PROGRESS_TEXT:o.GET_A_LINK_PROGRESS_TEXT,SHARE_CREATE_LINK_BUTTON:o.SHARE_CREATE_LINK_BUTTON,SHARE_COPY_LINK_BUTTON:o.SHARE_COPY_LINK_BUTTON,ADD_LINK_TO_EMAIL_BUTTON:o.ADD_LINK_TO_EMAIL_BUTTON,ADD_LINK_TO_EMAIL_MSG1:o.ADD_LINK_TO_EMAIL_MSG1,errtext:o.FSS_LINK_CREATION_FAILED_BODY,bodytext3:o.FSS_LINK_COPIED2,ADVISORY_MSG:o.GET_A_LINK_ADVISORY})),this._initWrappers()),this._onWorkflowStatusChange(),this._getSelectedFile();var t=s.QueryParams.agreementOpened;return"true"==t?(this.$createlinkbar.hide(),this.$getALinkSummary.html(o.GET_A_LINK_DESCRIPTION2),this.$getLinkHeading.html(o.GET_A_LINK_HEADING2)):(this.$createlinkbar.show(),this.$createlinkbar.focus()),this._getDefaultEmailClient(),this._getLastUsedChoices(),this._fetchAllProfiles(),this},events:function(){return{"click #share-create-link-button":"_onBtnClick","click .share-copy-link-button":"_CopyLink","click .add-link-to-email-button":"_addLinkToEmailButtonClick","mouseenter .add-link-to-email-button":"_addLinkToEmailButtonMouseEnter","mouseleave .add-link-to-email-button":"_addLinkToEmailButtonMouseLeave","click .fss-share-link-text-area":"_onTxtAreaClick"}},_initWrappers:function(){this.$createLinkButton=this.$("#share-create-link-button"),this.$copyLinkButton=this.$("#share-copy-link-button"),this.$getALinkSummary=this.$("#get-a-link-summary"),this.$advisoryMsg=this.$(".fss-share-advisory-container"),this.$progressContainer=this.$(".get-a-link-progress-container"),this.$fssShareCopyContainer=this.$(".fss-share-copy-link-container"),this.$fssShareErrContainer=this.$(".fss-share-error-container"),this.$fssShareErrmsg=this.$("#fss-share-err-msg"),this.$fssTxtArea=this.$(".fss-share-link-text-area"),this.$createlinkbar=this.$(".get-a-link-button-bar"),this.$copylinkbtnbar=this.$(".copy-link-button-bar"),this.$fssLinkCopied=this.$(".fss-share-link-copied"),this.$fssAddLinktoEmailMsg=this.$(".fss-share-add-link-to-email-msg"),this.$fssAddLinktoEmailIcon=this.$(".add-link-to-email-icon"),this.$addLinktoEmailButton=this.$(".add-link-to-email-button"),this.$getLinkHeading=this.$("#get-a-link-heading")},_addUiModelEventListeners:function(){var e=this.options.sfsAppShareUiModel;e.on("change:get_a_link_status",this._onWorkflowStatusChange)},_onWorkflowStatusChange:function(){var e=this.options.sfsAppShareUiModel.get("get_a_link_status");this.$copylinkbtnbar.addClass("hidden"),this.$progressContainer.addClass("hidden"),"idle"===e?this.$createLinkButton.show():"creating"===e?(this.$createLinkButton.show(),this.$progressContainer.removeClass("hidden")):"successful"===e&&this.$fssShareCopyContainer.removeClass("hidden")},_workflowcomplete:function(){if(0==this.options.sfsAppSendACopyUiModel.get("workflow_running"))return void console.log("No workflow running");console.log("workflow complete");var e=this.options.sfsAppSendACopyUiModel,i=e.get("certified_email_link"),t=e.get("workflow_success_status"),s=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),n=s+"-"+a.GET_A_LINK;1!=t||_.isUndefined(i)||_.isEmpty(i)?(this.options.appApi.siteCatalystApi.logScEvent([n,a.GET_A_LINK_FAILURE]),this._showErrorScreen()):(this.options.appApi.siteCatalystApi.logScEvent([n,a.GET_A_LINK_SUCCESS]),console.log("workflow::success"),this.$fssTxtArea.val(i),this.$progressContainer.addClass("hidden"),this.$fssShareCopyContainer.removeClass("hidden"),this.$copylinkbtnbar.removeClass("hidden"),this.$createlinkbar.addClass("hidden"),this._copyLinkOnWorkflowSuccess(),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"UpdateWorkflowStatus",methodArgs:{Workflow:"Get_a_link",State:"Successful"}}),0==this.options.sfsAppSendACopyUiModel.get("is_agreement_opened")&&_.delay(_.bind(function(){var e={};e.id=this.options.sfsAppSendACopyUiModel.get("agreementId"),this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaSignWorkflowServicesAPI.invokeMethod({methodName:"updateDataModelAfterActionForAgreement",methodArgs:e})},this))},this),1e3))},_getSelectedFile:function(){console.log("_getSelectedFile"),this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();if(_.isEmpty(i))console.log("_getSelectedFile::Active doc NOT found"),this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc");else{console.log("_getSelectedFile::Active doc found");var t=[];t.push(i),this.options.sfsAppSendACopyUiModel.set("selectedFiles",t),console.log(t.length),console.log(this.options.sfsAppSendACopyUiModel.get("selectedFiles").length)}},this))},_ValidateSession:function(){console.log("_ValidateSession");var e=this.options.sfsAppSendACopyUiModel.get("is_agreement_opened"),i=this.options.sfsAppSendACopyUiModel.get("selectedFiles");return e||!_.isUndefined(i)&&0!=i.length||this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc"),this.options.appApi.networkConnectivityApi.isOnline()||this.options.sfsAppSendACopyUiModel.set("failed_workflow","UserOffline"),_.isEmpty(this.options.sfsAppSendACopyUiModel.get("failed_workflow"))?(console.log("ValidateSession: success"),!0):!1},_showErrorScreen:function(){var e=this.options.sfsAppSendACopyUiModel.get("failed_workflow"),i=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=i+"-"+a.GET_A_LINK_FAILURE_REASON;switch(this.options.appApi.siteCatalystApi.logScEvent([s,e]),this.$fssShareErrmsg.css("left","5px"),this.$fssShareErrContainer.css("display","flex"),e){case"NoDoc":this.$fssShareErrmsg.html(o.FSS_LINK_CREATION_FAILED_BODY);break;case"UserOffline":this.$fssShareErrmsg.html(o.FSS_ERR_OFFLINE_MSG);break;case"LARGE_FILE_SIZE":this.$fssShareErrmsg.html(o.FSS_ERR_LARGE_FILE_MSG);break;case"AUTH_FAILED":this.$fssShareErrmsg.html(o.FSS_LINK_CREATION_FAILED_BODY+"<br><br>"+o.FSS_ERR_AUTH_FAILED_MSG);break;case"Missing_TransientIDs":this.$fssShareErrmsg.html(o.FSS_LINK_CREATION_FAILED_BODY+"<br><br>"+o.FSS_ERR_MIISSING_TRANSIENTIDS_MSG);break;case"Agreement_Wait_Exceeded":this.$fssShareErrmsg.html(o.FSS_LINK_CREATION_FAILED_BODY+"<br><br>"+o.FSS_ERR_AGREEMENT_WAIT_EXCEEDED_MSG);break;default:this.$fssShareErrmsg.html(e==o.SFS_ERR_GENERAL_WORKFLOW_FAILURE?o.FSS_LINK_CREATION_FAILED_BODY:o.FSS_LINK_CREATION_FAILED_BODY+"<br><br>"+e)}"INVALID_API_ACCESS_POINT"==e&&t.esApi.authApi.clearESAuthSession(),console.log("workflow::failure"),this.$createlinkbar.show(),this.$createLinkButton.removeClass("disabled"),this.$createLinkButton.html(o.FSS_TRY_AGAIN),this.$progressContainer.addClass("hidden"),this.$fssShareErrContainer.removeClass("hidden")},_onBtnClick:function(){console.log("CTA clicked"),this.$fssShareErrContainer.css("display","none");var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.GET_A_LINK;this.options.appApi.siteCatalystApi.logScEvent([i,a.GET_A_LINK_CREATE]),this.$createLinkButton.hasClass("disabled")||(this._getEventListener(),this.options.sfsAppSendACopyUiModel.reset(),"true"===s.QueryParams.agreementOpened&&this.options.sfsAppSendACopyUiModel.set("is_agreement_opened",!0),this._CreateLink(),this.$createLinkButton.html()===o.FSS_TRY_AGAIN&&this.options.appApi.siteCatalystApi.logScEvent([i,a.GET_A_LINK_TRYAGAIN]))},_getEventListener:function(){},_CreateLink:function(){if(console.log("create link"),this.options.sfsAppSendACopyUiModel.set("is_getalink_workflow",!0),this.$advisoryMsg.addClass("hidden"),!this._ValidateSession())return this._showErrorScreen();var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.GET_A_LINK;this.options.appApi.sessionApi.ensureSignedInV2().done(_.bind(function(){this.options.appApi.siteCatalystApi.logScEvent([i,a.FSS_USER_SIGNED_IN]),this.$progressContainer.removeClass("hidden"),this.options.sfsAppSendACopyUiModel.set("workflow_running",!0),this.$createLinkButton.addClass("disabled"),this.$fssShareErrContainer.addClass("hidden"),this.$fssLinkCopied.addClass("hidden"),this.$fssAddLinktoEmailMsg.addClass("hidden"),this.$fssAddLinktoEmailIcon.addClass("hidden"),s.opFactory.create("SendCompletedCopyOp",_.extend({},this.options)).run().then(_.bind(function(){console.log("SendCompletedCopyOp success"),this._workflowcomplete()},this),_.bind(function(){console.log("SendCompletedCopyOp failure"),this._workflowcomplete()},this))},this))},_onTxtAreaClick:function(){this.$fssTxtArea.select()},_copyLinkOnWorkflowSuccess:function(){this._CopyLink()},_CopyLink:function(){console.log("copy clicked");var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.GET_A_LINK;this.options.appApi.siteCatalystApi.logScEvent([i,a.GET_A_LINK_COPY,a.CLICKED]),this.$fssTxtArea.select(),this.options.appApi.rnaApi.done(_.bind(function(e){e.cefBrowserApi({methodName:"handleViewEvent",parameters:["CopyEvent",{}]})},this)),this.$fssLinkCopied.removeClass("hidden")},_addLinkToEmailButtonClick:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile"),s=e.get("default_mail_set"),n=e.get("email_addresses")[t],o=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),r=o+"-"+a.GET_A_LINK;this.options.appApi.siteCatalystApi.logScEvent([r,a.GET_A_LINK_EMAIL]),s?(this.$fssAddLinktoEmailMsg.addClass("hidden"),this.$fssAddLinktoEmailIcon.addClass("hidden"),this.options.appApi.siteCatalystApi.logScEvent([r,a.GET_A_LINK_MAIL_LAUNCHED]),"sm_default_mail"===i?this._sendMail(!1,"none"):this._sendMail(!0,n)):(this.$fssAddLinktoEmailMsg.removeClass("hidden"),this.$fssAddLinktoEmailIcon.removeClass("hidden"),this.options.appApi.siteCatalystApi.logScEvent([r,a.GET_A_LINK_MAIL_UNKNOWN]))},_sendMail:function(e,i){var t=this.options.sfsAppSendACopyUiModel.get("selectedFiles"),n=t.length>0?t[0].get("name"):"";if("true"===s.QueryParams.agreementOpened){var a=this.options.sfsAppSendACopyUiModel.get("agreementId");n=n.substr(0,n.indexOf(a)-1)||n}var r=_.template(o.ADD_LINK_TO_EMAIL_MSG2,{FileName:n}),l="\n\n"+r;l+="\n\n",l+=this.$fssTxtArea.val();var d={useWebmail:e,profile:i,message:l,instantLink:!0};this.options.appApi.rnaApi.then(_.bind(function(e){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"}),e.stApi.sendMailWithoutFLD(d).then(_.bind(function(){},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_addLinkToEmailButtonMouseEnter:function(){var e=this.options.SendMailUiModel.get("send_mail_mode"),i=this.options.SendMailUiModel.get("default_email_client"),t=this.options.SendMailUiModel.get("default_mail_set");t&&("sm_default_mail"===e?this.$addLinktoEmailButton.attr("title",i):this.$addLinktoEmailButton.attr("title",o.ATTACH_EMAIL_MSG2))},_addLinkToEmailButtonMouseLeave:function(){this.$addLinktoEmailButton.removeAttr("title")},_getDefaultEmailClient:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getDefaultEmailClient().then(_.bind(function(e){this.options.SendMailUiModel.set("default_email_client",this._getEmailClientName(e))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_getEmailClientName:function(e){switch(e){case 0:return o.EMAIL_CLIENT_OTHER;case 1:return a.EMAIL_CLIENT_EUDORA;case 2:return a.EMAIL_CLIENT_LOTUS_NOTES;case 3:return a.EMAIL_CLIENT_NETSCAPE;case 4:return a.EMAIL_CLIENT_OUTLOOK;case 5:return a.EMAIL_CLIENT_OUTLOOK_EXPRESS;case 6:return a.EMAIL_CLIENT_ENTOURAGE;case 7:return a.EMAIL_CLIENT_MAIL;case 8:return o.UNKNOWN;default:return o.UNKNOWN}},_getLastUsedChoices:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getLastUsedPreferences().then(_.bind(function(e){this._updateLastUsedChoices(e)},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_updateLastUsedChoices:function(e){var i,t,s,n,o,a,r=this.options.SendMailUiModel;e&&(i=e.didLastUsedWebmail,o=e.defaultSet,t=e.useWebmail,a=e.webmailDisabled,r.set("default_mail_set",o),a&&(r.set("send_mail_mode","sm_default_mail"),t=!1),o&&(t?(r.set("send_mail_mode","sm_webmail"),s=e.selectedProfile,n=this._convertEncodedToSimpleProfile(s),r.set("selected_profile",n)):r.set("send_mail_mode","sm_default_mail")))},_convertEncodedToSimpleProfile:function(e){for(var i=this.options.SendMailUiModel,t=i.get("email_addresses"),s=Object.getOwnPropertyNames(t),n=0;n<s.length;n++)if(t[s[n]]===e)return s[n];return""},_fetchAllProfiles:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getAllWebmailProfiles().then(_.bind(function(e){this._updateProfilesInUiModel(e)},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_updateProfilesInUiModel:function(e){for(var i={},t=Object.getOwnPropertyNames(e),s=0;s<t.length;s++){var n=e[t[s]],o=n.EmailAddress;i[o]=t[s]}Object.keys(i).length>0&&this.options.SendMailUiModel.set("email_addresses",i)}}),s.ShareGetALinkView}),define("pdmplugins/send-for-sign/js/templates/share/share-send-a-copy-view-template",[],function(){return'<div class = "sac-info-content-container ui-theme theme-share-container" ><div id="send-a-copy-heading" class="ui-theme theme-header-text expansion-view-heading"><%= SEND_A_COPY_HEADING  %></div><div id="send-a-copy-description" class="modal-sfs-share-tab-summary ui-theme theme-text"><div class="ui-theme theme-header-text"><%= SEND_A_COPY_DESCRIPTION %> </div></div><div class="fss-share-service-spacer"></div><div id= "email-address-template-container" class ="ui-theme theme-share-container" tabindex = "-1"></div><div class="fss-share-service-spacer-small"></div><div class="textarea-container"><textarea class="share-send-copy-subject ui-theme theme-container theme-text" tabindex = "3" placeholder ="<%=SHARE_INITIAL_SUBJECT_ARIA_LABEL%>" align="left" maxlength="255"></textarea><textarea class="share-send-copy-message ui-theme theme-container theme-text" align="left" tabindex="4" placeholder="<%=INPUT_MESSAGE_PLACEHOLDER%>"></textarea></div><div class="fss-share-advisory-container fss-share-advisory-msg ui-theme fss-normal-text-theme"><%= SEND_A_COPY_NOTICE %></div><div class="send-a-copy-button-bar ui-theme theme-share-container"><button class="share-send-a-copy-button control-button theme-button theme-button-label" tabindex = "5" aria-label = "<%= SHARE_BUTTON %>"  id="share-send-a-copy-button_id"><%= SHARE_BUTTON %></button></div></div>'
}),define("pdmplugins/send-for-sign/js/templates/share/share-tab-email-addr-view-template",[],function(){return'<div class="sfs-share-modal-address-input-container">        <div class = "share-modal-tool-frame ui-theme theme-share-border theme-share-container">            <button id="sfs-share-modal-search-email-img" tabindex="-1"/>            <div class="share-modal-email-list" role="grid" aria-labelledby="share-heading">                <div class = "sfs-share-modal-email-input-box">                   <input type="text" tabindex="1" class="sfs-share-modal-address-input ui-theme theme-share-container theme-share-input-text"                           placeholder="<%= SHARE_ADDRESS_PROMPT %>"                           id="sfs-share-modal-address-input"                           aria-autocomplete="list"                           aria-label="<%= SHARE_ADDRESS_PROMPT %>"                           aria-owns="us-share-auto-c-list" autocomplete="false" />                </div>                <button class="sfs-share-modal-address-book" tabindex="2" aria-label ="<%= ADDRESS_BOOK_LABEL %>" title="<%= ADDRESS_BOOK %>"                     aria-describedby="sfs-share-modal-address-book" id="sfs-share-modal-address-book-img"/>            </div>         </div></div><div class="sfs-share-modal-autocomplete-box-parent ui-theme theme-share-container"><div class="sfs-share-modal-autocomplete-box ui-theme theme-share-border theme-share-container theme-text"></div></div>'}),define("pdmplugins/send-for-sign/js/templates/share/share-tab-email-list-item-template",[],function(){return'    <div class="share-modal-email-list-item  theme-hoverable ui-theme theme-share-container" title="<%= email %>">       <div class="share-email-list-name theme-text" tabindex="-1"><%= name %></div>       <div           aria-labelledby="share-email-list-name">           <button class="share-email-list-close core-remove-x"                title="<%= remove %>" tabindex="0"                 data-asset-id="<%= asset_id %>"                aria-label="<%= ariaRemoveLabel %>"></button>       </div>   </div> '}),define("pdmplugins/send-for-sign/js/templates/share/share-tab-autocomplete-template",[],function(){return' <div class="us-share-auto-c-list"     role="listbox" id="us-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/send-for-sign/js/templates/share/share-tab-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 i=e.AcUnifiedShare;return i.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"},i.ScConstants}),define("pdmplugins/send-for-sign/js/views/Share/share-tab-autocomplete-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-tab-autocomplete-template","pdmplugins/send-for-sign/js/templates/share/share-tab-autocomplete-item-template","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","i18n!pdmplugins/send-for-sign/js/nls/ui-strings"],function(e,i,t,s,n,o,a){return i.SendACopyAutocompleteView=e.View.extend({events:{"mousedown .us-share-auto-address":"_onAddressClick","mousedown .us-ms-graph-get-contacts-banner":"_onGetMSGraphContactsClick"},initialize:function(){var i,n=this.options,o=n.autoCCollection;e.View.prototype.initialize.call(this),this._template=_.template(t),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,i=new Backbone.Collection,this.filteredCollection=i,i.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:a.GET_MS_GRAPH_CONTACTS_MSG_1+"Office"+a.GET_MS_GRAPH_CONTACTS_MSG_2+"Outlook"+a.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 i,t,s;this.options,this.options.sfsAppShareUiModel}return this.isMSGraphBannerInFocus?this._onGetMSGraphContactsClick():(e?this.selectedID&&(i=this.filteredCollection.get(this.selectedID)):i=this.selectedID?this.filteredCollection.get(this.selectedID):this.filteredCollection.at(0),i&&(t=i.get("email"),s=i.get("name"),this._insertEmail(t,s),this._editControl.clear())),i},selectDown:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),r=$(".us-share-auto-address").outerHeight(),l=6,d=6;e.Util.isCEF&&(l=n.length),s=this.options.sfsAppShareUiModel.get("enable_autoc_arrows"),s&&(o?(l>n.length&&(l=n.length),t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(l>i&&(i+=1,l>d&&this._keyboardScrollTo(a+r)),i>=l?(o=void 0,this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus&&(this.isMSGraphBannerInFocus=!0)):(t=n.at(i),o=t?t.id:void 0))):this.isMSGraphBannerInFocus?this.isMSGraphBannerInFocus=!1:(t=n.at(0),t?(o=t.id,this._keyboardScrollTo(0)):o=void 0),this.selectedID=o,this._renderAddressList())},selectUp:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),r=6,l=6,d=$(".us-share-auto-address").outerHeight();e.Util.isCEF&&(r=n.length),s=this.options.sfsAppShareUiModel.get("enable_autoc_arrows"),s&&(o?(t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(i>=0&&(i-=1,r>l&&this._keyboardScrollTo(a-d)),0>i?o=void 0:(t=n.at(i),o=t?t.id:void 0))):this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus?(o=void 0,this.isMSGraphBannerInFocus=!0):(this.isMSGraphBannerInFocus=!1,r>n.length&&(r=n.length),r-=1,t=n.at(r),t?(o=t.id,r>=l&&this._keyboardScrollTo(r*d)):o=void 0),this.selectedID=o,this._renderAddressList())},_keyboardScrollTo:function(i){e.Util.isCEF()&&(this.$autoCList.stop(!0,!0),this.$autoCList.animate({scrollTop:i},1))},_initWrappers:function(){this.$autoCList=this.$(".us-share-auto-c-list"),this.$getMSGraphContacts=this.$(".us-ms-graph-get-contacts-banner")},_renderAddressList:function(){var e,i,t=this.filteredCollection,s=this.$autoCList,n=this.selectedID;e=this._localAddressTemplate,i=this._addressTemplate,t.length&&this.$el.show(),s.empty(),t.each(function(t){var o,a="";t.id===n&&(a="selected"),o=_.isUndefined(t.get("name"))||""===t.get("name")?i({email:t.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}):e({name:t.get("name"),email:t.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}),s.append(o)}),this._renderGetMSGraphBanner(),t.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,i=this.options.autoCCollection,t=this.filteredCollection,s=[],n="",o="",a=!1,r=this.options.sfsAppShareUiModel.get("pgcSuggestionsCollection");return r&&i.add(r.toJSON(),{merge:!0}),e=this.fragment,e&&e.length&&(s=i.filter(function(i){return o=i.get("email"),a=0===o.indexOf(e),a===!1&&(n=i.get("name"),void 0!==n&&(n=n.toLowerCase(),a=0===n.indexOf(e.toLowerCase()))),a})),t.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 i,t,s=$(e.target),o=this.options,a=this.options.sfsAppShareUiModel;i=s.attr("title"),t=s.attr("name"),this._insertEmail(i,t),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(i){var t=o.SEND_A_COPY,s=o.CLICKED,n="Sign In to MSGraph";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),i.rnaMicrosoftGraphAPI.loginToMicrosoftGraph().then(_.bind(function(){var i=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),t=o.SEND_A_COPY,s=o.START,n="Get MSGraph Contacts After Sign In";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),i.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.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,i=this.options.sfsAppShareUiModel;i.get("autocomplete_scroll")||(e.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SHARE,n.EMAIL,n.AUTOCOMPLETE,n.SCROLL]),i.set("autocomplete_scroll",!0),i.set("autocomplete_immediate_click",!0),i.set("autocomplete_avoided",!0))},_insertEmail:function(e,i){this.options.emailView.abortPGCRequest(),this.options.emailView._setRecipientsFromText(e,i),this.setFilter(void 0),_.delay(_.bind(function(){this._editControl.focus(!0)},this),10)}}),i.SendACopyAutocompleteView}),define("pdmplugins/send-for-sign/js/ops/plugin/get-from-addressbook-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){return i.GetFromAddressbookOp=e.Op.extend({run:function(){var e=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(i){i.stApi.resolveAddressBookApi().then(_.bind(function(i){i._addEventListener("custom:onAddressesAdded",_.bind(function(i,t){var s=t.params;s.length?e.resolve(s):e.reject()},this))},this),_.bind(function(){e.reject()},this))},this)),e.promise()}}),i.GetFromAddressbookOp}),define("pdmplugins/send-for-sign/js/views/Share/share-tab-email-addr-view",["core/ac-core","core/utils/view-util","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-tab-email-addr-view-template","pdmplugins/send-for-sign/js/templates/share/share-tab-email-list-item-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/views/Share/share-tab-autocomplete-view","pdmplugins/unified-share/js/utils/sc-constants","core/utils/truncate","pdmplugins/send-for-sign/js/ops/plugin/get-from-addressbook-op","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/views/input-placeholder-view"],function(e,i,t,s,n,o,a,r,l,d,p){return t.UsModalEmailAddrView=e.View.extend({events:{"input .sfs-share-modal-address-input":"_onRecipientsInput","paste .sfs-share-modal-address-input":"_onRecipientsPaste","blur  .sfs-share-modal-address-input":"_onRecipientsBlur","click .us-share-address-box":"_onShareAddressClick","click .share-email-list-close":"_onEmailListClose","focus .sfs-share-modal-address-input":"_onInputFocus","blur .sfs-share-modal-address-input":"_onInputBlur","click .sfs-share-modal-address-book":"_onAddressBookClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s),this._localAddressTemplate=_.template(n);var i=_.extend({},this.options,{searchString:""});this.PGCOp=e.opFactory.create("GettingPGCSuggestionsOp",i)},render:function(){var i;e.View.prototype.render.call(this);this.options.sfsAppShareUiModel;return 0===this.$el.children().length&&(this.$el.html(this._template({SHARE_ADDRESS_HEADING:o.SHARE_ADDRESS_HEADING,SHARE_ADDRESS_PROMPT:o.SEND_A_COPY_EMAIL_RECIPIENTS,SHARE_INDIVIDUAL_HELP:o.SHARE_INDIVIDUAL_HELP,CLOSE:o.CLOSE,ADDED_MEMBERS:o.ADDED_RECIPIENT,SHARE_SUBTEXT:o.SHARE_SUBTEXT,USER_ADVISORY_MSG:o.USER_ADVISORY_MSG,ADDED_MEMBERS_MSG:o.SHARE_ACCORDIAN_SUMMARY_2,SUBJECT_TITLE:o.NAME_STRING,MESSAGE_TITLE:o.SHARE_MESSAGE_HEADING,ADDRESS_BOOK:o.ADDRESS_BOOK,ADDRESS_BOOK_LABEL:o.ADDRESS_BOOK_LABEL})),this._initWrappers(),i=document.createElement("input"),void 0!==i.placeholder?this.$addressHeading.hide():this.$addressHeading.show(),e.Util.isCEF()&&(this.$addressHelpMsg.css("z-index","1000"),this.$autocompleteBox.css("z-index","1001"))),this._addUiModelEventListeners(),this._addKeyEventListener(),this._renderChildViews(),$(".sfs-share-modal-address-input").one("focus",this._initialiseEmailAddFetching),this._updateEmailFields(),this._processRecipients(!0),this},stopListening:function(i,t,s){e.View.prototype.stopListening.call(this,i,t,s),this.applyMethodRecursively("undelegateEvents"),this._removeUiModelEventListeners()},_initWrappers:function(){this.$addressHeading=this.$(".share-address-heading"),this.$addressBox=this.$(".us-share-address-box"),this.$emailErrorBubble=this.$(".sharing-email-error"),this.$addressHelpMsg=this.$(".share-address-help-msg"),this.$autocompleteBox=this.$(".sfs-share-modal-autocomplete-box"),this.$shareModalEmailList=this.$(".share-modal-email-list"),this.$addedMembers=this.$("#added-members"),this.$addedMembersMessage=this.$("#share-added-members-message"),this.$addedMembersListContainer=this.$("#added-members-list-container"),this.$removeButton=this.$(".share-email-list-close"),this.$inputContainer=this.$(".sfs-share-modal-address-input-container"),this.$input=this.$(".sfs-share-modal-address-input"),this.$inputMask=this.$(".share-address-input-mask"),this.$searchEmailImg=this.$("#sfs-share-modal-search-email-img"),this.$usModalEmailInputBox=this.$(".sfs-share-modal-email-input-box")},_renderChildViews:function(){var i,t=this.options.sfsAppShareUiModel;this._renderChildView("_input",e.InputPlaceholderView,this.$input),t.get("enable_autocomplete")?(i=_.extend({},this.options,{emailView:this}),this.$autocompleteBox.show(),this._renderChildView("_autocompleteControl",a,this.$autocompleteBox,i)):(this._autocompleteControl&&this.removeChildView(this._autocompleteControl),this.$autocompleteBox.hide())},_detachChildViewsAndClear:function(){this._autocompleteControl&&this.removeChildView(this._autocompleteControl);var e=this.options.sfsAppShareUiModel.get("email_addr_collection");e.length>0&&e.reset()},_updateEmailFields:function(){this.options.sfsAppShareUiModel;this.$el.removeClass("disabled"),this.$addressHeading.removeAttr("disabled"),this.enable(!0)},_onEmailListClose:function(e){var i,t,s=$(e.target),n=this.options.sfsAppShareUiModel.get("email_addr_collection"),o=r.SHARE,a=r.USE,l="Remove User";this.options.appApi.siteCatalystApi.logScEvent([o,a,l]),i=s.data("asset-id"),i&&(t=n.get(i),n.remove(t)),this._updateAddedMembersText(n.length)},_processRecipients:function(e){var i=this.options.sfsAppShareUiModel.get("email_addr_collection");i.length>0?(this._toggleSubjectAndMessageVisibility(!0),console.log("Send Button enabled"),parent.$(".share-send-a-copy-button").removeClass("disabled").removeAttr("disabled"),this.$searchEmailImg.hide(),this.$input.css("margin-left","4px")):(console.log("Send Button disabled"),parent.$(".share-send-a-copy-button").addClass("disabled").attr("disabled","disabled"),this.$searchEmailImg.show(),this.$input.css("margin-left","20px")),e&&(this.focus(!0),this._input.enablePrompt(0===i.length).render(),this._renderEmailList(i))},_renderEmailList:function(i){var t,s,n,a,r,d=this.$shareModalEmailList,p=(this.options,this._computeMaxAvailWidth());e.Util.isCEF()&&d.show(),d.children(".share-modal-email-list-item").remove(),i.each(_.bind(function(e){s=e.get(e.get("name")?"name":"email"),n=e.get("email"),r=e.get("valid"),a=this._localAddressTemplate({name:s,email:n,remove:o.SEND_REMOVE,asset_id:e.cid,ariaRemoveLabel:this._getRemoveAriaLabel(s)}),s&&r?0==d.children(".share-modal-email-list-item").length?d.prepend(a):d.children(".share-modal-email-list-item").last().after(a):r||i.remove(e)},this)),_.each(this.$(".share-email-list-name"),function(e){t=$(e);var i={truncateFromRight:!0,truncateFromExt:!1,ellipsis:"...",maxIterations:10};l.truncateElementText(t,p-$(".share-email-list-close").width(),i)}),this._updateAddedMembersText(i.length);var c=this.$(".sfs-share-modal-email-input-box").last().offset().top;d.scrollTop(c)},_updateAddedMembersText:function(e){void 0!=e&&e>=0&&this.$addedMembers.html(o.ADDED_RECIPIENT_NO_COUNT+" ("+e+")")},_getRemoveAriaLabel:function(e){return _.template(o.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:o.SEND_REMOVE})},_initialiseEmailAddFetching:function(){var i=this.options,s=i.sfsAppShareUiModel,n=(i.limitsModel,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(i){i.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().done(_.bind(function(){i.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().done(_.bind(function(i){if(i){var t=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),n=p.SEND_A_COPY,o=p.START,a="Get MSGraph Contacts for SignedIn User";this.options.appApi.siteCatalystApi.logScEvent([n,o,a]),t.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.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,i){var t=i.params,s=t.split(";"),n="",o="",a=-1,r=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)),r.get(o)&&r.remove(o),r.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.sfsAppShareUiModel;e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:enable_autocomplete",this._onEnableAutocompleteChange)},_removeUiModelEventListeners:function(){var e=this.options.sfsAppShareUiModel;e.get("email_addr_collection").off("all",this._onRecipientsChange),e.off("change:enable_autocomplete",this._onEnableAutocompleteChange)},_onViewEvent:function(i,t){"CHICKLET_REMOVED"===i&&this._onChickletRemoved(),e.View.prototype._onViewEvent.call(this,i,t)},_onRecipientsChange:function(){this._onDebouncedRecipientsChange()},_onDebouncedRecipientsChange:function(){this._processRecipients(!0)},_getAriaLabelForDesktop:function(e,i){return _.template(o.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_onEnableAutocompleteChange:function(){this._renderChildViews()},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which,s=!1,n=this.$input;return this._input._hasFocus()?(this._updateInputEmailTextAreaWidth(),13===t?this._autocompleteControl&&(this._autocompleteControl.makeChoice(!1)||_.defer(_.bind(function(){this.abortPGCRequest(),this._setRecipientModels()},this))):9===t?this._autocompleteControl&&!e.shiftKey&&this._autocompleteControl.makeChoice()&&(i=!0):8===t?this.hasText()||(this.removeLastRecipient(),i=!0):40===t?this._autocompleteControl&&(this._autocompleteControl.selectDown(),s=!0,i=!0):38===t?this._autocompleteControl&&(this._autocompleteControl.selectUp(),s=!0,i=!0):27===t&&this._autocompleteControl&&(this._autocompleteControl.filteredCollection.length?(this._autocompleteControl.setFilter(void 0),i=!0):i=!1),s?n.attr("aria-activedescendant",this._autocompleteControl.$(".selected").attr("id")):n.removeAttr("aria-activedescendant"),i&&this._consumeEvent(e),i):i},_onKeyup:function(e){var i=!1,t=e.which;return this._input._hasFocus()?(32===t&&(i=!0,_.defer(_.bind(function(){this._setRecipientModels(!0)},this))),i):i},_updateInputEmailTextAreaWidth:function(){var e=this.options.sfsAppShareUiModel.get("email_addr_collection");if(0==e.length)return void this.$usModalEmailInputBox.css("width","90%");var i,t=8*this.val().length,s=this.$usModalEmailInputBox.width(),n=this.$shareModalEmailList.width()-25;t>s&&n>t&&(i=t+32,i>n&&(i=n),this.$usModalEmailInputBox.css("width",i+"px"))},_restoreInputEmailTextAreaWidth:function(){var e=this.options.sfsAppShareUiModel.get("email_addr_collection");if(0==e.length)return void this.$usModalEmailInputBox.css("width","90%");var i,t=this.$shareModalEmailList.width();0==this.val().length&&(i=.4*t,this.$usModalEmailInputBox.css("width",i+"px"))},_changeTextColor:function(e){e?($("#sfs-share-modal-address-input").removeClass("theme-share-input-text"),$("#sfs-share-modal-address-input").addClass("theme-text")):($("#sfs-share-modal-address-input").removeClass("theme-text"),$("#sfs-share-modal-address-input").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(i){i.length>0&&(this.options.sfsAppShareUiModel.set("pgcSuggestionsCollection",i),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.sfsAppShareUiModel.get("email_addr_collection");e.pop()},_onRecipientsInput:function(){var e=this.val();this._changeTextColor(e),this._setAutocompleteFilterValue(e)},_onRecipientsPaste:function(){_.defer(_.bind(function(){var e=this.val();this._changeTextColor(!0),this._setRecipientModels(),this._setAutocompleteFilterValue(e)},this),100)},_onRecipientsBlur:function(){return this._setRecipientModels(),this._autocompleteControl&&this._autocompleteControl.setFilter(void 0),!0},_setRecipientModels:function(e){var i=this.val();_.isUndefined(e)||!e||i.match(/.*@.*/)||(i+=" "),this._setRecipientsFromText(i)},_setRecipientsFromText:function(i,t){var s,n,o=this.options,a=o.sfsAppShareUiModel;if(e.Util.isCEF()&&i.match(/.+\s$/)&&0!==this._autocompleteControl.filteredCollection.length&&!i.match(/.*@.*|.+\s\s$/))return void this.setValue(i);if(i=i.replace(/(\r\n|\n|\r)/gm,""),s=i.split(i.match(/(<\S+>)/)?/\s*[,;]+\s*/:/\s*[,;\s]+\s*/),n=a.parseEmailArray(s,t),n.length>0)if(console.log(n[0].get("valid")),0==n[0].get("valid"));else{a.addRecipientsToCollection(n),this.clear();var l=r.SHARE,d=r.USE,p="Add user";o.appApi.siteCatalystApi.logScEvent([l,d,p]),o.appApi.siteCatalystApi.logScEvent([r.TOOLS,r.SHARE,r.EMAIL,r.CHICKLET_ADDED]),a.get("autocomplete_avoided")||(o.appApi.siteCatalystApi.logScEvent([r.TOOLS,r.SHARE,r.EMAIL,r.AUTOCOMPLETE,r.AVOIDED]),a.set("autocomplete_avoided",!0))}},_onInputFocus:function(){this.$input.addClass("focus")},_onInputBlur:function(){this.$input.removeClass("focus"),this._restoreInputEmailTextAreaWidth()},_onAddressBookClick:function(){var e,i,t,s=r.SHARE,n=r.USE,o="Select Address Book";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),t=_.extend({},this.options),i=new d(t),e=i.run(),e.then(_.bind(function(e){this._setRecipientsFromText(e)},this),_.bind(function(){},this))},_onShareAddrHelp:function(){var e=this.options.sfsAppShareUiModel;e.set({display_individual_help:!0})},_onShareAddrMsgClose:function(){var e=this.options.sfsAppShareUiModel;e.set({display_individual_help:!1}),this.focus(!0)},_onShareAddressClick:function(){this.focus(!0)},_onChickletRemoved:function(){this.focus(!0)},_computeMaxAvailWidth:function(){return 200},val:function(){return this.$input.val()||""},hasText:function(){return this._input.hasText()},setValue:function(e){this.$input.val(e)},enable:function(e){e?(this.$input.removeAttr("disabled"),this.$inputMask.hide()):(this.$input.attr({disabled:"disabled"}),this.$inputMask.show())},focus:function(e){var t=this.$input.is(":disabled");t&&(e=!1),i.descendantHasFocus(".share-individual:checked,.share-email-chicklet,.sfs-share-modal-address-input,.share-address-help-msg-close")||(e=!1),this._isFocus=e,this.$input.focus()},clear:function(){this.$input.val(""),this._restoreInputEmailTextAreaWidth()}}),t.UsModalEmailAddrView}),define("pdmplugins/send-for-sign/js/views/Share/share-send-a-copy-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-send-a-copy-view-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/views/Share/share-tab-email-addr-view","core/views/plugin-content-view"],function(e,i,t,s,n,o,a){var r=100,l=255;
return s.ShareSendACopyView=e.View.extend({events:{"click .share-send-a-copy-button":"_onBtnClick","keydown .share-send-copy-subject":"_onKeyDownSubjectTextArea","keydown .share-send-copy-message":"_onKeyDownMessageTextArea"},initialize:function(){e.PluginContentView.prototype.initialize.call(this),this._template=_.template(n)},render:function(){var i=this.$el;e.PluginContentView.prototype.render.call(this),console.log("send a copy called"),0===i.children().length&&(i.html(_.template(n,{SEND_A_COPY_HEADING:o.SEND_A_COPY_HEADING,SEND_A_COPY_DESCRIPTION:o.SEND_A_COPY_DESCRIPTION,LEARN_MORE:o.LEARN_MORE,SHARE_BUTTON:o.SEND_A_COPY_BUTTON,SHARE_CLOSE:o.SEND_A_COPY_STATUS2,SEND_A_COPY_NOTICE:o.GET_A_LINK_ADVISORY,SHARE_INITIAL_SUBJECT_ARIA_LABEL:"",SHARE_MESSAGE_HEADING_ARIA_LABEL:o.SEND_A_COPY_OPTIONAL_MESSAGE,INPUT_MESSAGE_PLACEHOLDER:o.SEND_A_COPY_OPTIONAL_MESSAGE})),this._initWrappers()),this._renderChildViews(),this.$(".sfs-share-modal-address-input").focus();var t=s.QueryParams.agreementOpened;return"true"==t&&(this.$(".fss-share-advisory-container").css("display","none"),this.$(".share-send-copy-subject").prop("readonly",!0),this.$sendACopyHeading.html(o.SEND_A_COPY_HEADING2),this.$("#send-a-copy-description").html(o.SEND_A_COPY_DESCRIPTION2)),this.$subjectHeader.val().length<=0&&!_.isUndefined(s.QueryParams.agreementName)&&s.QueryParams.agreementName.length>0&&this.$subjectHeader.text(s.QueryParams.agreementName),this.$(".share-send-copy-subject").prop("readonly",!0),this._getSelectedFile(),this},_renderChildViews:function(){console.log("send a copy adding child view"),this._renderChildView("_emailAddressView",s.UsModalEmailAddrView,this.$emailAddressView)},_onKeyDownMessageTextArea:function(e){var i=e.which?e.which:e.keyCode,t=i>=37&&40>=i||8==i||46==i;return t||e.target.textLength!=l?void e.stopPropagation():(e.preventDefault(),void e.stopPropagation())},_onKeyDownSubjectTextArea:function(e){var i=e.which?e.which:e.keyCode,t=i>=37&&40>=i||8==i||46==i;if(!t&&e.target.textLength==r)return e.preventDefault(),void e.stopPropagation();var s;13==i&&e.preventDefault(),32==i&&(s=this.$subjectHeader.text()+" ",this.$subjectHeader.text(s)),e.stopPropagation()},_doSendACopy:function(){console.log("send a copy"),this.options.sfsAppSendACopyUiModel.set("is_getalink_workflow",!1),"true"===s.QueryParams.agreementOpened&&this.options.sfsAppSendACopyUiModel.set("is_agreement_opened",!0),this._ValidateSession()&&this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.SEND_A_COPY;this.options.appApi.siteCatalystApi.logScEvent([i,a.FSS_USER_SIGNED_IN]),this.options.sfsAppSendACopyUiModel.set("workflow_running",!0),s.opFactory.create("SendCompletedCopyOp",_.extend({},this.options)).run().then(_.bind(function(){this._workflowcomplete()},this),_.bind(function(){this._workflowcomplete()},this))},this))},_workflowcomplete:function(){console.log("workflow complete"),0==this.options.sfsAppSendACopyUiModel.get("is_agreement_opened")&&_.delay(_.bind(function(){var e={};e.id=this.options.sfsAppSendACopyUiModel.get("agreementId"),this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaSignWorkflowServicesAPI.invokeMethod({methodName:"updateDataModelAfterActionForAgreement",methodArgs:e})},this))},this),1e3)},_acceptPGCRecipients:function(i){var t=[];i.map(_.bind(function(i){if(_.isUndefined(i.get("token"))){var s=_.extend({},this.options,{newContactEmail:i.get("email")});e.opFactory.create("AcceptingNewPGCSuggestionOp",s).run()}else t.push(i.get("token"))},this));var s=_.extend({},this.options,{tokens:t});e.opFactory.create("AcceptingPGCSuggestionsOp",s).run()},_onBtnClick:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.SEND_A_COPY;this.options.appApi.siteCatalystApi.logScEvent([i,a.SEND_A_COPY_CREATE]),console.log("send a copy button clicked");var t=this.options.sfsAppSendACopyUiModel;t.reset();var n=this.$subjectHeader.val().length>0;n||this.$subjectHeader.text(s.QueryParams.agreementName);var o=this.$subjectHeader.val().replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n");t.set("agreement_subject",o);var r=this.options.sfsAppSendACopyUiModel.get("selectedFiles");n&&r.length>0&&r[0].get("name")!=this.$subjectHeader.val()&&this.options.appApi.siteCatalystApi.logScEvent([i,a.SEND_A_COPY_SUBJECT]),console.log(t.get("agreement_subject"));var l=this.$descriptionBody.val().replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n");t.set("agreement_msg",l),console.log(t.get("agreement_msg")),_.isEmpty(t.get("agreement_msg").length>0)||this.options.appApi.siteCatalystApi.logScEvent([i,a.SEND_A_COPY_MSG]);var d=this.options.sfsAppShareUiModel.getRecipientsArray();t.set("recipientlist",d),console.log(t.get("recipientlist"));var p=d.length;this.options.appApi.siteCatalystApi.logScEvent([a.SEND_A_COPY_USER_COUNT,p]);var c=_.clone(this.options.autoCCollection),h=this.options.autoCCollection.filter(function(e){return _.contains(d,e.get("email"))});c.reset(h),_.each(d,function(e){c.add({email:e})}),this._acceptPGCRecipients(c),this.options.sfsAppSendACopyUiModel.set("is_getalink_workflow",!1),console.log("is running = "+this.options.sfsAppSendACopyUiModel.get("workflow_running")),this._doSendACopy()},_getSelectedFile:function(){console.log("_getSelectedFile"),this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();if(_.isEmpty(i))console.log("_getSelectedFile::Active doc NOT found"),this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc");else{console.log("_getSelectedFile::Active doc found");var t=[];t.push(i),this.options.sfsAppSendACopyUiModel.set("selectedFiles",t);var n=t[0].get("name"),o=n.substr(0,n.lastIndexOf("."))||n;"true"===s.QueryParams.agreementOpened?e.esApi.invokeMethod({methodName:"GetOpenDocAgreementID"}).done(_.bind(function(e){var i=e,t=o.substr(0,o.indexOf(i)-1)||o;this.$subjectHeader.text(t),this.$subjectHeader.val().length<=0&&this.$(".share-send-copy-subject").prop("readonly",!1)},this)):this.$subjectHeader.text(o)}},this))},_ValidateSession:function(){console.log("_ValidateSession");var e=this.options.sfsAppSendACopyUiModel.get("is_agreement_opened"),i=this.options.sfsAppSendACopyUiModel.get("selectedFiles");return e||!_.isUndefined(i)&&0!=i.length||this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc"),this.options.appApi.networkConnectivityApi.isOnline()||this.options.sfsAppSendACopyUiModel.set("failed_workflow","UserOffline"),_.isEmpty(this.options.sfsAppSendACopyUiModel.get("failed_workflow"))?(console.log("ValidateSession: success"),!0):!1},_initWrappers:function(){this.$emailAddressView=this.$("#email-address-template-container"),this.$emailAddressInner=this.$("#sfs-share-modal-address-input"),this.$subjectHeader=this.$(".share-send-copy-subject"),this.$descriptionBody=this.$(".share-send-copy-message"),this.$emailInput=$(".sac-email-textarea"),this.$sendACopyHeading=$("#send-a-copy-heading")}}),s.ShareSendACopyView}),define("pdmplugins/send-for-sign/js/templates/share/share-sfs-view-template",[],function(){return'<div class="sfs-share-title ui-theme theme-header-text expansion-view-heading"><%= GET_SIGNATURES_HEADING  %></div><div id="get-signatures-description" class="modal-sfs-share-tab-summary ui-theme theme-text"><div class="sfs-desc-str ui-theme theme-header-text"><%= GET_SIGNATURES_DESCRIPTION %> <a id="get-signatures-learn-more" class="ui-theme theme-hyperlink theme-share-add-files" tabindex = "6"><%= LEARN_MORE %></a></div><div class="sfs-workflow-education ui-theme theme-text"><div class="sfs-workflow-education-div"><div class="sfs-workflow-stage1-img"></div><div class="sfs-sendafile-text ui-theme theme-header-text"><%= SFS_WORKFLOW_STAGE_1 %></div></div><div class="sfs-workflow-arrow-img"></div><div class="sfs-workflow-education-div"><div class="sfs-workflow-stage2-img"></div><div class="sfs-recipients-text ui-theme theme-header-text"><%= SFS_WORKFLOW_STAGE_2 %></div></div><div class="sfs-workflow-arrow-img"></div><div class="sfs-workflow-education-div"><div class="sfs-workflow-stage3-img"></div><div class="sfs-getnotified-text ui-theme theme-header-text"><%= SFS_WORKFLOW_STAGE_3 %></div></div></div><div id="sfs-legal-id" class="sfs-legal-txt ui-theme theme-header-text"><%= GET_LEGAL_TEXT %></div><div class="sfs-button-bar ui-theme theme-share-container"><button class="share-sfs-button control-button theme-button theme-button-label"  tabindex = "9" aria-label = "<%= SFS_ADD_SIGNERS_BUTTON %>"  id="sfs-add-signers-button"><%= SFS_ADD_SIGNERS_BUTTON %></button></div>'}),define("pdmplugins/send-for-sign/js/views/Share/share-sfs-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-sfs-view-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/views/plugin-content-view"],function(e,i,t,s,n,o,a){return s.ShareSFSView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addUiModelEventListeners()},render:function(){var i=this.$el;return e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n,{GET_SIGNATURES_HEADING:o.SFS_TITLE1,GET_SIGNATURES_DESCRIPTION:o.SFS_MSG2,LEARN_MORE:o.LEARN_MORE,SFS_WORKFLOW_STAGE_1:o.SFS_MSG3,SFS_WORKFLOW_STAGE_2:o.SFS_MSG4,SFS_WORKFLOW_STAGE_3:o.SFS_MSG5,SFS_ADD_SIGNERS_BUTTON:o.SFS_SIGNIN_BTN,GET_LEGAL_TEXT:o.SFS_TRIAL_CONDITION})),this._initWrappers()),this._renderChildViews(),this._UpdateTrialView(),this.$("#sfs-add-signers-button").focus(),this},events:function(){return{"click #sfs-add-signers-button":"_LaunchSFSApp","click #sfs-signin-button":"_ShowSignInDialog","click #get-signatures-learn-more":"_onLearnMoreClick","keyup #get-signatures-learn-more":"_onLearnMorePress"}},_initWrappers:function(){this.$addSignersButton=this.$("#sfs-add-signers-button"),this.$signInButton=this.$("#sfs-signin-button"),this.$signDesc=this.$(".sfs-desc-str"),this.$signTitle=this.$(".sfs-share-title"),this.$signLegalTextId=this.$("#sfs-legal-id")},_addUiModelEventListeners:function(){var e=this.options.sfsAppShareUiModel;e.on("change:is_signed_in",this._onSignInStatusChange)},_renderChildViews:function(){this.$signLegalTextId.hide()},_onLearnMorePress:function(e){var i=e.which?e.which:e.keyCode;13==i&&(this._onLearnMoreClick(),e.preventDefault())},_UpdateTrialView:function(){this.options.appApi.rnaApi.done(_.bind(function(i){if(e.Util.isReader()&&!i.isSignedInReader()&&i.esApi.isTrialFeatureEnabled()){var t=i.esApi.getTotalTrialTransactionsForFreeUser();console.log("total_free_transaction::"+t);var s=_.template(o.SFS_TRIAL_TITLE4,{count:t});this.$signTitle.html(o.SFS_TRIAL_TITLE),this.$signDesc.html(s),this.$signLegalTextId.show(),this.options.appApi.siteCatalystApi.logScEvent([a.GET_SIG,a.GET_SIG_TRIAL])}else this.$signLegalTextId.hide()},this))},_LaunchSFSApp:function(){this.options.appApi.rnaApi.done(_.bind(function(i){var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+a.GET_SIG;this.options.appApi.siteCatalystApi.logScEvent([s,a.GET_STARTED_CLICKED]),e.Util.isReader()&&!i.isSignedInReader()&&i.esApi.isTrialFeatureEnabled()?this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){this.options.appApi.siteCatalystApi.logScEvent([s,a.FSS_USER_SIGNED_IN]),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"SwitchLayout",methodArgs:{Type:"SFS",Context:"ShareDialog"}})},this)):this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"SwitchLayout",methodArgs:{Type:"SFS",Context:"ShareDialog"}})},this))},_ShowSignInDialog:function(){},_onLearnMoreClick:function(){this.options.appApi.siteCatalystApi.logScEvent([a.GET_SIG,a.GET_SIG_LM]);var e=o.LP_LEARN_MORE_GOURL;_.isEmpty(e)||this.options.appApi.rnaApi.done(_.bind(function(i){i.openDecoratedUrl(e)},this))}}),s.ShareSFSView}),define("pdmplugins/send-for-sign/js/views/Share/share-expansion-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-expansion-view-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/views/Share/share-get-a-link-view","pdmplugins/send-for-sign/js/views/Share/share-send-a-copy-view","pdmplugins/send-for-sign/js/views/Share/share-sfs-view","core/views/plugin-content-view"],function(e,i,t,s,n){return s.ShareExpansionView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addUiModelEventListeners()},render:function(){var i=this.$el;return e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n,{})),this._initWrappers()),this._renderChildViews(),this._onTabChange(),this},_initWrappers:function(){this.$getALinkView=this.$("#get-a-link-view-container"),this.$sendACopyView=this.$("#send-a-copy-view-container"),this.$sfsView=this.$("#request-sig-view-container")},_addUiModelEventListeners:function(){var e=this.options.sfsAppShareUiModel;e.on("change:current_tab",this._onTabChange)},_renderChildViews:function(){this._renderChildView("_shareGetALink",s.ShareGetALinkView,this.$getALinkView),this._renderChildView("_shareSendACopy",s.ShareSendACopyView,this.$sendACopyView),this._renderChildView("_shareSFS",s.ShareSFSView,this.$sfsView)},_onTabChange:function(){var e=this.options.sfsAppShareUiModel.get("current_tab");this.$getALinkView.hide(),this.$sendACopyView.hide(),this.$sfsView.hide(),"get-a-link"===e?this.$getALinkView.show():"send-a-copy"===e?this.$sendACopyView.show():"get-others-to-sign"===e&&this.$sfsView.show()}}),s.ShareExpansionView}),define("pdmplugins/send-for-sign/js/templates/share/share-send-a-copy-success-template",[],function(){return'<div id="sfs-modal-success-view-container" class="ui-theme theme-share-grey-container"><button class="us-modal-success-view-image" tabindex="-1"/><div class="doc-sent-container"><div class="doc-sent-text-heading theme-text"><%= DOC_SENT_HEADING %></div></div><div class="send-a-copy-button-success-bar ui-theme theme-share-grey-container"><div class="sac-button-set"><button class="close-sac-button theme-text" aria-label = "<%= CLOSE %>"> <%= CLOSE %> </button></div></div></div>'}),define("pdmplugins/unified-share/js/ac-unified-share",["plugins-common/ac-plugins","pdmplugins/esign/js/ac-esign-init"],function(e){var i=e.UnifiedShare;return i||(i=e.UnifiedShare={}),i.PLUGIN_ID||(i.PLUGIN_ID="unified_share"),i}),define("pdmplugins/unified-share/js/ops/close-app-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t){i.CloseAppOp=e.Op.extend({run:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=t.USE,s="Close Share Panel";this.options.appApi.siteCatalystApi.logScEvent([e,i,s]),"true"===this.options.sendFilesUiModel.get("isModalView")?this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.closeModalShareView()},this),_.bind(function(){return $.Deferred().reject().promise()},this)):this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"executeAppUICommand",methodArgs:""})},this))}})}),define("pdmplugins/send-for-sign/js/views/Share/share-send-a-copy-success",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-send-a-copy-success-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/unified-share/js/ops/close-app-op"],function(e,i,t,s){return i.UsModalShareSuccessView=e.View.extend({events:{"click #share-send-a-copy-button":"_onClickSentLink","click .close-sac-button":"_CloseDialog"},initialize:function(){e.PluginContentView.prototype.initialize.call(this),this._template=_.template(t)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SUCCESS_CLOSE:s.CLOSE_STRING,DOC_SENT_HEADING:s.SEND_A_COPY_STATUS2,CLOSE:s.SFS_ERR_CLOSE_BTN})),this._initWrappers()),this.$(".close-sac-button").focus()},_initWrappers:function(){this.$sfsSuccessViewContainer=this.$("#sfs-modal-success-view-container"),this.$close=this.$(".close-button"),this.$close.focus()},_onClickSentLink:function(){console.log("invoked _onClickSentLink");var e,i,t,s,n,o;this.options.appApi.rnaApi.done(_.bind(function(a){if(e=a.esApi.getEchoSignServiceParams(),i=e.apiURL,t=this.options.esAuthUiModel.get("access_token"),n=this.options.sfsAppSendACopyUiModel.get("agreementId"),o=this.options.sfsAppSendACopyUiModel.get("agreement_msg"),!_.isEmpty(i)&&!_.isEmpty(t)){s=i+"/api/rest/v6/agreements/"+n+"/combinedDocument";var r={requestURL:s,accessToken:t,agreementName:o,agreementId:n,context:"SendACopy"};a.esApi.invokeMethod({methodName:"viewSignedDoc",methodArgs:r}).then(function(){},function(){})}},this))},_CloseDialog:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"})},_centerVertically:function(){var e,i=$("#sfs-view-container").height();console.log("the height is  : "+i),e=.15*i,this.$sfsSuccessViewContainer.css("margin-top",e)}}),i.UsModalShareSuccessView}),define("pdmplugins/send-for-sign/js/views/Share/share-dialog-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-dialog-view-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/views/plugin-content-view","pdmplugins/send-for-sign/js/views/Share/share-tab-view","pdmplugins/send-for-sign/js/views/Share/share-expansion-view","pdmplugins/send-for-sign/js/views/Share/share-send-a-copy-success",""],function(e,i,t,s,n,o,a){return s.ShareDialogView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this)},render:function(){var i=this.$el;e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n,{SHARE_DIALOG_HEADING:o.SHARE_DIALOG_HEADING,CLOSE:o.SFS_ERR_CLOSE_BTN})),this._initWrappers()),this.$sendACopyLoader.hide(),this._renderChildViews(),this._addKeyEventListener();var t=s.QueryParams.agreementOpened;return"true"==t&&this.$uploadText.css("display","none"),this},_addKeyEventListener:function(){var e=this.options.sfsAppSendACopyUiModel;console.log("_addKeyEventListener"),e.on("change:workflow_running",this._onSendACopyWorkflowStateChange),e.on("change:failed_workflow",this._onSendACopySuccessStateChange),e.on("change:workflow_success_status",this._onSendACopySuccessStateChange)},_onSendACopyWorkflowStateChange:function(){var e=this.options.sfsAppSendACopyUiModel,i=e.get("workflow_running"),t=e.get("is_getalink_workflow");return t?void console.log("is get a link"):void(i&&!t&&(console.log("workflow running"),this.$shareViewContainer.hide(),this.$modalShareHeading.hide(),this.$modeText.text(o.SEND_A_COPY_STATUS),this.$uploadText.text(o.SEND_A_COPY_MSG),this.$sendACopyLoader.show(),this._makeLoaderCenterVertically(),this._makeLoaderCenterHorizontally()))},_onSendACopySuccessStateChange:function(){var e=this.options.sfsAppSendACopyUiModel,i=e.get("workflow_success_status"),t=e.get("workflow_running"),n=e.get("is_getalink_workflow");if(n||!t&&_.isEmpty(e.get("failed_workflow")))return void console.log("is get a link or model reset");var r=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),l=r+"-"+a.SEND_A_COPY;if(i)console.log("send a copy workflow completed"),this.options.appApi.siteCatalystApi.logScEvent([l,a.SEND_A_COPY_SUCCESS]),this._renderChildView("_shareSuccessView",s.UsModalShareSuccessView,this.$sfsSuccessView),this.$shareViewContainer.hide(),this.$modalShareHeading.hide(),this.$sendACopyLoader.hide(),this.$sfsSuccessView.show();else{this.$shareViewContainer.hide(),this.$modalShareHeading.hide(),this.$sendACopyLoader.hide(),this.$SendACopyErrorDiv.show(),this.options.appApi.siteCatalystApi.logScEvent([l,a.SEND_A_COPY_FAILURE]);var d=this.options.sfsAppSendACopyUiModel.get("failed_workflow");switch(d){case"NoDoc":this.$ErrText.html(o.FSS_LINK_CREATION_FAILED_BODY);break;case"UserOffline":this.$ErrText.html(o.FSS_ERR_OFFLINE_MSG);break;case"LARGE_FILE_SIZE":this.$ErrText.html(o.FSS_ERR_LARGE_FILE_MSG);break;case"AUTH_FAILED":this.$ErrText.html(o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+o.FSS_ERR_AUTH_FAILED_MSG);break;case"Missing_TransientIDs":this.$ErrText.html(o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+o.FSS_ERR_MIISSING_TRANSIENTIDS_MSG);break;case"Agreement_Wait_Exceeded":this.$ErrText.html(o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+o.FSS_ERR_AGREEMENT_WAIT_EXCEEDED_MSG);break;default:this.$ErrText.html(d==o.SFS_ERR_GENERAL_WORKFLOW_FAILURE?o.SFS_ERR_GENERAL_WORKFLOW_FAILURE:o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+d)}this.$SendACopyErrorDiv.show(),this.options.appApi.siteCatalystApi.logScEvent([a.SEND_A_COPY_FAILURE_REASON,d])}},events:function(){return{"click .share-close-img":"_CloseDialog","click #share-close-button":"_CloseDialog"}},_initWrappers:function(){this.$sfsViewContainer=this.$("#sfs-view-container"),this.$shareTabViewContainer=this.$("#share-tab-view-container"),this.$shareExpansionViewContainer=this.$("#share-expansion-view-container"),this.$sendACopyLoader=this.$(".sfs-modal-loader"),this.$shareViewContainer=this.$("#share-view-container"),this.$modeText=this.$("#mode-text"),this.$uploadText=this.$("#uploading-text"),this.$sfsSuccessView=this.$("#us-success-view"),this.$sfsLoader=this.$(".sfs-modal-loader"),this.$modalLoader=this.$("#modal-loader"),this.$modalShareHeading=this.$("#modal-share-heading"),this.$SendACopyErrorDiv=this.$(".sfs-modal-sac-error"),this.$ErrText=this.$("#sac-error-text"),this.closeButton=this.$("#share-close-button")},_renderChildViews:function(){this._renderChildView("_sharetabview",s.ShareTabView,this.$shareTabViewContainer),this._renderChildView("_shareexpansionview",s.ShareExpansionView,this.$shareExpansionViewContainer)},_CloseDialog:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.FSS_SHARE_CLOSED;this.options.appApi.siteCatalystApi.logScEvent([i,a.FSS_SHARE_CLOSE_CLICKED]),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"})},_makeLoaderCenterVertically:function(){var e,i=this.$sfsViewContainer.height();e=.4*i,this.$sfsLoader.css("margin-top",e)},_makeLoaderCenterHorizontally:function(){var e=this.$sfsViewContainer.width(),i=this.$modalLoader.outerWidth(!1);this.$modalLoader.css("margin-left",(e-i)/2)}}),s.ShareDialogView}),define("pdmplugins/send-for-sign/js/templates/share/share-popup-view-template",[],function(){return'<div id="share-popup-view-container" class="ui-theme theme-container theme-share-grey-container">      	<div id="saved-changes-container" class = "ui-theme theme-container theme-share-grey-container theme-fill-sign-auto-popup-saved-bar-bg-color">            <table >              <tr>                <td rowspan="2"><div id="saved-changes-img" class="popup-table-icon"></div></td>                <td>					<div class="saved-changes-content ui-theme theme-text"> <%= SHARE_POPUP_SAVED_INFO %> </div>				 </td>              </tr>            </table>		</div>		<hr id="separator" class="theme-fill-sign-auto-popup-separator-color">      	<div id="heading-table-close-container">          <div id="heading-close-container">            <div id="share-popup-heading-text" class ="ui-theme theme-text" aria-label="<%= SHARE_POPUP_HEADING %>"><%= SHARE_POPUP_HEADING %></div>			 <div id="start-focus-guard" tabindex = 1></div>			 <div id="end-focus-guard" tabindex = 6></div>          </div>          <div id="table-container">            <table id="locked-copy-table" tabindex=3 aria-label="<%= SHARE_LOCKED_COPY_HEADING %>" class="popup-table-content ui-theme theme-text theme-share-grey-container">              <tr>                <td rowspan="2">					 <div id="locked-copy-radio-button-container" class="popup-table-radio-button popup-radio-cell">						<input type="radio" id="locked-copy-radio-button" name="locked-copy-radio-button" value="locked-copy" checked>					 </div>				 </td>                <td rowspan="2"><div id="locked-copy-icon-img" class="popup-table-icon"></div></td>                <td>					<div class="popup-table-heading ui-theme theme-text"> <%= SHARE_LOCKED_COPY_HEADING %> </div>				 </td>              </tr>              <tr>                <td>					<div class="popup-table-content ui-theme theme-text subheading-content"> <%= SHARE_LOCKED_COPY_CONTENT %> </div>                </td>              </tr>            </table>            <table id="request-signature-table-fss" tabindex=4 aria-label="<%= REQUEST_SIGNATURES_HEADING %>" class="popup-table-content ui-theme theme-text theme-share-grey-container">              <tr>                <td rowspan="2">					<div id="request-signature-radio-button-container" class="popup-table-radio-button popup-radio-cell">						<input type="radio" id="request-signature-radio-button" name="request-signature-radio-button" value="request-signature">					</div>				 </td>                <td rowspan="2"><div id="request-signature-icon-img" class="popup-table-icon"></div></td>                <td>					<div class="popup-table-heading ui-theme theme-text"> <%= REQUEST_SIGNATURES_HEADING %> </div>				 </td>              </tr>              <tr>                <td>					<div class="popup-table-content ui-theme theme-text subheading-content"> <%= REQUEST_SIGNATURES_CONTENT %> </div>				 </td>              </tr>            </table>          </div>			<div id="offline-error-container" class="hidden">				<div id="offline-error-img"></div>				<div id="offline-error-text" class="ui-theme fss-err-title theme-text"> <%= SHARE_POPUP_OFFLINE_ERROR %></div>			</div>    	</div> 	<div id="continue-button-container">   	<input type="button" tabindex=5 aria-label="<%= SHARE_POPUP_CONTINUE_BUTTON %>" id = "share-popup-continue-button" class="theme-fill-sign-next-popup-continue-cta-text-color theme-fill-sign-next-popup-continue-cta-bg-color" value="<%= SHARE_POPUP_CONTINUE_BUTTON %>" />   	<input type="button" tabindex=2 aria-label="<%= SHARE_POPUP_CANCEL_BUTTON %>" id = "share-popup-cancel-button" class="theme-fill-sign-next-popup-cancel-cta-bg-color theme-fill-sign-next-popup-cancel-cta-text-color" value="<%= SHARE_POPUP_CANCEL_BUTTON %>" />   </div></div>'}),define("pdmplugins/send-for-sign/js/views/Share/share-popup-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-popup-view-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/views/plugin-content-view",""],function(e,i,t,s,n,o,a){return s.SharePopUpView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this)},render:function(){var i=this.$el;e.PluginContentView.prototype.render.call(this);var t=this.options.appApi,a=!1;a=t.isAppUsingAV2UI();var r=s.QueryParams.selection,l=s.QueryParams.saved;return 0===i.children().length&&(i.html(_.template(n,{SHARE_POPUP_SAVED_INFO:o.SHARE_POPUP_SAVED_INFO,SHARE_POPUP_HEADING:o.SHARE_POPUP_HEADING,SHARE_LOCKED_COPY_HEADING:o.SHARE_LOCKED_COPY_HEADING,SHARE_LOCKED_COPY_CONTENT:o.SHARE_LOCKED_COPY_CONTENT,REQUEST_SIGNATURES_HEADING:o.REQUEST_SIGNATURES_HEADING,REQUEST_SIGNATURES_CONTENT:a?o.AV2_REQUEST_SIGNATURES_CONTENT:o.REQUEST_SIGNATURES_CONTENT,SHARE_POPUP_OFFLINE_ERROR:o.SHARE_POPUP_OFFLINE_ERROR,SHARE_POPUP_CONTINUE_BUTTON:o.SHARE_POPUP_CONTINUE_BUTTON,CLOSE:o.SFS_ERR_CLOSE_BTN,SHARE_POPUP_CANCEL_BUTTON:o.SHARE_POPUP_CANCEL_BUTTON})),this._initWrappers(),this._focusGuard()),this._adjustmarginForLocale(),this.options.sfsAppSendACopyUiModel.reset(),"request_signatures"===r?this._RequestSignatureSelected():this._LockedCopySelected(),"after_save"!==l&&(this.$("#saved-changes-container").hide(),this.$("#separator").hide()),this._getSelectedFile(),this},events:function(){return{"click .share-popup-close-img":"_CloseSharePopUpDialog","click #locked-copy-table":"_LockedCopySelected","click #request-signature-table-fss":"_RequestSignatureSelected","click #share-popup-continue-button":"_ContinueDialog","click #share-popup-cancel-button":"_CloseSharePopUpDialog","keypress .share-popup-close-img":"_keypressOnCloseBtn","keypress #locked-copy-table":"_keypressOnLockedCopy","keypress #request-signature-table-fss":"_keypressOnRequestSignature","keypress #share-popup-continue-button":"_keypressOnContinueBtn","keypress #share-popup-cancel-button":"_keypressOnCloseBtn"}},_initWrappers:function(){this.$lockedCopyTable=this.$("#locked-copy-table"),this.$lockedCopyRadioButton=this.$("#locked-copy-radio-button"),this.$requestSignatureTable=this.$("#request-signature-table-fss"),this.$requestSignatureRadioButton=this.$("#request-signature-radio-button"),this.$sharePopupCloseButton=this.$("#share-popup-cancel-button"),this.$continueBtn=this.$("#share-popup-continue-button"),this.$errorContainer=this.$("#offline-error-container")},_adjustmarginForLocale:function(){var e=400,i=document.getElementById("share-popup-view-container").offsetWidth;i>e&&(document.getElementById("heading-table-close-container").setAttribute("style","margin-right:5%;"),document.getElementById("heading-table-close-container").style.width="auto")},_focusGuard:function(){this.$("#end-focus-guard").on("focus",_.bind(function(){this.$sharePopupCloseButton.focus()},this)),this.$("#start-focus-guard").on("focus",_.bind(function(){this.$continueBtn.focus()},this))},_keypressOnLockedCopy:function(e){e&&"keypress"==e.type&&(13==e.keyCode||32==e.keyCode||0==e.keyCode)&&this._LockedCopySelected()},_keypressOnRequestSignature:function(e){e&&"keypress"==e.type&&(13==e.keyCode||32==e.keyCode||0==e.keyCode)&&this._RequestSignatureSelected()},_keypressOnContinueBtn:function(e){e&&"keypress"==e.type&&(13==e.keyCode||32==e.keyCode||0==e.keyCode)&&this._ContinueDialog()},_keypressOnCloseBtn:function(e){e&&"keypress"==e.type&&(13==e.keyCode||32==e.keyCode||0==e.keyCode)&&this._CloseSharePopUpDialog()},_LockedCopySelected:function(){this.$requestSignatureTable.removeClass("row-selected-border"),this.$requestSignatureTable.addClass("row-unselected-border"),this.$lockedCopyTable.removeClass("row-unselected-border"),this.$lockedCopyTable.addClass("row-selected-border"),this.options.sfsAppSendACopyUiModel.set("current_share_choice","locked-copy"),document.getElementById("locked-copy-radio-button").checked=!0,document.getElementById("request-signature-radio-button").checked=!1},_RequestSignatureSelected:function(){this.$lockedCopyTable.removeClass("row-selected-border"),this.$lockedCopyTable.addClass("row-unselected-border"),this.$requestSignatureTable.removeClass("row-unselected-border"),this.$requestSignatureTable.addClass("row-selected-border"),this.options.sfsAppSendACopyUiModel.set("current_share_choice","request-signature"),document.getElementById("locked-copy-radio-button").checked=!1,document.getElementById("request-signature-radio-button").checked=!0},_ContinueDialog:function(){return this._isOffline()?void this.$errorContainer.removeClass("hidden"):void this.options.appApi.rnaApi.done(_.bind(function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.FSS_SHARE_POPUP,t=this.options.sfsAppSendACopyUiModel.get("current_share_choice");this.options.sfsAppSendACopyUiModel.set("is_locked_copy_workflow",!0),"locked-copy"===t?(this.options.appApi.siteCatalystApi.logScEvent([i,"LockedCopy"]),this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.rnaApiObj.esApi.isSavingSignCertifiedCopyEnabled()?[i,"LockedCopy_SaveLocalCopyEnabled"]:[i,"LockedCopy_SaveLocalCopyDisabled"]),this._SaveLocalCopy()):(this.options.appApi.siteCatalystApi.logScEvent([i,"RequestSignature"]),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchSFSAppInModalDialog"})),this._CloseSharePopUpDialog()
},this))},_isOffline:function(){return!this.options.appApi.networkConnectivityApi.isOnline()},_getSelectedFile:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();if(_.isEmpty(i))this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc");else{var t=[];t.push(i),this.options.sfsAppSendACopyUiModel.set("selectedFiles",t)}},this))},_SaveLocalCopy:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"saveLocalCopy",methodArgs:{}}).done(_.bind(function(e){e.length},this))},this))},_UploadAndOpenLockedCopy:function(){this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){this._notifyProgressBar("StartProgressBar"),this.options.sfsAppSendACopyUiModel.set("workflow_running",!0),s.opFactory.create("SendCompletedCopyOp",_.extend({},this.options)).run().then(_.bind(function(){this._workflowcomplete(),this._notifyProgressBar("AgreementCreated")},this),_.bind(function(e){this._workflowError(e)},this))},this))},_CloseSharePopUpDialog:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeSharePopUpDialog"})},_notifyProgressBar:function(e,t){this.options.appApi.rnaApi.done(_.bind(function(s){(!i.isReader()||s.isSignedInReader())&&s.esApi.invokeMethod({methodName:"FSSProgessBar",methodArgs:{State:e,Message:t}})},this))},_workflowError:function(){var e="";"LARGE_FILE_SIZE"==this.options.sfsAppSendACopyUiModel.get("error_code")&&(e=o.FSS_ERR_LARGE_FILE_MSG),this._notifyProgressBar("Error",e)}}),s.SharePopUpView}),define("pdmplugins/send-for-sign/js/templates/sign-educational-card-template",[],function(){return'    <div" id="sfs-educational-card-outer-container" >    <div id="sfs-educational-card-container" >       <div id="sfs-educational-card-title" class="theme-text">           <%=  sfs_edu_card_title  %>       </div>       <hr id="edu_card_sep_line" />       <div id="sfs_edu_card_details"  class="theme-text"><%=CARD_DETAIL%>       </div>   <div id="sfs-workflow-edu">       <table class="sfs-workflow-table">           <tr>               <td class="sfs-workflow-edu-icon-column"><div id="sfs-workflow-edu-stage1-img"></div></td>               <td class="sfs-arrow-edu-column"><div class="sfs-edu-arrow-img"></div></td>               <td class="sfs-workflow-edu-icon-column"><div id="sfs-workflow-edu-stage2-img"></div></td>               <td class="sfs-arrow-edu-column"><div class="sfs-edu-arrow-img"></div></td>               <td class="sfs-workflow-edu-icon-column"><div id="sfs-workflow-edu-stage3-img"></div></td>           </tr>           <tr>               <td class="sfs-workflow-edu-text-column theme-text"><div class="ui-theme theme-text edu_stage_details edu_stage_send"><%= SFS_WORKFLOW_STAGE_1 %></div></td>               <td class="sfs-arrow-edu-column"></td>               <td class="sfs-workflow-edu-text-column theme-text"><div class="ui-theme theme-text edu_stage_details edu_stage_recv"><%= SFS_WORKFLOW_STAGE_2 %></div></td>               <td class="sfs-arrow-edu-column"></td>               <td class="sfs-workflow-edu-text-column theme-text"><div class="ui-theme theme-text edu_stage_details edu_stage_noti"><%= SFS_WORKFLOW_STAGE_3 %></div></td>           </tr>       </table>   </div>     <div class="sfs-trial-condition-text theme-text"><%= TRIAL_CONDITION_TEXT %></div>     <div id="sfs-edu-card-button-grp">           <div id ="powere-by-adobe-on-edu-card" class="sfs-workflow-poweredby-img"></div>               <button id = "sfs-edu-card-cancel-btn" class=" control-button site-catalyst button-grey  theme-button-gray-label">                   <%= desc_cancel %>               </button>               <button id = "sfs-edu-card-next-btn"  aria-labelledby="sfs-educational-card-title sfs-edu-card-next-btn" class=" control-button site-catalyst theme-button theme-button-label">                   <%= desc_next %>               </button>           </div>    </div></div>'}),define("pdmplugins/send-for-sign/js/views/sfs-sign-educational-card-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sign-educational-card-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s,n,o,a){return s.SignEducationalCardView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addKeyEventListener()},events:function(){return{"click #sfs-edu-card-cancel-btn":"_onCancelClick","click #sfs-edu-card-next-btn":"_onNextClick"}},render:function(){var i=this.$el;e.PluginContentView.prototype.render.call(this);var t=s.QueryParams.width,o=s.QueryParams.height,a=this._getVariantStringSet();return 0===i.children().length&&(i.html(_.template(n,{sfs_edu_card_title:a.cardTitle,CARD_DETAIL:a.cardDetails,desc_cancel:a.sfsCardCancelBtn,desc_next:a.sfsCardNextBtn,SFS_WORKFLOW_STAGE_1:a.eduStageSend,SFS_WORKFLOW_STAGE_2:a.eduStageRecv,SFS_WORKFLOW_STAGE_3:a.eduStageNoti,TRIAL_CONDITION_TEXT:a.trialCondText})),this._initWrappers(),$("#sfs-educational-card-outer-container").width(t-4).height(o-4),$("#sfs-educational-card-container").width(t-80),$("#sfs-educational-card-container").height(o-80),this.options.appApi.rnaApi.then(_.bind(function(e){e.isHighContrastEnabled()&&($("#sfs-educational-card-outer-container").css("border-color","white"),$("#sfs-educational-card-outer-container").css("border","1px"),$("#sfs-educational-card-outer-container").css("border-style","solid"))},this))),$("#sfs-edu-card-next-btn").focus(),this},_initWrappers:function(){this.$cardTitle=this.$("#sfs-educational-card-title"),this.$cardDetails=this.$("#sfs_edu_card_details"),this.$eduStageSend=this.$(".edu_stage_send"),this.$eduStageRecv=this.$(".edu_stage_recv"),this.$eduStageNoti=this.$(".edu_stage_noti"),this.$trialCondText=this.$(".sfs-trial-condition-text"),this.$sfsCardCancelBtn=this.$("#sfs-edu-card-cancel-btn"),this.$sfsCardNextBtn=this.$("#sfs-edu-card-next-btn")},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_CloseDialog:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeEducationalCard"})},_onCancelClick:function(){this.options.appApi.siteCatalystApi.logScEvent([a.SEND_FOR_SIG,a.EDU_CARD,a.CANCEL_CLICKED]),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeEducationalCard"})},_onNextClick:function(){this.options.appApi.siteCatalystApi.logScEvent([a.SEND_FOR_SIG,a.EDU_CARD,a.GET_STARTED_CLICKED]);var e=void 0!==s.QueryParams.invocationPoint?s.QueryParams.invocationPoint:"";this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"nextEducationalCard",methodArgs:{invocationPoint:e}})},_onKeyDown:function(e){{var i=e.keyCode,t=$(e.target);$.Event("click")}switch(i){case 9:this.$sfsCardNextBtn[0]===t[0]?this.$sfsCardCancelBtn.focus():this.$sfsCardNextBtn.focus(),e.preventDefault(),e.stopPropagation()}},_getVariantStringSet:function(){if(this.options.stringSet)return this.options.stringSet;var e={};return e.cardTitle=o.SFS_TRIAL_TITLE,e.cardDetails=o.SFS_TRIAL_TITLE5+s.QueryParams.trans_count+o.SFS_TRIAL_TITLE6,e.eduStageSend=o.SFS_TRIAL_MSG,e.eduStageRecv=o.SFS_TRIAL_MSG1,e.eduStageNoti=o.SFS_TRIAL_MSG2,e.trialCondText=o.SFS_TRIAL_CONDITION,e.sfsCardCancelBtn=o.SFS_PROGRESS_CANCEL_LABEL,e.sfsCardNextBtn=o.SFS_SIGNIN_BTN,e}}),s.SignEducationalCardView}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-modal-view-container-template",[],function(){return'<div class="sfs-modal-view-container"><div class="sfs-modal-landing-page-container" class="ui-theme theme-container"></div><div class="sfs-modal-sac-error ui-theme theme-text theme-share-grey-container hidden"><div id="sfs-failure-img" class= "ui-theme theme-text"></div><div id="sac-error-text" class= "ui-theme theme-text"></div><div class="sfs-button-bar ui-theme theme-text theme-share-grey-container"><button class="close-button control-button theme-button theme-button-label" aria-label = "<%= CLOSE %>"  id="share-close-button"><%= CLOSE %></button></div></div></div>'}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-modal-landing-page-template",[],function(){return'<div class="sfs-modal-trial-bar-container" class="ui-theme theme-container"></div><div id="sfs-modal-top-heading"><div class="sfs-modal-close-img" aria-label="<%= close %>" title="<%= close %>" > </div><div id="sfs-modal-landing-page-content" class="ui-theme theme-container">     <div class="sfs-modal-view-title theme-text" ><%= title %></div>     <hr>     <div id="sfs-modal-description">     <div class="sfs-modal-view-subtitle theme-text">           <div id="add-signers-description"><%= subtitle %></div>           <a class="sfs-modal-learn-more theme-hyperlink" tabindex="13"><%= subtitle3 %></a>     </div>     </div>     </div></div><div id="sfs-modal-primary-container">      <div class="sfs-modal-loader-container hidden">          <div class="sfs-modal-loader-new" id="modal-loader-new"></div>          <div id="uploading-text-new" class= "ui-theme theme-text"><%= uploadingText %></div>      </div>  <div id="sfs-modal-scrollable-div">  <div class = "sfs-modal-info-content-container">    <div class = "sfs-modal-add-signers-div">          <div class="sfs-modal-general-heading theme-text"><%= totitle %></div>         <div class="sfs-modal-email-addcc" >                <a class = "theme-hyperlink" tabindex= "2"><%= addcc %></a>         </div>    </div>     <div class="sfs-modal-email-list">       <div class="sfs-modal-to-email-block">         <button id="sfs-modal-landing-page-new-search-email-img" tabindex="-1"/>         <div class ="sfs-to-email-ids-list"></div>           <textarea class="sfs-modal-email-textarea ui-theme theme-container theme-text" placeholder="<%=to_email_placeholder%>" align="right" rows="1" tabindex="1" spellcheck="false"></textarea>       </div>       <div class="sfs-modal-cc-email-fullblock hidden" >           <div class="sfs-modal-general-heading-addcc theme-text"> <%= cc %> | <a id="sfs-modal-email-hidecc" class = "theme-hyperlink" tabindex="4"><%= hide %></a></div>           <div class="sfs-modal-cc-email-block" >                 <div class ="sfs-cc-email-ids-list"></div>                 <textarea class="sfs-modal-email-cc-textarea ui-theme theme-container theme-text" placeholder="<%=cc_email_placeholder%>" align="right" rows="1" tabindex="5" spellcheck="false"></textarea>           </div>       </div>       <div class = "role-dropdown hidden">           <ul id="dropdown-menu" >                 <li class="signer"><div id = "icon"><div class="signerImg posAbsolute"></div></div><span class="value" > <%=roledropdown_signer%></span></li>                 <li class="approver"><div id = "icon"><div class="approverImg posAbsolute"></div></div><span class="value"> <%=roledropdown_approver%></span></li>           </ul>       </div>       <div class="share-autocomplete-box"></div>    </div>    <div id="sfs-modal-subjext-textarea">           <textarea class="sfs-modal-subject-list ui-theme theme-container theme-text" rows="1" placeholder ="<%=subject_placeholder%>" align="left" maxlength="255" tabindex="6"></textarea>           <textarea class="sfs-modal-message-list ui-theme theme-container theme-text" rows="3" align="left" tabindex="7"></textarea>     </div>    <div class="sfs-modal-selected-files-heading-container-new.hidden">    <div class="sfs-modal-selected-files-heading-container-new">       <div class="sfs-modal-selected-files-heading-new theme-text" tabindex="-1"><%= selected_files %></div>       <div class="sfs-modal-tool-options-add-files">           <a id="sfs-modal-add-button" class="sfs-modal-add-files addfile theme-hyperlink" tabindex="8"><%= add_files %></a>       </div>    </div>    <div class="sfs-modal-selected-files-container-new">       <div class="sfs-modal-selected-files-list-new ui-theme theme-border"></div>       <div class="sfs-modal-app-info-container">           <div class="info-txt 1"></div>           <div class="info-txt 2"></div>           <div class="info-txt 3"></div>       </div>    </div>    </div>    </div>    </div>     <div class = "sfs-modal-email-error-parent hidden">           <table class = "sfs-modal-email-error">              <tr>                 <td><div class="sfs-modal-caution-img"></td>                 <td><div class="sfs-modal-email-error-msg"></div></td>                 <td><span id="sfs-modal-close-button" class="theme-text" tabindex="12"><span></td>               <tr>           </table>     </div>    <div class="sfs-share-advisory-msg">           <em><%= share_advisory_msg %></em>    </div>     <div class="sfs-modal-action-btns-group-new">    <div class="sfs-modal-row">           <div class="sfs-modal-left" id="sfs-modal-file-action-btn-new-2">                 <a id="sfs-modal-more-options-heading" title = "<%= advanced_tooltip %>" class="ui-theme theme-hyperlink" tabindex="9"><%=advanced_sign%>                 <span id="sfs-modal-more-options-plus-icon"></span></a>           </div>           <div class="sfs-modal-right">                 <div class="sfs-modal-file-action-new-btn-and-descr sfs-modal-action-btns-group-new-container">                       <input type="button" id = "sfs-modal-cancel-btn" class=" control-button dialog-control-button button-grey site-catalyst ui-theme theme-text" tabindex="10" aria-label="<%= cancel %>" value="<%= cancel %>"/>                       <input type="button" id = "sfs-modal-file-action-btn-new-1" class=" control-button sfs-modal-file-action-btn-new 1 site-catalyst theme-button theme-button-label" tabindex="11"/>                 </div>           </div>    </div>    </div></div></div></div>'}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-modal-filename-template",[],function(){return'<div class="sfs-modal-selected-file-item-new ui-theme      theme-border">	 <div class="file-icon"> </div>    <div class="file-name ui-theme theme-text"><%= fileName %></div>    <button class="file-remove-new hidden core-remove-x sfs-file-remove-new"     tabindex = 0 aria-label="<%= ariaRemoveLabel %>"></button></div>'}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-modal-trial-bar-template",[],function(){return'<div id="sfs-modal-free-transaction" class="theme-sfs-modal-trial-bar-color">       <div id="sfs-modal-trial-bar-signed-user-view"><div class="sfs-modal-free-trans-title theme-text">     <div class="sfs-modal-free-trans-title_text"><%= trial_title  %></div>     <div class="sfs-modal-info-icon-img" title = "<%= info_label_tooltip %>" class="ui-theme theme-hyperlink"></div></div></div>       <div id="sfs-modal-trial-bar-unsigned-user-view"><div class="sfs-modal-free-trans-title theme-text">     <div><%= trial_title_unsigned_user  %></div></div></div></div>'}),define("pdmplugins/send-for-sign/js/views/modal/sfs-modal-trial-bar-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-modal-trial-bar-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s,n){return i.SFSModalTrialBarView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addUiModelEventListeners()},events:function(){return{"hover .sfs-modal-info-icon-img":"_onHoverTrialInfo","click .sfs-modal-info-icon-img":"_onHoverTrialInfo"}},render:function(){if(e.View.prototype.render.call(this),!this.options.sfsAppTrialBarUiModel.get("is_visible")&&this.options.appApi.sessionApi.isSignedInReader())return this.$el.hide(),this;this.$el.show();var i=this.options.sfsAppTrialBarUiModel.get("remaining_transaction"),t=_.template(s.SFS_MODAL_TRIAL_TITLE,{rem_trans:i});return 0===this.$el.children().length&&(this.$el.html(this._template({trial_title:t,info_label_tooltip:s.SFS_MODAL_INFO_LABEL_DESC,trial_title_unsigned_user:s.SFS_MODAL_INFO_LABEL_DESC})),this._initWrappers(),this.options.appApi.rnaApi.then(_.bind(function(e){e.isHighContrastEnabled()&&(this.$trialBar.css("border-color","white"),this.$trialBar.css("border","1px"),this.$trialBar.css("border-style","solid")),this.options.appApi.sessionApi.isSignedInReader()?this.$unsigned_user_bar.hide():(this.$signed_user_bar.hide(),this.$trialBar.css("padding-bottom","8.5px"),this.$trialBar.css("padding-top","4.5px")),this._updateRemainingTransactions()},this))),this},_initWrappers:function(){this.$trialBar=this.$("#sfs-modal-free-transaction"),this.$trial_title=this.$(".sfs-modal-free-trans-title_text"),this.$unsigned_user_bar=this.$("#sfs-modal-trial-bar-unsigned-user-view"),this.$signed_user_bar=this.$("#sfs-modal-trial-bar-signed-user-view")},_onDataUpdate:function(){this.render(),this._updateRemainingTransactions()},_addUiModelEventListeners:function(){var e=this.options.sfsAppTrialBarUiModel;e.on("change:remaining_transaction",this._onDataUpdate),e.on("change:is_visible",this._onDataUpdate)},_onUpgradeBtnClick:function(){this.options.appApi.rnaApi.done(_.bind(function(e){this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SEND_FOR_SIG,n.FREE_TRANS_BAR,n.UPGRADE,n.CLICKED]);var i;i=s.SFS_FREE_TRANSACTION_BAR_UPGRADE,_.isEmpty(i)||e.openDecoratedUrl(i)},this))},_onHoverTrialInfo:function(){},_updateRemainingTransactions:function(){var e=this.options.sfsAppTrialBarUiModel.get("remaining_transaction"),i=this.$trial_title.text();0===e&&(this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"}),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"})),i=e>1?_.template(s.SFS_MODAL_TRIAL_TITLE,{rem_trans:e}):_.template(s.SFS_MODAL_TRIAL_TITLE_1,{rem_trans:e}),this.$trial_title.html(i)},show:function(){this.render()}}),i.SFSModalTrialBarView}),define("pdmplugins/send-for-sign/js/views/modal/sfs-modal-landing-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-modal-landing-page-template","pdmplugins/send-for-sign/js/templates/modal/sfs-modal-filename-template","pdmplugins/send-for-sign/js/templates/sfs-email-block-template","pdmplugins/send-for-sign/js/templates/sfs-guide-template","pdmplugins/send-for-sign/js/templates/sfs-guide-template-new","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/utils/util","core/utils/truncate","core/utils/css-util","core/utils/file-types","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/utils/image-loader","core/utils/http-util","pdmplugins/send-for-sign/js/utils/sfs-ts-utils","pdmplugins/send-for-sign/js/views/sfs-autocomplete-view","pdmplugins/send-for-sign/js/views/modal/sfs-modal-trial-bar-view","pdmplugins/send-for-sign/js/ops/plugin/desktop-fetching-autocomplete-list-op","pdmplugins/send-for-sign/js/ops/plugin/desktop-getting-subscription-levels-op"],function(e,i,t,s,n,o,a,r,l,d,p,c,h,u,g,f){var S,m=!1,E=!1,A=25,v=11,C=255,I=!1,T=!1,O=!1,b=!1,w=!1,R=0,L=0,F=!0;return i.SFSModalLandingPageView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._fileNameTemplate=_.template(s),this._emailIdTemplate=_.template(n),this._landingPageUiModel=this.options.sfsAppLandingPageUiModel,this.$currentVisibleThumbNail="fileName",this._addUiModelEventListeners(),this._addKeyEventListener();var i=_.extend({},this.options,{searchString:""});this.PGCOp=e.opFactory.create("GettingPGCSuggestionsOp",i)},events:function(){return{"click .sfs-modal-learn-more":"_onLearnMoreBtnClick","click .sfs-guide-lean-more-link":"_onLearnMoreLinkClickAddSignersGuide","click .sfs-modal-add-files":"_onAddFilesBtnClick","click .sfs-modal-selected-file-item-new .file-remove-new":"_onSelectedFileItemRemoveClick","click #sfs-modal-file-action-btn-new-1":"_onSFSNextBtnClick","click #sfs-modal-file-action-btn-new-2":"_onSFSAdvancedSignBtnClick","click .sfs-modal-close-img":"_closeDialog","click #sfs-modal-cancel-btn":"_closeDialog","keyup .sfs-modal-email-textarea":"_onKeyUpEmaiTextarea","keydown .sfs-modal-email-textarea":"_onKeyDownEmailTextarea","paste .sfs-modal-email-textarea":"_onPasteEmailTextarea","focusout .sfs-modal-email-textarea ":"_onFocusOutEmailTextarea","input .sfs-modal-email-textarea ":"_onInputEmailTextarea","keyup .sfs-modal-email-cc-textarea":"_onKeyUpCCEmaiTextarea","keydown .sfs-modal-email-cc-textarea":"_onKeyDownCCEmailTextarea","paste .sfs-modal-email-cc-textarea":"_onPasteCCEmailTextarea","focusout .sfs-modal-email-cc-textarea ":"_onFocusOutCCEmailTextarea","input .sfs-modal-email-cc-textarea ":"_onInputCCEmailTextarea","click .sfs-modal-email-addcc":"_OnclickAddCC","click #sfs-modal-email-hidecc":"_OnClickHideCC","click #sfs-modal-close-button":"_closeError","click .dropbtn":"_roleDropdownClick","mouseenter .signer":"_OnMouseEnterSignerBlock","mouseleave .signer":"_OnMouseLeaveSignerBlock","mouseenter .approver":"_OnMouseEnterApproverBlock","mouseleave .approver":"_OnMouseLeaveApproverBlock","mouseenter .sfs-guide-new":"_OnMouseEnterGuideBlock","mouseleave .sfs-guide-new":"_OnMouseLeaveGuideBlock","click .sfs-email-id-item .email-remove":"_onSelectedEmailRemoveClick","keydown .sfs-modal-subject-list":"_onKeyDownSubjectTextArea","keydown .sfs-modal-message-list":"_onKeyDownMessageTextArea","input .sfs-modal-message-list":"_adjustMessgeTextAreaHeight","mouseenter .sfs-modal-selected-file-item-new":"_onMouseEnterSelectedFileItem","mouseleave .sfs-modal-selected-file-item-new":"_onMouseLeaveSelectedFileItem","mouseenter .sfs-modal-email-address-help":"_onMouseEnterEmailHelpIcon","mouseleave .sfs-modal-email-address-help":"_onMouseLeaveEmailHelpIcon","click .sfs-modal-to-email-block":"_onEmailToAreaClick","click .sfs-modal-cc-email-block":"_onCCAreaClick","focus .sfs-modal-to-email-block":"_getEmailContacts","focus .sfs-modal-cc-email-block":"_getEmailContacts","click .sfs-guide-new-close":"_hideNewGuide"}},_OnMouseEnterGuideBlock:function(){F=!1},_OnMouseLeaveGuideBlock:function(){F=!0},_closeOpenDropdownandGuides:function(){this.$roleDropDown.hasClass("hidden")||(this.$roleDropDown.addClass("hidden"),this.$signerBlockInRoleDropDown.hasClass("SignerHover")&&(this.$signerBlockInRoleDropDown.removeClass("SignerHover"),this._roleDropdownSelectSignerClick(this.$signerBlockInRoleDropDown)),this.$approverBlockInRoleDropDown.hasClass("ApproverHover")&&(this.$approverBlockInRoleDropDown.hasClass("ApproverHover"),this._roleDropdownSelectApproverClick(this.$approverBlockInRoleDropDown)),event.stopPropagation()),this._hideButtonGuide(),this._autocompleteControl&&this._autocompleteControl.setFilter(void 0)},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var i=e.keyCode,t=$(e.target),s=$.Event("click");switch(i){case 13:t.trigger(s),e.preventDefault();break;case 9:var n=!this.$EmailErrorParent.hasClass("hidden"),o=n?this.$closeButton:this.$learnMore;this.$emailTextarea[0]==t[0]?e.shiftKey?(o.focus(),e.stopPropagation(),e.preventDefault()):n&&(this.$(".sfs-modal-email-addcc").focus(),this.$(".sfs-modal-email-addcc").focus(),e.stopPropagation(),e.preventDefault()):e.shiftKey||o[0]!=t[0]?this.$(".sfs-modal-email-addcc")[0]==t[0]?this._onMouseEnterEmailHelpIcon():this.$(".sfs-modal-email-address-help")[0]==t[0]&&this._onMouseLeaveEmailHelpIcon():(this.$emailTextarea.focus(),e.stopPropagation(),e.preventDefault())}},_addUiModelEventListeners:function(){this._landingPageUiModel.on("change:is_refreshed",this._refreshPageContent),this._landingPageUiModel.on("change:is_visible",this._onVisibilityChange)},render:function(){if(e.View.prototype.render.call(this),!this._landingPageUiModel.get("is_visible"))return this.$el.hide(),this;if(this.$el.show(),0===this.$el.children().length){var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+f.getFillSignReaderFreeTransVariant(this.options);this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.sessionApi.isSignedInReader()?[s,h.NEW_LANDING_PAGE,h.SIGNED_USER]:[s,h.NEW_LANDING_PAGE,h.UNSIGNED_USER]),this.$el.html(this._template({title:r.SFS_LANDING_TITLE,addcc:r.LP_ADD_CC,subtitle:r.SFS_LANDING_DESCRIPTION,subtitle3:r.LP_SUBTITLE4_NEW,uploadingText:r.DOC_PROGRESS_LABEL,close:r.SFS_ERR_CLOSE_BTN,totitle:r.SFS_LANDING_STR2,toMessage:r.SFS_LANDING_MSG5,add_files:r.SFS_ADD_FILES,selected_files:r.LP_FILES,cancel:r.SFS_PROGRESS_CANCEL_LABEL,no_email_error:r.LP_NO_EMAIL_ERROR,invalid_email_error:r.LP_INVALID_EMAIL_ERROR,to_email_placeholder:r.SFS_LANDING_MSG8,cc_email_placeholder:r.LP_CC_EMAIL_PLACEHOLDER,subject_placeholder:r.LP_SUBJECT_PLACEHOLDER,roledropdown_signer:r.LP_SIGNER,roledropdown_approver:r.LP_APPROVER,help_icon_text:r.LP_HELP_ICON_TEXT,cc:r.LP_CC,hide:r.LP_HIDE,advanced_sign:r.SFS_LANDING_MSG4,advanced_tooltip:r.ADVANCED_BUTTON_TOOLTIP,disclaimer1:r.LP_DISCLAIMER1,disclaimer2:r.LP_DISCLAIMER2,disclaimer3:r.GET_A_LINK_ADVISORY,share_advisory_msg:r.GET_A_LINK_ADVISORY2})),this._initWrappers(),this._refreshPageContent(),this._UpdatePreviouslyUsedContacts()}this.$sfsLoaderNew.hide(),this._renderChildViews();var n=i.QueryParams.mode;return 1==n&&this._prepopulateFields(),this._registerEventsToCloseRoleDropDown(),this._LogSignActivity(),this},_initWrappers:function(){this.$sfsTrialBar=this.$(".sfs-modal-trial-bar-container"),this.$fileItemsContainerElem=this.$(".sfs-modal-selected-files-list-new"),this.$modalLandingPageContentDiv=this.$("#sfs-modal-landing-page-content"),this.$sfsScrollableDiv=this.$("#sfs-modal-scrollable-div"),this.$sfsLoaderNew=this.$(".sfs-modal-loader-container"),this.$emailBlock=this.$(".sfs-modal-to-email-block"),this.$emailCCBlock=this.$(".sfs-modal-cc-email-block"),this.$emailIdList=this.$(".sfs-to-email-ids-list"),this.$emailIdCCList=this.$(".sfs-cc-email-ids-list"),this.$emailTextarea=this.$(".sfs-modal-email-textarea"),this.$emailCCTextarea=this.$(".sfs-modal-email-cc-textarea"),this.$messageBody=this.$(".sfs-modal-message-list"),this.$hiddenMessageBodyDiv=this.$(".sfs-modal-message-list-hidden-div"),this.$subject=this.$(".sfs-modal-subject-list"),this.$fileItemsHeadingElem=this.$(".sfs-modal-selected-files-heading-container-new"),this.$actionBtnsGrpElem=this.$(".sfs-modal-action-btns-group-new"),this.$actionBtnsContainerElem=this.$(".sfs-modal-action-btns-group-new-container"),this.$actionBtn1Elem=this.$(".sfs-modal-file-action-btn-new.1"),this.$actionBtn2Elem=this.$(".sfs-modal-file-action-btn-new.2"),this.$advancedSignBtn=this.$("#sfs-modal-file-action-btn-new-2"),this.$actionBtn1DescrElem=this.$(".description-text.1"),this.$actionBtn2DescrElem=this.$(".description-text.2"),this.$actionBtnSeparatorElem=this.$(".sfs-modal-action-btn-separator"),this.$appInfoContainer=this.$(".sfs-modal-app-info-container"),this.$appInfoTxt1Elem=this.$(".sfs-modal-app-info-container .info-txt.1"),this.$appInfoTxt2Elem=this.$(".sfs-modal-app-info-container .info-txt.2"),this.$appInfoTxt3Elem=this.$(".sfs-modal-app-info-container .info-txt.3"),this.$docThumbnail=this.$(".sfs-modal-current-thumbnail-row"),this.$EmailError=this.$(".sfs-modal-email-error"),this.$EmailErrorMsg=this.$(".sfs-modal-email-error-msg"),this.$EmailErrorParent=this.$(".sfs-modal-email-error-parent"),this.$addCCBlock=this.$(".sfs-modal-cc-email-fullblock"),this.$autocompleteBox=this.$(".share-autocomplete-box"),this.$learnMore=this.$(".sfs-modal-learn-more"),this.$closeButton=this.$("#sfs-modal-close-button"),this.$previewImage=this.$(".sfs-modal-preview-image"),this.$signerBlockInRoleDropDown=this.$(".signer"),this.$approverBlockInRoleDropDown=this.$(".approver"),this.$roleDropDown=this.$(".role-dropdown"),R=this._calculateUtf8Length(this.$emailTextarea[0].placeholder),L=this._calculateUtf8Length(this.$emailCCTextarea[0].placeholder),this.$emailTextarea.css("width",7*R+"px"),this.$emailCCTextarea.css("width",8*L+"px")},_calculateUtf8Length:function(e){for(var i=0,t=0;t<e.length;t++){var s=e.charCodeAt(t);128>s?i++:i+=s>127&&2048>s?1.5:2}return i},_renderChildViews:function(){if(this._renderSFSTrialBarView(),this._landingPageUiModel.get("enable_autocomplete")){var e=_.extend({},this.options,{editControl:this.$emailTextarea,emailView:this});this.$autocompleteBox.show(),this._renderChildView("_autocompleteControl",i.AutocompleteView,this.$autocompleteBox,e)}else this._autocompleteControl&&this.removeChildView(this._autocompleteControl),this.$autocompleteBox.hide()},_renderSFSTrialBarView:function(){l.isReader()&&this._renderChildView("_sfsModalTrialBarView",i.SFSModalTrialBarView,this.$sfsTrialBar)},_onVisibilityChange:function(){this.render()},_refreshPageContent:function(){this._updateFileItemsList(),w||(this._updateToListWithPrepareFormRecipients(),w=!0),this._updateActionButtonLabels(),this._updateActionButtonEnabledState(),this._updateActionButtonDescription(),this._updateAppInfoTexts(),this._adjustCSS(),this._focusOnSelectButton(),this._LogSignActivity()},_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,i){var t=i.params,s=t.split(";"),n="",o="",a=-1,r=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)),r.get(o)&&r.remove(o),r.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))},_adjustToEmailTextAreaMargin:function(){var e=$(".sfs-to-email-ids-list > div").length;e>0?this.$emailTextarea.css("margin-left","4px"):this.$emailTextarea.css("margin-left","24px")},_getEmailContacts:function(){this._showGuideonButton(r.LP_GUIDE_ADD_SIGNERS_TEXT);var t=this._getResolvedPromise();e.Util.isCEF()&&this._landingPageUiModel.get("autocomplete_local_contacts_imported")===!1&&(t=this._importLocalEmailContacts(),t.then(_.bind(function(){this._landingPageUiModel.set({autocomplete_local_contacts_imported:!0})},this))),e.Util.isCEF()&&this.options.appApi.sessionApi.isSignedInReader()&&i.opFactory.create("DesktopFetchingAutocompleteListOp",this.options).run(),e.Util.isCEF()&&this._landingPageUiModel.get("autocomplete_msgraph_contacts_imported")===!1&&this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().done(_.bind(function(){i.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().done(_.bind(function(i){if(i){var t=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),s=h.SEND_FOR_SIG,n=h.START,o="Get MSGraph Contacts for SignedIn User";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),t.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),this._landingPageUiModel.set({autocomplete_msgraph_contacts_imported:!0})},this),_.bind(function(){},this))}},this))},this))},this))},_hideNewGuide:function(){F=!0,this._hideButtonGuide()},_UpdatePreviouslyUsedContacts:function(){this._userSignedIn=this.options.appApi.sessionApi.isSignedInReader(),this._userConnected=this.options.appApi.networkConnectivityApi.isOnline(),this._userSignedIn&&this._userConnected&&(this.options.readRegistry=!0,i.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run())},_registerEventsToCloseRoleDropDown:function(){_.bindAll(this,"_closeOpenDropdownandGuides"),$("html").bind("mousewheel",this._closeOpenDropdownandGuides),$("body").bind("mousedown",this._closeOpenDropdownandGuides),$(window).on("resize",this._closeOpenDropdownandGuides)},_updateToListWithPrepareFormRecipients:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.prepareFormsEmailRecipients().then(_.bind(function(e){var i=0;if(e.length>0){var t=e.split(",");_.each(t,_.bind(function(e){e=$.trim(e);
var t=this._validateEmail(e);if(t){var s=$(this._emailIdTemplate({emailID:e,ariaRemoveLabel:this._getRemoveAriaLabel(e)}));this._addToEmailIdList(this.$emailIdList,s,!1),i=1}},this)),i&&this._showGuideonButton(r.LP_NEXT_GUIDE_TEXT)}},this))},this))},_addToEmailIdList:function(e,i,t){i.appendTo(e),t?this.$emailCCTextarea[0].placeholder="":this.$emailTextarea[0].placeholder=""},_removeFromEmailIdList:function(e,i){e.children().last().remove(),1==e.children().length,i?this.$emailCCTextarea[0].placeholder=r.LP_CC_EMAIL_PLACEHOLDER:this.$emailTextarea[0].placeholder=r.SFS_LANDING_MSG8},_updateActionButtonLabels:function(){this._landingPageUiModel.get("action_btn1_visible")?(this.$actionBtn1Elem.val(this._landingPageUiModel.get("action_btn1_label")),this.$actionBtn1Elem.removeClass("hidden")):this.$actionBtn1Elem.addClass("hidden"),this._landingPageUiModel.get("action_btn2_visible")?(this.$actionBtn2Elem.val(this._landingPageUiModel.get("action_btn2_label")),this.$actionBtnSeparatorElem.html(this._landingPageUiModel.get("action_btn_separator_label")),this.$actionBtn2Elem.removeClass("hidden"),this.$actionBtnSeparatorElem.removeClass("hidden")):(this.$actionBtn2Elem.addClass("hidden"),this.$actionBtnSeparatorElem.addClass("hidden"))},_updateActionButtonEnabledState:function(){this._landingPageUiModel.get("action_btn1_enabled")?this.$actionBtn1Elem.removeClass("disabled"):this.$actionBtn1Elem.addClass("disabled"),this._landingPageUiModel.get("action_btn2_enabled")?this.$actionBtn2Elem.removeClass("disabled"):this.$actionBtn2Elem.addClass("disabled")},_updateActionButtonDescription:function(){this._landingPageUiModel.get("action_btn_descr_visible")?(this.$actionBtn1DescrElem.html(this._landingPageUiModel.get("action_btn1_descr_txt")),this.$actionBtn2DescrElem.html(this._landingPageUiModel.get("action_btn2_descr_txt")),this.$actionBtn1DescrElem.removeClass("hidden"),this.$actionBtn2DescrElem.removeClass("hidden")):(this.$actionBtn1DescrElem.addClass("hidden"),this.$actionBtn2DescrElem.addClass("hidden"))},_updateAppInfoTexts:function(){this._landingPageUiModel.get("app_info_txt_visible")?(this.$appInfoContainer.removeClass("hidden"),this.$appInfoTxt1Elem.html(this._landingPageUiModel.get("app_info_txt1")),this.$appInfoTxt1Elem.removeClass("hidden"),this.$appInfoTxt2Elem.html(this._landingPageUiModel.get("app_info_txt2")),this.$appInfoTxt2Elem.removeClass("hidden"),this.$appInfoTxt3Elem.html(this._landingPageUiModel.get("app_info_txt3")),this.$appInfoTxt3Elem.removeClass("hidden")):(this.$appInfoContainer.addClass("hidden"),this.$appInfoTxt1Elem.addClass("hidden"),this.$appInfoTxt2Elem.addClass("hidden"),this.$appInfoTxt3Elem.addClass("hidden"))},_getRemoveAriaLabel:function(e){return _.template(r.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:r.SEND_REMOVE})},_updateFileItemsList:function(){var e,i,t,s=this._landingPageUiModel.get("selected_files"),n=this._landingPageUiModel.get("file_collection_visible"),o="",a=this.$messageBody.val();if(T||(a=r.LP_MESSAGE_TEXT2),n){if(!I){o=s[0].get("name");var l=o.lastIndexOf(".");-1!==l&&(o=o.substr(0,l)),o.length>55&&this.$subject.css("height","50px"),this.$subject.val(o)}this.$fileItemsContainerElem.empty(),_.each(s,_.bind(function(s){e=s.get("name"),t=s.get("path"),i=$(this._fileNameTemplate({fileName:e,ariaRemoveLabel:this._getRemoveAriaLabel(e)})),i.data("file",s),this.$fileItemsContainerElem.append(i)},this)),this.$fileItemsContainerElem.removeClass("hidden"),this.$fileItemsHeadingElem.removeClass("hidden"),1===this.options.appApi.rnaApiObj.esApi.shouldShowAdvanceSign()?this.$advancedSignBtn.show():this.$advancedSignBtn.hide()}else this.$fileItemsContainerElem.addClass("hidden"),this.$fileItemsHeadingElem.addClass("hidden"),this.$advancedSignBtn.hide(),I||this.$subject.val("");this.$messageBody.val(a)},_adjustCSS:function(){this._adjustAppsInfoContainerCSS(),this._adjustFileItemsCSS(),this._adjustActionButtonsCSS()},_focusOnSelectButton:function(){this.$emailTextarea.focus()},_adjustAppsInfoContainerCSS:function(){var e=this.$fileItemsContainerElem.css("margin-left");this.$appInfoContainer.css("margin-left",e)},_adjustActionButtonsCSS:function(){var e=this.$actionBtn1Elem.width()+p.getCssNum(this.$actionBtn1Elem,"padding-left")+p.getCssNum(this.$actionBtn1Elem,"padding-left"),i=this.$actionBtn2Elem.width()+p.getCssNum(this.$actionBtn2Elem,"padding-left")+p.getCssNum(this.$actionBtn2Elem,"padding-left"),t=Math.max(e,parseInt(this.$actionBtn1Elem.css("min-width"),10)),s=Math.max(i,parseInt(this.$actionBtn2Elem.css("min-width"),10));this.$actionBtn1DescrElem.width(t),this.$actionBtn2DescrElem.width(s)},_adjustFileItemsCSS:function(){this.$fileItemsContainerElem.children().each(function(){var e=$(this),i=$(".file-name",e),t=$(".file-icon",e),s=$(".file-remove-new",e),n=t.position().left+t.outerWidth(),o=s.outerWidth(),a=e.innerWidth(),a=a-n-o-35;d.truncateElementText(i,a);var r,l=i[0].innerText.toLowerCase(),p=l.lastIndexOf(".");-1!==p&&(r=l.substr(p+1,l.length)),t[0].classList.add("png"==r||"svg"==r||"gif"==r||"bmp"==r||"tif"==r||"tiff"==r||"jpg"==r||"jpeg"==r?"file-icon-image":"doc"==r||"docx"==r?"file-icon-docx":"ppt"==r||"pptx"==r?"file-icon-ppt":"htm"==r||"html"==r?"file-icon-html":"xls"==r||"xlsx"==r?"file-icon-xls":"pdf"==r||"tmp"==r?"file-icon-pdf":"file-icon-text")});var e=this._getSelectedFilesCount();e>0?this.$actionBtn1Elem.removeClass("no-file-selected"):this.$actionBtn1Elem.addClass("no-file-selected")},_getSelectedFilesCount:function(){var e=this._landingPageUiModel.get("selected_files");return _.isEmpty(e)?0:e.length},_onLearnMoreBtnClick:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,h.LEARN_MORE,h.CLICKED]);var t;t=l.isReader()?r.LANDING_PAGE_LEARN_MORE_RDR:r.LANDING_PAGE_LEARN_MORE_ACRO,_.isEmpty(t)||this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(t)},this))},_onLearnMoreLinkClickAddSignersGuide:function(){this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.LEARN_MORE,h.CLICKED]);var e;e=l.isReader()?r.CM_LEARN_MORE_RDR:r.CM_LEARN_MORE_ACRO,_.isEmpty(e)||this.options.appApi.rnaApi.done(_.bind(function(i){i.openDecoratedUrl(e)},this))},_decode:function(e){for(var i="",t=0;t<e.length;t++)"%"!=e[t]?i+="+"==e[t]?" ":e[t]:(i+=String.fromCharCode(parseInt(e.substring(t+1,t+3),16)),t+=2);return i},_prepopulateFields:function(){if(this.$emailTextarea.val(i.QueryParams.toList),this._setRecipientsFromText(i.QueryParams.toList),i.QueryParams.toList&&i.QueryParams.toList.split(",").length>=2&&this._showGuideonButton(r.LP_GUIDE_SIGNING_ORDER),void 0!=i.QueryParams.ccList&&(this.$addCCBlock.removeClass("hidden"),this.$emailCCTextarea.val(i.QueryParams.ccList)),void 0!=i.QueryParams.subject){var e=this._decode(i.QueryParams.subject);this.$subject.val(e)}if(void 0!=i.QueryParams.body){var e=this._decode(i.QueryParams.body);this.$messageBody.val(e)}this.$("#sfs-modal-file-action-btn-new-1").focus()},_onAddFilesBtnClick:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([h.TOOLS,i,h.ADD_FILES,h.CLICKED]),this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","browse_file")},_posAminusB:function(e,i){return{left:e.left-i.left,top:e.top-i.top}},_hideButtonGuide:function(e){if(e=e||S,F&&e)if(e.guide&&e===S)e.removeTimer&&(clearTimeout(e.removeTimer),delete e.removeTimer),e.guide.remove(),e.removeFunc&&e.removeFunc(),S=null,e.nextGuide&&this._showButtonGuide(e.nextGuide);else{for(var i=S;i&&i.nextGuide!==e;)i=i.nextGuide;i&&(i.nextGuide=e.nextGuide),e.removeFunc&&e.removeFunc()}},_findButtonGuide:function(e){for(var i=S;i&&e&&!e(i);)i=i.nextGuide;return i},_showButtonGuide:function(e){var i=this,t=!1,s=!1,n=!1;if(e.text===r.LP_NEXT_GUIDE_TEXT?t=!0:e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT&&(s=!0),e.text===r.LP_GUIDE_SIGNING_ORDER&&(n=!0),e=_.extend({top:0,left:0,text:"",parent:$(document),duration:5e3,arrowPosition:40,clickToRemove:!0,important:!1,getPreference:function(){if(t){var e=i.options.appApi.rnaApiObj.esApi.isSFSCoachmarkAlreadyDisplayed();return e||m}if(s){var e=i.options.appApi.rnaApiObj.esApi.isAddSignersCoachmarkAlreadyDisplayed();return e||E}return!1},setPreference:function(){t?(m=!0,i.options.appApi.rnaApiObj.esApi.setSFSCoachmarkAlreadyDisplayed()):s&&(E=!0)}},e),s&&(e.duration=1e4),e.force||e.redo||!e.getPreference()){if(t&&this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.NEXT_GUIDE_SHOWN]),S){if(e.noQueueIfShowing&&findGuide(function(i){return i.guideID===e.guideID}))return e;if(!e.important||S.important){for(var l=S;l.nextGuide;){if(e.important&&!l.nextGuide.important){e.nextGuide=l.nextGuide;break}l=l.nextGuide}return l.nextGuide=e,e}S.removeTimer&&(clearTimeout(S.removeTimer),delete S.removeTimer),S.guide.remove(),delete S.guide,S.redo=!0,e.nextGuide=S}e.redo||e.setPreference();var d;s?(d=e.guide=$(_.template(a,{title:r.LP_GUIDE_ADD_SIGNERS_TITLE,text:r.LP_GUIDE_SIGNING_ORDER,learn:r.LP_GUIDE_LEARN_MORE,guideType:e.guideType||""})),e.arrowPosition=10):d=e.guide=$(_.template(o,{text:e.text,guideType:e.guideType||""}));var p=d.find(".sfs-guide-arrow");p.addClass(e.arrow),e.parent.append(d);var c="left";switch(e.arrow){case"up":e.initialPosition=s?{left:e.left-10,top:e.top+p.height()}:{left:e.left-d.outerWidth(),top:e.top+p.height()};break;case"down":e.initialPosition={left:e.left-d.outerWidth(),top:e.bottom-p.height()-d.outerHeight()};break;case"left":e.initialPosition={left:e.left+p.width(),top:e.top};break;case"right":e.initialPosition={left:e.right,top:e.top},c="right"}t?d.css("top",e.initialPosition.top+"px").css(c,e.initialPosition.left+"px"):d.css("top",e.initialPosition.top+"px").css(c,e.initialPosition.left+20+"px"),p.css("up"===e.arrow||"down"===e.arrow?"left":"top",s||n?e.arrowPosition:d.outerWidth()-e.arrowPosition),e.width&&d.css("width",e.width+"px"),e.maxWidth&&d.css("max-width",e.maxWidth+"px"),d.css("cursor","default"),S=e,e.clickToRemove&&(d.css("cursor","pointer"),d.click(function(){i._hideButtonGuide()})),e.addFunc&&!e.redo&&e.addFunc(d),e.duration&&(e.removeTimer=_.delay(function(e){delete e.removeTimer,d.fadeOut(function(){i._hideButtonGuide()})},e.duration,e)),delete e.redo}return e},_setGuidePlacement:function(e){var i,t,s,n=!1;t=this.$("#sfs-modal-landing-page-content"),e.text===r.LP_NEXT_GUIDE_TEXT?(s=this.$(".sfs-modal-action-btns-group-new"),i=this.$(".sfs-modal-file-action-new-btn-and-descr")):e.text===r.LP_HELP_ICON_TEXT?(s=this.$(".sfs-modal-general-heading-addcc"),i=this.$(".sfs-modal-email-addcc")):e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT?(s=this.$(".sfs-modal-email-list"),i=this.$(".sfs-modal-to-email-block"),n=!0):e.text===r.LP_GUIDE_SIGNING_ORDER&&(s=this.$(".sfs-modal-email-list"),i=this.$(".sfs-modal-email-list"));var o=(this._posAminusB(s.offset(),t.offset()),i.offset());e.left=s.position().left+s.outerWidth(),e.left=e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT?i.position().left:e.text===r.LP_GUIDE_SIGNING_ORDER?i.position().left+240:Math.max(10,e.left);var a=o.top+i.height()-$(window).scrollTop(),l=i.position().top;a>$(window).height()-e.guideHeight?(e.bottom=l,e.arrow="down",e.bottom=Math.min(t.height()-10,e.bottom)):(e.top=l+(i.height()||s.height()),e.arrow="up",e.top=Math.max(10,e.top))},_showGuideonButton:function(e){if(e===r.LP_NEXT_GUIDE_TEXT){if("Next"!=this.$actionBtn1Elem.val())return;if(!this.options.appApi.rnaApiObj.esApi.shouldShowSFSCoachmark())return}var i={preference:"",text:e,guideType:"",guideHeight:120,important:!0},t=(this._findButtonGuide(_.bind(function(e){return e.field===this&&e.text===i.text},this)),this),s=$.extend({field:t,parent:this.$("#sfs-modal-landing-page-content")},i);this._setGuidePlacement(s),this._showButtonGuide(s)},_validateEmail:function(e){var i=/^(([^<>()[\]\\.,;:\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,}))$/;return i.test(e)},_setRecipientModels:function(e){var i;this.$emailTextarea.hasClass("activeEmailTextarea")?i=this.$emailTextarea.val():this.$emailCCTextarea.hasClass("activeEmailTextarea")&&(i=this.$emailCCTextarea.val()),this._setRecipientsFromText(i,e)},_removeLastEmailAddress:function(){},_parseRecipients:function(e){var i;return e=e.replace(/(\r\n|\n|\r)/gm,""),i=e.split(/\s*[,;\s]+\s*/)},_iterateAndValidateEmails:function(e){var i="",t="",s="";s=e?this.$emailCCTextarea.val():this.$emailTextarea.val();for(var n=this._parseRecipients(s),o=n.length,a=0;o>a;a++){var l=n[a];if(l){var d=this._validateEmail(l);if(d){var p=$(this._emailIdTemplate({emailID:l,ariaRemoveLabel:this._getRemoveAriaLabel(l)}));if(e){p.find("#dropdownMenu").css("display","none"),p.find(".caret").css("display","none"),this._addToEmailIdList(this.$emailIdCCList,p,!0),this.$emailCCTextarea.val("");var c=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),_=c+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([_,h.EMAIL_CC_ADDED])}else{this._addToEmailIdList(this.$emailIdList,p,!1),1==this.$emailIdList.children().length&&this._showGuideonButton(r.LP_NEXT_GUIDE_TEXT),this.$emailTextarea.val("");var c=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),_=c+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([_,h.EMAIL_TO_ADDED])}}else{0!=i.length&&(i+=","),0!=t.length&&(t+=",");var u=l;u.length>30&&(u=u.substring(0,30),u+="..."),i+=l,t+=u}}}i.length>0&&(this._showErrorRedRibbon(t+r.LP_INVALID_EMAIL_ERROR,!1),e?this.$emailCCTextarea.val(i):this.$emailTextarea.val(i))},_onFocusOutEmailTextarea:function(){this._autocompleteControl&&this._autocompleteControl.setFilter(void 0),this._iterateAndValidateEmails(!1)},_onFocusOutEmailCCTextarea:function(){},_onKeyUpEmaiTextarea:function(e){var i=e.which?e.which:e.keyCode;13==i&&(e.preventDefault(),this._onFocusOutEmailTextarea())},_showErrorRedRibbon:function(e,i){this.$EmailErrorMsg.html(e),this.$EmailErrorParent.removeClass("hidden"),this.$closeButton.focus(),i&&this.$emailBlock.css("border","1px solid red"),this.$sfsScrollableDiv.css("height","275px")},_onKeyDownEmailTextarea:function(e){this._hideButtonGuide(),O||(O=!0,this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.EMAIL_TO_EDITED]));var i=e.which?e.which:e.keyCode,t=$(".sfs-to-email-ids-list > div").length,s=8*this.$emailTextarea.val().length,n=this.$emailTextarea.width(),o=this.$emailBlock.width();if(s>n&&o>s&&this.$emailTextarea.css("width",s+32+"px"),8!=i&&46!=i&&t>=A)this._showErrorRedRibbon(r.LP_RECIPIENTS_LIMITS_ERROR,!1),e.preventDefault();else if(40===i)this._autocompleteControl&&this._autocompleteControl.selectDown();else if(38===i)this._autocompleteControl&&this._autocompleteControl.selectUp();else if(186===i||188===i){var a=e.key;_.defer(_.bind(function(){this._setRecipientModels(a)},this))}else if(13===i)this.$emailTextarea.css("width",7*R+"px"),this._autocompleteControl&&(this._autocompleteControl.makeChoice(!0)||_.defer(_.bind(function(){this.abortPGCRequest(),this._setRecipientModels()},this))),e.preventDefault();else{if(8!==i)return 13!=i;this.$emailTextarea.val()||this._removeFromEmailIdList(this.$emailIdList,!1)}this._adjustToEmailTextAreaMargin()},_onPasteEmailTextarea:function(e){O||(O=!0,this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.EMAIL_TO_EDITED]));var i=this.$emailBlock.width();this.$emailTextarea.css("width",i+"px");var t=$(".sfs-to-email-ids-list > div").length;t>=A&&(this._showErrorRedRibbon(r.LP_RECIPIENTS_LIMITS_ERROR,!1),e.preventDefault())},_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(i){i.length>0&&(this._landingPageUiModel.set("pgcSuggestionsCollection",i),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())},_onInputEmailTextarea:function(){var e;this.$emailCCTextarea.removeClass("activeEmailTextarea"),this.$emailTextarea.removeClass("activeEmailTextarea");var i=this.$emailTextarea.offset(),t=this.$emailTextarea.outerHeight();this.$autocompleteBox.css("top",i.top+t+10),this.$autocompleteBox.css("left","55px");var s=this.$(".sfs-email-id-item").css("width");s&&this.$autocompleteBox.css("left","95px"),this._autocompleteControl&&(e=this.$emailTextarea.val(),this.$emailTextarea.addClass("activeEmailTextarea"),this._setAutocompleteFilterValue(e))},_onFocusOutCCEmailTextarea:function(){this._autocompleteControl&&this._autocompleteControl.setFilter(void 0);this._iterateAndValidateEmails(!0)},_onKeyUpCCEmaiTextarea:function(e){var i=e.which?e.which:e.keyCode;13==i&&(e.preventDefault(),this._onFocusOutCCEmailTextarea())},_onKeyDownCCEmailTextarea:function(e){b||(b=!0,this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.EMAIL_CC_EDITED]));var i=e.which?e.which:e.keyCode,t=$(".sfs-cc-email-ids-list > div").length,s=8*this.$emailCCTextarea.val().length,n=this.$emailCCTextarea.width(),o=this.$emailBlock.width();if(s>n&&o>s&&this.$emailCCTextarea.css("width",s+32+"px"),8!=i&&46!=i&&t>=v)this._showErrorRedRibbon(r.LP_CC_LIMITS_ERROR,!1),e.preventDefault();else if(40===i)this._autocompleteControl&&this._autocompleteControl.selectDown();else if(38===i)this._autocompleteControl&&this._autocompleteControl.selectUp();else if(186===i||188===i){var a=e.key;_.defer(_.bind(function(){this._setRecipientModels(a)},this))}else if(13===i)this.$emailCCTextarea.css("width",8*L+"px"),this._autocompleteControl&&(this._autocompleteControl.makeChoice(!0)||_.defer(_.bind(function(){this._setRecipientModels()},this)));else{if(8!==i)return 13!=i;this.$emailCCTextarea.val()||this._removeFromEmailIdList(this.$emailIdCCList,!0)}},_onPasteCCEmailTextarea:function(e){b||(b=!0,this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.EMAIL_CC_EDITED]));var i=this.$emailBlock.width();this.$emailCCTextarea.css("width",i+"px");var t=$(".sfs-cc-email-ids-list > div").length;t>=v&&(this._showErrorRedRibbon(r.LP_CC_LIMITS_ERROR,!1),e.preventDefault())},_onInputCCEmailTextarea:function(){var e;this.$emailCCTextarea.removeClass("activeEmailTextarea"),this.$emailTextarea.removeClass("activeEmailTextarea");var i=this.$emailCCTextarea.offset(),t=this.$emailCCTextarea.outerHeight();this.$autocompleteBox.css("top",i.top+t+10),this.$autocompleteBox.css("left",i.left),this._autocompleteControl&&(e=this.$emailCCTextarea.val(),this.$emailCCTextarea.addClass("activeEmailTextarea"),this._setAutocompleteFilterValue(e))},_OnclickAddCC:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,h.ADD_CC_CLICKED]),this.$addCCBlock.removeClass("hidden"),this.$emailCCTextarea.show().focus()},_OnClickHideCC:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,h.HIDE_CLICKED]),this.$addCCBlock.addClass("hidden")},_closeError:function(){this.$EmailErrorParent.hide(),this.$sfsScrollableDiv.css("height","295px")},_setRecipientsFromText:function(e){this.$emailTextarea.hasClass("activeEmailTextarea")?(this.$emailTextarea.val(""),this.$emailTextarea.val(e),this._onFocusOutEmailTextarea(void 0),this.$emailTextarea.removeClass("activeEmailTextarea")):this.$emailCCTextarea.hasClass("activeEmailTextarea")&&(this.$emailCCTextarea.val(""),this.$emailCCTextarea.val(e),this._onFocusOutCCEmailTextarea(void 0),this.$emailCCTextarea.removeClass("activeEmailTextarea"))},_onSelectedFileItemRemoveClick:function(e){var i=$(e.currentTarget).parents(".sfs-modal-selected-file-item-new"),t=i.data("file");this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_removed_file",t),this._landingPageUiModel.set("user_action","removed_file"),e.stopPropagation()},_onSFSAdvancedSignBtnClick:function(){i.isAdvancedSign=!0,this._LogSignActivity();var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=e+"-"+h.SEND_FOR_SIG;return this.options.appApi.siteCatalystApi.logScEvent(i.IsTrialUser===!0?[t,h.ADVANCED_CLICKED,h.FREE_USER]:[t,h.ADVANCED_CLICKED]),this.options.sfsAppTrialBarUiModel.get("is_visible")&&0==this.options.sfsAppTrialBarUiModel.get("remaining_transaction")?void this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"}):void this._onSFSFileActionBtn1Click()},_onSFSNextBtnClick:function(){i.isAdvancedSign=!1,this._LogSignActivity();var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=e+"-"+f.getFillSignReaderFreeTransVariant(this.options);return this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.sessionApi.isSignedInReader()?i.IsTrialUser===!0?[h.TOOLS,t,h.SPECIFY_WHERE_TO_SIGN_CTA,h.CLICKED,h.FREE_USER]:[h.TOOLS,t,h.SPECIFY_WHERE_TO_SIGN_CTA,h.CLICKED,h.ENTITLED_USER]:[h.TOOLS,t,h.SPECIFY_WHERE_TO_SIGN_CTA,h.CLICKED,h.UNSIGNED_USER]),this.options.sfsAppTrialBarUiModel.get("is_visible")&&0==this.options.sfsAppTrialBarUiModel.get("remaining_transaction")?void this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"}):void this._onSFSFileActionBtn1Click()},_onSFSFileActionBtn1Click:function(){if(!this.$actionBtn1Elem.hasClass("disabled")){if(!this.options.appApi.networkConnectivityApi.isOnline())return this.$(".sfs-modal-email-error").css("width","90%"),this._showErrorRedRibbon(r.FSS_ERR_OFFLINE_TITLE+". "+r.FSS_ERR_OFFLINE_MSG),this.$("#sfs-modal-file-action-btn-new-1").removeClass("draw-button-focus-outline"),void this.$("#sfs-modal-more-options-heading").css("text-decoration","none");this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){var t=this._getSelectedFilesCount();if(t>0){var s=this.$emailTextarea.val();if(s&&!this._validateEmail(s)){var n=s;return n.length>30&&(n=n.substring(0,30),n+="..."),void this._showErrorRedRibbon(n+r.LP_INVALID_EMAIL_ERROR,!1)}if(s=this.$emailCCTextarea.val(),s&&!this._validateEmail(s)){var n=s;return n.length>30&&(n=n.substring(0,30),n+="..."),void this._showErrorRedRibbon(n+r.LP_INVALID_EMAIL_ERROR,!1)}var o=this.$el.find(".sfs-to-email-ids-list").children();if(0===o.length&&i.isAdvancedSign===!1)return void this._showErrorRedRibbon(r.LP_NO_EMAIL_ERROR,!0);if(1===o.length){var a=this.options.appApi.usersMeApi.getUserIdentity().email;if(void 0!==a&&o[0].children[1].innerText.toLowerCase()===a.toLowerCase())return void this._showErrorRedRibbon(r.LP_ONLY_SENDER_EMAIL_ERROR,!0)}var l,d=this.$el.find(".sfs-cc-email-ids-list").children(),p=this.$(".sfs-email-id-item"),c="",u="",g=[],f="",S=this;this.options.recipients=[],$.each(p,function(e,i){if(l=i.children[1].innerText,"none"==$(i.children[0].children).eq(0).css("display"))0!=f.length&&(f=f.concat(",")),f=f.concat(l);else if($(i.children[0].children[0].children).eq(0).hasClass("signerImg")){0!=c.length&&(c=c.concat(",")),c=c.concat(l);var t={};t.email=l,t.role="SIGNER",g.push(t)}else{0!=u.length&&(u=u.concat(",")),u=u.concat(l);var t={};t.email=l,t.role="APPROVER",g.push(t)}if(l){var i=$.trim(l.toLowerCase());S.options.autoCCollection.add({email:i}),S.options.recipients.push(l)}}),this._landingPageUiModel.set("user_added_approver_emails",u),this._landingPageUiModel.set("user_added_signer_emails",c),this._landingPageUiModel.set("user_added_cc_emails",f),this._landingPageUiModel.set("user_added_emails_in_order",g),this._landingPageUiModel.set("user_action","email_list_added");var m=_.union(u.split(","),c.split(","),f.split(",")),E=_.clone(this.options.autoCCollection),A=this.options.autoCCollection.filter(function(e){return _.contains(m,e.get("email"))});E.reset(A),_.each(m,function(e){E.add({email:e})}),this.options.appApi.sessionApi.isSignedInReader()&&this._acceptPGCRecipients(E);var v=this.$subject.val();v=v.replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n"),this._landingPageUiModel.set("user_added_subject",v),this._landingPageUiModel.set("user_action","subject_added");var C=this.$messageBody.val();C=C.replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n"),this._landingPageUiModel.set("user_added_message",C),this._landingPageUiModel.set("user_action","message_added");var I=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),T=I+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([T,h.TO_EMAIL_COUNT,o.length]),this.options.appApi.siteCatalystApi.logScEvent([T,h.CC_EMAIL_COUNT,d.length]),this.options.appApi.siteCatalystApi.logScEvent([T,h.FILE_COUNT,t]),this._showUploadSpinner(),this._getSelectedFile(),e.Util.isCEF()&&(this.options=_.extend({},this.options,{recipientsAreFinalized:!0})),this.options.appApi.sessionApi.isSignedInReader()&&(this.options.readRegistry=!1,i.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run())}else this._handleSelectFileClickEvent()},this)),this.$("#sfs-modal-file-action-btn-new-1").removeClass("draw-button-focus-outline")}},_showUploadSpinner:function(){_.delay(_.bind(function(){this.$("#sfs-modal-as-image").hide(),this.$(".sfs-modal-trial-bar-container").hide(),this.$(".sfs-share-advisory-msg").hide(),this.$modalLandingPageContentDiv.hide(),this.$sfsScrollableDiv.hide(),this.$actionBtnsGrpElem.hide(),this.$EmailErrorParent.hide(),this.$sfsLoaderNew.show()},this),250)},_acceptPGCRecipients:function(i){var t=[];i.map(_.bind(function(i){if(_.isUndefined(i.get("token"))){var s=_.extend({},this.options,{newContactEmail:i.get("email")});e.opFactory.create("AcceptingNewPGCSuggestionOp",s).run()}else t.push(i.get("token"))},this));var s=_.extend({},this.options,{tokens:t});e.opFactory.create("AcceptingPGCSuggestionsOp",s).run()},_handlePrepareFormClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","prepare_form_btn_clicked")},_handleSendClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","send_action_btn_clicked")},_handleSelectFileClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","select_action_btn_clicked")},_onSFSManageAgreementsBtnClick:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","manage_agreements_btn_clicked")},_getRenditionUrl:function(e,i,t,s){var n=$.Deferred();return this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){var o=this.options.appApi.baseFilesUrisApi.getRenditionUri()+"assets/"+encodeURIComponent(t)+"/"+e;o+="?"+g.getClientIdQueryParam(),i&&(o+="&page="+i),s===!1&&(o+="&markup=false"),n.resolve(o)},this)),n.promise()},_loadUrl:function(i,t){var s=2200,n=$.Deferred();return this.options.appApi.rnaApi.done(function(o){o.fssApi({methodName:"getRenditionShm",methodArgs:[i,s,t]}).done(function(i){var t=new e.RNAModel(void 0,_.extend({_proxy:i,shouldCache:!1}));t.hasProperty("renditionURL")?n.resolve(t.get("renditionURL")):t.once("change:renditionURL",function(){n.resolve(t.get("renditionURL"))})})}),n.promise()},_loadDocthumbnail:function(){var e=this._landingPageUiModel.get("file_collection_visible");if(e){var i=this._getSelectedFilesCount();if(i>0){var t=this._landingPageUiModel.get("selected_files"),s=t[0].get("name"),n=t[0].get("path");if(this.$currentVisibleThumbNail===n)return;this.$docThumbnail.removeClass("hidden"),this.$currentVisibleThumbNail=n;var o=l.getExtension(s),a=t[0].get("isNonPlatformFile"),r=t[0].get("assetId");this.$previewImage.css("border",""),this.$previewImage.attr("src",""),this.$previewImage.attr("alt",""),this.$previewImage.attr("class","sfs-preview-image");var d=$("<img>").addClass("sfs-preview-image");if(this.$previewImage.replaceWith(d),this.$previewImage=d,this.$(".sfs-recent-file").hasClass("collection-thumb-view")&&this.$(".sfs-recent-file").removeClass("collection-thumb-view"),a)this.$docThumbnail.addClass("hidden"),this._getRenditionUrl("thumbnail",0,r).then(_.bind(function(e){u.cancelPendingRequests(),this.options.appApi.rnaApi.then(_.bind(function(i){i.logIn(!1).then(_.bind(function(i){if(i.get("primary_token")){var t=this.options.sfsAppUiModel;_.each(Ac.Core,function(e){e.HttpUtil.setSessionAttrs(t,i.attributes)});var s=this;u.loadImage(this.$previewImage,e,void 0,!0).then(_.bind(function(){s.$(".sfs-preview-image").css("border","solid 1px rgba(0,0,0,0.2)")},this))}},this))},this))},this));else if("pdf"==o){var p=0,h=this;this._loadUrl(p,n).then(function(e){return h.$(".sfs-preview-image").attr("src",e),h.$(".sfs-preview-image").attr("alt",s),h.$(".sfs-preview-image").css("border","solid 1px rgba(0,0,0,0.2)"),$.Deferred().resolve().promise()})}else{var g=c.getFileInfo("",s).iconCls;this.$(".sfs-recent-file").addClass("collection-thumb-view");var f=$("<div>").addClass("sfs-preview-image");this.$previewImage.replaceWith(f),this.$previewImage.addClass("collection-item-thumb"),this.$previewImage.addClass(g),this.$previewImage.attr("alt",s),this.$previewImage.css("border","solid 1px rgba(0,0,0,0.2)")}}else this.$docThumbnail.addClass("hidden")}else this.$docThumbnail.addClass("hidden")},_roleDropdownClick:function(e){var i=e.target,t=i.parentElement.parentElement.parentElement.getBoundingClientRect(),s=($(i).attr("class"),this.$(".sfs-email-id-item"));$.each(s,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&$(t).removeClass("clicked")}),this.$roleDropDown.hasClass("hidden")?(this.$roleDropDown.removeClass("hidden"),this.$roleDropDown.css("top",t.bottom),this.$roleDropDown.css("left",t.left),$(i).addClass("clicked")):(this.$roleDropDown.addClass("hidden"),$(i).removeClass("clicked")),e.stopPropagation()},_OnMouseEnterSignerBlock:function(e){$(e.currentTarget).addClass("SignerHover")},_OnMouseLeaveSignerBlock:function(e){$(e.currentTarget).removeClass("SignerHover")},_OnMouseEnterApproverBlock:function(e){$(e.currentTarget).addClass("ApproverHover")},_OnMouseLeaveApproverBlock:function(e){$(e.currentTarget).removeClass("ApproverHover")},_roleDropdownSelectSignerClick:function(e){var i=$(e)[0],t=this.$(".sfs-email-id-item");$.each(t,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&($(t).removeClass("clicked"),$(t).hasClass("signerImg")&&$(t).removeClass("signerImg"),$(t).hasClass("approverImg")&&$(t).removeClass("approverImg"),$(t).addClass("signerImg"))}),$(i.parentElement.parentElement).addClass("hidden")},_roleDropdownSelectApproverClick:function(e){var i=$(e)[0],t=this.$(".sfs-email-id-item");$.each(t,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&($(t).removeClass("clicked"),$(t).hasClass("signerImg")&&$(t).removeClass("signerImg"),$(t).hasClass("approverImg")&&$(t).removeClass("approverImg"),$(t).addClass("approverImg"))}),$(i.parentElement.parentElement).addClass("hidden")},_onSelectedEmailRemoveClick:function(e){var i=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=i+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([t,h.EMAIL_REMOVED]);{var s=$(e.currentTarget).parents(".sfs-email-id-item");s.data("email")}s.remove(),e.stopPropagation()},_onKeyDownSubjectTextArea:function(e){var i=e.which?e.which:e.keyCode;if(!I&&9!=i){I=!0;var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([s,h.MESSAGE_SUBJECT_EDITED])}var n=i>=37&&40>=i||8==i||46==i;if(!n&&e.target.textLength==C)return this._showErrorRedRibbon(r.LP_AGREEMENT_CHARLIMITS_ERROR,!1),void e.stopPropagation();var o;13==i&&e.preventDefault(),32==i&&(o=this.$subject.text()+" ",this.$subject.html(o)),e.stopPropagation()},_adjustMessgeTextAreaHeight:function(){this.$messageBody.css("height","auto");{var e=null,i=document.createElement("div");
document.querySelectorAll(".sfs-modal-message-list")}i.classList.add("sfs-modal-message-list-hidden-div"),i.classList.add("sfs-modal-message-list"),document.getElementById("sfs-modal-subjext-textarea").appendChild(i),e=this.$messageBody.text(),i.innerHTML=e+'<br style="line-height: 3px;">',i.style.visibility="hidden",i.style.display="block",this.$messageBody.css("height",i.offsetHeight+"px"),i.style.visibility="visible",i.style.display="none"},_onKeyDownMessageTextArea:function(e){var i=e.which?e.which:e.keyCode;if(!T&&9!=i){T=!0;var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([s,h.MESSAGE_BODY_EDITED])}var n;13==i&&(n=this.$messageBody.text()+"\n",this.$messageBody.html(n)),32==i&&(n=this.$messageBody.text()+" ",this.$messageBody.html(n)),e.stopPropagation()},_onMouseEnterSelectedFileItem:function(e){var i=e.currentTarget,t=i.getElementsByClassName("file-remove-new");$(t).removeClass("hidden")},_onMouseLeaveSelectedFileItem:function(){var e=event.currentTarget,i=e.getElementsByClassName("file-remove-new");$(i).addClass("hidden")},_onMouseEnterEmailHelpIcon:function(){this._showGuideonButton(r.LP_HELP_ICON_TEXT)},_onMouseLeaveEmailHelpIcon:function(){this._hideButtonGuide()},_onEmailToAreaClick:function(){this.$emailTextarea.show().focus()},_onCCAreaClick:function(){this.$emailCCTextarea.show().focus()},_LogSignActivity:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.logSignServicesActivity()},this))},_uploadFile:function(){this.options.sfsAppSendACopyUiModel.set("is_upload_only",!0),i.opFactory.create("SendCompletedCopyOp",_.extend({},this.options)).run().then(_.bind(function(){this._uploadFinished(!0)},this),_.bind(function(){this._uploadFinished(!1)},this))},_uploadFinished:function(e){var t=this.options.sfsAppSendACopyUiModel,s=t.get("upload_req_queue"),n=[];_.each(s,function(e){n.push(e.responseObj.respBody.transientDocumentId)});var o=this._landingPageUiModel,a="AUTHORING",r=void 0!==i.QueryParams.invocationPoint?i.QueryParams.invocationPoint:"";if(i.isAdvancedSign&&(a="DRAFT"),e){var l=[{transientDocIds:n,esAccessToken:"Bearer "+this.options.esAuthUiModel.get("access_token"),emailSubject:o.get("user_added_subject"),emailMessage:o.get("user_added_message"),signers_emails:o.get("user_added_signer_emails"),approver_emails:o.get("user_added_approver_emails"),cc_emails:o.get("user_added_cc_emails"),agreementStatus:a,hasFullParams:"true",invocationPoint:r}];this.options.appApi.rnaApiObj.stApi.launchSendForSignWithTransientDocIdsAPI(l).always(_.bind(function(){this.options.appApi.rnaApiObj.esApi.setAddSignersCoachmarkAlreadyDisplayed().done(_.bind(function(){this._closeDialog()},this))},this))}else this._undoShowUploadSpinner()},_undoShowUploadSpinner:function(){_.delay(_.bind(function(){this.$("#sfs-modal-as-image").show(),this.$modalLandingPageContentDiv.show(),this.$sfsScrollableDiv.show(),this.$actionBtnsGrpElem.show(),this.$EmailErrorParent.show(),this.$sfsLoaderNew.hide(),this.$(".sfs-modal-trial-bar-container").show(),this._showErrorRedRibbon(r.FSS_ERR_AUTH_FAILED_MSG)},this),250)},_closeDialog:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"})},_getSelectedFile:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();if(_.isEmpty(i))this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc");else{var t=[];t.push(i),this.options.sfsAppSendACopyUiModel.set("selectedFiles",t),this._uploadFile()}},this))}}),i.SFSModalLandingPageView}),define("pdmplugins/send-for-sign/js/views/modal/sfs-modal-container-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-modal-view-container-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/views/modal/sfs-modal-landing-page-view","pdmplugins/esign/js/views/es-offline-view","core/views/plugin-content-view"],function(e,i,t,s,n,o,a){return s.SFSModalContainerView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addUiModelEventListeners()},render:function(){var i=this.$el;return e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n,{CLOSE:o.SFS_ERR_CLOSE_BTN})),this._initWrappers()),this._renderChildViews(),this},events:function(){return{"click #share-close-button":"_CloseDialog"}},_addUiModelEventListeners:function(){this.options.sfsAppUiModel.on("change:app_state_updated",this._onSFSAppStateUpdatedChange),this.options.sfsAppSendACopyUiModel.on("change:failed_workflow",this._ErrorStateChange)},_onSFSAppStateUpdatedChange:function(){this.render()},_initWrappers:function(){this.$sfsLandingPage=this.$(".sfs-modal-landing-page-container"),this.$ErrorDiv=this.$(".sfs-modal-sac-error"),this.$ErrText=this.$("#sac-error-text"),this.$sfsOfflinePage=this.$(".sfs-offline-view-container")},_renderChildViews:function(){this._renderSFSLandingPageView(),this._renderSFSOfflineView()},_renderSFSLandingPageView:function(){s.skipUploadingForSfsOldLandingPage=!0,this._renderChildView("_sfsModalLandingPageView",s.SFSModalLandingPageView,this.$sfsLandingPage)},_renderSFSOfflineView:function(){this._renderChildView("_sfsAppOfflineView",t.AppOfflineView,this.$sfsOfflinePage,{acceptLabel:o.SFS_OFFLINE_ACCEPT_LABEL})},_CloseDialog:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"})},_ErrorStateChange:function(){var e=this.options.sfsAppSendACopyUiModel,i=e.get("workflow_success_status"),t=e.get("workflow_running");if(t||!_.isEmpty(e.get("failed_workflow"))){var s=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),n=s+"-"+a.SEND_FOR_SIG;if(!i){var r=this.options.sfsAppSendACopyUiModel.get("failed_workflow");switch(r){case"UserOffline":this.$ErrText.html(o.FSS_ERR_OFFLINE_TITLE+"<br><br>"+o.FSS_ERR_OFFLINE_MSG);break;case"LARGE_FILE_SIZE":this.$ErrText.html(o.FSS_ERR_LARGE_FILE_MSG);break;case"AUTH_FAILED":return;case"Missing_TransientIDs":this.$ErrText.html(o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+o.FSS_ERR_MIISSING_TRANSIENTIDS_MSG);break;case"Agreement_Wait_Exceeded":this.$ErrText.html(o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+o.FSS_ERR_AGREEMENT_WAIT_EXCEEDED_MSG);break;default:this.$ErrText.html(r==o.SFS_ERR_GENERAL_WORKFLOW_FAILURE?o.SFS_ERR_GENERAL_WORKFLOW_FAILURE:o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+r)}this.$sfsLandingPage.hide(),this.$ErrorDiv.show(),this.options.appApi.siteCatalystApi.logScEvent([n,a.FAILURE,r])}}}}),s.SFSModalContainerView}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-view-container-template",[],function(){return'<div class="sfs-progressive-modal-view-container"><div class="sfs-modal-trial-bar-container"></div><div class="sfs-modal-t2e-bar-container"></div><div class="sfs-progressive-modal-view-container-row"><div class="sfs-progressive-modal-view-container-column-left theme-sfs-progressive-modal-left-bg-color" id ="left-side"><div class="sfs-progressive-modal-landing-page-container-left" class="ui-theme theme-container"></div></div><div class="sfs-progressive-modal-view-container-column-right theme-sfs-progressive-modal-right-bg-color" id="right-side"><div class="sfs-progressive-modal-landing-page-container-right" class="ui-theme theme-container"></div><div class="sfs-modal-sac-error ui-theme theme-text hidden"><div id="sfs-failure-img" class= "ui-theme theme-text"></div><div id="sac-error-text" class= "ui-theme theme-text"></div><div class="sfs-button-bar ui-theme theme-text theme-share-grey-container"><button class="close-button control-button theme-button theme-button-label" aria-label = "<%= CLOSE %>"  id="share-close-button"><%= CLOSE %></button></div></div></div></div></div>'}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-trial-bar-template",[],function(){return'<div id="sfs-modal-free-transaction">       <div id="sfs-progressive-modal-trial-bar-signed-user-view"><div class="sfs-modal-free-trans-title">     <span class="sfs-modal-free-trans-title_text"><%= trial_title  %></span>	  <span class="sfs-progressive-upgrade-now-title"><%= upgrade_now  %></span>     <span class="sfs-progressive-modal-info-icon-img" title = "<%= info_label_tooltip %>" class="ui-theme theme-hyperlink"></span></div></div>       <div id="sfs-progressive-modal-trial-bar-unsigned-user-view"><div class="sfs-modal-free-trans-title">     <span><%= trial_title_unsigned_user  %></span>	  <span class="sfs-progressive-upgrade-now-title"><%= upgrade_now  %></span></div></div></div>'}),define("pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-trial-bar-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-trial-bar-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s,n){return i.SFSProgressiveModalTrialBarView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addUiModelEventListeners()},events:function(){return{"hover .sfs-progressive-modal-info-icon-img":"_onHoverTrialInfo","click .sfs-progressive-modal-info-icon-img":"_onHoverTrialInfo","click .sfs-progressive-upgrade-now-title":"_upgradeNowClicked"}},render:function(){if(e.View.prototype.render.call(this),!this.options.sfsAppTrialBarUiModel.get("is_visible")&&this.options.appApi.sessionApi.isSignedInReader())return this.$el.hide(),this;this.$el.show();var i=this.options.sfsAppTrialBarUiModel.get("remaining_transaction"),t=_.template(s.SFS_MODAL_TRIAL_TITLE,{rem_trans:i});return 0===this.$el.children().length&&(this.$el.html(this._template({trial_title:t,info_label_tooltip:s.SFS_MODAL_INFO_LABEL_DESC,trial_title_unsigned_user:s.SFS_MODAL_INFO_LABEL_DESC,upgrade_now:s.SFS_SUBSCRIBE_UPGRADE1})),this._initWrappers(),this.options.appApi.rnaApi.then(_.bind(function(e){e.isHighContrastEnabled()&&(this.$trialBar.css("border-color","white"),this.$trialBar.css("border","1px"),this.$trialBar.css("border-style","solid")),this.options.appApi.sessionApi.isSignedInReader()?this.$unsigned_user_bar.hide():this.$signed_user_bar.hide(),this._updateRemainingTransactions()},this))),this},_initWrappers:function(){this.$trialBar=this.$("#sfs-modal-free-transaction"),this.$trial_title=this.$(".sfs-modal-free-trans-title_text"),this.$unsigned_user_bar=this.$("#sfs-progressive-modal-trial-bar-unsigned-user-view"),this.$signed_user_bar=this.$("#sfs-progressive-modal-trial-bar-signed-user-view")},_onDataUpdate:function(){this.render(),this._updateRemainingTransactions()},_addUiModelEventListeners:function(){var e=this.options.sfsAppTrialBarUiModel;e.on("change:remaining_transaction",this._onDataUpdate),e.on("change:is_visible",this._onDataUpdate)},_onUpgradeBtnClick:function(){this.options.appApi.rnaApi.done(_.bind(function(e){this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SEND_FOR_SIG,n.FREE_TRANS_BAR,n.UPGRADE,n.CLICKED]);var i;i=s.SFS_FREE_TRANSACTION_BAR_UPGRADE,_.isEmpty(i)||e.openDecoratedUrl(i)},this))},_upgradeNowClicked:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"}),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSignViaUpgradeNowWorkflow"})},_onHoverTrialInfo:function(){},_updateRemainingTransactions:function(){var e=this.options.sfsAppTrialBarUiModel.get("remaining_transaction"),i=this.$trial_title.text();i=e>1?_.template(s.SFS_MODAL_TRIAL_TITLE,{rem_trans:e}):_.template(s.SFS_MODAL_TRIAL_TITLE_1,{rem_trans:e}),this.$trial_title.html(i)},show:function(){this.render()}}),i.SFSProgressiveModalTrialBarView}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-t2e-bar-template",[],function(){return'<div id="sfs-modal-t2e-wrapper"><div id="sfs-progressive-modal-t2e-bar-view"><div class="t2e_text_cluster">     <span class="t2e_info_text"><%= t2e_title  %></span></div><span class="sfs-progressive-modal-close-icon-img" tabindex="0"></span></div></div>'}),define("pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-t2e-bar-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-t2e-bar-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s){return i.SFSProgressiveModalT2EBarView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},events:function(){return{"click .sfs-progressive-modal-close-icon-img":"_onCloseButtonClicked"}},render:function(){e.View.prototype.render.call(this),this.$el.show();var n=_.template(s.SFS_MODAL_T2E_TITLE,{login_profile:void 0!==i.QueryParams.loginProfile?i.QueryParams.loginProfile:"",sign_profile:void 0!==i.QueryParams.signProfile?i.QueryParams.signProfile:""});return 0===this.$el.children().length&&(this.$el.html(_.template(t,{t2e_title:n})),this._initWrappers(),this.options.appApi.rnaApi.then(_.bind(function(e){e.isHighContrastEnabled()&&(this.$t2eBar.css("border-color","white"),this.$t2eBar.css("border","1px"),this.$t2eBar.css("border-style","solid"))},this))),this},_initWrappers:function(){this.$t2eBar=this.$("#sfs-modal-t2e-wrapper")},_onCloseButtonClicked:function(){this.$el.hide()},show:function(){this.render()}}),i.SFSProgressiveModalT2EBarView}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-right-landing-page-template",[],function(){return'<div id="sfs-progressive-modal-top-heading"><div id="sfs-progressive-modal-landing-page-content" class="theme-sfs-progressive-modal-right-bg-color ui-theme theme-container">     <div class="sfs-progressive-modal-view-title theme-text" aria-label="<%= title %>" > <%= title %></div></div><div id="sfs-progressive-modal-primary-container">      <div class="sfs-modal-loader-container hidden">          <div class="sfs-modal-loader-new" id="modal-loader-new"></div>          <div id="uploading-text-new" class= "ui-theme theme-text"><%= uploadingText %></div>      </div>  <div id="sfs-progressive-modal-scrollable-div">  <div class = "sfs-progressive-modal-info-content-container">    <div class = "sfs-progressive-modal-add-signers-div">            <div class="sfs-progressive-modal-email-list">                 <div class="sfs-progressive-modal-to-email-block">                       <div class ="sfs-to-email-ids-list"></div>                       <textarea class="sfs-progressive-modal-email-textarea theme-sfs-progressive-modal-right-bg-color ui-theme theme-container theme-text" aria-label="<%= to_email_placeholder %>" placeholder="<%=to_email_placeholder%>" align="right" rows="1" tabindex="1" spellcheck="false"></textarea>                 </div>           </div>           <div class="sfs-progressive-modal-email-addcc hidden" >                <a class = "theme-hyperlink" tabindex= "2"><%= addCc %></a>           </div>    </div>        <div class="sfs-progressive-modal-cc-email-fullblock hidden" >           <div class="sfs-progressive-modal-heading-addcc theme-text"> <%= addCc %></div>           <div class="sfs-progressive-modal-cc-email-block" >                 <div class ="sfs-cc-email-ids-list"></div>                 <textarea class="sfs-progressive-modal-email-cc-textarea theme-sfs-progressive-modal-right-bg-color ui-theme theme-container theme-text" placeholder="<%=cc_email_placeholder%>" align="right" rows="1" tabindex="4" spellcheck="false"></textarea>           </div>           <a id="sfs-progressive-modal-email-hidecc" class = "theme-hyperlink" tabindex="3"><%= hide %></a>       </div>       <div class = "role-dropdown hidden">           <ul id="dropdown-menu" >                 <li class="signer"><div id = "icon"><div class="signerImg posAbsolute"></div></div><span class="value" > <%=roledropdown_signer%></span></li>                 <li class="approver"><div id = "icon"><div class="approverImg posAbsolute"></div></div><span class="value"> <%=roledropdown_approver%></span></li>           </ul>       </div>       <div class="sfs-progressive-modal-autocomplete-box"></div>    </div>    <div id="subject-message-container">           <div class="sfs-progressive-modal-subjext-textarea hidden">                 <textarea class="sfs-progressive-modal-subject-list theme-sfs-progressive-modal-right-bg-color ui-theme theme-container theme-text" rows="1" placeholder ="<%=subject_placeholder%>" align="left" maxlength="255" tabindex="5"></textarea>           </div>           <div class="sfs-progressive-modal-message-textarea hidden">                 <textarea class="sfs-progressive-modal-message-list theme-sfs-progressive-modal-right-bg-color ui-theme theme-container theme-text" rows="3" align="left" tabindex="6"></textarea>           </div>     </div>    <div class="sfs-modal-selected-files-heading-container-progressive hidden">    <div class="sfs-modal-selected-files-heading-container-progressive">       <div class="sfs-modal-selected-files-heading-new theme-text" tabindex="-1"><%= selected_files %></div>    </div>    <div class="sfs-modal-selected-files-container-new">       <div class="sfs-modal-selected-files-list-new ui-theme theme-border"></div>       <div class="sfs-modal-app-info-container">           <div class="info-txt 1"></div>           <div class="info-txt 2"></div>           <div class="info-txt 3"></div>       </div>    </div>    </div>     <div class="sfs-progressive-modal-more-options hidden">         <a title = "<%= advanced_tooltip %>" class="ui-theme theme-hyperlink" style="float:left" tabindex="7"><%=advanced_sign%></a>     </div>    <div class="sfs-progressive-share-advisory-msg hidden">           <em class="sfs-progressive-share-advisory-msg-em"><%= share_advisory_msg %></em>    </div>     </div>    </div>     <div class = "sfs-progressive-modal-email-error-parent hidden">           <table class = "sfs-progressive-modal-email-error">              <tr>                 <td><div class="sfs-progressive-modal-caution-img"></td>                 <td><div class="sfs-progressive-modal-email-error-msg"></div></td>                 <td><span id="sfs-progressive-modal-close-button" class="theme-text" tabindex="10"><span></td>               <tr>           </table>     </div>    <div class="sfs-progressive-modal-bottom-CTA-row">        <input type="button" id = "sfs-progressive-modal-cancel-btn" class="adobe-sign-modal-cancel-cta-bg-color adobe-sign-modal-cancel-cta-text-color control-button dialog-control-button button-grey site-catalyst ui-theme theme-text" tabindex="9" aria-label="<%= cancel %>" value="<%= cancel %>"/>        <input type="button" id = "sfs-progressive-modal-assign-fields-btn" class="adobe-sign-modal-send-cta-bg-color adobe-sign-modal-send-cta-text-color sfs-modal-file-action-btn-new 1 control-button sfs-modal-file-action-btn-new 1 site-catalyst theme-button theme-button-label" tabindex="8"/>    </div>'}),define("pdmplugins/send-for-sign/js/views/sfs-new-autocomplete-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-autocomplete-template","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t){return i.NewAutocompleteView=e.View.extend({events:{"mousedown .share-auto-address":"_onAddressClick"},initialize:function(){var i,s=this.options,n=s.autoCCollection;e.View.prototype.initialize.call(this),this._template=_.template(t),this._addressTemplate=_.template("<div class='share-auto-address <%=specialClass%>'     title='<%-title %>'     role='option' id='<%=id%>' tabindex='-1'     aria-selected='<%=ariaSelected%>'><%=emailHTML%> </div>"),this._localAddressTemplate=_.template("<div class='share-auto-address <%=specialClass%>' title='<%-title %>' ><%=nameHTML%> &lt;<%=emailHTML%>&gt;</div>"),this._editControl=s.editControl,this._landingPageUiModel=s.sfsAppLandingPageUiModel,i=new Backbone.Collection,this.filteredCollection=i,i.on("all",_.debounce(_.bind(this._onFilteredCChange,this),50)),n.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()),this._initWrappers(),this.$autoCList.on("scroll",this._onAddressScroll),e.Util.isCEF()&&(this.$autoCList.css("overflow","auto"),this.$autoCList.css("width","100%"))),this._renderAddressList(),this},_initWrappers:function(){this.$autoCList=this.$(".share-auto-c-list")},setFilter:function(e){e&&(e=$.trim(e.toLowerCase()),e.length<3&&(e=void 0)),e||(this.selectedID=void 0),this.fragment=e,this._updateFilteredCollection()},makeChoice:function(e){{var i,t;this.options}return e||1!==this.filteredCollection.length?this.selectedID&&(i=this.filteredCollection.get(this.selectedID)):i=this.filteredCollection.at(0),i&&(t=i.get("email"),this._insertEmail(t)),i},selectDown:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),r=$(".share-auto-address").height(),l=6,d=6;e.Util.isCEF&&(l=n.length),s=this._landingPageUiModel.get("enable_autoc_arrows"),s&&(o?(l>n.length&&(l=n.length),t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(l>i&&(i+=1,l>d&&this._keyboardScrollTo(a+r)),i>=l?o=void 0:(t=n.at(i),o=t?t.id:void 0))):(t=n.at(0),t?(o=t.id,this._keyboardScrollTo(0)):o=void 0),this.selectedID=o,this._renderAddressList())},selectUp:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),r=6,l=6,d=$(".share-auto-address").height();e.Util.isCEF&&(r=n.length),s=this._landingPageUiModel.get("enable_autoc_arrows"),s&&(o?(t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(i>=0&&(i-=1,r>l&&this._keyboardScrollTo(a-d)),0>i?o=void 0:(t=n.at(i),o=t?t.id:void 0))):(r>n.length&&(r=n.length),r-=1,t=n.at(r),t?(o=t.id,r>l&&this._keyboardScrollTo(r*d)):o=void 0),this.selectedID=o,this._renderAddressList())},_keyboardScrollTo:function(i){e.Util.isCEF()&&(this.$autoCList.stop(!0,!0),this.$autoCList.animate({scrollTop:i},"fast"))},_renderAddressList:function(){var e,i,t=this.filteredCollection,s=this.$autoCList,n=this.selectedID,o=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),a=this.fragment;e=this._localAddressTemplate,i=this._addressTemplate,t.length&&this.$el.show();var r=function(e,i){if(!i||""===i)return e;for(var t=e.toLowerCase(),s=i.toLowerCase(),n=i.length,o=e.length,a=[],r=0,l=function(e,i,t){var s={};s.token=i,s.highlight=t,e.push(s)},d=function(e){return t.indexOf(s,e)},p=d(r);-1!==p&&(r!==p&&l(a,e.substr(r,p-r),!1),l(a,e.substr(p,n),!0),r=p+n,!(r>=o));)p=d(r);o>r&&l(a,e.substr(r),!1);for(var c="",_='<span style="font-weight:bold">',h="</span>",u=0;u<a.length;++u){var g=a[u];if(g.highlight){var f=_+g.token+h;c+=f}else c+=g.token}return c};s.empty(),t.each(function(t){var l,d="";t.id===n&&(d="selected");var p=t.get("email"),c=t.get("name"),h="FSS_VARIANT_3"===o||"FSS_VARIANT_4"===o||"FSS_VARIANT_5"===o?!0:!1;l=_.isUndefined(t.get("name"))||""===t.get("name")||h&&c.toLowerCase()===p.toLowerCase()?i({emailHTML:r(p,a),title:p,specialClass:d,id:_.uniqueId("share-auto-address-"),ariaSelected:""===d?"false":"true"}):e({nameHTML:r(c,a),emailHTML:r(p,a),title:p,specialClass:d,id:_.uniqueId("share-auto-address-"),ariaSelected:""===d?"false":"true"}),s.append(l)}),t.length||this.$el.hide()},_updateFilteredCollection:function(){var e,i=this.options.autoCCollection,t=this.filteredCollection,s=[],n="",o="",a=!1,r=this._landingPageUiModel.get("pgcSuggestionsCollection");return r&&i.add(r.toJSON(),{merge:!0}),e=this.fragment,e&&e.length&&(s=i.filter(function(i){return o=i.get("email"),a=0===o.indexOf(e),a===!1&&(n=i.get("name"),void 0!==n&&(n=n.toLowerCase(),a=0===n.indexOf(e.toLowerCase()))),a})),t.set(s),s},_onFilteredCChange:function(){if(this.filteredCollection.length>0){var e=this.filteredCollection.at(0);this.selectedID=e.id}this._renderAddressList()},_onCollectionChange:function(){this._renderAddressList()},_onAddressClick:function(e){var i,t=$(e.target);i=t.attr("title"),this._insertEmail(i),this._landingPageUiModel.get("autocomplete_eventual_click")||(this._landingPageUiModel.set("autocomplete_eventual_click",!0),this._landingPageUiModel.set("autocomplete_avoided",!0)),this._landingPageUiModel.get("autocomplete_immediate_click")||this._landingPageUiModel.set("autocomplete_immediate_click",!0)},_onAddressScroll:function(){this._landingPageUiModel.get("autocomplete_scroll")||(this._landingPageUiModel.set("autocomplete_scroll",!0),this._landingPageUiModel.set("autocomplete_immediate_click",!0),this._landingPageUiModel.set("autocomplete_avoided",!0))},_insertEmail:function(e){e=e.split(/\s*[,;()\s]+\s*/)[0],this.options.emailView.abortPGCRequest(),this.options.emailView._setRecipientsFromText(e),this.setFilter(void 0),_.delay(_.bind(function(){this._editControl.focus(!0)},this),10)}}),i.NewAutocompleteView}),define("pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-right-landing-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-right-landing-page-template","pdmplugins/send-for-sign/js/templates/modal/sfs-modal-filename-template","pdmplugins/send-for-sign/js/templates/sfs-email-block-template","pdmplugins/send-for-sign/js/templates/sfs-guide-template","pdmplugins/send-for-sign/js/templates/sfs-guide-template-new","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/utils/util","core/utils/truncate","core/utils/css-util","core/utils/file-types","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/utils/image-loader","core/utils/http-util","pdmplugins/send-for-sign/js/utils/sfs-ts-utils","pdmplugins/send-for-sign/js/views/sfs-new-autocomplete-view","pdmplugins/send-for-sign/js/ops/plugin/desktop-fetching-autocomplete-list-op","pdmplugins/send-for-sign/js/ops/plugin/desktop-getting-subscription-levels-op"],function(e,i,t,s,n,o,a,r,l,d,p,c,h,u,g,f){var S,m=!1,E=!1,A=25,v=11,C=255,I=!1,T=!1,O=!1,b=!1,w=!1,R=0,L=0,F=!0,N=!1;return i.SFSModalProgressiveLandingPageView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._fileNameTemplate=_.template(s),this._emailIdTemplate=_.template(n),this._landingPageUiModel=this.options.sfsAppLandingPageUiModel,this.$currentVisibleThumbNail="fileName",this._addUiModelEventListeners(),this._addKeyEventListener();var i=_.extend({},this.options,{searchString:""});this.PGCOp=e.opFactory.create("GettingPGCSuggestionsOp",i)},events:function(){return{"click #sfs-progressive-modal-assign-fields-btn":"_onSFSNextBtnClick","click .sfs-progressive-modal-more-options":"_onSFSAdvancedSignBtnClick","click .sfs-modal-add-files":"_onAddFilesBtnClick","click .sfs-modal-close-img":"_closeDialog","click #sfs-progressive-modal-cancel-btn":"_closeDialog","keyup .sfs-progressive-modal-email-textarea":"_onKeyUpEmaiTextarea","keydown .sfs-progressive-modal-email-textarea":"_onKeyDownEmailTextarea","paste .sfs-progressive-modal-email-textarea":"_onPasteEmailTextarea","focusout .sfs-progressive-modal-email-textarea":"_onFocusOutEmailTextarea","input .sfs-progressive-modal-email-textarea":"_onInputEmailTextarea","click .sfs-progressive-modal-email-textarea":"_onClickEmailTextarea","keyup .sfs-progressive-modal-email-cc-textarea":"_onKeyUpCCEmaiTextarea","keydown .sfs-progressive-modal-email-cc-textarea":"_onKeyDownCCEmailTextarea","keydown .sfs-email-id-item":"_onKeyDownToggleSignerApprover","paste .sfs-progressive-modal-email-cc-textarea":"_onPasteCCEmailTextarea","focusout .sfs-progressive-modal-email-cc-textarea":"_onFocusOutCCEmailTextarea","input .sfs-progressive-modal-email-cc-textarea":"_onInputCCEmailTextarea","click .sfs-progressive-modal-email-addcc":"_OnclickAddCC","click #sfs-progressive-modal-email-hidecc":"_OnClickHideCC","click #sfs-progressive-modal-close-button":"_closeError","click .dropbtn":"_roleDropdownClick","mouseenter .signer":"_OnMouseEnterSignerBlock","mouseleave .signer":"_OnMouseLeaveSignerBlock","mouseenter .approver":"_OnMouseEnterApproverBlock","mouseleave .approver":"_OnMouseLeaveApproverBlock","mouseenter .sfs-guide-new":"_OnMouseEnterGuideBlock","mouseleave .sfs-guide-new":"_OnMouseLeaveGuideBlock","click .sfs-email-id-item .email-remove":"_onSelectedEmailRemoveClick","keydown .sfs-progressive-modal-subject-list":"_onKeyDownSubjectTextArea","keydown .sfs-progressive-modal-message-list":"_onKeyDownMessageTextArea","input .sfs-progressive-modal-message-list":"_adjustMessgeTextAreaHeight","click .sfs-progressive-modal-to-email-block":"_onEmailToAreaClick","click .sfs-progressive-modal-cc-email-block":"_onCCAreaClick","focus .sfs-progressive-modal-to-email-block":"_getEmailContacts","focus .sfs-progressive-modal-cc-email-block":"_getEmailContacts","click .sfs-guide-new-close":"_hideNewGuide"}},_OnMouseEnterGuideBlock:function(){F=!1},_OnMouseLeaveGuideBlock:function(){F=!0},_closeOpenDropdownandGuides:function(){this.$roleDropDown.hasClass("hidden")||(this.$roleDropDown.addClass("hidden"),this.$signerBlockInRoleDropDown.hasClass("SignerHover")&&(this.$signerBlockInRoleDropDown.removeClass("SignerHover"),this._roleDropdownSelectSignerClick(this.$signerBlockInRoleDropDown)),this.$approverBlockInRoleDropDown.hasClass("ApproverHover")&&(this.$approverBlockInRoleDropDown.hasClass("ApproverHover"),this._roleDropdownSelectApproverClick(this.$approverBlockInRoleDropDown)),event.stopPropagation()),this._hideButtonGuide(),this._autocompleteControl&&this._autocompleteControl.setFilter(void 0)},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var i=e.keyCode,t=$(e.target),s=$.Event("click");switch(i){case 13:t.trigger(s),e.preventDefault();break;case 27:this.options.appApi.siteCatalystApi.logScEvent(["SFSProgressiveDialog","EscapeButton::Clicked"]);break;case 9:var n=!this.$EmailErrorParent.hasClass("hidden"),o=this.$closeButton;if(this.$emailTextarea[0]==t[0])e.shiftKey?(e.stopPropagation(),e.preventDefault()):n&&(e.stopPropagation(),e.preventDefault());else if(e.shiftKey||o[0]!=t[0])if(this.$(".sfs-progressive-modal-email-addcc")[0]==t[0]){var a=window.getComputedStyle(this.$addCCBlock);"none"===a.display?this.$(".sfs-progressive-modal-email-addcc").focus():(this.$(".sfs-progressive-modal-email-addcc").hide(),this.$emailCCTextarea.show().focus())}else this.$(".sfs-modal-email-address-help")[0]==t[0]||this.$(".sfs-email-id-item")[0]==t[0]&&this.$(".signer").show().focus();else e.stopPropagation(),e.preventDefault()}},_addUiModelEventListeners:function(){this._landingPageUiModel.on("change:is_refreshed",this._refreshPageContent),this._landingPageUiModel.on("change:is_visible",this._onVisibilityChange)},render:function(){if(e.View.prototype.render.call(this),!this._landingPageUiModel.get("is_visible"))return this.$el.hide(),this;if(this.$el.show(),0===this.$el.children().length){var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+f.getFillSignReaderFreeTransVariant(this.options);this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.sessionApi.isSignedInReader()?[s,h.NEW_LANDING_PAGE,h.SIGNED_USER]:[s,h.NEW_LANDING_PAGE,h.UNSIGNED_USER]),this.$el.html(this._template({title:r.SFS_PROGRESSIVE_MODAL_TITLE_RIGHT,subtitle:r.SFS_LANDING_DESCRIPTION,subject_title:r.SFS_PROGRESSIVE_MODAL_SUBJECT,message_title:r.SFS_PROGRESSIVE_MODAL_MESSAGE,message_placeholder:r.LP_MESSAGE_TEXT2,subtitle3:r.LP_SUBTITLE4_NEW,uploadingText:r.DOC_PROGRESS_LABEL,close:r.SFS_ERR_CLOSE_BTN,totitle:r.SFS_LANDING_STR2,toMessage:r.SFS_LANDING_MSG5,add_files:r.SFS_ADD_FILES,selected_files:r.LP_FILES,cancel:r.SFS_PROGRESS_CANCEL_LABEL,no_email_error:r.LP_NO_EMAIL_ERROR,invalid_email_error:r.LP_INVALID_EMAIL_ERROR,to_email_placeholder:r.SFS_PROGRESSIVE_MODAL_ADD_EMAIL_NEW,cc_email_placeholder:r.SFS_PROGRESSIVE_MODAL_ADD_CC_EMAIL,subject_placeholder:r.LP_SUBJECT_PLACEHOLDER,roledropdown_signer:r.LP_SIGNER,roledropdown_approver:r.LP_APPROVER,help_icon_text:r.LP_HELP_ICON_TEXT,addCc:r.SFS_PROGRESSIVE_MODAL_ADD_CC,hide:r.SFS_PROGRESSIVE_MODAL_HIDE_CC,advanced_sign:r.SFS_LANDING_MSG4,advanced_tooltip:r.ADVANCED_BUTTON_TOOLTIP,share_advisory_msg:r.GET_A_LINK_ADVISORY2})),this._initWrappers(),this._refreshPageContent(),this._UpdatePreviouslyUsedContacts();
var n=i.QueryParams.mode;1==n&&(this._prepopulateFields(),i.QueryParams.mode=-1);var o=i.QueryParams.reqSignReengageBannerStatus;void 0!=o&&"true"==o&&(this._prepopulateFields(),i.QueryParams.reqSignReengageBannerStatus="false")}return this.$sfsLoaderNew.hide(),this._renderChildViews(),this._registerEventsToCloseRoleDropDown(),this._LogSignActivity(),this},_initWrappers:function(){this.$fileItemsContainerElem=this.$(".sfs-modal-selected-files-list-new"),this.$modalLandingPageContentDiv=this.$("#sfs-progressive-modal-landing-page-content"),this.$sfsScrollableDiv=this.$("#sfs-progressive-modal-scrollable-div"),this.$sfsLoaderNew=this.$(".sfs-modal-loader-container"),this.$emailBlock=this.$(".sfs-progressive-modal-to-email-block"),this.$emailCCBlock=this.$(".sfs-progressive-modal-cc-email-block"),this.$emailIdList=this.$(".sfs-to-email-ids-list"),this.$emailIdCCList=this.$(".sfs-cc-email-ids-list"),this.$emailTextarea=this.$(".sfs-progressive-modal-email-textarea"),this.$emailCCTextarea=this.$(".sfs-progressive-modal-email-cc-textarea"),this.$messageBody=this.$(".sfs-progressive-modal-message-list"),this.$hiddenMessageBodyDiv=this.$(".sfs-progressive-modal-message-list-hidden-div"),this.$subject=this.$(".sfs-progressive-modal-subject-list"),this.$fileItemsHeadingElem=this.$(".sfs-modal-selected-files-heading-container-new"),this.$actionBtnsGrpElem=this.$(".sfs-modal-action-btns-group-new"),this.$actionBtnsContainerElem=this.$(".sfs-modal-action-btns-group-new-container"),this.$actionBtn1Elem=this.$(".sfs-modal-file-action-btn-new.1"),this.$actionBtn2Elem=this.$(".sfs-modal-file-action-btn-new.2"),this.$advancedSignBtn=this.$(".sfs-progressive-modal-more-options"),this.$actionBtn1DescrElem=this.$(".description-text.1"),this.$actionBtn2DescrElem=this.$(".description-text.2"),this.$actionBtnSeparatorElem=this.$(".sfs-modal-action-btn-separator"),this.$appInfoContainer=this.$(".sfs-modal-app-info-container"),this.$appInfoTxt1Elem=this.$(".sfs-modal-app-info-container .info-txt.1"),this.$appInfoTxt2Elem=this.$(".sfs-modal-app-info-container .info-txt.2"),this.$appInfoTxt3Elem=this.$(".sfs-modal-app-info-container .info-txt.3"),this.$docThumbnail=this.$(".sfs-modal-current-thumbnail-row"),this.$EmailError=this.$(".sfs-progressive-modal-email-error"),this.$EmailErrorMsg=this.$(".sfs-progressive-modal-email-error-msg"),this.$EmailErrorParent=this.$(".sfs-progressive-modal-email-error-parent"),this.$addCCBlock=this.$(".sfs-progressive-modal-cc-email-fullblock"),this.$autocompleteBox=this.$(".sfs-progressive-modal-autocomplete-box"),this.$closeButton=this.$("#sfs-progressive-modal-close-button"),this.$previewImage=this.$(".sfs-modal-preview-image"),this.$signerBlockInRoleDropDown=this.$(".signer"),this.$approverBlockInRoleDropDown=this.$(".approver"),this.$shareAdvisoryMessage=this.$(".sfs-progressive-share-advisory-msg"),this.$roleDropDown=this.$(".role-dropdown"),R=this._calculateUtf8Length(this.$emailTextarea[0].placeholder),L=this._calculateUtf8Length(this.$emailCCTextarea[0].placeholder),this.$emailTextarea.css("width",8*R+"px"),this.$emailCCTextarea.css("width",8*L+"px")},_calculateUtf8Length:function(e){for(var i=0,t=0;t<e.length;t++){var s=e.charCodeAt(t);128>s?i++:i+=s>127&&2048>s?1.5:2}return i},_renderChildViews:function(){if(this._landingPageUiModel.get("enable_autocomplete")){var e=_.extend({},this.options,{editControl:this.$emailTextarea,emailView:this});this.$autocompleteBox.show(),this._renderChildView("_autocompleteControl",i.NewAutocompleteView,this.$autocompleteBox,e)}else this._autocompleteControl&&this.removeChildView(this._autocompleteControl),this.$autocompleteBox.hide()},_onVisibilityChange:function(){this.render()},_refreshPageContent:function(){this._updateFileItemsList(),w||(this._updateToListWithPrepareFormRecipients(),w=!0),this._updateActionButtonLabels(),this._updateActionButtonEnabledState(),this._updateActionButtonDescription(),this._updateAppInfoTexts(),this._adjustCSS(),this._focusOnSelectButton(),this._LogSignActivity()},_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,i){var t=i.params,s=t.split(";"),n="",o="",a=-1,r=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)),r.get(o)&&r.remove(o),r.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))},_adjustToEmailTextAreaMargin:function(){var e=$(".sfs-to-email-ids-list > div").length;e>0?this.$emailTextarea.css("margin-left","4px"):this.$emailTextarea.css("width",8*R+"px")},_getEmailContacts:function(){var t=this._getResolvedPromise();e.Util.isCEF()&&this._landingPageUiModel.get("autocomplete_local_contacts_imported")===!1&&(t=this._importLocalEmailContacts(),t.then(_.bind(function(){this._landingPageUiModel.set({autocomplete_local_contacts_imported:!0})},this))),e.Util.isCEF()&&this.options.appApi.sessionApi.isSignedInReader()&&i.opFactory.create("DesktopFetchingAutocompleteListOp",this.options).run(),e.Util.isCEF()&&this._landingPageUiModel.get("autocomplete_msgraph_contacts_imported")===!1&&this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().done(_.bind(function(){i.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().done(_.bind(function(i){if(i){var t=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),s=h.SEND_FOR_SIG,n=h.START,o="Get MSGraph Contacts for SignedIn User";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),t.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),this._landingPageUiModel.set({autocomplete_msgraph_contacts_imported:!0})},this),_.bind(function(){},this))}},this))},this))},this))},_hideNewGuide:function(){F=!0,this._hideButtonGuide()},_UpdatePreviouslyUsedContacts:function(){this._userSignedIn=this.options.appApi.sessionApi.isSignedInReader(),this._userConnected=this.options.appApi.networkConnectivityApi.isOnline(),this._userSignedIn&&this._userConnected&&(this.options.readRegistry=!0,i.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run())},_registerEventsToCloseRoleDropDown:function(){_.bindAll(this,"_closeOpenDropdownandGuides"),$("html").bind("mousewheel",this._closeOpenDropdownandGuides),$("body").bind("mousedown",this._closeOpenDropdownandGuides),$(window).on("resize",this._closeOpenDropdownandGuides)},_decode:function(e){for(var i="",t=0;t<e.length;t++)"%"!=e[t]?i+="+"==e[t]?" ":e[t]:(i+=String.fromCharCode(parseInt(e.substring(t+1,t+3),16)),t+=2);return i},_prepopulateFields:function(){if(void 0!=i.QueryParams.toList&&(this.$emailTextarea.addClass("activeEmailTextarea"),this._setRecipientsFromText(i.QueryParams.toList),i.QueryParams.toList.split(",").length>=2&&"false"==i.QueryParams.reqSignReengageBannerStatus&&this._showGuideonButton(r.LP_GUIDE_SIGNING_ORDER)),void 0!=i.QueryParams.ccList&&(this.$addCCBlock.removeClass("hidden"),this.$(".sfs-progressive-modal-email-addcc").hide(),this.$emailCCTextarea.addClass("activeEmailTextarea"),this._setRecipientsFromText(i.QueryParams.ccList)),void 0==i.QueryParams.reqSignReengageBannerStatus&&this.$(".sfs-modal-selected-files-heading-container-progressive").show(),void 0!=i.QueryParams.subject){var e=this._decode(i.QueryParams.subject);this.$subject.val(e)}if(void 0!=i.QueryParams.body){var e=this._decode(i.QueryParams.body);this.$messageBody.val(e)}this.$("#sfs-progressive-modal-assign-fields-btn").focus()},_updateToListWithPrepareFormRecipients:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.prepareFormsEmailRecipients().then(_.bind(function(e){var i=0;if(e.length>0){var t=e.split(",");_.each(t,_.bind(function(e){e=$.trim(e);var t=this._validateEmail(e);if(t){var s=$(this._emailIdTemplate({emailID:e,ariaRemoveLabel:this._getRemoveAriaLabel(e)}));this._addToEmailIdList(this.$emailIdList,s,!1),i=1}},this)),i&&this._showGuideonButton(r.LP_NEXT_GUIDE_TEXT)}},this))},this))},_addToEmailIdList:function(e,i,t){i.appendTo(e),t?this.$emailCCTextarea[0].placeholder="":this.$emailTextarea[0].placeholder=""},_removeFromEmailIdList:function(e,i){e.children().last()&&e.children().last().remove(),0==e.children().length&&(i?this.$emailCCTextarea[0].placeholder=r.SFS_PROGRESSIVE_MODAL_ADD_CC_EMAIL:(this.$emailTextarea[0].placeholder=r.SFS_PROGRESSIVE_MODAL_ADD_EMAIL_NEW,this.$emailTextarea.css("width",8*R+"px")))},_updateActionButtonLabels:function(){this._landingPageUiModel.get("action_btn1_visible")?(this.$actionBtn1Elem.val(this._landingPageUiModel.get("action_btn1_label")),this.$actionBtn1Elem.removeClass("hidden")):this.$actionBtn1Elem.addClass("hidden"),this._landingPageUiModel.get("action_btn2_visible")?(this.$actionBtn2Elem.val(this._landingPageUiModel.get("action_btn2_label")),this.$actionBtnSeparatorElem.html(this._landingPageUiModel.get("action_btn_separator_label")),this.$actionBtn2Elem.removeClass("hidden"),this.$actionBtnSeparatorElem.removeClass("hidden")):(this.$actionBtn2Elem.addClass("hidden"),this.$actionBtnSeparatorElem.addClass("hidden"))},_updateActionButtonEnabledState:function(){this._landingPageUiModel.get("action_btn1_enabled")?this.$actionBtn1Elem.removeClass("disabled"):this.$actionBtn1Elem.addClass("disabled"),this._landingPageUiModel.get("action_btn2_enabled")?this.$actionBtn2Elem.removeClass("disabled"):this.$actionBtn2Elem.addClass("disabled")},_updateActionButtonDescription:function(){this._landingPageUiModel.get("action_btn_descr_visible")?(this.$actionBtn1DescrElem.html(this._landingPageUiModel.get("action_btn1_descr_txt")),this.$actionBtn2DescrElem.html(this._landingPageUiModel.get("action_btn2_descr_txt")),this.$actionBtn1DescrElem.removeClass("hidden"),this.$actionBtn2DescrElem.removeClass("hidden")):(this.$actionBtn1DescrElem.addClass("hidden"),this.$actionBtn2DescrElem.addClass("hidden"))},_updateAppInfoTexts:function(){this._landingPageUiModel.get("app_info_txt_visible")?(this.$appInfoContainer.removeClass("hidden"),this.$appInfoTxt1Elem.html(this._landingPageUiModel.get("app_info_txt1")),this.$appInfoTxt1Elem.removeClass("hidden"),this.$appInfoTxt2Elem.html(this._landingPageUiModel.get("app_info_txt2")),this.$appInfoTxt2Elem.removeClass("hidden"),this.$appInfoTxt3Elem.html(this._landingPageUiModel.get("app_info_txt3")),this.$appInfoTxt3Elem.removeClass("hidden")):(this.$appInfoContainer.addClass("hidden"),this.$appInfoTxt1Elem.addClass("hidden"),this.$appInfoTxt2Elem.addClass("hidden"),this.$appInfoTxt3Elem.addClass("hidden"))},_getRemoveAriaLabel:function(e){return _.template(r.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:r.SEND_REMOVE})},_updateFileItemsList:function(){var e,i,t,s=this._landingPageUiModel.get("selected_files"),n=this._landingPageUiModel.get("file_collection_visible"),o="",a=this.$messageBody.val();if(T||(a=r.LP_MESSAGE_TEXT2),n){if(!I){o=s[0].get("name");var l=o.lastIndexOf(".");-1!==l&&(o=o.substr(0,l)),o.length>55&&this.$subject.css("height","50px"),this.$subject.val(o)}this.$fileItemsContainerElem.empty(),_.each(s,_.bind(function(s){e=s.get("name"),t=s.get("path"),i=$(this._fileNameTemplate({fileName:e,ariaRemoveLabel:this._getRemoveAriaLabel(e)})),i.data("file",s),this.$fileItemsContainerElem.append(i)},this)),this.$fileItemsContainerElem.removeClass("hidden"),this.$fileItemsHeadingElem.removeClass("hidden"),1===this.options.appApi.rnaApiObj.esApi.shouldShowAdvanceSign()?this.$advancedSignBtn.show():this.$advancedSignBtn.hide()}else this.$fileItemsContainerElem.addClass("hidden"),this.$fileItemsHeadingElem.addClass("hidden"),this.$advancedSignBtn.hide(),I||this.$subject.val("");this.$messageBody.val(a)},_adjustCSS:function(){this._adjustAppsInfoContainerCSS(),this._adjustFileItemsCSS(),this._adjustActionButtonsCSS()},_focusOnSelectButton:function(){this.$emailTextarea.focus()},_adjustAppsInfoContainerCSS:function(){var e=this.$fileItemsContainerElem.css("margin-left");this.$appInfoContainer.css("margin-left",e)},_adjustActionButtonsCSS:function(){var e=this.$actionBtn1Elem.width()+p.getCssNum(this.$actionBtn1Elem,"padding-left")+p.getCssNum(this.$actionBtn1Elem,"padding-left"),i=this.$actionBtn2Elem.width()+p.getCssNum(this.$actionBtn2Elem,"padding-left")+p.getCssNum(this.$actionBtn2Elem,"padding-left"),t=Math.max(e,parseInt(this.$actionBtn1Elem.css("min-width"),10)),s=Math.max(i,parseInt(this.$actionBtn2Elem.css("min-width"),10));this.$actionBtn1DescrElem.width(t),this.$actionBtn2DescrElem.width(s)},_adjustFileItemsCSS:function(){this.$fileItemsContainerElem.children().each(function(){var e=$(this),i=$(".file-name",e),t=$(".file-icon",e),s=$(".file-remove-new",e),n=t.position().left+t.outerWidth(),o=s.outerWidth(),a=e.innerWidth(),a=a-n-o-35;d.truncateElementText(i,a);var r,l=i[0].innerText.toLowerCase(),p=l.lastIndexOf(".");-1!==p&&(r=l.substr(p+1,l.length)),t[0].classList.add("png"==r||"svg"==r||"gif"==r||"bmp"==r||"tif"==r||"tiff"==r||"jpg"==r||"jpeg"==r?"file-icon-image":"doc"==r||"docx"==r?"file-icon-docx":"ppt"==r||"pptx"==r?"file-icon-ppt":"htm"==r||"html"==r?"file-icon-html":"xls"==r||"xlsx"==r?"file-icon-xls":"pdf"==r||"tmp"==r?"file-icon-pdf":"file-icon-text")});var e=this._getSelectedFilesCount();e>0?this.$actionBtn1Elem.removeClass("no-file-selected"):this.$actionBtn1Elem.addClass("no-file-selected")},_getSelectedFilesCount:function(){var e=this._landingPageUiModel.get("selected_files");return _.isEmpty(e)?0:e.length},_onLearnMoreBtnClick:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,h.LEARN_MORE,h.CLICKED]);var t;t=l.isReader()?r.LANDING_PAGE_LEARN_MORE_RDR:r.LANDING_PAGE_LEARN_MORE_ACRO,_.isEmpty(t)||this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(t)},this))},_onAddFilesBtnClick:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([h.TOOLS,i,h.ADD_FILES,h.CLICKED]),this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","browse_file")},_onLearnMoreLinkClickAddSignersGuide:function(){this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.LEARN_MORE,h.CLICKED]);var e;e=l.isReader()?r.CM_LEARN_MORE_RDR:r.CM_LEARN_MORE_ACRO,_.isEmpty(e)||this.options.appApi.rnaApi.done(_.bind(function(i){i.openDecoratedUrl(e)},this))},_posAminusB:function(e,i){return{left:e.left-i.left,top:e.top-i.top}},_hideButtonGuide:function(e){if(e=e||S,F&&e)if(e.guide&&e===S)e.removeTimer&&(clearTimeout(e.removeTimer),delete e.removeTimer),e.guide.remove(),e.removeFunc&&e.removeFunc(),S=null,e.nextGuide&&this._showButtonGuide(e.nextGuide);else{for(var i=S;i&&i.nextGuide!==e;)i=i.nextGuide;i&&(i.nextGuide=e.nextGuide),e.removeFunc&&e.removeFunc()}},_findButtonGuide:function(e){for(var i=S;i&&e&&!e(i);)i=i.nextGuide;return i},_showButtonGuide:function(e){var i=this,t=!1,s=!1,n=!1;if(e.text===r.LP_NEXT_GUIDE_TEXT?t=!0:e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT&&(s=!0),e.text===r.LP_GUIDE_SIGNING_ORDER&&(n=!0),e=_.extend({top:0,left:0,text:"",parent:$(document),duration:5e3,arrowPosition:40,clickToRemove:!0,important:!1,getPreference:function(){if(t){var e=i.options.appApi.rnaApiObj.esApi.isSFSCoachmarkAlreadyDisplayed();return e||m}if(s){var e=i.options.appApi.rnaApiObj.esApi.isAddSignersCoachmarkAlreadyDisplayed();return e||E}return!1},setPreference:function(){t?(m=!0,i.options.appApi.rnaApiObj.esApi.setSFSCoachmarkAlreadyDisplayed()):s&&(E=!0)}},e),s&&(e.duration=1e4),n&&(e.top=110),e.force||e.redo||!e.getPreference()){if(t&&this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.NEXT_GUIDE_SHOWN]),S){if(e.noQueueIfShowing&&findGuide(function(i){return i.guideID===e.guideID}))return e;if(!e.important||S.important){for(var l=S;l.nextGuide;){if(e.important&&!l.nextGuide.important){e.nextGuide=l.nextGuide;break}l=l.nextGuide}return l.nextGuide=e,e}S.removeTimer&&(clearTimeout(S.removeTimer),delete S.removeTimer),S.guide.remove(),delete S.guide,S.redo=!0,e.nextGuide=S}e.redo||e.setPreference();var d;s?(d=e.guide=$(_.template(a,{title:r.LP_GUIDE_ADD_SIGNERS_TITLE,text:r.LP_GUIDE_ADD_SIGNERS_TEXT,learn:r.LP_GUIDE_LEARN_MORE,guideType:e.guideType||""})),e.arrowPosition=10):d=e.guide=$(_.template(o,{text:e.text,guideType:e.guideType||""}));var p=d.find(".sfs-guide-arrow");p.addClass(e.arrow),e.parent.append(d);var c="left";switch(e.arrow){case"up":e.initialPosition=s?{left:e.left-10,top:e.top+p.height()}:{left:e.left-d.outerWidth(),top:e.top+p.height()};break;case"down":e.initialPosition={left:e.left-d.outerWidth(),top:e.bottom-p.height()-d.outerHeight()};break;case"left":e.initialPosition={left:e.left+p.width(),top:e.top};break;case"right":e.initialPosition={left:e.right,top:e.top},c="right"}t?d.css("top",e.initialPosition.top+"px").css(c,e.initialPosition.left+"px"):d.css("top",e.initialPosition.top+"px").css(c,e.initialPosition.left+20+"px"),p.css("up"===e.arrow||"down"===e.arrow?"left":"top",s||n?e.arrowPosition:d.outerWidth()-e.arrowPosition),e.width&&d.css("width",e.width+"px"),e.maxWidth&&d.css("max-width",e.maxWidth+"px"),d.css("cursor","default"),S=e,e.clickToRemove&&(d.css("cursor","pointer"),d.click(function(){i._hideButtonGuide()})),e.addFunc&&!e.redo&&e.addFunc(d),e.duration&&(e.removeTimer=_.delay(function(e){delete e.removeTimer,d.fadeOut(function(){i._hideButtonGuide()})},e.duration,e)),delete e.redo}return e},_setGuidePlacement:function(e){var i,t,s,n=!1;t=this.$("#sfs-modal-landing-page-content"),e.text===r.LP_NEXT_GUIDE_TEXT?(s=this.$(".sfs-modal-action-btns-group-new"),i=this.$(".sfs-modal-file-action-new-btn-and-descr")):e.text===r.LP_HELP_ICON_TEXT?(s=this.$(".sfs-progressive-modal-heading-addcc"),i=this.$(".sfs-progressive-modal-email-addcc")):e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT?(s=this.$(".sfs-progressive-modal-email-list"),i=this.$(".sfs-progressive-modal-to-email-block"),n=!0):e.text===r.LP_GUIDE_SIGNING_ORDER&&(s=this.$(".sfs-progressive-modal-email-list"),i=this.$(".sfs-progressive-modal-to-email-block"));var o=i.offset();e.left=s.position().left+s.outerWidth(),e.text===r.LP_GUIDE_ADD_SIGNERS_TEXT?e.left=i.position().left:e.text===r.LP_GUIDE_SIGNING_ORDER?e.left+=270:e.left=Math.max(10,e.left);var a=o.top+i.height()-$(window).scrollTop(),l=i.position().top;a>$(window).height()-e.guideHeight?(e.bottom=l,e.arrow="down",e.bottom=Math.min(t.height()-10,e.bottom)):(e.top=l+(i.height()||s.height()),e.arrow="up",e.top=Math.max(10,e.top))},_showGuideonButton:function(e){if(e===r.LP_NEXT_GUIDE_TEXT){if("Next"!=this.$actionBtn1Elem.val())return;if(!this.options.appApi.rnaApiObj.esApi.shouldShowSFSCoachmark())return}var i={preference:"",text:e,guideType:"",guideHeight:120,important:!0},t=(this._findButtonGuide(_.bind(function(e){return e.field===this&&e.text===i.text},this)),this),s=$.extend({field:t,parent:this.$("#sfs-progressive-modal-primary-container")},i);this._setGuidePlacement(s),this._showButtonGuide(s)},_validateEmail:function(e){var i=/^(([^<>()[\]\\.,;:\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,}))$/;return i.test(e)},_setRecipientModels:function(e){var i;this.$emailTextarea.hasClass("activeEmailTextarea")?i=this.$emailTextarea.val():this.$emailCCTextarea.hasClass("activeEmailTextarea")&&(i=this.$emailCCTextarea.val()),this._setRecipientsFromText(i,e)},_removeLastEmailAddress:function(){},_parseRecipients:function(e){var i;return e=e.replace(/(\r\n|\n|\r)/gm,""),i=e.split(/\s*[,;\s]+\s*/)},_iterateAndValidateEmails:function(e){var i="",t="",s="";s=e?this.$emailCCTextarea.val():this.$emailTextarea.val();for(var n=this._parseRecipients(s),o=n.length,a=0;o>a;a++){var l=n[a];if(l){var d=this._validateEmail(l);if(d){var p=$(this._emailIdTemplate({emailID:l,ariaRemoveLabel:this._getRemoveAriaLabel(l)}));if(e){p.find("#dropdownMenu").css("display","none"),p.find(".caret").css("display","none"),this._addToEmailIdList(this.$emailIdCCList,p,!0),this.$emailCCTextarea.val("");var c=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),_=c+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([_,h.EMAIL_CC_ADDED])}else{this._addToEmailIdList(this.$emailIdList,p,!1),1==this.$emailIdList.children().length&&this._showGuideonButton(r.LP_NEXT_GUIDE_TEXT),this.$emailTextarea.val("");var c=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),_=c+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([_,h.EMAIL_TO_ADDED])}}else{0!=i.length&&(i+=","),0!=t.length&&(t+=",");var u=l;u.length>30&&(u=u.substring(0,30),u+="..."),i+=l,t+=u}}}return i.length>0&&(this._showErrorRedRibbon(t+r.LP_INVALID_EMAIL_ERROR,!1),e?this.$emailCCTextarea.val(i):this.$emailTextarea.val(i)),i},_onFocusOutEmailTextarea:function(){this._autocompleteControl&&this._autocompleteControl.setFilter(void 0);var e=this._iterateAndValidateEmails(!1),i=$(".sfs-to-email-ids-list > div").length;i>0&&""===e&&(this.$(".sfs-progressive-modal-subjext-textarea").show(),this.$(".sfs-progressive-modal-message-textarea").show(),this.$shareAdvisoryMessage.show(),this.$(".sfs-progressive-modal-more-options").removeClass("hidden"),this.$addCCBlock.hasClass("hidden")&&this.$(".sfs-progressive-modal-email-addcc").show())},_onFocusOutEmailCCTextarea:function(){},_onKeyUpEmaiTextarea:function(e){var i=e.which?e.which:e.keyCode;13==i&&(e.preventDefault(),this._onFocusOutEmailTextarea())},_showErrorRedRibbon:function(e,i){this.$EmailErrorMsg.html(e),this.$EmailErrorParent.show(),i&&this.$emailBlock.css("border","1px solid red"),this.$sfsScrollableDiv.css("height","355px")},_onKeyDownEmailTextarea:function(e){this._hideButtonGuide(),O||(O=!0,this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.EMAIL_TO_EDITED]));var i=e.which?e.which:e.keyCode,t=$(".sfs-to-email-ids-list > div").length,s=8*this.$emailTextarea.val().length,n=this.$emailTextarea.width(),o=this.$emailBlock.width();if(s>n&&o>s&&this.$emailTextarea.css("width",s+21+"px"),8!=i&&46!=i&&t>=A)this._showErrorRedRibbon(r.LP_RECIPIENTS_LIMITS_ERROR,!1),e.preventDefault();else if(40===i)this._autocompleteControl&&this._autocompleteControl.selectDown();else if(38===i)this._autocompleteControl&&this._autocompleteControl.selectUp();else if(186===i||188===i){var a=e.key;_.defer(_.bind(function(){this._setRecipientModels(a)},this))}else if(13===i)this.$emailTextarea.css("width",8*R+"px"),this._autocompleteControl&&(this._autocompleteControl.makeChoice(!0)||_.defer(_.bind(function(){this.abortPGCRequest(),this._setRecipientModels()},this))),e.preventDefault();else{if(8!==i)return 13!=i;this.$emailTextarea.val()||this._removeFromEmailIdList(this.$emailIdList,!1)}this._adjustToEmailTextAreaMargin()},_onPasteEmailTextarea:function(e){O||(O=!0,this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.EMAIL_TO_EDITED]));var i=this.$emailBlock.width();this.$emailTextarea.css("width",i+"px");var t=$(".sfs-to-email-ids-list > div").length;t>=A&&(this._showErrorRedRibbon(r.LP_RECIPIENTS_LIMITS_ERROR,!1),e.preventDefault())},_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(i){i.length>0&&(this._landingPageUiModel.set("pgcSuggestionsCollection",i),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())},_onInputEmailTextarea:function(){var i;e.Util.isMac()&&this.$emailCCTextarea.removeClass("activeEmailTextarea"),this.$emailTextarea.removeClass("activeEmailTextarea");var t=this.$emailTextarea.offset(),s=this.$emailTextarea.outerHeight();this.$autocompleteBox.css("top",t.top+s-68),this.$autocompleteBox.css("width","84.5%");var n=($(".sfs-to-email-ids-list > div").length,50);this.$autocompleteBox.css("left",n);this.$(".sfs-email-id-item").css("width");this._autocompleteControl&&(i=this.$emailTextarea.val(),this.$emailTextarea.addClass("activeEmailTextarea"),this._setAutocompleteFilterValue(i))},_onClickEmailTextarea:function(){this.options.appApi.siteCatalystApi.logScEvent(["SFSProgressiveDialog","AddSigner","EmailTextArea::Clicked"])},_onFocusOutCCEmailTextarea:function(){this._autocompleteControl&&this._autocompleteControl.setFilter(void 0);this._iterateAndValidateEmails(!0)},_onKeyUpCCEmaiTextarea:function(e){var i=e.which?e.which:e.keyCode;13==i&&(e.preventDefault(),this._onFocusOutCCEmailTextarea())},_onKeyDownToggleSignerApprover:function(e){var i=e.which?e.which:e.keyCode;console.log(i);$(e.target);e.stopPropagation(),38===i?($(this.$signerBlockInRoleDropDown).hasClass("signer-hover")?($(this.$signerBlockInRoleDropDown).removeClass("signer-hover"),$(this.$approverBlockInRoleDropDown).addClass("approver-hover")):$(this.$approverBlockInRoleDropDown).hasClass("approver-hover")?($(this.$approverBlockInRoleDropDown).removeClass("approver-hover"),$(this.$signerBlockInRoleDropDown).addClass("signer-hover")):$(this.$signerBlockInRoleDropDown).addClass("signer-hover"),console.log("Up arrow pressed")):40===i?($(this.$signerBlockInRoleDropDown).hasClass("signer-hover")?($(this.$signerBlockInRoleDropDown).removeClass("signer-hover"),$(this.$approverBlockInRoleDropDown).addClass("approver-hover")):$(this.$approverBlockInRoleDropDown).hasClass("approver-hover")?($(this.$approverBlockInRoleDropDown).removeClass("approver-hover"),$(this.$signerBlockInRoleDropDown).addClass("signer-hover")):$(this.$approverBlockInRoleDropDown).addClass("approver-hover"),console.log("Down arrow pressed")):13===i&&($(this.$signerBlockInRoleDropDown).hasClass("signer-hover")?($(this.$signerBlockInRoleDropDown).removeClass("signer-hover"),this._roleDropdownSelectSignerClick(this.$signerBlockInRoleDropDown)):$(this.$approverBlockInRoleDropDown).hasClass("approver-hover")?($(this.$approverBlockInRoleDropDown).removeClass("approver-hover"),this._roleDropdownSelectApproverClick(this.$approverBlockInRoleDropDown)):this._roleDropdownSelectSignerClick(this.$signerBlockInRoleDropDown))},_onKeyDownCCEmailTextarea:function(e){b||(b=!0,this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.EMAIL_CC_EDITED]));var i=e.which?e.which:e.keyCode,t=$(".sfs-cc-email-ids-list > div").length,s=8*this.$emailCCTextarea.val().length,n=this.$emailCCTextarea.width(),o=this.$emailBlock.width();if(s>n&&o>s&&this.$emailCCTextarea.css("width",s+32+"px"),8!=i&&46!=i&&t>=v)this._showErrorRedRibbon(r.LP_CC_LIMITS_ERROR,!1),e.preventDefault();else if(40===i)this._autocompleteControl&&this._autocompleteControl.selectDown();else if(38===i)this._autocompleteControl&&this._autocompleteControl.selectUp();else if(186===i||188===i){var a=e.key;_.defer(_.bind(function(){this._setRecipientModels(a)},this))}else if(13===i)this.$emailCCTextarea.css("width",8*L+"px"),this._autocompleteControl&&(this._autocompleteControl.makeChoice(!0)||_.defer(_.bind(function(){this._setRecipientModels()},this)));else{if(8!==i)return 13!=i;this.$emailCCTextarea.val()||this._removeFromEmailIdList(this.$emailIdCCList,!0)}},_onPasteCCEmailTextarea:function(e){b||(b=!0,this.options.appApi.siteCatalystApi.logScEvent([h.SEND_FOR_SIG,h.EMAIL_CC_EDITED]));var i=this.$emailBlock.width();this.$emailCCTextarea.css("width",i+"px");var t=$(".sfs-cc-email-ids-list > div").length;t>=v&&(this._showErrorRedRibbon(r.LP_CC_LIMITS_ERROR,!1),e.preventDefault())},_onInputCCEmailTextarea:function(){var e;this.$emailCCTextarea.removeClass("activeEmailTextarea"),this.$emailTextarea.removeClass("activeEmailTextarea");var i=this.$emailCCTextarea.offset(),t=this.$emailCCTextarea.outerHeight();this.$autocompleteBox.css("top",i.top+t-66),this.$autocompleteBox.css("left","25px"),this.$autocompleteBox.css("width","79%"),this._autocompleteControl&&(e=this.$emailCCTextarea.val(),this.$emailCCTextarea.addClass("activeEmailTextarea"),this._setAutocompleteFilterValue(e))},_OnclickAddCC:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,h.ADD_CC_CLICKED]),this.$addCCBlock.removeClass("hidden"),this.$(".sfs-progressive-modal-email-addcc").hide(),this.$emailCCTextarea.show().focus()},_OnClickHideCC:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([i,h.HIDE_CLICKED]),this.$addCCBlock.addClass("hidden"),this.$(".sfs-progressive-modal-email-addcc").show()},_closeError:function(){this.$EmailErrorParent.hide(),this.$sfsScrollableDiv.css("height","395px")},_setRecipientsFromText:function(e){this.$emailTextarea.hasClass("activeEmailTextarea")?(this.$emailTextarea.val(""),this.$emailTextarea.val(e),this._onFocusOutEmailTextarea(void 0),this.$emailTextarea.removeClass("activeEmailTextarea")):this.$emailCCTextarea.hasClass("activeEmailTextarea")&&(this.$emailCCTextarea.val(""),this.$emailCCTextarea.val(e),this._onFocusOutCCEmailTextarea(void 0),this.$emailCCTextarea.removeClass("activeEmailTextarea"))},_onSFSAdvancedSignBtnClick:function(){i.isAdvancedSign=!0,this._LogSignActivity();var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=e+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent(i.IsTrialUser===!0?[t,h.ADVANCED_CLICKED,h.FREE_USER]:[t,h.ADVANCED_CLICKED]),this._onSFSFileActionBtn1Click()},_onSFSNextBtnClick:function(){i.isAdvancedSign=!1,this._LogSignActivity();var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=e+"-"+f.getFillSignReaderFreeTransVariant(this.options);this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.sessionApi.isSignedInReader()?i.IsTrialUser===!0?[h.TOOLS,t,h.SPECIFY_WHERE_TO_SIGN_CTA,h.CLICKED,h.FREE_USER]:[h.TOOLS,t,h.SPECIFY_WHERE_TO_SIGN_CTA,h.CLICKED,h.ENTITLED_USER]:[h.TOOLS,t,h.SPECIFY_WHERE_TO_SIGN_CTA,h.CLICKED,h.UNSIGNED_USER]),N=!0,this._onSFSFileActionBtn1Click()},_onSFSFileActionBtn1Click:function(){if(!this.$actionBtn1Elem.hasClass("disabled")){if(!this.options.appApi.networkConnectivityApi.isOnline())return this._showErrorRedRibbon(r.FSS_ERR_OFFLINE_TITLE+". "+r.FSS_ERR_OFFLINE_MSG,!1),this.$("#sfs-progressive-modal-assign-fields-btn").removeClass("draw-button-focus-outline"),void this.$("#sfs-progressive-modal-more-options-heading").css("text-decoration","none");this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){var t=this._getSelectedFilesCount();if(t>0){var s=this.$emailTextarea.val();if(s&&!this._validateEmail(s)){var n=s;return n.length>30&&(n=n.substring(0,30),n+="..."),void this._showErrorRedRibbon(n+r.LP_INVALID_EMAIL_ERROR,!1)}if(s=this.$emailCCTextarea.val(),s&&!this._validateEmail(s)){var n=s;return n.length>30&&(n=n.substring(0,30),n+="..."),void this._showErrorRedRibbon(n+r.LP_INVALID_EMAIL_ERROR,!1)}var o=this.$el.find(".sfs-to-email-ids-list").children();if(0===o.length&&i.isAdvancedSign===!1)return void this._showErrorRedRibbon(r.LP_NO_EMAIL_ERROR,!0);if(1===o.length){var a=this.options.appApi.usersMeApi.getUserIdentity().email;if(void 0!==a&&o[0].children[1].innerText.toLowerCase()===a.toLowerCase())return void this._showErrorRedRibbon(r.LP_ONLY_SENDER_EMAIL_ERROR,!0)}var l,d=this.$el.find(".sfs-cc-email-ids-list").children(),p=this.$(".sfs-email-id-item"),c="",u="",g=[],f="",S=this;this.options.recipients=[],$.each(p,function(e,i){if(l=i.children[1].innerText,"none"==$(i.children[0].children).eq(0).css("display"))0!=f.length&&(f=f.concat(",")),f=f.concat(l);else if($(i.children[0].children[0].children).eq(0).hasClass("signerImg")){0!=c.length&&(c=c.concat(",")),c=c.concat(l);
var t={};t.email=l,t.role="SIGNER",g.push(t)}else{0!=u.length&&(u=u.concat(",")),u=u.concat(l);var t={};t.email=l,t.role="APPROVER",g.push(t)}if(l){var i=$.trim(l.toLowerCase());S.options.autoCCollection.add({email:i}),S.options.recipients.push(l)}}),this._landingPageUiModel.set("user_added_approver_emails",u),this._landingPageUiModel.set("user_added_signer_emails",c),this._landingPageUiModel.set("user_added_cc_emails",f),this._landingPageUiModel.set("user_added_emails_in_order",g),this._landingPageUiModel.set("user_action","email_list_added");var m=_.union(u.split(","),c.split(","),f.split(",")),E=_.clone(this.options.autoCCollection),A=this.options.autoCCollection.filter(function(e){return _.contains(m,e.get("email"))});E.reset(A),_.each(m,function(e){E.add({email:e})}),this.options.appApi.sessionApi.isSignedInReader()&&this._acceptPGCRecipients(E);var v=this.$subject.val();v=v.replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n"),this._landingPageUiModel.set("user_added_subject",v),this._landingPageUiModel.set("user_action","subject_added");var C=this.$messageBody.val();C=C.replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n"),this._landingPageUiModel.set("user_added_message",C),this._landingPageUiModel.set("user_action","message_added");var I=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),T=I+"-"+h.SEND_FOR_SIG;if(this.options.appApi.siteCatalystApi.logScEvent([T,h.TO_EMAIL_COUNT,o.length]),this.options.appApi.siteCatalystApi.logScEvent([T,h.CC_EMAIL_COUNT,d.length]),this.options.appApi.siteCatalystApi.logScEvent([T,h.FILE_COUNT,t]),this.options.sfsAppTrialBarUiModel.get("is_visible")&&0==this.options.sfsAppTrialBarUiModel.get("remaining_transaction"))return this._closeDialog(),void this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"});this._showUploadSpinner(),this._getSelectedFile(),e.Util.isCEF()&&(this.options=_.extend({},this.options,{recipientsAreFinalized:!0})),this.options.appApi.sessionApi.isSignedInReader()&&(this.options.readRegistry=!1,i.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run())}else this._handleSelectFileClickEvent()},this)),this.$("#sfs-progressive-modal-assign-fields-btn").removeClass("draw-button-focus-outline"),this.$shareAdvisoryMessage.addClass("hidden")}},_showUploadSpinner:function(){_.delay(_.bind(function(){this.$modalLandingPageContentDiv.hide(),this.$sfsScrollableDiv.hide(),this.$actionBtnsGrpElem.hide(),this.$EmailErrorParent.hide(),this.$(".sfs-progressive-modal-bottom-CTA-row").hide(),this.$(".sfs-progressive-modal-more-options").hide(),this.$("#sfs-progressive-modal-landing-page-content").hide(),this.$(".sfs-progressive-share-advisory-msg").hide(),this.$shareAdvisoryMessage.addClass("hiddden"),this.$sfsLoaderNew.show()},this),250)},_acceptPGCRecipients:function(i){var t=[];i.map(_.bind(function(i){if(_.isUndefined(i.get("token"))){var s=_.extend({},this.options,{newContactEmail:i.get("email")});e.opFactory.create("AcceptingNewPGCSuggestionOp",s).run()}else t.push(i.get("token"))},this));var s=_.extend({},this.options,{tokens:t});e.opFactory.create("AcceptingPGCSuggestionsOp",s).run()},_handlePrepareFormClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","prepare_form_btn_clicked")},_handleSendClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","send_action_btn_clicked")},_handleSelectFileClickEvent:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","select_action_btn_clicked")},_onSFSManageAgreementsBtnClick:function(){this._landingPageUiModel.clearLastUserAction(),this._landingPageUiModel.set("user_action","manage_agreements_btn_clicked")},_roleDropdownClick:function(e){var i=e.target,t=i.parentElement.parentElement.parentElement.getBoundingClientRect(),s=($(i).attr("class"),this.$(".sfs-email-id-item"));$.each(s,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&$(t).removeClass("clicked")}),this.$roleDropDown.hasClass("hidden")?(this.$roleDropDown.removeClass("hidden"),this.$roleDropDown.css("top",t.bottom-75.5),this.$roleDropDown.css("left",t.left-432),$(i).addClass("clicked")):(this.$roleDropDown.addClass("hidden"),$(i).removeClass("clicked")),e.stopPropagation()},_OnMouseEnterSignerBlock:function(e){$(e.currentTarget).addClass("SignerHover")},_OnMouseLeaveSignerBlock:function(e){$(e.currentTarget).removeClass("SignerHover")},_OnMouseEnterApproverBlock:function(e){$(e.currentTarget).addClass("ApproverHover")},_OnMouseLeaveApproverBlock:function(e){$(e.currentTarget).removeClass("ApproverHover")},_roleDropdownSelectSignerClick:function(e){var i=($(e)[0],this.$(".sfs-email-id-item"));$.each(i,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&($(t).removeClass("clicked"),$(t).hasClass("signerImg")&&$(t).removeClass("signerImg"),$(t).hasClass("approverImg")&&$(t).removeClass("approverImg"),$(t).addClass("signerImg")),$(t).hasClass("signer-hover")&&($(t).removeClass("signer-hover"),$(t).hasClass("signerImg")&&$(t).removeClass("signerImg"),$(t).hasClass("approverImg")&&$(t).removeClass("approverImg"),$(t).addClass("signerImg"))}),$(roleDropDown).addClass("hidden")},_roleDropdownSelectApproverClick:function(e){var i=($(e)[0],this.$(".sfs-email-id-item"));$.each(i,function(e,i){var t=i.children[0].children[0].children;$(t).hasClass("clicked")&&($(t).removeClass("clicked"),$(t).hasClass("signerImg")&&$(t).removeClass("signerImg"),$(t).hasClass("approverImg")&&$(t).removeClass("approverImg"),$(t).addClass("approverImg")),$(t).hasClass("approver-hover")&&($(t).removeClass("approver-hover"),$(t).hasClass("signerImg")&&$(t).removeClass("signerImg"),$(t).hasClass("approverImg")&&$(t).removeClass("approverImg"),$(t).addClass("approverImg"))}),$(roleDropDown).addClass("hidden")},_onSelectedEmailRemoveClick:function(e){var i=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=i+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([t,h.EMAIL_REMOVED]);{var s=$(e.currentTarget).parents(".sfs-email-id-item");s.data("email")}s&&s.remove(),e.stopPropagation();var n=$(".sfs-to-email-ids-list > div").length;0==n&&(this.$emailTextarea[0].placeholder=r.SFS_PROGRESSIVE_MODAL_ADD_EMAIL_NEW,this.$emailTextarea.css("width",8*R+"px"));var o=$(".sfs-cc-email-ids-list > div").length;0==o&&(this.$emailCCTextarea[0].placeholder=r.SFS_PROGRESSIVE_MODAL_ADD_CC_EMAIL)},_onKeyDownSubjectTextArea:function(e){var i=e.which?e.which:e.keyCode;if(!I&&9!=i){I=!0;var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([s,h.MESSAGE_SUBJECT_EDITED])}var n=i>=37&&40>=i||8==i||46==i;if(!n&&e.target.textLength==C)return this._showErrorRedRibbon(r.LP_AGREEMENT_CHARLIMITS_ERROR,!1),void e.stopPropagation();var o;13==i&&e.preventDefault(),32==i&&(o=this.$subject.text()+" ",this.$subject.html(o)),e.stopPropagation()},_adjustMessgeTextAreaHeight:function(){this.$messageBody.css("height","auto");{var e=null,i=document.createElement("div");document.querySelectorAll(".sfs-progressive-modal-message-list")}i.classList.add("sfs-progressive-modal-message-list-hidden-div"),i.classList.add("sfs-progressive-modal-message-list"),document.getElementById("sfs-progressive-modal-subjext-textarea").appendChild(i),e=this.$messageBody.text(),i.innerHTML=e+'<br style="line-height: 3px;">',i.style.visibility="hidden",i.style.display="block",this.$messageBody.css("height",i.offsetHeight+"px"),i.style.visibility="visible",i.style.display="none"},_onKeyDownMessageTextArea:function(e){var i=e.which?e.which:e.keyCode;if(!T&&9!=i){T=!0;var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+h.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([s,h.MESSAGE_BODY_EDITED])}var n;13==i&&(n=this.$messageBody.text()+"\n",this.$messageBody.html(n)),32==i&&(n=this.$messageBody.text()+" ",this.$messageBody.html(n)),e.stopPropagation()},_onEmailToAreaClick:function(){this.$emailTextarea.show().focus()},_onCCAreaClick:function(){this.$emailCCTextarea.show().focus()},_LogSignActivity:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.logSignServicesActivity()},this))},_uploadFile:function(){this.options.sfsAppSendACopyUiModel.set("is_upload_only",!0),i.opFactory.create("SendCompletedCopyOp",_.extend({},this.options)).run().then(_.bind(function(){this._uploadFinished(!0)},this),_.bind(function(){this._uploadFinished(!1)},this))},_uploadFinished:function(e){var t=this.options.sfsAppSendACopyUiModel,s=t.get("upload_req_queue"),n=[];_.each(s,function(e){n.push(e.responseObj.respBody.transientDocumentId)});var o=this._landingPageUiModel,a="AUTHORING",r=void 0!==i.QueryParams.invocationPoint?i.QueryParams.invocationPoint:"";if(i.isAdvancedSign&&(a="DRAFT"),e){var l=[{transientDocIds:n,esAccessToken:"Bearer "+this.options.esAuthUiModel.get("access_token"),emailSubject:o.get("user_added_subject"),emailMessage:o.get("user_added_message"),signers_emails:o.get("user_added_signer_emails"),approver_emails:o.get("user_added_approver_emails"),cc_emails:o.get("user_added_cc_emails"),agreementStatus:a,hasFullParams:"true",invocationPoint:r}];this.options.appApi.rnaApiObj.stApi.launchSendForSignWithTransientDocIdsAPI(l).always(_.bind(function(){this.options.appApi.rnaApiObj.esApi.setAddSignersCoachmarkAlreadyDisplayed().done(_.bind(function(){this._closeDialog()},this))},this))}else this._undoShowUploadSpinner()},_undoShowUploadSpinner:function(){_.delay(_.bind(function(){this.$modalLandingPageContentDiv.show(),this.$sfsScrollableDiv.show(),this.$(".sfs-progressive-modal-bottom-CTA-row").show(),this.$(".sfs-progressive-modal-more-options").show(),this.$("#sfs-progressive-modal-landing-page-content").show(),this.$sfsLoaderNew.hide(),this._showErrorRedRibbon(r.FSS_ERR_AUTH_FAILED_MSG)},this),250)},_closeDialog:function(){var e=[],i=[];if(void 0!=this.$el.find(".sfs-to-email-ids-list"))for(var t=this.$el.find(".sfs-to-email-ids-list").children(),s=0;s<t.length;s++)e.push(t[s].innerText);if(void 0!=this.$el.find(".sfs-cc-email-ids-list"))for(var n=this.$el.find(".sfs-cc-email-ids-list").children(),s=0;s<n.length;s++)i.push(n[s].innerText);(e.length>0||i.length>0)&&this.options.appApi.rnaApi.done(_.bind(function(t){t.invokeMethod({methodName:"storeEmailIdsList",methodArgs:{EmailVector:e,CCEmailVector:i}})},this)),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"}),N||this.options.appApi.siteCatalystApi.logScEvent(["SFSProgressiveDialog","AddSigner","CancelButton::Clicked"])},_getSelectedFile:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();if(_.isEmpty(i))this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc");else{var t=[];t.push(i),this.options.sfsAppSendACopyUiModel.set("selectedFiles",t),this._uploadFile()}},this))}}),i.SFSModalProgressiveLandingPageView}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-left-video-landing-page-template",[],function(){return'<div id="sfs-progressive-modal-left-container"><div id="sfs-progressive-modal-landing-page-title" class="theme-sfs-progressive-modal-left-bg-color"><div class="sfs-progressive-modal-view-title title_1 theme-text"><%= get_esign_title_1 %></div><div class="sfs-progressive-modal-view-title title_2 theme-text" id="title_faster"><%= get_esign_title_2 %></div><div class="sfs-progressive-modal-view-title title_3 theme-text"><%= get_esign_title_3 %></div></div>          <div id="sfs-progressive-modal-table-container">            <table id="sfs-progressive-modal-view-content-table" class="ui-theme theme-text">              <tr>                <td rowspan="2"><div id="progressive-left-img-1" class="progressive-table-icon"></div></td><td>					<div class="sfs-progressive-modal-view-content ui-theme theme-text" aria-label="<%= get_esign_content_1 %>" > <%= get_esign_content_1 %> </div>                </td>              </tr>            </table>            <table id="sfs-progressive-modal-view-content-table" class="ui-theme theme-text content-2">              <tr>                <td rowspan="2"><div id="progressive-left-img-2" class="progressive-table-icon"></div></td><td>					<div class="sfs-progressive-modal-view-content ui-theme theme-text" aria-label="<%= get_esign_content_2 %>"> <%= get_esign_content_2 %> </div>                </td>              </tr>            </table>            <table id="sfs-progressive-modal-view-content-table" class="ui-theme theme-text">              <tr>                <td rowspan="2"><div id="progressive-left-img-3" class="progressive-table-icon"></div></td><td>					<div class="sfs-progressive-modal-view-content ui-theme theme-text" aria-label="<%= get_esign_content_3 %>"> <%= get_esign_content_3 %> </div>                </td>              </tr>            </table>			</div>			<div class="sfs-progressive-modal-video-container ui-theme">				<div id="replay-video-text-container" class="ui-theme theme-sfs-progressive-modal-video-play-button" tabindex="0">					<div class="video-play-img"></div>					<div class="sfs-progressive-modal-play-video-text ui-theme theme-text" aria-label="<%= video_title %>" style="float: right;"> <%= video_title %> </div>				</div>			</div></div><div class="sfs-progressive-modal-left-video">	<video id="video-id" autoplay muted controls controlsList="nodownload" width="384" height="580" src="static\\js\\plugins\\send-for-sign\\images\\RequestSignatureVideo.webm" type="video/webm"></video>   <button class="video-close-btn"></button></div>'}),define("pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-left-video-landing-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-left-video-landing-page-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings"],function(e,i,t,s){return i.SFSModalProgressiveLandingPageViewLeftVideo=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._landingPageUiModel=this.options.sfsAppLandingPageUiModel,this._addUiModelEventListeners()},events:function(){return{"click #replay-video-text-container":"_onVideoContainerClicked","click .video-close-btn":"_onVideoCloseBtnClicked","keydown .sfs-progressive-modal-left-video":"_onKeyDown"}},_addUiModelEventListeners:function(){this._landingPageUiModel.on("change:is_refreshed",this._refreshPageContent),this._landingPageUiModel.on("change:is_visible",this._onVisibilityChange)},render:function(){return e.View.prototype.render.call(this),this.closeOnEscape=!1,this._landingPageUiModel.get("is_visible")?(this.$el.show(),0===this.$el.children().length&&(this.$el.html(this._template({get_esign_title_1:s.SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART1,get_esign_title_2:s.SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART2,get_esign_title_3:s.SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART3,get_esign_content_1:s.SFS_PROGRESSIVE_MODAL_CONTENT_1,get_esign_content_2:s.SFS_PROGRESSIVE_MODAL_CONTENT_2,get_esign_content_3:s.SFS_PROGRESSIVE_MODAL_CONTENT_3,video_title:s.SEE_HOW_IT_WORKS})),this._initWrappers()),this._addTimeUpdateEvents(),this._renderChildViews(),this):(this.$el.hide(),this)},_initWrappers:function(){this.$video=this.$("#video-id"),this.$sfsProgressiveModalLeftContainer=this.$("#sfs-progressive-modal-left-container"),this.$sfsProgressiveModalLeftVideo=this.$(".sfs-progressive-modal-left-video")},_addTimeUpdateEvents:function(){this.$video.on("ended",this._onVideoEnd),this.$video.on("webkitfullscreenchange",this._onFullScreenChange)},_renderChildViews:function(){"true"==i.QueryParams.firstTimeUser?(this.$sfsProgressiveModalLeftContainer.hide(),this.$sfsProgressiveModalLeftVideo.show(),this.options.appApi.siteCatalystApi.logScEvent(["SFSProgressiveDialog","VideoAutoPlay","true"])):(this.$sfsProgressiveModalLeftContainer.show(),this.$sfsProgressiveModalLeftVideo.hide())},_onVisibilityChange:function(){this.render()},_refreshPageContent:function(){this.render()},_onVideoContainerClicked:function(){this.$sfsProgressiveModalLeftContainer.hide(),this.$sfsProgressiveModalLeftVideo.show();var e=document.getElementById("video-id");e.load(),e.play(),this.options.appApi.siteCatalystApi.logScEvent(["SFSProgressiveDialog","SFSVideo","VideoSeeHowItWorks::Clicked"])},_onVideoCloseBtnClicked:function(){var e=document.getElementById("video-id");e.pause(),this.$sfsProgressiveModalLeftContainer.show(),this.$sfsProgressiveModalLeftVideo.hide(),this.options.appApi.siteCatalystApi.logScEvent(["SFSProgressiveDialog","SFSVideo","VideoCloseButton::Clicked"])},_onVideoEnd:function(){var e=document.getElementById("video-id");e.webkitExitFullScreen(),this.$sfsProgressiveModalLeftContainer.show(),this.$sfsProgressiveModalLeftVideo.hide(),this.options.appApi.siteCatalystApi.logScEvent(["SFSProgressiveDialog","SFSVideo","VideoEnded"])},_onFullScreenChange:function(){this._closeOnESC(),this.options.appApi.siteCatalystApi.logScEvent(["SFSProgressiveDialog","SFSVideo","VideoFullScreen::Toggled"])},_closeOnESC:function(){console.log(this.closeOnEscape),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"sfsProgressiveSetCloseOnESC",methodArgs:this.closeOnEscape})},this)),this.closeOnEscape=!this.closeOnEscape},_onKeyDown:function(e){var i=document.getElementById("video-id");27===e.which&&this.closeOnEscape&&i.webkitExitFullScreen()}}),i.SFSModalProgressiveLandingPageViewLeftVideo}),define("pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-left-landing-page-template",[],function(){return'<div id="sfs-progressive-modal-left-container"><div id="sfs-progressive-modal-landing-page-title" class="theme-sfs-progressive-modal-left-bg-color"><div class="sfs-progressive-modal-view-title title_1 theme-text"><%= get_esign_title_1 %></div><div class="sfs-progressive-modal-view-title title_2 theme-text" id="title_faster"><%= get_esign_title_2 %></div><div class="sfs-progressive-modal-view-title title_3 theme-text"><%= get_esign_title_3 %></div></div>          <div id="sfs-progressive-modal-table-container">            <table id="sfs-progressive-modal-view-content-table" class="ui-theme theme-text">              <tr>                <td rowspan="2"><div id="progressive-left-img-1" class="progressive-table-icon"></div></td><td>					<div class="sfs-progressive-modal-view-content ui-theme theme-text" aria-label="<%= get_esign_content_1 %>" > <%= get_esign_content_1 %> </div>                </td>              </tr>            </table>            <table id="sfs-progressive-modal-view-content-table" class="ui-theme theme-text content-2">              <tr>                <td rowspan="2"><div id="progressive-left-img-2" class="progressive-table-icon"></div></td><td>					<div class="sfs-progressive-modal-view-content ui-theme theme-text" aria-label="<%= get_esign_content_2 %>"> <%= get_esign_content_2 %> </div>                </td>              </tr>            </table>            <table id="sfs-progressive-modal-view-content-table" class="ui-theme theme-text">              <tr>                <td rowspan="2"><div id="progressive-left-img-3" class="progressive-table-icon"></div></td><td>					<div class="sfs-progressive-modal-view-content ui-theme theme-text" aria-label="<%= get_esign_content_3 %>"> <%= get_esign_content_3 %> </div>                </td>              </tr>            </table>			</div>		<div class="sfs-progressive-modal-video-container ui-theme theme-text">			<div id="video-text-container" tabindex="0" class="theme-sfs-progressive-modal-video-bar-bg-color theme-sfs-progressive-modal-video-bar-text-color">				<div class="video-img"></div>				<div class="sfs-progressive-modal-video-text ui-theme theme-text" aria-label="<%= video_title %>" style="float: right;"> <%= video_title %> </div>			</div>			<div class="share-img"></div>		</div>'}),define("pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-left-landing-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-left-landing-page-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings"],function(e,i,t,s){return i.SFSModalProgressiveLandingPageViewLeft=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._landingPageUiModel=this.options.sfsAppLandingPageUiModel,this._addUiModelEventListeners()},events:function(){return{"click #video-text-container":"_onVideoContainerClicked"}},_addUiModelEventListeners:function(){this._landingPageUiModel.on("change:is_refreshed",this._refreshPageContent),this._landingPageUiModel.on("change:is_visible",this._onVisibilityChange)},render:function(){return e.View.prototype.render.call(this),this._landingPageUiModel.get("is_visible")?(this.$el.show(),0===this.$el.children().length&&(this.$el.html(this._template({get_esign_title_1:s.SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART1,get_esign_title_2:s.SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART2,get_esign_title_3:s.SFS_PROGRESSIVE_MODAL_TITLE_LEFT_PART3,get_esign_content_1:s.SFS_PROGRESSIVE_MODAL_CONTENT_1,get_esign_content_2:s.SFS_PROGRESSIVE_MODAL_CONTENT_2,get_esign_content_3:s.SFS_PROGRESSIVE_MODAL_CONTENT_3,video_title:s.SEE_HOW_IT_WORKS})),this._initWrappers()),this._renderChildViews(),this):(this.$el.hide(),this)},_initWrappers:function(){},_renderChildViews:function(){},_onVisibilityChange:function(){this.render()},_refreshPageContent:function(){this.render()},_onVideoContainerClicked:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-";this.options.appApi.siteCatalystApi.logScEvent([i,"SEE_HOW_IT_WORKS","CLICKED"]),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"RedirectToAdobeSignHelpxPage"})}}),i.SFSModalProgressiveLandingPageViewLeft}),define("pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-container-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/modal/sfs-progressive-modal-view-container-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/views/modal/sfs-modal-landing-page-view","pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-trial-bar-view","pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-t2e-bar-view","pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-right-landing-page-view","pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-left-video-landing-page-view","pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-left-landing-page-view","pdmplugins/esign/js/views/es-offline-view","core/views/plugin-content-view"],function(e,i,t,s,n,o,a){return s.SFSModalProgressiveContainerView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addUiModelEventListeners()},render:function(){var i=this.$el;return e.PluginContentView.prototype.render.call(this),0===i.children().length&&(i.html(_.template(n,{CLOSE:o.SFS_ERR_CLOSE_BTN})),this._initWrappers()),this._renderChildViews(),this},events:function(){return{"click #share-close-button":"_CloseDialog"}},_addUiModelEventListeners:function(){this.options.sfsAppUiModel.on("change:app_state_updated",this._onSFSAppStateUpdatedChange),this.options.sfsAppSendACopyUiModel.on("change:failed_workflow",this._ErrorStateChange)},_onSFSAppStateUpdatedChange:function(){this.render()},_initWrappers:function(){this.$sfsTrialBar=this.$(".sfs-modal-trial-bar-container"),this.$sfsT2EBar=this.$(".sfs-modal-t2e-bar-container"),this.$sfsProgressiveLandingPageRight=this.$(".sfs-progressive-modal-landing-page-container-right"),this.$sfsProgressiveLandingPageLeft=this.$(".sfs-progressive-modal-landing-page-container-left"),this.$ErrorDiv=this.$(".sfs-modal-sac-error"),this.$ErrText=this.$("#sac-error-text"),this.$sfsOfflinePage=this.$(".sfs-offline-view-container")},_renderChildViews:function(){console.log(s.QueryParams.product),this._renderSFSTrialBarView(),this._renderSFST2EBarView(),this._renderSFSProgressiveLandingPageViewRight(),this._renderSFSProgressiveLandingPageViewLeft(),this._renderSFSOfflineView()},_renderSFSProgressiveLandingPageViewLeft:function(){s.skipUploadingForSfsOldLandingPage=!0,"true"==s.QueryParams.canShowVideo?this._renderChildView("_sfsModalProgressiveLandingPageViewLeftVideo",s.SFSModalProgressiveLandingPageViewLeftVideo,this.$sfsProgressiveLandingPageLeft):this._renderChildView("_sfsModalProgressiveLandingPageViewLeft",s.SFSModalProgressiveLandingPageViewLeft,this.$sfsProgressiveLandingPageLeft)},_renderSFSProgressiveLandingPageViewRight:function(){s.skipUploadingForSfsOldLandingPage=!0,this._renderChildView("_sfsModalProgressiveLandingPageView",s.SFSModalProgressiveLandingPageView,this.$sfsProgressiveLandingPageRight)},_renderSFSOfflineView:function(){this._renderChildView("_sfsAppOfflineView",t.AppOfflineView,this.$sfsOfflinePage,{acceptLabel:o.SFS_OFFLINE_ACCEPT_LABEL})},_renderSFSTrialBarView:function(){i.isReader()?this._renderChildView("_sfsProgressiveModalTrialBarView",s.SFSProgressiveModalTrialBarView,this.$sfsTrialBar):this.$sfsTrialBar.hide()},_renderSFST2EBarView:function(){"true"==s.QueryParams.canShowT2EBar?this._renderChildView("_sfsProgressiveModalT2EBarView",s.SFSProgressiveModalT2EBarView,this.$sfsT2EBar):this.$sfsT2EBar.hide()},_CloseDialog:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeShareDialog"})},_ErrorStateChange:function(){var e=this.options.sfsAppSendACopyUiModel,i=e.get("workflow_success_status"),t=e.get("workflow_running");if(t||!_.isEmpty(e.get("failed_workflow"))){var s=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),n=s+"-"+a.SEND_FOR_SIG;if(!i){var r=this.options.sfsAppSendACopyUiModel.get("failed_workflow");switch(r){case"UserOffline":this.$ErrText.html(o.FSS_ERR_OFFLINE_TITLE+"<br><br>"+o.FSS_ERR_OFFLINE_MSG);break;case"LARGE_FILE_SIZE":this.$ErrText.html(o.FSS_ERR_LARGE_FILE_MSG);break;case"AUTH_FAILED":return;case"Missing_TransientIDs":this.$ErrText.html(o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+o.FSS_ERR_MIISSING_TRANSIENTIDS_MSG);break;case"Agreement_Wait_Exceeded":this.$ErrText.html(o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+o.FSS_ERR_AGREEMENT_WAIT_EXCEEDED_MSG);break;case"File size too large":this.$ErrText.html(o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+o.FSS_ERR_FILE_SIZE_TOO_LARGE_MSG);break;default:this.$ErrText.html(r==o.SFS_ERR_GENERAL_WORKFLOW_FAILURE?o.SFS_ERR_GENERAL_WORKFLOW_FAILURE:o.SFS_ERR_GENERAL_WORKFLOW_FAILURE+"<br><br>"+r)}this.$sfsProgressiveLandingPageRight.hide(),this.$ErrorDiv.show(),this.options.appApi.siteCatalystApi.logScEvent([n,a.FAILURE,r])}}}}),s.SFSModalProgressiveContainerView}),define("pdmplugins/send-for-sign/js/templates/fss-rhp-template",[],function(){return'<div id="fss-rhp-primary-view-container" class="ui-theme theme-container theme-share-grey-container"><div id="fss-rhp-modal-tab-view" class="ui-theme theme-share-grey-container" role="menubar"><div id="fss-rhp-title-text" class ="ui-theme theme-text"><%= FSS_RHP_TITLE %></div><div class = "show-blue-box hideborder"><div id="get-link-tab" class ="fss-rhp-tab ui-theme" role="button" tabindex=1 aria-label="<%= FSS_RHP_GET_LINK %>"><div id="fss-rhp-get-link-img" class="fss-rhp-icon-container"></div><div id="get-link-tab-text" class="fss-rhp-tab-text theme-text"><%= FSS_RHP_GET_LINK %></div></div><div id="send-a-copy-tab" class ="fss-rhp-tab ui-theme" role="button" tabindex=2 aria-label="<%= FSS_RHP_SEND_A_COPY %>"><div id="fss-rhp-send-a-copy-img" class="fss-rhp-icon-container"></div><div id="send-a-copy-tab-text" class="fss-rhp-tab-text theme-text"><%= FSS_RHP_SEND_A_COPY%></div></div></div><div id="manage-agreement-tab" class ="fss-rhp-tab ui-theme" role="button" tabindex=-1 aria-label="<%= MANAGE_AGREEMENT %>"><div id="fss-rhp-manage-agr-img" class="fss-rhp-icon-container"></div><div id="manage-agreement-tab-text" class="fss-rhp-tab-text theme-text"><%= MANAGE_AGREEMENT%></div></div><table id="sign-another-agreement-tab" class="fss-rhp-tab ui-theme" role="button" tabindex=0 aria-label="<%= SIGN_ANOTHER_DOCUMENT %>"><tr><td><div id="fss-rhp-sign-another-agr-img" class="fss-rhp-icon-container"></div></td><td><div id="sign-another-agreement-tab-text" class="fss-rhp-tab-text theme-text"><%= SIGN_ANOTHER_DOCUMENT%></div></td></tr></table></div></div>'}),define("pdmplugins/send-for-sign/js/views/fss-rhp-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/fss-rhp-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s,n,o,a){return s.FSSRhpView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._addKeyEventListener()},events:function(){return{"click #get-link-tab":"_GetLinkClicked","click #send-a-copy-tab":"_SendACopyClicked","click #sign-another-agreement-tab":"_SelectSignAnotherAgr","click #manage-agreement-tab":"_SelectManageAgreement","keypress #get-link-tab":"_keypressOnGetALink","keypress #send-a-copy-tab":"_keypressOnSendACopy","keypress #sign-another-agreement-tab":"_keypressOnSignAnotherAgr","keypress #manage-agreement-tab":"_keypressOnManageAgr","mouseenter #get-link-tab":"_onmouseenterGetLinkTab","mouseleave #get-link-tab":"_onmouseleaveGetLinkTab","mouseenter #send-a-copy-tab":"_onmouseenterSendACopyTab","mouseleave #send-a-copy-tab":"_onmouseleaveSendACopyTab","mouseenter #manage-agreement-tab":"_onmouseenterManageAgrTab","mouseleave #manage-agreement-tab":"_onmouseleaveManageAgrTab","mouseenter #sign-another-agreement-tab":"_onmouseenterSignAnotherAgrTab","mouseleave #sign-another-agreement-tab":"_onmouseleaveSignAnotherAgrTab"}},render:function(){var t=this.$el;return e.PluginContentView.prototype.render.call(this),0===t.children().length&&(t.html(_.template(n,{FSS_RHP_TITLE:o.FSS_RHP_TITLE,FSS_RHP_GET_LINK:o.FSS_RHP_GET_LINK,FSS_RHP_SEND_A_COPY:o.FSS_RHP_SEND_A_COPY,SIGN_ANOTHER_DOCUMENT:o.SIGN_ANOTHER_DOCUMENT,MANAGE_AGREEMENT:o.MANAGE_AGREEMENT})),i.isReader()&&this.$("#send-a-copy-tab").hide(),this._initWrappers(),this._initWalkthrough()),this},_initWrappers:function(){},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_initWalkthrough:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"LaunchShareWalkthrough",methodArgs:{}}).done(_.bind(function(e){e.length&&this._showBlueBox()},this))},this))},_onmouseenterGetLinkTab:function(){this.$("#get-link-tab-text").removeClass("theme-text")},_onmouseleaveGetLinkTab:function(){this.$("#get-link-tab-text").addClass("theme-text")},_onmouseenterSendACopyTab:function(){this.$("#send-a-copy-tab-text").removeClass("theme-text")},_onmouseleaveSendACopyTab:function(){this.$("#send-a-copy-tab-text").addClass("theme-text")},_onmouseenterManageAgrTab:function(){this.$("#manage-agreement-tab-text").removeClass("theme-text")},_onmouseleaveManageAgrTab:function(){this.$("#manage-agreement-tab-text").addClass("theme-text")},_onmouseenterSignAnotherAgrTab:function(){this.$("#sign-another-agreement-tab-text").removeClass("theme-text")},_onmouseleaveSignAnotherAgrTab:function(){this.$("#sign-another-agreement-tab-text").addClass("theme-text")},_GetLinkClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.esApi.getFillSignVariant(),t=i+"-"+a.FSS_SHARE_RHP;this.options.appApi.siteCatalystApi.logScEvent([t,"get_a_link"]),e.esApi.invokeMethod({methodName:"LaunchShareDialog",methodArgs:{Workflow:"Get_a_link"}})},this))},_SendACopyClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.esApi.getFillSignVariant(),t=i+"-"+a.FSS_SHARE_RHP;
this.options.appApi.siteCatalystApi.logScEvent([t,"send_a_copy"]),e.esApi.invokeMethod({methodName:"LaunchShareDialog",methodArgs:{Workflow:"Send_a_copy"}})},this))},_SelectSignAnotherAgr:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.esApi.getFillSignVariant(),t=i+"-"+a.FSS_SHARE_RHP;this.options.appApi.siteCatalystApi.logScEvent([t,"sign-another"]),e.esApi.invokeMethod({methodName:"FSSSignAnotherDoc",methodArgs:{Workflow:"Get_a_link"}})},this))},_SelectManageAgreement:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.esApi.getFillSignVariant(),t=i+"-"+a.FSS_SHARE_RHP;this.options.appApi.siteCatalystApi.logScEvent([t,"manage-agreement"]),e.esApi.invokeMethod({methodName:"FSSManageAgreements",methodArgs:{Workflow:"Get_a_link"}})},this))},_keypressOnGetALink:function(e){e&&"keypress"==e.type&&(13==e.keyCode||32==e.keyCode||0==e.keyCode)&&this._GetLinkClicked()},_keypressOnSendACopy:function(e){e&&"keypress"==e.type&&(13==e.keyCode||32==e.keyCode||0==e.keyCode)&&this._SendACopyClicked()},_keypressOnSignAnotherAgr:function(e){e&&"keypress"==e.type&&(13==e.keyCode||32==e.keyCode||0==e.keyCode)&&this._SelectSignAnotherAgr()},_keypressOnManageAgr:function(e){e&&"keypress"==e.type&&(13==e.keyCode||32==e.keyCode||0==e.keyCode)&&this._SelectManageAgreement()},_showBlueBox:function(){_.delay(_.bind(function(){this.$(".show-blue-box").removeClass("hideborder")},this),3e3)}}),s.FSSRhpView}),define("pdmplugins/send-for-sign/js/views/plugin-view",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","core/utils/sc-analytics","pdmplugins/send-for-sign/js/views/sfs-app-main-view","pdmplugins/send-for-sign/js/views/sfs-inapp-sign-view","pdmplugins/send-for-sign/js/views/fss-Send-view","pdmplugins/send-for-sign/js/views/unified-fss-view","pdmplugins/send-for-sign/js/views/Share/share-dialog-view","pdmplugins/send-for-sign/js/views/Share/share-popup-view","pdmplugins/send-for-sign/js/views/sfs-sign-educational-card-view","pdmplugins/send-for-sign/js/views/modal/sfs-modal-container-view","pdmplugins/send-for-sign/js/views/modal/sfs-progressive-modal-container-view","pdmplugins/send-for-sign/js/views/fss-rhp-view","core/views/plugin-content-view","plugins-common/ac-plugins"],function(e,i,t,s,n,o){var a;return s.PluginView=e.PluginContentView.extend({initialize:function(){e.PluginContentView.prototype.initialize.call(this),console.log("SFS initialize")},render:function(){e.PluginContentView.prototype.render.call(this),console.log("SFS render"),this.options.sfsAppUiModel.canRunInUIMode()&&this._renderChildViews()},selectPlugin:function(){return this.options.appApi.displayApi.applyUIThemeStyles(this.$el).then(_.bind(function(){this.render(),this.options.appApi.displayApi.showSpinner(!1)},this)),this.render(),console.log("SFS selectPlugin"),this._startPlugin()},deselectPlugin:function(){},initPlugin:function(){return this._initPlugin()},releasePlugin:function(){e.PluginContentView.prototype.releasePlugin.call(this)},hideBlueBoxDiv:function(){console.log("[vas] function hit"),this.$("#show-blue-box").hide()},getSiteCatalystName:function(){return n.SEND_FOR_SIG},_renderChildViews:function(){var e=s.QueryParams.app,i=s.QueryParams.agreementOpened,t=s.QueryParams.workflow,n=0;"FillSign"==e&&(n=1),console.log(n),"InAppSigning"==e?(console.log("starting inapp workflow"),this._renderSFSInAppSignView()):1===n?(console.log("starting F&S workflow"),this._renderSendACopyView()):"Share"==e?(console.log("Launching share window"),"true"==i&&this.options.sfsAppSendACopyUiModel.set("is_agreement_opened",!0),"none"!=t&&this.options.sfsAppSendACopyUiModel.set("share_modal_workflow",t),this._renderShareView()):"Share_popup"==e?this._renderSharePopUpView():"modernize_send_copy_save"==e?s.opFactory.create("ListenForSendCopy",this.options).run():"SFSEducationalCard"==e?(console.log("showing Adobe sign educational card"),this._renderSignEducationalCard()):"FSS_RHP"==e?this._renderFSSRHPView():"invite_others"==e?this._renderSFSModalView():"invite_others_progressive_fields"==e?this._renderSFSModalProgressiveView():this._renderSFSAppMainView()},_renderSFSAppMainView:function(){this.sfsAppMainView=this._renderChildView("_sfsAppMainView",s.SFSAppMainView,this.$el)},_renderSFSInAppSignView:function(){this.sfsInAppSignView=this._renderChildView("_sfsInAppSignView",s.SFSInAppSignView,this.$el)},_renderSendACopyView:function(){this.FSSView=this._renderChildView("_FSSView",s.FSSView,this.$el)},_renderSharePopUpView:function(){this.SharePopUpView=this._renderChildView("_SharePopUpView",s.SharePopUpView,this.$el)},_renderSFSModalView:function(){this.SFSModalView=this._renderChildView("_SFSModalContainerView",s.SFSModalContainerView,this.$el)},_renderSFSModalProgressiveView:function(){this.SFSModalProgressiveView=this._renderChildView("_SFSModalProgressiveContainerView",s.SFSModalProgressiveContainerView,this.$el)},_renderShareView:function(){this.ShareView=this._renderChildView("_ShareDialogView",s.ShareDialogView,this.$el)},_renderSignEducationalCard:function(){this.EducationalCardView=this._renderChildView("_SignEducationalCardView",s.SignEducationalCardView,this.$el)},_renderFSSRHPView:function(){this.fssRhpView=this._renderChildView("_FSSRhpView",s.FSSRhpView,this.$el)},_initPlugin:function(){var e=this._initingPluginPromise;return e||(e=this._initingPluginPromise=s.opFactory.create("InitializingPluginOp",this.options).run()),e},_startPlugin:function(){var e=this._startingPluginPromise;return e||(e=this._startingPluginPromise=this.options.appApi.rnaApi.then(_.bind(function(){return this.$el.parent().css("overflow","hidden"),s.opFactory.create("StartingPluginOp",this.options).run().then(_.bind(function(){this._addAppApiCallbacks(),this._addUiModelEventListeners()},this))},this))),e},_addAppApiCallbacks:function(){var e=this.options.appApi;e.sessionApi.addSignedInChangeCallback(this._onSignedInChange),e.networkConnectivityApi.addNetworkConnectivtyChangeCallback(this._onNetworkConnectionChanged)},_addUiModelEventListeners:function(){var e=this.options.sfsAppUiModel,i=this.options.actionsUiModel;e.on("change:restart_app",_.bind(function(e,i){i&&this._resetEntirePlugin()},this)),i.addCallback("showBlueBoxOnFssRHP",this._hideBlueBoxOnFssRHP),i.addCallback("createReadOnlyCopy",this._UploadAndOpenLockedCopy),i.addCallback("modernizeUploadAndOpenLockedCopy",this._ModernizeUploadAndOpenLockedCopy),i.addCallback("modernizeSaveReadOnlyCopy",this._ModernizeSaveReadOnlyCopy),console.log("_addUiModelEventListeners1"),this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"sfsActionUIModelReady",methodArgs:{}}).done(_.bind(function(){},this))},this))},_hideBlueBoxOnFssRHP:function(){this.$(".show-blue-box").addClass("hideborder")},_notifyProgressBar:function(e,t){this.options.appApi.rnaApi.done(_.bind(function(s){(!i.isReader()||s.isSignedInReader())&&s.esApi.invokeMethod({methodName:"FSSProgessBar",methodArgs:{State:e,Message:t}})},this))},_UploadAndOpenLockedCopy:function(){this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){this._notifyProgressBar("StartProgressBar"),this.options.sfsAppSendACopyUiModel.set("workflow_running",!0),s.opFactory.create("SendCompletedCopyOp",_.extend({},this.options)).run().then(_.bind(function(){this._workflowcomplete(),this._notifyProgressBar("AgreementCreated")},this),_.bind(function(e){this._workflowError(e)},this))},this))},_ModernizeSaveReadOnlyCopy:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"saveLocalCopy",methodArgs:{}}).done(_.bind(function(){},this))},this))},_getSelectedFile:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();if(_.isEmpty(i))this.options.sfsAppSendACopyUiModel.set("failed_workflow","NoDoc");else{var t=[];t.push(i),this.options.sfsAppSendACopyUiModel.set("selectedFiles",t)}},this))},_ModernizeUploadAndOpenLockedCopy:function(){this.options.sfsAppSendACopyUiModel.set("current_share_choice","locked-copy"),this.options.sfsAppSendACopyUiModel.set("is_locked_copy_workflow",!0),this._getSelectedFile(),this._UploadAndOpenLockedCopy()},_resetEntirePlugin:function(){this.options.sfsAppLandingPageUiModel.resetTodefaults(),this.options.autoCCollection.reset(),delete this._startingPluginPromise,delete this._initingPluginPromise,this.releasePlugin(),this.options.sfsAppUiModel.off(),this.options.sfsAppProgressUiModel.off(),this.options.sfsAppSendPageUiModel.off(),this.options.sfsAppLandingPageUiModel.off(),this.initPlugin().then(_.bind(function(){this.selectPlugin()},this))},_onSignedInChange:function(e,i){i?a||(s.sfsAppApi.handleSessionSignedIn(),s.sfsAppApi.workflowApi.handleSessionSignedIn(),s.sfsAppApi.subscriptionApi.handleSessionSignedIn(),t.esApi.authApi.handleSessionSignedIn(),a=!0):a===!0&&(s.sfsAppApi.handleSessionSignOut(),s.sfsAppApi.workflowApi.handleSessionSignOut(),s.sfsAppApi.subscriptionApi.handleSessionSignOut(),t.esApi.authApi.handleSessionSignOut(),this._resetEntirePlugin(),a=!1)},_onNetworkConnectionChanged:function(e,i){i||(s.sfsAppApi.handleNetworkDisconnectedEvent(),s.sfsAppApi.workflowApi.handleNetworkDisconnectedEvent(),s.sfsAppApi.subscriptionApi.handleNetworkDisconnectedEvent(),t.esApi.authApi.handleNetworkDisconnectedEvent())},_workflowError:function(){var e="";"AUTH_FAILED"==this.options.sfsAppSendACopyUiModel.get("failed_workflow")&&(e=o.FSS_ERR_AUTH_FAILED_MSG),this._notifyProgressBar("Error",e)}}),s.PluginView}),define("pdmplugins/send-for-sign/js/models/sfs-autocomplete-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/models/model"],function(e,i){return i.AutocompleteModel=e.Model.extend({idAttribute:"email",initialize:function(i,t){e.Model.prototype.initialize.call(this,i,t),this.rootUrl="",t.collection&&(this.rootUrl=t.collection.rootUrl),t.rootUrl&&(this.rootUrl=t.rootUrl)},url:function(){return this.rootUrl+"a/api/autoc/emails"}}),i.AutocompleteModel}),define("pdmplugins/send-for-sign/js/collections/sfs-autocomplete-collection",["pdmplugins/send-for-sign/js/ac-send-for-sign","core/utils/http-util","pdmplugins/send-for-sign/js/models/sfs-autocomplete-model"],function(e,i){return e.AutocompleteCollection=Backbone.Collection.extend({model:e.AutocompleteModel,initialize:function(e,i){Backbone.Collection.prototype.initialize.call(this,e,i),this.rootUrl=i.rootUrl,this.set({models:[]})},url:function(){return this.rootUrl+"/a/api/autoc/email"},fetch:function(e){return e=i.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/send-for-sign/js/constants/sfs-constants",{API_SUBPATH_NEW:"/api/rest/v6",API_SUBPATH_V6:"/api/rest/v6",API_SUBPATH_OLD:"/api/rest/v3",API_VERSION_V6:"v6",ERROR_BODY_MAX_WIDTH:40,SUPPORTED_EXTENSIONS:["pdf","doc","docx","rtf","xls","xlsx","ppt","pptx","txt","html","htm","tiff","tif","bmp","gif","jpg","jpeg","png"],MIMETYPES:["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/rtf","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/plain","text/html","text/html","image/tiff","image/tiff","image/bmp","image/gif","image/jpeg","image/jpeg","image/png","application/msexcel","text/rtf"]}),define("pdmplugins/send-for-sign/js/constants/sfs-error-codes",{PDFIsPortfolio:0,PDFIsPasswordProtected:1,PDFIsCertificateProtected:2,PDFIsPolicyProtected:3,PDFIsDynamicXFA:4,PDFIsOfInvalidType:5,InvalidFileExtn:6,GeneralWorkflowError:7,LargeFileSize:8,SendPageSessionTimeOut:9,EnterpriseServiceAccessDenied:10,PrepareFormsMultipleFilesSelect:11,ESAutoLoginDenied:12,MultipleWorkflowsRunning:13,CombineFilesFailed:14,GeneralInAppSignWorkflowError:15,InAppSessionTimeOutError:16,PermissionDenied:17,FileUploadError:18,ESAuthSessionCreateError:19,SendUrlFetchError:20,OpenSendPageError:21,SendPageError:22,FetchManageAgreementURLError:23,SignPageEventError:24,ESAuthSessionCreateForSigningUrlError:25,FetchSigningURLInAppSigningError:26,IMSAuthSessionCreateFailure:27,PageLimitExceedError:28}),define("pdmplugins/send-for-sign/js/api/sfs-workflow-api",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/file-types","core/utils/util","pdmplugins/send-for-sign/js/utils/sfs-ts-utils","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-error-codes","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/apis/api"],function(e,i,t,s,n,o,a,r,l,d){var p=l.UploadDocumentToEchoSignOp.prototype.UPLOAD_STATES;return i.SFSWorkflowApi=e.Api.extend({initialize:function(){e.Api.prototype.initialize.call(this),this._initStateMachine(),this._initializeOperationMap()},startWorkflow:function(e){e.workflowUiModel.set("workflow_id",_.uniqueId("sfs_workflow")),this._fsm.handleEvent("StartWorkflow",e)},startInAppSignWorkflow:function(e){e.workflowUiModel.set("workflow_id",_.uniqueId("sfs_sign_workflow")),console.log(Date.now()+"sfs-workflow-api::startInAppSignWorkflow"),this._fsm.handleEvent("StartInAppSignWorkflow",e)},startFSSWorkflow:function(e){e.workflowUiModel.set("workflow_id",_.uniqueId("sfs_sign_workflow")),console.log(Date.now()+"sfs-workflow-api::startFSSWorkflow"),this._fsm.handleEvent("StartFSSWorkflow",e)},startUnifiedShareWorkflow:function(e){console.log("Inside wf-api startUnifiedShareWorkflow"),e.workflowUiModel.set("workflow_id",_.uniqueId("sfs_workflow")),this._fsm.handleEvent("StartUnifiedShareWorkflow",e)},abortWorkflow:function(e){this._fsm.handleEvent("AbortWorkflow",e)},handleSessionSignOut:function(){this._fsm.handleEvent("SessionSignOut",_.extend({},this.options))},handleSessionSignedIn:function(){this._fsm.handleEvent("SessionSignedIn",_.extend({},this.options))},showFileBrowseDlg:function(){var e=$.Deferred(),i=_.extend({fileBrowseDlgPromise:e},this.options);return this._fsm.handleEvent("ShowFileBrowseDlg",i),e},handleNetworkDisconnectedEvent:function(){this._fsm.handleEvent("NetworkDisconnectedEvent",_.extend({},this.options))},_initStateMachine:function(){var e=_.extend({controller:this},this.options);this._fsm=i.fsmFactory.create("SFSWorkflowFSM",e)},_initializeOperationMap:function(){this._opMap=this._opMap||{},this._opMap.ShowAppLandingPageOp=this._showAppLandingPage,this._opMap.CheckTrialBarStatusOp=this._checkTrialStatus,this._opMap.ShowCachedTrialInfoIfExistsOp=this._showCachedTrialInfoIfExists,this._opMap.ListenForSignPageEventsOp=this._listenForSignPageEvents,this._opMap.ShowPostSignPageOp=this._showPostSignPageOp,this._opMap.ShowSFSTrialBarOp=this._showTrialBar,this._opMap.HideAppLandingPageOp=this._hideAppLandingPage,this._opMap.HideTrialBarOp=this._hideTrialBar,this._opMap.CheckESUserSubscriptionOp=this._checkESUserSubscriptionStatus,this._opMap.FetchActiveDocumentOp=this._fetchActiveDocument,this._opMap.SetActiveDocumentForFSSOp=this._setActiveDocumentForFSS,this._opMap.ShowFileSelectionDlgOp=this._showFileSelectionDlg,this._opMap.NotifyDlgFilesSelectedToClientsOp=this._notifyDlgFilesSelectedToClients,this._opMap.NotifyDlgFilesNotSelectedToClientsOp=this._notifyDlgFilesNotSelectedToClients,this._opMap.ValidateSelectedFilesOp=this._validateSelectedFiles,this._opMap.CreateESAuthSessionOp=this._createESAuthSession,this._opMap.CreateUploadRequestsQueueOp=this._createUploadRequestsQueue,this._opMap.StartUploadRequestForAllFilesOp=this._startUploadRequestForAllFiles,this._opMap.CancelUploadOp=this._cancelUpload,this._opMap.UploadFileToEchoSignOp=this._uploadFileToEchoSign,this._opMap.NotifyUploadStartedOp=this._notifyUploadStarted,this._opMap.ListenForUploadProgressEventsOp=this._listenForUploadProgressEvents,this._opMap.NotifyUploadProgressOp=this._notifyUploadProgress,this._opMap.ProcessUploadFinishedResultOp=this._processUploadFinishedResult,this._opMap.NotifyUploadSuccessOp=this._notifyUploadSuccess,this._opMap.NotifyUploadFailureOp=this._notifyUploadFailure,this._opMap.FetchSendForSignaturePageUrlOp=this._fetchSendForSignaturePageUrl,this._opMap.NotifySendUrlFetchSuccessOp=this._notifySendUrlFetchSuccess,this._opMap.OpenSendForSignPageInAppOp=this._openSendForSignPageInApp,this._opMap.OpenSignPageInAppOp=this._openSignPageInApp,this._opMap.HandleOpenSendPageSuccessOp=this._handleOpenSendPageSuccess,this._opMap.ListenForSendPageEventsOp=this._listenForSendPageEvents,this._opMap.FetchManageAgreementsURLOp=this._fetchManageAgreementsURL,this._opMap.FetchSigningURLOp=this._fetchSigningURL,this._opMap.LaunchManageAgreementsURLOp=this._launchManageAgreementsURL,this._opMap.RestartWorkflowOp=this._restartWorkflow,this._opMap.NotifyWorkflowFailureOp=this._notifyWorkflowFailure,this._opMap.NotifyWorkflowSuccessOp=this._notifyWorkflowSuccess,this._opMap.SetSFSWorkflowInProgressOp=this._setSFSWorkflowInProgress,this._opMap.ClearSFSWorkflowInProgressOp=this._clearSFSWorkflowInProgress,this._opMap.ClearESAuthSessionOp=this._clearESAuthSession,this._opMap.ShowWaitCursorOp=this._showWaitCursor,this._opMap.HideWaitCursorOp=this._hideWaitCursor,this._opMap.FetchPrepareFormRecipientsOp=this._getRecipientsIDs,this._opMap.FetchSFSPageUrlExternalParamsOp=this._fetchSFSPageUrlExternalParams,this._opMap.GetUnifiedShareParamsOp=this._getParamsFromUnifiedShare,this._opMap.SetInAppSigningWorkflowInProgressOp=this._setInAppSigningWorkflowInProgress,this._opMap.ClearInAppSigningWorkflowInProgressOp=this._clearInAppSigningWorkflowInProgress,this._opMap.GettingAgreementLimitOp=this._gettingAgreementLimitOp,this._opMap.TryFreeTransactionWorkflowOp=this._tryFreeTransactionWorkflowOp,this._opMap.ClearSignTrialInfoOp=this._clearSignTrialInfoOp,this._opMap.ResumeFreeUserWorkflow=this._resumeFreeUserWorkflow,this._opMap.ShowWorkflowErrorMsgOp=this._showWorkflowErrorMsg},_invokeOperation:function(e){var i=e.opName;if(this._opMap){var t=this._opMap[i];t.call(this,e)}},_showPostSignPageOp:function(e){i.opFactory.create("ShowPostSignPageOp",_.extend({parentView:e.parentView},this.options)).run()},_showTrialBar:function(e){console.log("just entered _showTrialBar"),i.opFactory.create("ShowSFSTrialBarOp",_.extend({parentView:e.parentView},e)).run()},_showAppLandingPage:function(e){var i=this.options.appApi.sfsAppApi;console.log("_showAppLandingPage"),i.showAppLandingPage(e).then(_.bind(function(i){e.workflowSelectedFiles=i.selectedFiles,this._fsm.handleEvent("FileSelectedInLandingPage",e)},this),_.bind(function(){this._fsm.handleEvent("ErrorOccuredInLandingPage",e)},this))},_checkTrialStatus:function(e){function i(){return t+=1,t>n?void clearInterval(o):void s.options.appApi.rnaApi.done(_.bind(function(i){i.invokeMethod({methodName:"obtainUsersLimitsResponse",methodArgs:""}).done(_.bind(function(i){if(i.length){clearInterval(o);var t=["pro","global","enterprise","team"],s=JSON.parse(i),n=s["limits/esign"],a=n.esign_access.toLowerCase(),r=$.inArray(a,t)>-1;r?this._fsm.handleEvent("NotTrialAdobeSignUser",e):l.opFactory.create("FetchESUserSubscriptionInfoOp",this.options).run().then(_.bind(function(i){if(i)this._fsm.handleEvent("NotTrialAdobeSignUser",e);else{var t,s=this.options.appApi.options.usersMeModel.get("identity");_.isUndefined(s)||(t=s.account_type),"adobeid"==t?this._fsm.handleEvent("TrialAdobeSignUser",e):this._fsm.handleEvent("NotTrialAdobeSignUser",e)}},this))}},s))},s))}var t=1,s=this,n=20,o=window.setInterval(i,300)},_showCachedTrialInfoIfExists:function(){console.log("just entered _showCachedTrialInfoIfExists"),console.log("before getRemainingAdobeSignTrial");var e=this.options.appApi.rnaApiObj.esApi.getRemainingAdobeSignTrial(),i=this.options.appApi.rnaApiObj.esApi.getTotalTrialTransactionsForFreeUser();if(console.log("after getRemainingAdobeSignTrial"),e>=0){e>i&&(e=i);var t=_.extend({remaining_transaction:e},this.options);t=_.extend({data_source:"cache"},t),this._showTrialBar(t)}},_hideAppLandingPage:function(e){this.options.appApi.sfsAppApi.hideAppLandingPage(e)},_hideTrialBar:function(){this.options.sfsAppTrialBarUiModel.set("is_visible",!1)},_checkESUserSubscriptionStatus:function(e){var i=this.options.appApi.sfsAppApi,t=!1;n.isReader()&&this.options.appApi.rnaApiObj.esApi.isTrialFeatureEnabled()&&this.options.sfsAppLandingPageUiModel.get("landedAsSignedInUser")===!1&&(t=!0),i.evaluateSubscriptionStatus(e).then(_.bind(function(){this._fsm.handleEvent("ESUserFoundPaid",e)},this),_.bind(function(){t?(this._showCachedTrialInfoIfExists(e),this._hideTrialBar(e),this._fsm.handleEvent("TrialAdobeSignUser",e)):this._fsm.handleEvent("ESUserFoundFree",e)},this))},_resumeFreeUserWorkflow:function(e){this._fsm.handleEvent("ESUserFoundFree",e)},_fetchActiveDocument:function(e){console.log("fetching active doc"),this.options.appApi.rnaApi.done(_.bind(function(i){var t=i.getOpenedFile();_.isEmpty(t)?(console.log("active doc NOT found"),this._fsm.handleEvent("ActiveDocNotFound",e)):(console.log("active doc found"),e.workflowSelectedFiles=[],e.workflowSelectedFiles.push(t),this._fsm.handleEvent("ActiveDocFound",e))},this))},_setActiveDocumentForFSS:function(e){console.log("setting active doc"),this.options.sfsAppSendACopyUiModel.set("selectedFiles",e.workflowSelectedFiles),console.log(this.options.sfsAppSendACopyUiModel.get("selectedFiles"))},_showFileSelectionDlg:function(e){var i={windowTitle:a.FILE_SELECT_TITLE,actionButton:a.FILE_SELECT_ACTION_BTN,filterDesc:"",allowMultiple:!0,chooseFolder:!1,allowNewFolder:!1,extnList:t.SUPPORTED_EXTENSIONS,mimeTypes:t.MIMETYPES,showCustomOpenDialog:!0};this.options.appApi.rnaApi.done(_.bind(function(t){t.selectFiles(i).then(_.bind(function(i){e.dlgSelectedFiles=[];var t=i.uploadedFileAttrs,s=i.localFiles;_.isEmpty(t)||(e.dlgSelectedFiles=e.dlgSelectedFiles.concat(_.values(t))),_.isEmpty(s)||(e.dlgSelectedFiles=e.dlgSelectedFiles.concat(s)),_.isEmpty(e.dlgSelectedFiles)?this._fsm.handleEvent("FilesNotSelected",e):this._fsm.handleEvent("FilesAreSelected",e)},this),_.bind(function(){this._fsm.handleEvent("FilesNotSelected",e)},this))},this))},_notifyDlgFilesSelectedToClients:function(e){_.isEmpty(e.fileBrowseDlgPromise)||e.fileBrowseDlgPromise.resolve(e.dlgSelectedFiles)},_notifyDlgFilesNotSelectedToClients:function(e){_.isEmpty(e.fileBrowseDlgPromise)||e.fileBrowseDlgPromise.reject()},_validateSelectedFiles:function(e){return _.isEmpty(e.filesToValidate)?void this._fsm.handleEvent("InvalidFilesSelected",e):void i.opFactory.create("SFSFilesValidatorOp",_.extend({inputFiles:e.filesToValidate},this.options)).run().then(_.bind(function(i,t){e.validFiles=i,e.invalidFiles=t,this._fsm.handleEvent("FilesValidationComplete",e)},this))},_createESAuthSession:function(e){var t=l.esApi.authApi,s=t.createAuthSession(e);console.log(Date.now()+"starting  ES auth"),s.then(_.bind(function(){console.log(Date.now()+"success  ES auth"),i.isAdvancedSign?(console.log("is advance sign"+i.isAdvancedSign),this._validateAllowedRoles(e).then(_.bind(function(e){console.log("Both roles allowed"),this._fsm.handleEvent("ESAuthSessionCreateSuccess",e)},this),_.bind(function(e){console.log("Auth session failed as user doesn't have rights to add few roles"),this._fsm.handleEvent("ESAuthSessionCreateFailure",e)},this))):this._fsm.handleEvent("ESAuthSessionCreateSuccess",e)},this),_.bind(function(){console.log(Date.now()+"failure  ES auth"),this.options.appApi.displayApi.clearSpinnerRefs(),this._fsm.handleEvent("ESAuthSessionCreateFailure",e)},this))},_validateAllowedRoles:function(e){console.log("_validateAllowedRoles()");var t=$.Deferred();return i.opFactory.create("FetchUsersMeSettingsOp",_.extend({},this.options)).run().then(_.bind(function(i){var s=i.availableRecipientRoles;if(_.isUndefined(s)||_.isEmpty(s)||0==s.length)return t.resolve(e);console.log("roles: "+s);var n=e.approverEmailIDS,o=e.signerEmailIDS;return!_.isUndefined(o)&&!_.isEmpty(o)&&s.indexOf("SIGNER")<0&&(console.log("roles: error signer not allowed"),t.reject(e)),!_.isUndefined(n)&&!_.isEmpty(n)&&s.indexOf("APPROVER")<0&&(console.log("roles: error approver not allowed"),t.reject(e)),console.log("roles: all roles allowed"),t.resolve(e)},this),_.bind(function(){t.resolve(e)},this)),t},_createUploadRequestsQueue:function(e){var i,t=e.workflowUiModel;i=_.map(e.workflowSelectedFiles,_.bind(function(e,i){return{file:e,fileIdx:i,responseObj:{},progressObj:{},bytesUploaded:0,bytesTotal:0,uploadStatus:""}},this)),t.set("upload_req_queue",i)},_startUploadRequestForAllFiles:function(e){var i=e.workflowUiModel,t=i.get("upload_req_queue");this.options.appApi.siteCatalystApi.logScEvent([d.TOOLS,d.SEND_FOR_SIG,d.CONVERSION,d.UPLOAD_STARTED,d.OPERATION]),_.each(t,_.bind(function(i){e.currentFileUploadReq=i,this._fsm.handleEvent("BeginNextFileUpload",e)},this))},_cancelUpload:function(){l.opFactory.create("CancelUploadToEchoSignOp",this.options).run()},_uploadFileToEchoSign:function(e){var i,n=e.currentFileUploadReq,o=n.file;i=this.options.sfsAppLandingPageUiModel.get("showSFSNewLandingPage")?t.API_SUBPATH_NEW:t.API_SUBPATH_OLD,this.options.appApi.rnaApi.done(_.bind(function(t){var a=t.esApi.getEchoSignServiceParams(),r=a.apiURL,d=this.options.esAuthUiModel,c=d.get("access_token"),h=o.get("ext").toLowerCase();o.get("isTemp")&&o.get("name").toLowerCase().endsWith(".pdf")&&(h="pdf");var u=s.getFileMimeType(h),g=_.extend({docToUpload:o,esAccessToken:c,esUploadEndpoint:r+i+"/transientDocuments",mimeType:u,apiVersion:"v6"},this.options);l.opFactory.create("UploadDocumentToEchoSignOp",g).run().then(_.bind(function(i){n.responseObj=i,n.progressObj=i.progressObj,e.currentFileUploadReq=n;var t=i.status;t===p.STARTED?this._fsm.handleEvent("UploadStarted",e):t===p.FINISHED?this._fsm.handleEvent("UploadFinished",e):t===p.QUEUED&&this._fsm.handleEvent("UploadQueued",e)},this),_.bind(function(i){n.responseObj=i,e.currentFileUploadReq=n,this._fsm.handleEvent("UploadFinished",e)},this))},this))},_listenForUploadProgressEvents:function(e){var i,t,s=e.currentFileUploadReq,n=s.responseObj,o=s.progressObj;i=l.uiModelFactory.create("ESDocUploadProgressUiModel",this.options),i.set("upload_response",n),i.set("progress_obj",o),i.on("all",_.bind(function(n){if("change"!==n)switch(t=i.get("progress_status"),e.currentFileUploadReq=s,t){case"ongoing":s.bytesUploaded=i.get("bytes_uploaded"),s.bytesTotal=i.get("bytes_total"),this._fsm.handleEvent("UploadProgress",e);break;case"finished":s.responseObj=i.get("upload_response"),this._fsm.handleEvent("UploadFinished",e)}},this)),l.opFactory.create("ListeningForESDocUploadProgressEventsOp",_.extend({esDocUploadProgressUiModel:i},this.options)).run()},_processUploadFinishedResult:function(e){var i=e.currentFileUploadReq,t=i.responseObj;t.errorSet?this._fsm.handleEvent("UploadFailure",e):this._fsm.handleEvent("UploadSuccess",e),delete e.esDocUploadProgressUiModel},_notifyUploadStarted:function(e){this._notifyWorkflowStatus(e,{name:"upload_started",isVisible:!0})},_notifyUploadProgress:function(e){var i=e.workflowUiModel,t=i.get("upload_req_queue"),s=0,n=t.length,o=e.currentFileUploadReq;o.uploadStatus="progress",_.each(t,_.bind(function(e){("progress"===e.uploadStatus||"success"===e.uploadStatus)&&(s+=e.bytesUploaded/e.bytesTotal)},this),0),s/=n,this._notifyWorkflowStatus(e,{name:"upload_progress",isVisible:!0,progressPercentage:100*s})},_notifyAndFetchPrepareFormRecipients:function(e){var i,t=e.workflowUiModel,s=t.get("upload_req_queue");if(i=_.every(s,_.bind(function(e){return"success"===e.uploadStatus},this))){var n=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),o=n+"-"+d.SEND_FOR_SIG;this.options.appApi.siteCatalystApi.logScEvent([d.TOOLS,o,d.CONVERSION,d.UPLOAD_COMPLETE,d.OPERATION]),this._notifyWorkflowStatus(e,{name:"upload_success",isVisible:!0,progressPercentage:100}),this._fsm.handleEvent("FetchPrepareFormRecipients",e),this.options.appApi.siteCatalystApi.logScEvent([d.TOOLS,d.SEND_FOR_SIG,d.CONVERSION,d.FETCH_SEND_PG_URL,d.OPERATION])}},_notifyUploadSuccess:function(e){console.log("Reached _notifyUploadSuccess");var i=(e.workflowUiModel,e.currentFileUploadReq);i.uploadStatus="success","undefined"!=typeof e.currentFileUploadReq&&"undefined"!=typeof e.currentFileUploadReq.responseObj&&"undefined"!=typeof e.currentFileUploadReq.responseObj.clusterTokenFetched&&e.currentFileUploadReq.responseObj.clusterTokenFetched?l.opFactory.create("FetchExistingESAuthSessionOp",this.options).run().then(_.bind(function(i){this.options.appApi.rnaApi.done(_.bind(function(){var t=this.options.esAuthUiModel;this.options.appApi.rnaApi.accessToken=i.accessToken,t.set("access_token",i.accessToken),t.set("expiration_time",i.expiryTime),t.set("refresh_token",i.refreshToken),t.set("signin_profile_id",i.signProfileID),t.set("signin_profile_name",i.signProfileName),t.set("loggedin_profile_name",i.loggedinProfileName),this._notifyAndFetchPrepareFormRecipients(e)},this))},this),_.bind(function(){e.currentFileUploadReq.responseObj.uploadErrorCode=GeneralWorkflowError,this._notifyUploadFailure(e)},this)):this._notifyAndFetchPrepareFormRecipients(e)},_notifyUploadFailure:function(e){var i=e.currentFileUploadReq,t=i.responseObj;i.uploadStatus="failure",this.options.appApi.siteCatalystApi.logScEvent([d.TOOLS,d.SEND_FOR_SIG,d.CONVERSION,d.UPLOAD_ERROR,d.OPERATION]),this._notifyWorkflowStatus(e,{name:"upload_failure",isVisible:!1,errorCode:t.uploadErrorCode})},_notifyWorkflowStatus:function(e,i){var t=e.workflowUiModel;t.set("workfow_status",i)},_fetchSendForSignaturePageUrl:function(e){var t,s=e.workflowUiModel,n=s.get("upload_req_queue"),o=n.length,a=n[0].file.get("name"),r=i.isAdvancedSign?"DRAFT":"AUTHORING";return t=_.map(n,function(e){return e.responseObj&&e.responseObj.respBody?e.responseObj.respBody.transientDocumentId:void 0}),t=_.compact(t),_.isEmpty(t)||t.length<o?void this._fsm.handleEvent("SendUrlFetchFailure",e):void i.opFactory.create("FetchSendForSignPageUrlV6Op",_.extend({transientDocumentIds:t,agreementName:a,recipientIDs:e.recipients,signerRecipients:e.signerEmailIDS,approverRecipients:e.approverEmailIDS,CCRecipients:e.ccemailIDS,recipientDetailsListOrderWise:e.recipientDetailsListOrderWise,agreementNameModified:e.subject,agreementMessages:e.message,esAccessToken:this.options.esAuthUiModel.get("access_token"),agreementStatus:r},this.options)).run().then(_.bind(function(i){e.sendPageResponse=i,this._fsm.handleEvent("SendUrlFetchSuccess",e)},this),_.bind(function(i){e.sendUrlFetchHttpCode=i.httpRespCode,e.sendUrlFetchRespBody=i.httpRespBody,this._fsm.handleEvent("SendUrlFetchFailure",e)},this))},_fetchSFSPageUrlExternalParams:function(e){console.log("Reached _fetchSFSPageUrlExternalParams");var t,s,n,o=i.unifiedShareResponse,a=i.unifiedShareResponse.hasFullParams;a?(t=o.signers_emails,s=o.approver_emails,n=o.cc_emails):(t=o.recipients.join(),s=e.approverEmailIDS,n=e.ccemailIDS),i.opFactory.create("FetchSendForSignPageUrlV6Op",_.extend({transientDocumentIds:o.transientDocIds,agreementName:o.agreementName,signerRecipients:t,approverRecipients:s,CCRecipients:n,agreementNameModified:o.emailSubject,agreementMessages:o.emailMessage,esAccessToken:o.esAccessToken,agreementStatus:o.agreementStatus},this.options)).run().then(_.bind(function(i){e.sendPageResponse=i,this._fsm.handleEvent("SendUrlFetchSuccess",e)},this),_.bind(function(i){e.sendUrlFetchHttpCode=i.httpRespCode,e.sendUrlFetchRespBody=i.httpRespBody,this._fsm.handleEvent("SendUrlFetchFailure",e)},this))},_notifySendUrlFetchSuccess:function(e){this._notifyWorkflowStatus(e,{name:"send_url_fetch_success",isVisible:!0,progressPercentage:100}),this._notifyWorkflowStatus(e,{isVisible:!1}),this.options.appApi.siteCatalystApi.logScEvent([d.SEND_FOR_SIG,d.FETCH_SEND_PG_URL,d.SUCCESS])
},_openSendForSignPageInApp:function(e){if(!e.sendPageResponse||!e.sendPageResponse.url)return void this._fsm.handleEvent("OpenSendPageFailure",e);var t=e.sendPageResponse.url;return _.isEmpty(t)?void this._fsm.handleEvent("OpenSendPageFailure",e):void i.opFactory.create("OpenSendForSignPageInAppOp",_.extend({sendPageUrl:t},e)).run().then(_.bind(function(){this._fsm.handleEvent("OpenSendPageSuccess",e)},this),_.bind(function(){this._fsm.handleEvent("OpenSendPageFailure",e)},this))},_openSignPageInApp:function(e){if(console.log(Date.now()+" sfs-workflow-api::_openSignPageInApp url = "+e.signingUrl),this.options.appApi.displayApi.clearSpinnerRefs(),!e.signingUrl)return void this._fsm.handleEvent("OpenSignPageFailure",e);var t=e.signingUrl;return _.isEmpty(t)?void this._fsm.handleEvent("OpenSignPageFailure",e):void i.opFactory.create("OpenSignPageInAppOp",_.extend({signPageUrl:t},e)).run().then(_.bind(function(){this._fsm.handleEvent("OpenSignPageSuccess",e),this.options.appApi.rnaApi.done(_.bind(function(e){var t=i.QueryParams.AgreementId;e.esApi.logSignServicesActivity(),e.esApi.setInAppSigningWorkflowInProgress(!0,t)},this)),console.log(Date.now()+" sfs-workflow-api::OpenSignPageInAppOp success")},this),_.bind(function(){console.log(Date.now()+" sfs-workflow-api::OpenSignPageInAppOp failed"),this._fsm.handleEvent("OpenSignPageFailure",e)},this))},_handleOpenSendPageSuccess:function(){this.options.appApi.siteCatalystApi.logScEvent([d.SEND_FOR_SIG,d.OPEN_SEND_PAGE_IN_APP,d.SUCCESS])},_updateDataModel:function(){var e=i.QueryParams.AgreementId;this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"logHighbeamData_InAppSigning",methodArgs:{agreementId:e,HighbeamEvent:"EmbeddedWorkflowCompleted",HighbeamData:"True"}}),_.delay(_.bind(function(){var i={};i.id=e,this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaSignWorkflowServicesAPI.invokeMethod({methodName:"updateDataModelAfterActionForAgreement",methodArgs:i})},this))},this),6e3)},_listenForSignPageEvents:function(e){var t=i.uiModelFactory.create("SFSEchoSignWebPageUiModel");i.opFactory.create("ListenForSendPageEventsOp",{sfsESWebPageUIModel:t}).run(),t.on("change:eventData",_.bind(function(t,s){if(!_.isEmpty(s))if(e.sendPageEventData=s.data,"ESIGN"===s.type)this.options.appApi.rnaApiObj.esApi.logSignServicesActivity(),this._updateDataModel(),this._fsm.handleEvent("ShowPostSignPage",e);else if("DELEGATE"===s.type||"REJECT"===s.type){this.options.appApi.rnaApiObj.esApi.logSignServicesActivity(),this._updateDataModel();var n=i.QueryParams.AgreementId;this.options.appApi.rnaApiObj.esApi.setInAppSigningWorkflowInProgress(!1,n)}else if("ERROR"===s.type){var o=s.data?s.data.message?s.data.message:s.data:a.SFS_ERR_GENERAL_WORKFLOW_FAILURE;e.errorOptions={errorMsg:o,errorType:r.SignPageEventError,showOpaqueOverlay:!0},this._fsm.handleEvent("SignPageErrorEvent",e)}else"SESSION_TIMEOUT"===s.type&&this._fsm.handleEvent("InAppSessionTimeOut",e)},this))},_listenForSendPageEvents:function(e){var t,s=i.uiModelFactory.create("SFSEchoSignWebPageUiModel");i.opFactory.create("ListenForSendPageEventsOp",{sfsESWebPageUIModel:s}).run(),s.on("change:eventData",_.bind(function(s,n){if(!_.isEmpty(n))if(e.sendPageEventData=n.data,"CLICK"===n.type)t=n.data.pageName,_.isEmpty(n.data)||"POST_SEND"!==t&&"POST_SIGN"!==t||(this.options.appApi.siteCatalystApi.logScEvent([d.SEND_FOR_SIG,d.POST_SEND_PAGE,d.CLICKED]),this._fsm.handleEvent("PostSendPageClickEvent",e));else if("PAGE_LOAD"===n.type){if(!_.isEmpty(n.data))if(e.sendPageName=n.data.pageName,"POST_SEND"===n.data.pageName){var l=this.options.sfsAppTrialBarUiModel.get("remaining_transaction");""!=l&&l>0&&(l-=1,this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"setAdobeSignTrialInfo",methodArgs:l})),this.options.appApi.rnaApiObj.esApi.allowDragAndDrop(!1),this.options.appApi.rnaApiObj.esApi.setCurrentWorkflowState("POST_SEND"),this._logSignCompleteEvents(),this._fsm.handleEvent("PostSendPageLoadEvent",e),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"UpdateProgressBar",methodArgs:{State:"PostSend"}})}else"AUTHORING"===n.data.pageName||"SIMPLIFIED_AUTHORING"===n.data.pageName?(this.options.appApi.rnaApiObj.esApi.setCurrentWorkflowState("Authoring"),this.options.appApi.rnaApiObj.esApi.allowDragAndDrop(!1),this._fsm.handleEvent("AuthoringSendPageLoadEvent",e),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"UpdateProgressBar",methodArgs:{State:"Authoring"}})):"COMPOSE"===n.data.pageName&&(this.options.appApi.siteCatalystApi.logScEvent([d.SEND_FOR_SIG,d.SIGN_EVENT,d.ADVANCED_WORKFLOW,d.COMPOSE_PAGE,d.LOADED,i.IsTrialUser?d.FREE_USER:d.ENTITLED_USER]),this.options.appApi.rnaApiObj.esApi.setCurrentWorkflowState("AdvancedWorkflow:Compose"),this.options.appApi.rnaApiObj.esApi.allowDragAndDrop(!0))}else if("SESSION_TIMEOUT"===n.type)this.options.appApi.rnaApiObj.esApi.setCurrentWorkflowState("SESSION_TIMEOUT"),this.options.appApi.rnaApiObj.esApi.allowDragAndDrop(!1),this.options.appApi.siteCatalystApi.logScEvent([o.getFillSignReaderFreeTransVariant(this.options),d.POST_SEND_PAGE,d.SESSION_TIMEOUT]),this._fsm.handleEvent("SendPageSessionTimeOutEvent",e);else if("ERROR"===n.type){this.options.appApi.rnaApiObj.esApi.setCurrentWorkflowState("ERROR"),this.options.appApi.rnaApiObj.esApi.allowDragAndDrop(!1),this.options.appApi.siteCatalystApi.logScEvent([o.getFillSignReaderFreeTransVariant(this.options),d.POST_SEND_PAGE,d.ERROR]);var p=n.data?n.data.message?n.data.message:n.data:a.SFS_ERR_GENERAL_WORKFLOW_FAILURE;if(e.errorOptions={errorMsg:p,errorType:r.SendPageError,showOpaqueOverlay:!0},this._fsm.handleEvent("SendPageErrorEvent",e),"SEND_LIMIT_EXCEEDED"===n.data.code){var c=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),h=c==FSS_VARIANT_1||c==FSS_VARIANT_2;1==i.IsTrialUser&&h&&this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"})}}else"ANALYTICS"==n.type&&(console.log(n),n.data.event.includes("fd:")||n.data.event.includes("S_A:")||n.data.event.includes("sendAction")||(this.options.appApi.siteCatalystApi.logScEvent([n.data.event]),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"documentSuccessfullySentForSignatures"})},this))))},this))},_fetchManageAgreementsURL:function(e){var t=e.agreementId,s=_.extend({agreementId:t},this.options);i.opFactory.create("FetchManageAgreementsURLOp",s).run().then(_.bind(function(i){e.manageAgreementsURL=i.viewURL,this._fsm.handleEvent("FetchManageAgreementURLSuccess",e)},this),_.bind(function(){this._fsm.handleEvent("FetchManageAgreementURLFailure",e)},this))},_fetchSigningURL:function(e){i.opFactory.create("FetchSigningURLOp",this.options).run().then(_.bind(function(i){var t=i.signingUrlSetInfos[0].signingUrls[0].esignUrl,s=i.signingUrlSetInfos[0].signingUrls[0].email,n=this.options.appApi.rnaApiObj.esApi.getLoggedInUser();console.log(n);var o=!1;s.toLowerCase()===n.toLowerCase()&&(o=!0),_.isEmpty(t)||1!=o?(console.log(Date.now()+" failed fetching URL"),this.options.appApi.displayApi.clearSpinnerRefs(),this._fsm.handleEvent("FetchSigningURLFailure",e)):(e=_.extend({signingUrl:t},e),console.log(Date.now()+" success fetching URL"),this._fsm.handleEvent("FetchSigningURLSuccess",e))},this),_.bind(function(){console.log(Date.now()+" failed2 fetching URL"),this.options.appApi.displayApi.clearSpinnerRefs(),this._fsm.handleEvent("FetchSigningURLFailure",e)},this))},_launchManageAgreementsURL:function(e){this.options.appApi.rnaApi.done(_.bind(function(i){i.ipmApi({methodName:"executeURI",methodArgs:e.manageAgreementsURL})},this))},_restartWorkflow:function(){this.options.appApi.sfsAppApi.restartApp()},_notifyWorkflowFailure:function(e){this._notifyWorkflowStatus(e,{name:"workflow_failure"})},_notifyWorkflowSuccess:function(){},_setSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!0)},this))},_clearSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!1)},this))},_setInAppSigningWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setInAppSigningWorkflowInProgress(!0)},this))},_clearInAppSigningWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var t=i.QueryParams.AgreementId;e.esApi.setInAppSigningWorkflowInProgress(!1,t)},this))},_gettingAgreementLimitOp:function(e){var t=_.clone(e),s=l.esApi.authApi,n=s.createAuthSession(e);console.log("In _gettingAgreementLimitOp"),n.then(_.bind(function(){console.log(Date.now()+"success  ES auth"),i.opFactory.create("GettingAgreementLimitOp",this.options).run().then(_.bind(function(e){var i=e.metrics.total_hits,s=this.options.appApi.rnaApiObj.esApi.getTotalTrialTransactionsForFreeUser(),n=0;s>i&&(n=s-i);var o=_.extend({remaining_transaction:n},this.options);o=_.extend({data_source:"server"},o),console.log("got result of GettingAgreementLimitOp"),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"setAdobeSignTrialInfo",methodArgs:n}),this._fsm.handleEvent("GettingESLimitSuccess",_.extend({},t,o))},this),_.bind(function(e){console.log(e)},this))},this),_.bind(function(){console.log(Date.now()+"failure  ES auth")},this))},_tryFreeTransactionWorkflowOp:function(e){this.options.appApi.rnaApi.done(_.bind(function(i){var t=-1;_.isUndefined(e.remaining_transaction)?_.isUndefined(this.options.sfsAppTrialBarUiModel)||""===this.options.sfsAppTrialBarUiModel.get("remaining_transaction")||(t=this.options.sfsAppTrialBarUiModel.get("remaining_transaction")):t=e.remaining_transaction,i.esApi.isSpecialSignUser()||t>0?this._fsm.handleEvent("UploadFiles",e):this._fsm.handleEvent("TransactionsExhausted",e)},this))},_clearSignTrialInfoOp:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.clearSignTrialInfo()},this))},_clearESAuthSession:function(){l.esApi.authApi.clearESAuthSession()},_showWaitCursor:function(){this.options.appApi.sfsAppApi.showWaitCursor()},_hideWaitCursor:function(){this.options.appApi.sfsAppApi.hideWaitCursor()},_showWorkflowErrorMsg:function(e){var i=e.errorOptions,t=this.options.appApi.sfsAppApi;t.showErrorMessage(i),i.appErrorPromise.always(_.bind(function(){this._fsm.handleEvent("ErrorDialogDismissed",e)},this))},_getRecipientsIDs:function(e){this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.prepareFormsEmailRecipients().then(_.bind(function(i){e.recipients=i.length>0?i:"",e.signerRecipients=e.signerEmailIDS,e.approverRecipients=e.approverEmailIDS,e.CCRecipients=e.ccemailIDS,e.agreementNameModified=e.subject,e.agreementMessages=e.message,this._fsm.handleEvent("FetchSendForSignPageUrl",e)},this),_.bind(function(){e.recipients="",e.signerRecipients="",e.approverRecipients="",e.CCRecipients="",e.agreementNameModified="",e.agreementMessages=""},this))},this),_.bind(function(){e.recipients="",e.signerRecipients="",e.approverRecipients="",e.CCRecipients="",e.agreementNameModified="",e.agreementMessages=""},this))},_getParamsFromUnifiedShare:function(e){console.log("Reached _getParamsFromUnifiedShare"),console.log("Inside fetching params condn."),this.options.appApi.rnaApi.then(_.bind(function(t){t.stApi.readPrecompiledDataFromSFSAPI().then(_.bind(function(t){i.unifiedShareResponse=t,console.log(i.unifiedShareResponse),this._fsm.handleEvent("FetchSendForSignPageUrl",e)},this))},this),_.bind(function(){return this._clearSFSWorkflowInProgress(this.options),$.Deferred().reject().promise()},this))},_logSignCompleteEvents:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t=e+"-"+o.getFillSignReaderFreeTransVariant(this.options),s=[t,d.POST_SEND_PAGE,d.LOADED,i.IsTrialUser===!0?d.FREE_USER:d.ENTITLED_USER];this.options.appApi.siteCatalystApi.logScEvent(s);var n=i.QueryParams.invocationPoint;if(void 0!==n&&""!==n){n+=d.INVOCATION;var a=[t,d.SIGN_COMPLETE,n];this.options.appApi.siteCatalystApi.logScEvent(a)}}}),i.SFSWorkflowApi}),define("pdmplugins/send-for-sign/js/api/sfs-subscription-api",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/esign/js/ac-esign","core/utils/util","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-error-codes","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/apis/api"],function(e,i,t,s,n,o,a){return i.SFSSubscriptionApi=e.Api.extend({initialize:function(){e.Api.prototype.initialize.call(this),this._initStateMachine(),this._initializeOperationMap(),this._subscriptionStatusClients=[]},checkSubscriptionStatus:function(e){var i=$.Deferred(),t={promise:i},s=_.extend({},e,this.options);return this._subscriptionStatusClients.push(t),this._fsm.handleEvent("EvaluateSubscriptionStatus",s),i},handleSessionSignOut:function(){this._fsm.handleEvent("SessionSignOut",_.extend({},this.options))},handleSessionSignedIn:function(){this._fsm.handleEvent("SessionSignedIn",_.extend({},this.options))},handleNetworkDisconnectedEvent:function(){this._fsm.handleEvent("NetworkDisconnectedEvent",_.extend({},this.options))},_initStateMachine:function(){var e=_.extend({controller:this},this.options);this._fsm=i.fsmFactory.create("SFSSubscriptionFSM",e)},_initializeOperationMap:function(){this._opMap=this._opMap||{},this._opMap.EvaluateIMSUserLoginStatusOp=this._evaluateIMSUserLoginStatus,this._opMap.CreateIMSAuthSessionOp=this._createIMSAuthSession,this._opMap.UpdateIMSAuthSessionOp=this._updateIMSAuthSession,this._opMap.ShowWaitCursorOp=this._showWaitCursor,this._opMap.HideWaitCursorOp=this._hideWaitCursor,this._opMap.FetchESUserSubscriptionStatusOp=this._fetchESUserSubscriptionStatus,this._opMap.ShowSubscribePageESUserSignedInOp=this._showSubscribePageESUserSignedIn,this._opMap.ShowSubscribePageESUserNotSignedInOp=this._showSubscribePageESUserNotSignedIn,this._opMap.ShowSubscribePageESUserSignedInAndUpgradeClickedOp=this._showSubscribePageESUserSignedInAndUpgradeClicked,this._opMap.NotifyESUserGotPaidSubscriptionOp=this._notifyESUserGotPaidSubscription,this._opMap.NotifyESUserGotFreeSubscriptionOp=this._notifyESUserGotFreeSubscription,this._opMap.NotifyIMSAuthSessionCreateFailureOp=this._notifyIMSAuthSessionCreateFailure,this._opMap.LaunchSubscribeWebPageOp=this._launchSubscribeWebPage,this._opMap.CheckIfUserOfEnterpriseTypeOp=this._checkIfUserOfEnterpriseType,this._opMap.ShowSubscriptionErrorMsgOp=this._showSubscriptionErrorMsg,this._opMap.ClearSFSWorkflowInProgressOp=this._clearSFSWorkflowInProgress},_invokeOperation:function(e){var i=e.opName;if(this._opMap){var t=this._opMap[i];t.call(this,e)}},_evaluateIMSUserLoginStatus:function(e){this.options.appApi.sessionApi.isSignedInReader()?this._fsm.handleEvent("IMSUserSignedIn",e):this._fsm.handleEvent("IMSUserNotSignedIn",e)},_createIMSAuthSession:function(e){this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){this._fsm.handleEvent("IMSAuthSessionCreateSuccess",e)},this),_.bind(function(i){i&&"NoAccessToPdfServices"===i.errorString?this._fsm.handleEvent("IMSAuthSessionCreateSuccess",e):this._fsm.handleEvent("IMSAuthSessionCreateFailure",e)},this))},_updateIMSAuthSession:function(e){this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){this._fsm.handleEvent("IMSSessionUpdateSuccess",e)},this),_.bind(function(i){i&&"NoAccessToPdfServices"===i.errorString?this._fsm.handleEvent("IMSSessionUpdateSuccess",e):this._fsm.handleEvent("IMSSessionUpdateFailure",e)},this))},_showWaitCursor:function(){var e=this.options.sfsSubscribeUiModel,i=e.get("wait_cursor_visible");i||this.options.appApi.rnaApi.done(_.bind(function(i){i.invokeMethod({methodName:"showWaitCursor",methodArgs:!0}),e.set("wait_cursor_visible",!0,{silent:!0})},this))},_hideWaitCursor:function(){var e=this.options.sfsSubscribeUiModel,i=e.get("wait_cursor_visible");i&&this.options.appApi.rnaApi.done(_.bind(function(i){i.invokeMethod({methodName:"showWaitCursor",methodArgs:!1}),e.set("wait_cursor_visible",!1,{silent:!0})},this))},_fetchESUserSubscriptionStatus:function(e){function i(i){var t=i?"ESUserFoundPaid":"ESUserFoundFree";this._fsm.handleEvent(t,e)}t.opFactory.create("FetchESUserSubscriptionInfoOp",this.options).run().then(_.bind(function(e){i.call(this,e)},this),_.bind(function(){this._fsm.handleEvent("ESSubscriptionError",e)},this))},_showSubscribePageESUserSignedIn:function(e){var i=this.options.sfsSubscribeUiModel;i.set("visible_btn_name","upgrade"),this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,a.SEND_FOR_SIG,a.UPSELL_PAGE,a.SHOWN]),this._showESSubscribePage(e)},_showSubscribePageESUserNotSignedIn:function(e){var i=this.options.sfsSubscribeUiModel;i.set("visible_btn_name","sign_in"),this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,a.SEND_FOR_SIG,a.UPSELL_PAGE,a.SHOWN]),this._showESSubscribePage(e)},_showSubscribePageESUserSignedInAndUpgradeClicked:function(e){var i=this.options.sfsSubscribeUiModel;i.set("visible_btn_name","start_now"),this._showESSubscribePage(e)},_showESSubscribePage:function(e){i.opFactory.create("ShowSFSSubscribePageOp",_.extend({parentView:e.parentView},this.options)).run(),this.options.sfsSubscribeUiModel.on("change:user_action",_.bind(function(i,t){switch(this.options.sfsSubscribeUiModel.off("change:user_action"),this.options.sfsSubscribeUiModel.reset(),t){case"sign_in_clicked":this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,a.SEND_FOR_SIG,a.UPSELL_PAGE,a.SIGN_IN,a.CLICKED]),this._fsm.handleEvent("UserClickedSignIn",e);break;case"upgrade_clicked":this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,a.SEND_FOR_SIG,a.UPSELL_PAGE,a.UPGRADE,a.CLICKED]),this._fsm.handleEvent("UserClickedUpgradeNow",e);break;case"start_now_clicked":this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,a.SEND_FOR_SIG,a.UPSELL_PAGE,a.START,a.CLICKED]),this._fsm.handleEvent("UserClickedStartNow",e);break;case"cancel_clicked":this._fsm.handleEvent("UserClickedCancel",e)}},this))},_notifyESUserGotPaidSubscription:function(){_.each(this._subscriptionStatusClients,function(e){e.promise.resolve({subscription:"paid"})})},_notifyESUserGotFreeSubscription:function(){_.each(this._subscriptionStatusClients,function(e){e.promise.resolve({subscription:"free"})})},_notifyIMSAuthSessionCreateFailure:function(){_.each(this._subscriptionStatusClients,function(e){e.promise.reject({error:o.IMSAuthSessionCreateFailure})})},_launchSubscribeWebPage:function(){var e;s.isAcrobat()?(e=n.SFS_ACRO_UPDGRADE_GO_URL,_.isEmpty(e)||this.options.appApi.rnaApi.done(_.bind(function(i){i.openDecoratedUrl(e)},this))):this.options.appApi.rnaApi.done(_.bind(function(i){e=i.rnaServicesAPI.isSFSUpsellExperimentEnabled()===!0?n.SFS_RDR_UPGRADE_GO_URL_RDREXP:n.SFS_RDR_UPGRADE_GO_URL,_.isEmpty(e)||i.openDecoratedUrl(e)},this))},_checkIfUserOfEnterpriseType:function(e){var i,t=this.options.appApi.options.usersMeModel.get("identity");_.isUndefined(t)||(i=t.account_type),"adobeid"!==i?this._fsm.handleEvent("EnterpriseUser",e):this._fsm.handleEvent("NotAnEnterpriseUser",e)},_showSubscriptionErrorMsg:function(e){var i=e.errorOptions,t=this.options.appApi.sfsAppApi;t.showErrorMessage(i),i.appErrorPromise.always(_.bind(function(){this._fsm.handleEvent("ErrorDialogDismissed",e)},this))},_clearSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!1)},this))}}),i.SFSSubscriptionApi}),define("pdmplugins/send-for-sign/js/api/sfs-error-api",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/utils/css-util","core/apis/api"],function(e,i,t,s){return i.SFSErrorApi=e.Api.extend({initialize:function(){e.Api.prototype.initialize.call(this),this._initStateMachine(),this._initializeOperationMap(),this._runningWorkflows={},this._isShowingError=!1},showErrorMessage:function(e){var i=e.errorType;return e.errorPromise=$.Deferred(),this._isShowingError?e.errorPromise.reject():this._fsm.handleEvent(i,e),e.errorPromise},hideErrorMessage:function(){this._fsm.handleEvent("HideErrorDialog",this.options),this._hideOpaqueOverlay()},_initStateMachine:function(){var e=_.extend({controller:this},this.options);this._fsm=i.fsmFactory.create("SFSErrorFSM",e)},_initializeOperationMap:function(){this._opMap=this._opMap||{},this._opMap.ShowGenericErrorDialogOp=this._showGenericErrorDialog,this._opMap.HideGenericErrorDialogOp=this._hideGenericErrorDialog},_invokeOperation:function(e){var i=e.opName;if(this._opMap){var t=this._opMap[i];t.call(this,e)}},_hideGenericErrorDialog:function(e){this._isShowingError=!1,delete e.titleTag,delete e.bodyTag,delete e.closeTag},_showGenericErrorDialog:function(e){this._isShowingError=!0;var i,t,n,o=this.options.appApi.dialogApi,a=e.titleTag,r=e.bodyTag,l=e.closeTag,d=this.options.appApi.dialogApi.SEVERITY_ERROR,p=e.showOpaqueOverlay,c=o.displayHtmlAlert(d,a,r,l);c.always(_.bind(function(){e.errorPromise.resolve()},this)),i=$(".alert-dialog-container .generic-dialog"),p&&this._showOpaqueOverlay(),_.isUndefined(e.width)||(i.width(e.width),t=i.width()+s.getPaddingWidth(i),i.css("margin-left",-t/2)),_.isUndefined(e.height)||(i.height(e.height),n=i.height()+s.getPaddingHeight(i),i.css("margin-top",-n/2))},_showOpaqueOverlay:function(){$(".alert-dialog-container").append('<div class="sfs-error-opaque-container"></div>'),$(".alert-dialog-container").append('<div class="sfs-error-opaque-container overlay"></div>')},_hideOpaqueOverlay:function(){$(".sfs-error-opaque-container").remove()}}),i.SFSErrorApi}),define("pdmplugins/send-for-sign/js/api/sfs-app-api",["core/ac-core","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/util","pdmplugins/send-for-sign/js/utils/sfs-ts-utils","core/utils/file-types","pdmplugins/send-for-sign/js/constants/sfs-error-codes","core/apis/api","pdmplugins/send-for-sign/js/api/sfs-workflow-api","pdmplugins/send-for-sign/js/api/sfs-subscription-api","pdmplugins/send-for-sign/js/api/sfs-error-api"],function(e,i,t,s,n,o,a,r,l){i.UploadDocumentToEchoSignOp.prototype.UPLOAD_STATES;return t.SFSAppApi=e.Api.extend({initialize:function(){e.Api.prototype.initialize.call(this),this._createSubApis(),this._initStateMachine(),this._initializeOperationMap(),this._runningWorkflows={}},startWorkflow:function(e){console.log("startWorkflow function in sfs-app-api.js");var i=$.Deferred();e=_.extend({},e,{promise:i});var s=0;"InAppSigning"==t.QueryParams.app&&(s=1);var n=0;"UnifiedFSS"==t.QueryParams.app&&(n=1);var o=0;"FillSign"==t.QueryParams.app&&(o=1);var a=0;return"modernize_send_copy_save"==t.QueryParams.app&&(a=1),1===s?(console.log("its for inappsigning"),this._fsm.handleEvent("AppStartNewSignWorkflow",{workflowOptions:e})):1===o||1===a?(console.log("its for fillsignsend"),console.log("starting:: AppStartNewFSSWorkflow"),this._fsm.handleEvent("AppStartNewFSSWorkflow",{workflowOptions:e})):1===n||"SFSEducationalCard"==t.QueryParams.app||"Share"==t.QueryParams.app||(console.log("its for sfs"),this._fsm.handleEvent("AppStartNewWorkflow",{workflowOptions:e})),e},startUnifiedShareWorkflow:function(e){console.log("Inside app-api startUnifiedShareWorkflow");var i=$.Deferred();return e=_.extend({},e,{promise:i}),this._fsm.handleEvent("AppStartNewUnifiedShareWorkflow",{workflowOptions:e}),e},handleSessionSignOut:function(){this._fsm.handleEvent("AppSessionSignOut",_.extend({},this.options))},handleSessionSignedIn:function(){this._fsm.handleEvent("SessionSignedIn",_.extend({},this.options))},handleNetworkDisconnectedEvent:function(){this._fsm.handleEvent("AppNetworkDisconnectedEvent",_.extend({},this.options))},evaluateSubscriptionStatus:function(e){var i=$.Deferred();return e=_.extend(e,{appESSubscriptionPromise:i}),this._fsm.handleEvent("AppEvaluateESUserSubscription",e),i},showAppLandingPage:function(e){var i=$.Deferred();return e=_.extend(e,{appLandingPagePromise:i,appApi:this.options.appApi}),this._fsm.handleEvent("AppShowLandingPage",e),i},hideAppLandingPage:function(e){this._fsm.handleEvent("AppHideLandingPage",e)},showWaitCursor:function(){this._fsm.handleEvent("ShowWaitCursor")},hideWaitCursor:function(){this._fsm.handleEvent("HideWaitCursor")},restartApp:function(){this._fsm.handleEvent("RestartApp",_.extend({},this.options))},showErrorMessage:function(e){e=e||{},this._fsm.handleEvent("AppShowErrorMessage",_.extend({errorOptions:e},this)),e.appErrorPromise=$.Deferred()},_createSubApis:function(){this.options.appApi.sfsAppApi=this,this.workflowApi=new t.SFSWorkflowApi(this.options),this.subscriptionApi=new t.SFSSubscriptionApi(this.options),this.errorApi=new t.SFSErrorApi(this.options)},_initStateMachine:function(){var e=_.extend({controller:this},this.options);this._fsm=t.fsmFactory.create("SFSAppFSM",e)},_initializeOperationMap:function(){this._opMap=this._opMap||{},this._opMap.AppStartNewWorkflowOp=this._startNewWorkflow,this._opMap.AppStartNewUnifiedShareWorkflowOp=this._startNewUniShareWorkflow,this._opMap.AppStartNewSignWorkflowOp=this._startNewSignWorkflow,this._opMap.AppStartNewFSSWorkflowOp=this._startNewFSSWorkflow,this._opMap.AppAbortWorkflowOp=this._abortWorkflow,this._opMap.AppShowLandingPageOp=this._showLandingPage,this._opMap.AppHideLandingPageOp=this._hideLandingPage,this._opMap.AppNotifyWorkflowToShowBrowseFileDlgOp=this._notifyWorkflowToShowBrowseFileDlg,this._opMap.AppNotifyFileSelectionToLandingPageOp=this._notifyFileSelectionToLandingPage,this._opMap.AppNotifyLandingPageSuccess=this._notifyLandingPageSuccess,this._opMap.AppStartSendACopyWorkflow=this._notifyStartSendACopyWorkflow,this._opMap.AppNotifyLandingPageErrorOp=this._notifyLandingPageError,this._opMap.AppLaunchFormsAppOp=this._launchFormsApp,this._opMap.AppRemoveFileFromSelectedFileListOp=this._removeFileFromSelectedFileList,this._opMap.ShowWaitCursorOp=this._showWaitCursor,this._opMap.HideWaitCursorOp=this._hideWaitCursor,this._opMap.AppHandleWorkflowStatusEventOp=this._handleWorkflowStatusEvent,this._opMap.AppHandleWorkflowSendPageEventOp=this._handleWorkflowSendPageEvent,this._opMap.AppHandleWorkflowSignPageEventOp=this._handleWorkflowSignPageEvent,this._opMap.AppHandleUploadProgressEventOp=this._handleUploadProgressEvent,this._opMap.AppHandleWorkflowFailureOp=this._handleWorkflowFailure,this._opMap.AppHandleWorkflowSuccessOp=this._handleWorkflowSuccess,this._opMap.AppEvaluateESUserSubscriptionOp=this._evaluateESUserSubscriptionStatus,this._opMap.AppListenForESAuthStatusChangeOp=this._listenForESAuthStatusChange,this._opMap.ShowDummyProgressOp=this._showDummyProgress,this._opMap.HideDummyProgressOp=this._hideDummyProgress,this._opMap.AppUnListenForESAuthStatusChangeOp=this._unlistenForESAuthStatusChange,this._opMap.AppNotifyESUserGotPaidSubscriptionOp=this._notifyESUserGotPaidSubscription,this._opMap.AppNotifyESUserGotFreeSubscriptionOp=this._notifyESUserGotFreeSubscription,this._opMap.RestartAppOp=this._restartApp,this._opMap.AppShowNetworkOfflineViewOp=this._showNetworkOfflineView,this._opMap.AppHideNetworkOfflineViewOp=this._hideNetworkOfflineView,this._opMap.AppShowErrorMessageOp=this._showErrorMessage,this._opMap.AppHideErrorMessageOp=this._hideErrorMessage,this._opMap.SFSCombineFilesOp=this._combineSelectedFilesForPrepareForm},_invokeOperation:function(e){var i=e.opName;if(this._opMap){var t=this._opMap[i];t.call(this,e)}},_startNewWorkflow:function(e){var i,t=e.workflowOptions,s=t.workflowUiModel,n=this.options.sfsAppUiModel;s.set("workflow_restarted_once",n.hasAppWorkflowRestartedOnce()),this.workflowApi.startWorkflow(t),this._addAppAndWorkflowEventListeners(e),i=s.get("workflow_id"),this._runningWorkflows[i]=t},_startNewFSSWorkflow:function(e){{var i=e.workflowOptions;i.workflowUiModel}console.log("_startNewFSSWorkflow"),this.workflowApi.startFSSWorkflow(i)},_startNewSignWorkflow:function(e){this.options.appApi.rnaApi.done(_.bind(function(i){var t=i.signServiceAuthAPI.ensureValidSignSession();t.done(_.bind(function(){var i=e.workflowOptions,t=i.workflowUiModel;this.workflowApi.startInAppSignWorkflow(i),this._addAppSignPageEventListeners(e),t.on("change:sign_page_status",_.bind(function(i,t){e.sign_page_status=t,this._fsm.handleEvent("AppWorkflowSignPageEvent",e)},this))},this))},this))},_startNewUniShareWorkflow:function(e){console.log("Inside app-api _startNewUniShareWorkflow");var i,t=e.workflowOptions,s=t.workflowUiModel,n=this.options.sfsAppUiModel;s.set("workflow_restarted_once",n.hasAppWorkflowRestartedOnce());var o=this.options.sfsAppProgressUiModel;o.set("upload_progress_percentage",90),o.set("max_dummy_percentage",120),this._showDummyProgress(),this.workflowApi.startUnifiedShareWorkflow(t),this._addAppAndWorkflowEventListeners(e),i=s.get("workflow_id"),this._runningWorkflows[i]=t},_abortWorkflow:function(e){this.workflowApi.abortWorkflow(e.workflowOptions)},_addAppAndWorkflowEventListeners:function(e){this._addAppProgressEventListeners(e),this._addAppSendPageEventListeners(e),this._addWorkflowEventListeners(e)},_addAppProgressEventListeners:function(e){var i=this.options.sfsAppProgressUiModel;i.on("change:abort_progress",_.bind(function(){this.options.appApi.siteCatalystApi.logScEvent([s.TOOLS,s.SEND_FOR_SIG,s.CONVERSION,s.UPLOAD_CANCELLED,s.OPERATION]),this._fsm.handleEvent("AppAbortWorkflowEvent",e)},this))},_addAppSendPageEventListeners:function(e){var i=this.options.sfsAppSendPageUiModel,t=e.workflowOptions.workflowUiModel;i.on("change:is_loaded",function(e,i){var s=_.extend({},t.get("send_page_status"),{isLoaded:i});t.set("send_page_status",s)})},_addAppSignPageEventListeners:function(e){var i=this.options.sfsAppSigningPageUiModel,t=e.workflowOptions.workflowUiModel;i.on("change:is_loaded",function(e,i){var s=_.extend({},t.get("sign_page_status"),{isLoaded:i});t.set("sign_page_status",s)})},_addWorkflowEventListeners:function(e){var i=e.workflowOptions.workflowUiModel;i.on("change:workfow_status",_.bind(function(i,t){e.workflow_status=t,this._fsm.handleEvent("AppWorkflowStatusEvent",e)},this)),i.on("change:send_page_status",_.bind(function(i,t){e.send_page_status=t,this._fsm.handleEvent("AppWorkflowSendPageEvent",e)},this))},_handleWorkflowStatusEvent:function(e){var i,t,s=e.workflow_status,n=this.options.sfsAppUiModel,o=this.options.sfsAppProgressUiModel,a=s.name,r=s.progressPercentage;switch(a){case"upload_started":i="upload";break;case"upload_progress":i="upload",t=o.get("upload_progress_percentage"),r>t&&(o.set("upload_progress_percentage",r),this._fsm.handleEvent("AppUploadProgressEvent",e));break;case"upload_success":i="upload",o.set("upload_progress_percentage",r);break;case"send_url_fetch_success":i="send_page_url_fetch",o.set("send_page_url_fetch_percentage",r);break;case"workflow_failure":this._fsm.handleEvent("AppWorkflowFailure",e)}o.setProgressName(i),o.set("is_visible",s.isVisible,{silent:!0}),n.notifyAppStateChange()},_handleWorkflowSendPageEvent:function(e){var i=e.send_page_status,t=this.options.sfsAppUiModel,s=this.options.sfsAppSendPageUiModel;s.set("url",i.url,{silent:!0}),s.set("is_visible",i.isVisible,{silent:!0}),t.notifyAppStateChange()},_handleWorkflowSignPageEvent:function(e){var i=e.sign_page_status,t=this.options.sfsAppUiModel,s=this.options.sfsAppSigningPageUiModel;s.set("url",i.url,{silent:!0}),s.set("is_visible",i.isVisible,{silent:!0}),t.notifyAppStateChange()},_handleUploadProgressEvent:function(e){this._hideDummyProgress(e)},_handleWorkflowFailure:function(e){var i=this._findWorkflowOptionsById(e.workflowId);i&&i.promise.reject(i)},_handleWorkflowSuccess:function(e){var i=this._findWorkflowOptionsById(e.workflowId);i&&i.promise.resolve(i)},_findWorkflowOptionsById:function(e){return this._runningWorkflows[e]},_showLandingPage:function(i){i.appSelectedFiles=_.clone(i.workflowSelectedFiles)||[];var n=_.clone(i.appSelectedFiles),r=_.extend({},this.options,{selectedFiles:n}),l=this.options.sfsAppLandingPageUiModel;t.opFactory.create("ShowSFSLandingPageOp",r).run(),l.on("change:user_action",_.bind(function(n,r){switch(r){case"browse_file":var d=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),p=d+"-"+s.SEND_FOR_SIG;
this.options.appApi.siteCatalystApi.logScEvent([s.TOOLS,p,s.ADD_FILES,s.CLICKED]),this._fsm.handleEvent("UserClickedBrowseFileDlg",i);break;case"removed_file":i.userRemovedFile=l.get("user_removed_file"),this._fsm.handleEvent("UserClickedRemoveFile",i);break;case"select_action_btn_clicked":this.options.appApi.siteCatalystApi.logScEvent([s.TOOLS,s.SEND_FOR_SIG,s.SELECT_FILES,s.CLICKED]),this._fsm.handleEvent("UserClickedBrowseFileDlg",i);break;case"send_action_btn_clicked":var c=s.START;if(o.isAcrobat()&&(c=s.READY_TO_SEND),this.options.appApi.siteCatalystApi.logScEvent([s.TOOLS,a.getFillSignReaderFreeTransVariant(this.options),s.OPTION_DLG,c,s.CLICKED]),"SendACopy"==l.get("WorkflowSelected"))this._fsm.handleEvent("UserClickedSendACopyBtn",i);else{var d=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),p=d+"-"+a.getFillSignReaderFreeTransVariant(this.options);this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.sessionApi.isSignedInReader()?t.IsTrialUser===!0?[s.TOOLS,p,s.SPECIFY_WHERE_TO_SIGN,s.CLICKED,s.FREE_USER]:[s.TOOLS,p,s.SPECIFY_WHERE_TO_SIGN,s.CLICKED,s.ENTITLED_USER]:[s.TOOLS,p,s.SPECIFY_WHERE_TO_SIGN,s.CLICKED,s.UNSIGNED_USER]),i=_.extend(i,{parentView:i.parentView}),this._showWaitCursor(i),this.options.sfsAppLandingPageUiModel.get("landedAsSignedInUser")===!1&&a.getFillSignReaderFreeTransVariant(this.options)===s.SEND_FOR_SIGN_NEW_EXP_READER_FREE_TRANS?this.subscriptionApi.checkSubscriptionStatus(i).then(_.bind(function(){this._hideWaitCursor(i),this._fsm.handleEvent("UserClickedSendFilesBtn",i)},this),_.bind(function(){this._hideWaitCursor(i)},this)):(this._hideWaitCursor(i),this._fsm.handleEvent("UserClickedSendFilesBtn",i))}break;case"prepare_form_btn_clicked":this.options.appApi.siteCatalystApi.logScEvent([s.TOOLS,s.SEND_FOR_SIG,s.OPTION_DLG,s.PREPARE_FORM,s.CLICKED]),e.Util.isAcrobat()&&i.appSelectedFiles.length>1?this._fsm.handleEvent("CombineSelectedFilesEvent",i):this._fsm.handleEvent("UserClickedPrepareFormBtn",i);break;case"email_list_added":i.signerEmailIDS=l.get("user_added_signer_emails"),i.approverEmailIDS=l.get("user_added_approver_emails"),i.ccemailIDS=l.get("user_added_cc_emails"),i.recipientDetailsListOrderWise=l.get("user_added_emails_in_order"),this._fsm.handleEvent("UserAddedEmailIds",i);break;case"subject_added":i.subject=l.get("user_added_subject");break;case"message_added":i.message=l.get("user_added_message")}},this))},_hideLandingPage:function(){this.options.sfsAppLandingPageUiModel.set("is_visible",!1)},_notifyWorkflowToShowBrowseFileDlg:function(e){this.workflowApi.showFileBrowseDlg().then(_.bind(function(i){e.appSelectedFiles=e.appSelectedFiles.concat(i),this._fsm.handleEvent("FilesAreSelected",e)},this),_.bind(function(){this._fsm.handleEvent("FilesNotSelected",e)},this))},_launchFormsApp:function(e){this.options.appApi.rnaApi.done(_.bind(function(i){i.invokeMethod({methodName:"launchFormsApp",methodArgs:_.map(e.appSelectedFiles,function(e){return e._proxy})})},this))},_removeFileFromSelectedFileList:function(e){e.appSelectedFiles=_.without(e.appSelectedFiles,e.userRemovedFile),delete e.userRemovedFile},_notifyFileSelectionToLandingPage:function(e){this.options.sfsAppLandingPageUiModel.set("selected_files",_.clone(e.appSelectedFiles))},_notifyLandingPageSuccess:function(e){e.appLandingPagePromise.resolve({selectedFiles:e.appSelectedFiles})},_notifyLandingPageError:function(e){e.appLandingPagePromise.reject(e)},_showWaitCursor:function(){var e=this.options.sfsAppUiModel,i=e.get("wait_cursor_visible");i||this.options.appApi.rnaApi.done(_.bind(function(i){i.invokeMethod({methodName:"showWaitCursor",methodArgs:!0}),e.set("wait_cursor_visible",!0,{silent:!0})},this))},_hideWaitCursor:function(){var e=this.options.sfsAppUiModel,i=e.get("wait_cursor_visible");i&&this.options.appApi.rnaApi.done(_.bind(function(i){i.invokeMethod({methodName:"showWaitCursor",methodArgs:!1}),e.set("wait_cursor_visible",!1,{silent:!0})},this))},_listenForESAuthStatusChange:function(e){var i=this.options.esAuthUiModel,t=this.options.sfsAppUiModel,s=this.options.sfsAppProgressUiModel;i.on("change:auth_status",_.bind(function(i,n){s.setProgressName("auth"),"success"===n?this._fsm.handleEvent("ESAuthSessionCreateSuccess",e):"in_progress"===n?this._fsm.handleEvent("ESAuthSessionInProgress",e):"failure"===n&&s.set("is_visible",!1,{silent:!0}),t.notifyAppStateChange()},this))},_showDummyProgress:function(){this.dummyProgressTimerId||(this.dummyProgressTimerId=setInterval(_.bind(function(){var e=this.options.sfsAppUiModel,i=this.options.sfsAppProgressUiModel,t=i.get("upload_progress_percentage"),s=i.get("max_dummy_percentage"),n=i.get("dummy_progress_incr");s>t?(t+=n,i.set("upload_progress_percentage",t),i.set("is_visible",!0,{silent:!0}),e.notifyAppStateChange()):(clearInterval(this.dummyProgressTimerId),delete this.dummyProgressTimerId)},this),10))},_hideDummyProgress:function(){this.dummyProgressTimerId&&(clearInterval(this.dummyProgressTimerId),delete this.dummyProgressTimerId)},_unlistenForESAuthStatusChange:function(){var e=this.options.esAuthUiModel;e.off("change:auth_status")},_evaluateESUserSubscriptionStatus:function(e){e=_.extend(e,{parentView:e.parentView}),this.subscriptionApi.checkSubscriptionStatus(e).then(_.bind(function(i){_.isUndefined(i)||"paid"!==i.subscription?this._fsm.handleEvent("AppESUserFoundFree",e):this._fsm.handleEvent("AppESUserFoundPaid",e)},this),_.bind(function(i){_.isUndefined(i)||i.error!==l.IMSAuthSessionCreateFailure?this._fsm.handleEvent("AppESUserFoundFree",e):this._fsm.handleEvent("IMSAuthSessionCreateFailure",e)},this))},_notifyESUserGotPaidSubscription:function(e){e.appESSubscriptionPromise.resolve()},_notifyESUserGotFreeSubscription:function(e){e.appESSubscriptionPromise.reject()},_restartApp:function(){var e=this.options.sfsAppUiModel,i=this.options.sfsAppSendPageUiModel,t=this.options.sfsAppProgressUiModel;i.set("is_visible",!1,{silent:!0}),t.set("is_visible",!1,{silent:!0}),this._clearRunningWorkflows(),e.notifyAppStateChange(),e.setAppWorkflowRestartedOnce(!0),e.set("restart_app",!0)},_showNetworkOfflineView:function(e){var i=this.options.sfsAppUiModel,t=this.options.esOfflineUiModel,s=this.options.sfsAppLandingPageUiModel,n=this.options.sfsAppProgressUiModel,o=this.options.sfsAppSendPageUiModel,a=this.options.sfsAppSigningPageUiModel;t.resetToDefaults(),$(".sfs-subscribe-page-container").empty(),t.set("is_visible",!0,{silent:!0}),s.set("is_visible",!1,{silent:!0}),n.set("is_visible",!1,{silent:!0}),o.set("is_visible",!1,{silent:!0}),a.set("is_visible",!1,{silent:!0}),t.on("change:user_action",_.bind(function(i,t){"okay"===t&&this._fsm.handleEvent("AppOfflineViewDismissed",e)},this)),i.notifyAppStateChange()},_hideNetworkOfflineView:function(){var e=this.options.sfsAppUiModel,i=this.options.esOfflineUiModel;i.set("is_visible",!1),e.notifyAppStateChange()},_showErrorMessage:function(e){var i=this.options.appApi.sfsAppApi.errorApi;i.showErrorMessage(e.errorOptions).always(_.bind(function(){this._fsm.handleEvent("AppErrorDialogDismissed",e),e.errorOptions.appErrorPromise.resolve()},this))},_hideErrorMessage:function(){if("UniShare"===this.options.sfsAppUiModel.getTriggerType())this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"CloseSFSApp"})},this));else{var e=this.options.appApi.sfsAppApi.errorApi;e.hideErrorMessage()}},_clearRunningWorkflows:function(){this._runningWorkflows={}},_combineSelectedFilesForPrepareForm:function(e){t.opFactory.create("SFSCombineFilesOp",_.extend({inputFiles:e.appSelectedFiles},this.options)).run().then(_.bind(function(i){e.validFiles=[],e.validFiles=i,e.appSelectedFiles=[],e.appSelectedFiles=e.validFiles,this._fsm.handleEvent("UserClickedPrepareFormBtn",e)},this),_.bind(function(i){i&&this._fsm.handleEvent("CombineSelectedFilesEventFailed",e)},this))}}),t.SFSAppApi}),define("pdmplugins/send-for-sign/js/ops/plugin/initializing-plugin-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/utils/sfs-ts-utils","pdmplugins/send-for-sign/js/collections/sfs-autocomplete-collection","pdmplugins/send-for-sign/js/api/sfs-app-api"],function(e,i,t,s){return i.InitializingPluginOp=e.Op.extend({run:function(){var n,o=this.options,a=i.uiModelFactory,r=t.opFactory,l=o.appApi.routerApi.getQueryParams(),d=l.mode;return e.Util.isCEF()||(n=o.appApi.baseFilesUrisApi.getSendApiUri(),n=s.extractRootUrl(n)),i.sfsAppApi=new i.SFSAppApi(o),_.extend(o,{actionsUiModel:e.uiModelFactory.create("ActionsUiModel"),sfsAppUiModel:a.create("SFSAppUiModel"),sfsAppProgressUiModel:a.create("SFSAppUploadProgressUiModel"),sfsAppSendPageUiModel:a.create("SFSAppSendPageUiModel"),sfsAppLandingPageUiModel:a.create("SFSAppLandingPageUiModel"),sfsSubscribeUiModel:a.create("SFSSubscribeUiModel"),sfsAppSigningPageUiModel:a.create("SFSAppSigningPageUiModel"),sfsAppSendACopyUiModel:a.create("SFSAppSendCompletedCopyModel"),sfsAppShareUiModel:a.create("SFSAppShareUiModel"),sfsAppTrialBarUiModel:a.create("SFSAppTrialBarUiModel"),autoCCollection:new i.AutocompleteCollection([],{rootUrl:n})}),"clearESWebSession"===d&&o.sfsAppUiModel.set("mode_type","clearESWebSession",{silent:!0}),o.sfsAppUiModel.set("trigger_type",i.QueryParams.trigger),r.create("InitializingOp",o).run(),this._getResolvedPromise()}}),i.InitializingPluginOp}),define("pdmplugins/send-for-sign/js/ops/plugin/running-plugin-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){return i.RunningPluginOp=e.Op.extend({run:function(){var e,t=this.options,s=t.sfsAppUiModel,n=i.uiModelFactory,o=i.opFactory;e=o.create("ListeningForViewEventsOp",t);var a=n.create("SFSWorkflowUiModel");s.set("workflow_ui_model",a);var r=n.create("SFSAppSendCompletedCopyModel");s.set("sendacopy_ui_model",r);var l={parentView:t.rootView,workflowUiModel:s.get("workflow_ui_model")};return"UniShare"===s.getTriggerType()?i.sfsAppApi.startUnifiedShareWorkflow(l):i.sfsAppApi.startWorkflow(l),$.when(e.run())}}),i.RunningPluginOp}),define("pdmplugins/send-for-sign/js/ops/plugin/starting-plugin-op",["core/ac-core","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i,t){return t.StartingPluginOp=e.Op.extend({run:function(){var e=this.options,s=t.opFactory,n=e.sfsAppUiModel.get("mode_type");return"clearESWebSession"===n?i.opFactory.create("LogOutESWebSessionOp",this.options).run():s.create("RunningPluginOp",e).run(),this._getResolvedPromise()}}),t.StartingPluginOp}),define("pdmplugins/send-for-sign/js/ops/listening/listening-for-view-events-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){return i.ListeningForViewEventsOp=e.Op.extend({run:function(){this.options;return this._getResolvedPromise()}}),i.ListeningForViewEventsOp}),define("pdmplugins/send-for-sign/js/ops/listening/listening-for-workflow-events-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){return i.ListeningForWorkflowEventsOp=e.Op.extend({run:function(){this.options;return this._getResolvedPromise()}}),i.ListeningForWorkflowEventsOp}),define("pdmplugins/send-for-sign/js/ops/listening/listening-for-send-page-events-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){var t=[".adobe.com",".documents.adobe.com",".documentsdemo.adobe.com",".documentsstage.adobe.com",".documentsopsdev.adobe.com",".documentspreview.adobe.com",".documentsdr.adobe.com",".echosign.com",".echosigndemo.com",".echosignstage.com",".echosignopsdev.com",".echosignpreview.com",".echosigndr.com",".echosignawspreview.com",".adobesign.com",".adobesignstage.com",".adobesignpreview.com"];return i.ListenForSendPageEventsOp=e.Op.extend({run:function(){function e(e){if(s=e.origin,!_.isUndefined(s)&&!_.isEmpty(s)&&(n=s.split("/"),_.size(n)>=3&&(o="."+n[2]),i=_.find(t,function(e){return _.isEmpty(o)||-1===o.indexOf(e,o.length-e.length)?void 0:e}),!_.isEmpty(i))){var a=JSON.parse(e.data);_.isEmpty(a)||(r.clearLastEventState(),r.set("eventData",a))}}var i,s,n,o,a=this.options,r=a.sfsESWebPageUIModel;return window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent("onmessage",e),this._getResolvedPromise()}}),i.ListenForSendPageEventsOp}),define("pdmplugins/send-for-sign/js/ops/plugin/fetch-send-for-sign-page-url-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/util","core/utils/http-util"],function(e,i,t,s,n){var o="";return i.FetchSendForSignPageUrlOp=e.Op.extend({run:function(){var e,i,s,a,r,l,d,p,c=this.options,h=c.appApi,u=$.Deferred(),g=h.localeApi.getLocale(),f=g.split("-"),S="",m=c.transientDocumentIds,E=m.length,A=c.agreementName,v=c.signerRecipients,C=c.approverRecipients,I=c.agreementNameModified,T=c.agreementMessages,O=c.CCRecipients,b=c.recipientIDs,w=this.options.sfsAppLandingPageUiModel.get("showSFSNewLandingPage");"UniShare"===c.trigger&&(w=!0);var R;return g=_.isEmpty(g)||_.isEmpty(f)?"en_US":f[0]+"_"+f[1].toUpperCase(),h.rnaApi.done(_.bind(function(h){if(r=h.esApi.getEchoSignServiceParams(),s=r.apiURL,a="UniShare"===c.trigger?c.esAccessToken:c.esAuthUiModel.get("access_token"),_.isEmpty(s)||_.isEmpty(a))return void u.reject();R=w?t.API_SUBPATH_NEW:t.API_SUBPATH_OLD,e=s+R+"/agreements",_.each(c.transientDocumentIds,function(e,i){S+='{"transientDocumentId": "'+e+'"}',i!==E-1&&(S+=",")}),d={transient_document_ids:S,locale:g},_.isUndefined(I)||_.isEmpty(I)?_.isUndefined(A)||_.isEmpty(A)||(p=A.lastIndexOf("."),-1!==p&&(A=A.substr(0,p)),d.agreement_name=A):d.agreement_name=I,w?(d.agreement_message="",_.isUndefined(T)||_.isEmpty(T)||(d.agreement_message=T),d.recipients_ids=!_.isUndefined(v)&&!_.isEmpty(v)||!_.isUndefined(C)&&!_.isEmpty(C)?this._getRecipientIDsString(v,C):"",d.cc_recipientsids=_.isUndefined(O)||_.isEmpty(O)?"":this._getCCRecipientIDsString(O)):d.recipients_ids=_.isUndefined(b)||_.isEmpty(b)?"":this._getRecipientIDsStringOld(b),this._generateJSONforAgreementsCall(w),i=_.template(o,d);var f=n.getClientIdQueryParam(),m=f.lastIndexOf("=");l={Accept:"application/json","Access-Token":a,"x-api-client-id":f.substr(m+1)},$.ajax({url:e,data:i,type:"POST",modal:!1,headers:l,contentType:"application/json",dataType:"json",success:_.bind(function(e){u.resolve(e)},this),error:_.bind(function(e){u.reject({httpRespCode:e.status,httpRespBody:e.responseText})},this)})},this)),u},_generateJSONforAgreementsCall:function(e){e?(o+="{",o+='  "documentCreationInfo": {',o+='    "fileInfos": [<%= transient_document_ids%>],',o+='    "name": "<%= agreement_name%>",',o+='    "message": "<%= agreement_message%>",',o+='    "signatureFlow": "SENDER_SIGNATURE_NOT_REQUIRED",',o+='    "signatureType": "ESIGN"',o+="<%= recipients_ids %>",o+="<%= cc_recipientsids %>",o+="  },",o+='  "options": {',o+='    "noChrome": "true",',o+='    "sendThroughWebOptions": {',o+='      "fileUploadOptions": {',o+='        "webConnectors": "false",',o+='        "localFile": "false",',o+='        "libraryDocument": "true"',o+="      }",o+="    },",o+='    "sendThroughWeb": "false",',o+='    "locale": "<%= locale %>",',o+='    "authoringRequested": "true",',o+='    "autoLoginUser": "true"',o+="  }",o+="}"):(o+="{",o+='  "documentCreationInfo": {',o+='    "fileInfos": [<%= transient_document_ids%>],',o+='    "name": "<%= agreement_name%>"',s.isAcrobat()&&(o+="<%= recipients_ids %>"),o+="  },",o+='  "options": {',o+='    "noChrome": "true",',o+='    "sendThroughWebOptions": {',o+='      "fileUploadOptions": {',o+='        "webConnectors": "false",',o+='        "localFile": "false",',o+='        "libraryDocument": "true"',o+="      }",o+="    },",o+='    "sendThroughWeb": "true",',o+='    "locale": "<%= locale %>",',o+=s.isAcrobat()?'    "authoringRequested": "false",':'    "authoringRequested": "true",',o+='    "autoLoginUser": "true"',o+="  }",o+="}")},_getRecipientIDsString:function(e,i){var t,s="";return _.isUndefined(e)&&_.isUndefined(i)?s:(s=', "recipientSetInfos" : [',_.isEmpty(e)||(t=e.split(","),_.each(t,function(e){s+='{ "recipientSetMemberInfos" :[{"email": "'+e+'"}], "recipientSetRole": "SIGNER"},'})),_.isEmpty(i)||(t=i.split(","),_.each(t,function(e){s+='{ "recipientSetMemberInfos" :[{"email": "'+e+'"}], "recipientSetRole": "APPROVER"},'})),s=s.slice(0,-1),s=s.replace(/\,$/,""),s+="]")},_getCCRecipientIDsString:function(e){var i,t="";return _.isUndefined(e)?t:(i=e.split(","),t=', "ccs" :[',_.each(i,function(e){t+='"'+e+'",'}),t=t.replace(/\,$/,""),t+="]")},_getRecipientIDsStringOld:function(e){var i,t="";return _.isUndefined(e)?t:(i=e.split(","),t=',"recipients":[',_.each(i,function(e){t+='{"email":"'+e+'"},'}),t=t.replace(/\,$/,""),t+="]")}}),i.FetchSendForSignPageUrlOp}),define("pdmplugins/send-for-sign/js/ops/plugin/fetch-send-for-sign-page-url-v6-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/util","core/utils/http-util"],function(e,i,t,s,n){var o,a=0,r=100;return i.FetchSendForSignPageUrlV6Op=e.Op.extend({run:function(){var e,i,s,r,l,d,p,c=this.options,h=c.appApi,u=$.Deferred(),g=h.localeApi.getLocale(),f=g.split("-"),S="",m=c.transientDocumentIds,E=m.length,A=c.agreementName,v=c.esAccessToken.startsWith("Bearer ")?c.esAccessToken:"Bearer "+c.esAccessToken,C=c.signerRecipients,I=c.approverRecipients,T=c.recipientDetailsListOrderWise,O=c.agreementNameModified,b=c.agreementMessages,w=c.CCRecipients,R=c.agreementStatus,L=t.API_SUBPATH_V6;return g=_.isEmpty(g)||_.isEmpty(f)?"en_US":f[0]+"_"+f[1].toUpperCase(),h.rnaApi.done(_.bind(function(t){var h=t.isUsingAV2UI();if(r=t.esApi.getEchoSignServiceParams(),s=r.apiURL,_.isEmpty(s)||_.isEmpty(v))return void u.reject();e=s+L+"/agreements",_.each(c.transientDocumentIds,function(e,i){S+='{"transientDocumentId": "'+e+'"}',i!==E-1&&(S+=",")}),d={transient_document_ids:S,locale:g},_.isUndefined(O)||_.isEmpty(O)?_.isUndefined(A)||_.isEmpty(A)||(p=A.lastIndexOf("."),-1!==p&&(A=A.substr(0,p)),d.agreement_name=A):d.agreement_name=O,d.agreement_message="",_.isUndefined(b)||_.isEmpty(b)||(d.agreement_message=b),d.recipients_ids=_.isUndefined(T)||_.isEmpty(T)?!_.isUndefined(C)&&!_.isEmpty(C)||!_.isUndefined(I)&&!_.isEmpty(I)?this._getV6RecipientIDsString(C,I):"":this._getV6RecipientIDsStringOrderWise(T),d.cc_recipientsids=_.isUndefined(w)||_.isEmpty(w)?"":this._getV6CCRecipientIDsString(w),d.agreement_status=R,i=_.template(this._generateJSONforCreateAgreementIDCall(),d);var f=n.getClientIdQueryParam(),m=f.lastIndexOf("=");l={Accept:"application/json",Authorization:v,"x-api-client-id":f.substr(m+1)},$.ajax({url:e,data:i,type:"POST",modal:!1,global:!1,headers:l,contentType:"application/json",dataType:"json",success:_.bind(function(i){"DRAFT"===R&&(R="COMPOSE");var t=h?"true":"false",s='{ "name" : "'+R+'","commonViewConfiguration": { "autoLoginUser": true, "noChrome": true,"locale": "'+g+'"},"composeViewConfiguration": {"fileUploadOptions":{"webConnectors":false},"isPreviewSelected":true},"authoringViewConfiguration": { "viewerIntegrationEnabled":'+t+"}}",n=new Object;n.esAgreementsURL=e,n.esAccessToken=v,n.id=i.id,n.body=s,n.headers=l,n.promise=u,n=_.extend(this.options,n);var r=this;a=0,o=window.setInterval(function(){r._waitForDocProcessing(n)},2e3)},this),error:_.bind(function(e){u.reject({httpRespCode:e.status,httpRespBody:e.responseText})},this)})},this)),u},_waitForDocProcessing:function(e){console.log("_waitForDocProcessing : "+a);var t=e.id;return a+=1,a>r?(console.log("Wait exceeded"),clearInterval(o),void e.promise.reject("OpFailed")):void i.opFactory.create("FetchAgreementStatusOp",_.extend({agreementId:t},e)).run().then(_.bind(function(i){console.log("_waitForDocProcessing success"+a),"DOCUMENTS_NOT_YET_PROCESSED"!=i.status&&(clearInterval(o),this._getAuthoringview(e))},this),_.bind(function(){console.log("_waitForDocProcessing_failure"+a),clearInterval(o),e.promise.reject("OpFailed")},this))},_getAuthoringview:function(e){$.ajax({url:e.esAgreementsURL+"/"+e.id+"/views",data:e.body,type:"POST",modal:!1,global:!1,headers:e.headers,contentType:"application/json",dataType:"json",success:_.bind(function(i){console.log(i.agreementViewList[0].url),e.promise.resolve(i.agreementViewList[0])},this),error:_.bind(function(i){e.promise.reject({httpRespCode:i.status,httpRespBody:i.responseText}),"400"==i.status&&'{"code":"VIEW_NOT_AVAILABLE","message":"Requested view is not available for the resource in the current state"}'==i.responseText&&this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"CreateASTestReportForLargeFileSize"})},this)})},_generateJSONforCreateAgreementIDCall:function(){var e="";return e+="{",e+='    "fileInfos": [<%= transient_document_ids%>],',e+='    "name": "<%= agreement_name%>",',e+='    "message": "<%= agreement_message%>",',e+='    "signatureType": "ESIGN",',e+='    "state": "<%= agreement_status%>"',e+="<%= recipients_ids %>",e+="<%= cc_recipientsids %>",e+="}"},_getV6RecipientIDsString:function(e,i){var t,s="",n=1;return s=', "participantSetsInfo" : [',_.isEmpty(e)||(t=e.split(","),_.each(t,function(e){s+='{ "memberInfos" :[{"email": "'+e+'"}], "order":'+n+', "role": "SIGNER"},',n+=1})),_.isEmpty(i)||(t=i.split(","),_.each(t,function(e){s+='{ "memberInfos" :[{"email": "'+e+'"}], "order":'+n+', "role": "APPROVER"},',n+=1})),s=s.slice(0,-1),s=s.replace(/\,$/,""),s+="]"},_getV6RecipientIDsStringOrderWise:function(e){var i="",t=1;if(i=', "participantSetsInfo" : [',!_.isEmpty(e))for(var s=0;s<e.length;s++)i+='{ "memberInfos" :[{"email": "'+e[s].email+'"}], "order":'+t+', "role":"'+e[s].role+'"},',t+=1;return i=i.slice(0,-1),i=i.replace(/\,$/,""),i+="]"},_getV6CCRecipientIDsString:function(e){var i,t="";return _.isUndefined(e)?t:(i=e.split(","),t=', "ccs" :[',_.each(i,function(e){t+='{"email":"'+e+'"},'}),t=t.replace(/\,$/,""),t+="]")}}),i.FetchSendForSignPageUrlV6Op}),define("pdmplugins/send-for-sign/js/ops/plugin/open-send-for-sign-page-in-app-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){return i.OpenSendForSignPageInAppOp=e.Op.extend({run:function(){var e=this.options,i=e.sendPageUrl,t=e.workflowUiModel,s=$.Deferred();return t.set("send_page_status",{url:i,isVisible:!0}),t.on("change:send_page_status",function(e,i){i.isLoaded?s.resolve():s.reject()}),s}}),i.OpenSendForSignPageInAppOp}),define("pdmplugins/send-for-sign/js/ops/plugin/show-sfs-landing-page-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/utils/util","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s,n){return i.ShowSFSLandingPageOp=e.Op.extend({run:function(){var e=this.options;return this.landingPageUiModel=e.sfsAppLandingPageUiModel,this.landingPageUiModel.set("selected_files",e.selectedFiles),this._updateLandingPageFileCollectionFields(),this._updateLandingPageAppInfoFields(),this._updateLandingPageActionBtnFields(),this._updateLandingPageVisibility(!0),this.addUiModelEventListeners(),this._getResolvedPromise()},addUiModelEventListeners:function(){this.landingPageUiModel.on("change:selected_files",this._onSelectedFilesChange),this.landingPageUiModel.on("change:is_visible",this._onVisibilityChange)},_getSelectedFilesCount:function(){var e=this.landingPageUiModel.get("selected_files");return _.isEmpty(e)?0:e.length},_onSelectedFilesChange:function(){this._updateLandingPageActionBtnFields(),this._updateLandingPageAppInfoFields(),this._updateLandingPageFileCollectionFields(),this._refreshLandingPage()},_onVisibilityChange:function(e,i){this._updateLandingPageVisibility(i)},_updateLandingPageVisibility:function(e){this.landingPageUiModel.set("is_visible",e>0)},_refreshLandingPage:function(){this.landingPageUiModel.clearLastRefreshState(),this.landingPageUiModel.set("is_refreshed",!0)},_updateLandingPageFileCollectionFields:function(){var e=this._getSelectedFilesCount();0>=e?(this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SEND_FOR_SIG,n.SELECT_FILES,n.SHOWN]),this.landingPageUiModel.set("file_collection_visible",!1,{silent:!0})):(this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SEND_FOR_SIG,n.OPTION_DLG,n.SHOWN]),this.landingPageUiModel.set("file_collection_visible",!0,{silent:!0}))},_updateLandingPageAppInfoFields:function(){this._updateAppInfoFieldsVisibility(),this._updateAppInfoFieldsContent()},_updateLandingPageActionBtnFields:function(){this._updateActionBtnsVisibility(),this._updateActionBtnsUpdateState(),this._updateActionBtnsLabels(),this._updateActionBtnsDescriptionVisibility(),this._updateActionBtnsDescriptionText()},_updateAppInfoFieldsVisibility:function(){this.landingPageUiModel.set("app_info_txt_visible",!1,{silent:!0})},_updateAppInfoFieldsContent:function(){t.isReader()&&(this.landingPageUiModel.set("app_info_txt1",s.LP_RDR_APP_INFO_TXT_1,{silent:!0}),this.landingPageUiModel.set("app_info_txt2",s.LP_RDR_APP_INFO_TXT_2,{silent:!0}),this.landingPageUiModel.set("app_info_txt3",s.LP_RDR_APP_INFO_TXT_3,{silent:!0}))},_updateActionBtnsVisibility:function(){this.landingPageUiModel.set("action_btn1_visible",!0,{silent:!0});var e=this._getSelectedFilesCount(),i=e>0;t.isAcrobat()&&this.landingPageUiModel.set("action_btn2_visible",i,{silent:!0})},_updateActionBtnsUpdateState:function(){var e=this._getSelectedFilesCount(),i=e>0;t.isAcrobat()&&(i?this.landingPageUiModel.get("showSFSNewLandingPage")?this.landingPageUiModel.set("action_btn1_enabled",!0,{silent:!0}):this.options.appApi.rnaApi.done(_.bind(function(e){e.isRunningInBrowser()&&this.landingPageUiModel.set("action_btn1_enabled",!1,{silent:!0})},this)):this.landingPageUiModel.set("action_btn1_enabled",!0,{silent:!0}))},_updateActionBtnsLabels:function(){var e=this._getSelectedFilesCount();this.landingPageUiModel.get("showSFSNewLandingPage")?e>0?this.landingPageUiModel.set("action_btn1_label",s.SFS_LANDING_BTN,{silent:!0}):this.landingPageUiModel.set("action_btn1_label",s.LP_SELECT_FILE_BTN_LABEL,{silent:!0}):e>0?t.isReader()?this.landingPageUiModel.set("action_btn1_label",s.LP_RDR_ACTION_BTN1_LABEL,{silent:!0}):t.isAcrobat()&&(this.landingPageUiModel.set("action_btn1_label",s.LP_ACR_ACTION_BTN1_LABEL,{silent:!0}),this.landingPageUiModel.set("action_btn2_label",s.LP_ACR_ACTION_BTN2_LABEL,{silent:!0}),this.landingPageUiModel.set("action_btn_separator_label",s.LP_ACR_ACTION_BTN_SEPARATOR,{silent:!0})):this.landingPageUiModel.set("action_btn1_label",s.LP_SELECT_FILE_BTN_LABEL,{silent:!0})},_updateActionBtnsDescriptionVisibility:function(){var e,i=this._getSelectedFilesCount();t.isAcrobat()&&(e=i>0,this.landingPageUiModel.set("action_btn_descr_visible",e,{silent:!0}))},_updateActionBtnsDescriptionText:function(){this.landingPageUiModel.get("showSFSNewLandingPage")||(this.landingPageUiModel.set("action_btn1_descr_txt",s.LP_ACR_ACTION_BTN1_INFO,{silent:!0}),this.landingPageUiModel.set("action_btn2_descr_txt",s.LP_ACR_ACTION_BTN2_INFO,{silent:!0}))}}),i.ShowSFSLandingPageOp}),define("pdmplugins/send-for-sign/js/ops/plugin/fetch-manage-agreements-url-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants"],function(e,i,t){var s="";return s+="{",s+='  "autoLogin": true,',s+='  "noChrome": false,',s+='  "agreementAssetId": "<%= agreementId%>"',s+="}",i.FetchManageAgreementsURLOp=e.Op.extend({run:function(){var e,i,n,o,a,r,l=this.options,d=l.appApi,p=$.Deferred();return d.rnaApi.done(_.bind(function(d){if(o=d.esApi.getEchoSignServiceParams(),i=o.apiURL,n=l.esAuthUiModel.get("access_token"),r=l.agreementId,_.isEmpty(i)||_.isEmpty(n))return void p.reject();var c;c=this.options.sfsAppLandingPageUiModel.get("showSFSNewLandingPage")?t.API_SUBPATH_NEW:t.API_SUBPATH_OLD,e=i+c+"/views/agreementAssetList",a={Accept:"application/json","Access-Token":n},s=_.template(s,{agreementId:r}),$.ajax({url:e,data:s,type:"POST",modal:!1,headers:a,contentType:"application/json",dataType:"json",success:_.bind(function(e){_.isEmpty(e)||_.isEmpty(e.viewURL)?p.reject():p.resolve(e)},this),error:_.bind(function(){p.reject()},this)})},this)),p}}),i.FetchManageAgreementsURLOp}),define("pdmplugins/send-for-sign/js/ops/plugin/fetch-signing-url-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants"],function(e,i,t){return i.FetchSigningURLOp=e.Op.extend({run:function(){var e,s,n,o,a,r,l=this.options,d=l.appApi,p=$.Deferred();return d.rnaApi.done(_.bind(function(d){return o=d.esApi.getEchoSignServiceParams(),s=o.apiURL,n=l.esAuthUiModel.get("access_token"),r=i.QueryParams.AgreementId,_.isEmpty(s)||_.isEmpty(n)?void p.reject():(e=s+t.API_SUBPATH_V6+"/agreements/"+r+"/signingUrls",a={Accept:"application/json",Authorization:"Bearer "+n},void $.ajax({url:e,type:"GET",modal:!1,headers:a,contentType:"application/json",dataType:"json",global:!1,success:_.bind(function(e){_.isEmpty(e)?p.reject():p.resolve(e)},this),error:_.bind(function(e){403==e.status&&"INVALID_API_ACCESS_POINT"==e.responseJSON.code&&this.options.appApi.rnaApiObj.esApi.authApi.clearESAuthSession(),p.reject()},this)}))},this)),p}}),i.FetchManageAgreementsURLOp}),define("pdmplugins/send-for-sign/js/ops/plugin/open-sign-page-in-app-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){return i.OpenSignPageInAppOp=e.Op.extend({run:function(){var e=this.options,i=e.signPageUrl,t=e.workflowUiModel,s=$.Deferred();return t.set("sign_page_status",{url:i,isVisible:!0}),t.on("change:sign_page_status",function(e,i){i.isLoaded?s.resolve():s.reject()}),s}}),i.OpenSignPageInAppOp}),define("pdmplugins/send-for-sign/js/ops/plugin/sfs-files-validator-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-error-codes","pdmplugins/send-for-sign/js/constants/sfs-constants"],function(e,i,t,s){var n=["",t.PDFIsPortfolio,t.PDFIsPasswordProtected,t.PDFIsCertificateProtected,t.PDFIsPolicyProtected,t.PDFIsDynamicXFA,t.PDFIsOfInvalidType];return i.SFSFilesValidatorOp=e.Op.extend({run:function(){var e,i,o,a,r=this.options,l=$.Deferred(),d=r.inputFiles,p=[],c=[],h=[];return _.each(d,_.bind(function(i){return _.isEmpty(i)?void c.push(i):(!_.isEmpty(i.get("assetId"))||(e=i.get("ext"),!_.isEmpty(e)&&_.some(s.SUPPORTED_EXTENSIONS,function(i){return i.toLowerCase()===e.toLowerCase()})||i.get("isTemp")&&i.get("name").toLowerCase().endsWith(".pdf")))&&(_.isEmpty(i.get("assetId"))||(e=i.get("ext"),_.isEmpty(e)||_.some(s.SUPPORTED_EXTENSIONS,function(i){return i.toLowerCase()===e.toLowerCase()})))?void p.push(i):void c.push({file:i,errorCode:t.InvalidFileExtn})},this)),_.isEmpty(p)?(l.resolve(p,c),l):(a=_.map(p,function(e){return e._proxy}),i={methodName:"canSendForSign",methodArgs:a},r.appApi.rnaApi.done(_.bind(function(e){e.servicesApi(i).then(_.bind(function(e){_.each(p,_.bind(function(i,t){e[t].errorSet?(o=e[t].errorCode,c.push({file:i,errorCode:n[o]})):h.push(i)},this)),l.resolve(h,c)},this),function(){l.reject()})},this)),l)}}),i.SFSFilesValidatorOp}),define("pdmplugins/send-for-sign/js/ops/plugin/sfs-combine-files-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s){return i.SFSCombineFilesOp=e.Op.extend({run:function(){var i,n,o,a,r,l=this.options,d=this.options.appApi.dialogApi,p=$.Deferred(),c=0,h=l.inputFiles,u=[],g=[],f=0;return _.each(h,_.bind(function(e){_.isEmpty(e)||u.push(e)},this)),_.isEmpty(u)?(p.resolve(u),p):(r=_.map(u,function(e){return e._proxy}),c=u.length,l.appApi.siteCatalystApi.logScEvent([s.TOOLS,s.SEND_FOR_SIG,s.OPTION_DLG,s.COMBINE,s.SHOWN]),i=t.SFS_COMBINE_MESSAGE_TITLE,n=t.SFS_COMBINE_MESSAGE_TEXT,d.displayHtmlAlert(d.SEVERITY_WARNING,i,n,t.YES,t.NO).then(_.bind(function(){l.appApi.siteCatalystApi.logScEvent([s.TOOLS,s.SEND_FOR_SIG,s.OPTION_DLG,s.COMBINE,s.YES_CLICKED]),l.appApi.siteCatalystApi.logScEvent([s.TOOLS,s.SEND_FOR_SIG,s.OPTION_DLG,s.COMBINE,s.STARTED,c,s.FILES]),l.appApi.rnaApi.done(_.bind(function(i){i.rnaServicesAPI.combineMultipleFilesToSinglePDFApi(r).then(_.bind(function(i){l.appApi.siteCatalystApi.logScEvent([s.TOOLS,s.SEND_FOR_SIG,s.OPTION_DLG,s.COMBINE,s.SUCCESS]),o=i,a=new e.LocalItemModel(void 0,{_proxy:o}),g.push(a),p.resolve(g)
},this),function(e){l.appApi.siteCatalystApi.logScEvent(e?[s.TOOLS,s.SEND_FOR_SIG,s.OPTION_DLG,s.COMBINE,s.FAILURE]:[s.TOOLS,s.SEND_FOR_SIG,s.OPTION_DLG,s.COMBINE,s.CANCELLED]),f=1,p.reject(f)})},this))},this),_.bind(function(){l.appApi.siteCatalystApi.logScEvent([s.TOOLS,s.SEND_FOR_SIG,s.OPTION_DLG,s.COMBINE,s.NO_CLICKED]),p.reject(f)},this)),p)}}),i.SFSCombineFilesOp}),define("pdmplugins/send-for-sign/js/templates/sfs-subscribe-page-template",[],function(){return'<div class="sfs-subscribe-page-container"><div class="sfs-subcribe-page-title theme-text"><%= pageTitle %></div><div class="sfs-subscribe-page-msg-content theme-text"><div><%= messageContent1 %></div></div><div class="sfs-sign-in-btns-group"><div class="sfs-sign-in-btn"><input id="sfs-subscribe-sign" class="control-button dialog-control-button"type="button"tabindex="1" value="<%= signInLabel %>"></input></div><div class="sfs-sign-in-upgrade-grp"><div class="sfs-upgrade-label  theme-text"><%= upgradeLabelNotSubscribed %></div><div role ="link" class="sfs-upgrade-link theme-hyperlink" tabindex=0><%= upgradeLabel %></div><div class="sfs-upgrade-grp-terminator"></div></div></div><div class="sfs-upgrade-btns-group"><div class="sfs-upgrade-btn"><input class="control-button dialog-control-button"type="button"tabindex="1" value="<%= upgradeNowLabel %>"></input></div></div><div class="sfs-start-now-btns-group"><div class="sfs-start-now-btn"><input class="control-button dialog-control-button"type="button"tabindex="1" value="<%= startNowLabel %>"></input></div></div></div>'}),define("pdmplugins/send-for-sign/js/views/sfs-subscribe-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-subscribe-page-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings"],function(e,i,t,s){i.SFSSubscribePageView=e.View.extend({events:function(){return{"click   .sfs-upgrade-btn .control-button":"_onUpgradeNowBtnClick","click   .sfs-start-now-btn .control-button":"_onStartNowBtnClick","click   .sfs-sign-in-btn .control-button":"_onSignInBtnClick","click   .sfs-upgrade-link":"_onUpgradeNowBtnClick"}},initialize:function(){this._template=_.template(t)},show:function(){this._pageViewId=this.options.parentView.addChildView(this),this.options.parentView.$el.append(this.$el),this.render()},render:function(){e.View.prototype.render.call(this),this.options.appApi.rnaApi.done(_.bind(function(e){var i=s.SFS_SUBSCRIBE_UPGRADE_NOT_SUBCRIBED,t=s.SFS_SUBSCRIBE_UPGRADE,n=s.SFS_SUBSCRIBE_SIGN_IN;e.rnaServicesAPI.isSFSUpsellExperimentEnabled()===!0&&(i=s.SFS_SUBSCRIBE_UPGRADE_ALREADY_SUBSCRIBED_EXPERIMENT,t=s.SFS_SUBSCRIBE_SIGN_IN,n=s.SFS_SUBSCRIBE_LEARN_MORE_EXPERIMENT),0===this.$el.children().length&&(this.$el.html(this._template({pageTitle:s.SFS_SUBSCRIBE_TITLE,messageContent1:s.SFS_SUBSCRIBE_MSG_CONTENT_1,signInLabel:n,upgradeLabelNotSubscribed:i,upgradeNowLabel:s.SFS_SUBSCRIBE_UPGRADE_NOW,startNowLabel:s.SFS_SUBSCRIBE_START_NOW,upgradeLabel:t})),this._initWrappers())},this)),this.$signInBtnGrpElem.addClass("hidden"),this.$startNowBtnGrpElem.addClass("hidden"),this.$upgradeNowBtnGrpElem.addClass("hidden");var i=this.options.sfsSubscribeUiModel.get("visible_btn_name");return"sign_in"===i?this.$signInBtnGrpElem.removeClass("hidden"):"start_now"===i?this.$startNowBtnGrpElem.removeClass("hidden"):"upgrade"===i&&this.$upgradeNowBtnGrpElem.removeClass("hidden"),this._initTabLimits(),$("#sfs-subscribe-sign").focus(),this},_initWrappers:function(){this.$upgradeNowBtnGrpElem=$(".sfs-upgrade-btns-group"),this.$signInBtnGrpElem=$(".sfs-sign-in-btns-group"),this.$startNowBtnGrpElem=$(".sfs-start-now-btns-group")},_initTabLimits:function(){var e;e=this.$("[tabindex][disabled != 'disabled']"),this.$firstTabbable=e.first(),this.$lastTabbable=e.last()},_onUpgradeNowBtnClick:function(){this._close(),this.options.sfsSubscribeUiModel.set("user_action","upgrade_clicked")},_onStartNowBtnClick:function(){this._close(),this.options.sfsSubscribeUiModel.set("user_action","start_now_clicked")},_onSignInBtnClick:function(){this._close(),this.options.sfsSubscribeUiModel.set("user_action","sign_in_clicked")},_onCloseBtnClick:function(){this._close(),this.options.sfsSubscribeUiModel.set("user_action","cancel_clicked")},_close:function(){_.defer(_.bind(function(){this.options.parentView.removeChildViewById(this._pageViewId),this.remove()},this))}})}),define("pdmplugins/send-for-sign/js/ops/plugin/show-sfs-subscribe-page-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/ops/op","pdmplugins/send-for-sign/js/views/sfs-subscribe-page-view"],function(e,i){return i.ShowSFSSubscribePageOp=e.Op.extend({run:function(){var e,t=this.options;e=new i.SFSSubscribePageView(_.extend({parentView:t.parentView},t)),e.show()}}),i.ShowSFSSubscribePageOp}),define("pdmplugins/send-for-sign/js/ops/plugin/show-post-sign-page-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/ops/op","pdmplugins/send-for-sign/js/views/sfs-post-sign-page-view"],function(e,i){return i.ShowPostSignPageOp=e.Op.extend({run:function(){var e,t=this.options;e=new i.SFSPostSignPageView(_.extend({el:".sfs-in-app-sign-container"},t)),e.show()}}),i.ShowPostSignPageOp}),define("pdmplugins/send-for-sign/js/ops/plugin/create-send-copy-agreement-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/util","core/utils/http-util"],function(e,i,t,s,n){var o="";return i.CreateSendACopyAgreementOp=e.Op.extend({run:function(){var e,i,s,a,r,l,d,p,c=this.options,h=c.appApi,u=$.Deferred(),g="",f=c.transientDocumentIds,S=f.length,m=c.agreementName,E=c.agreementMsg;return h.rnaApi.done(_.bind(function(f){if(r=f.esApi.getEchoSignServiceParams(),s=r.apiURL,a=c.esAuthUiModel.get("access_token"),_.isEmpty(s)||_.isEmpty(a))return void u.reject();var A=n.getClientIdQueryParam(),v=A.lastIndexOf("=");p=t.API_SUBPATH_V6,e=s+p+"/agreements",_.each(c.transientDocumentIds,function(e,i){g+='{"transientDocumentId": "'+e+'"}',i!==S-1&&(g+=",")}),d={transient_document_ids:g},_.isUndefined(m)||_.isEmpty(m)||(d.agreement_name=m),_.isUndefined(E)||(d.agreement_msg=E);var C=h.localeApi.getLocale().split("-");C.length>=2&&(d.current_locale=C[0]+"_"+C[1].toUpperCase()),this._generateJSONforAgreementsCall(),i=_.template(o,d),console.log(i),l={Accept:"application/json",Authorization:"Bearer "+a,"x-api-client-id":A.substr(v+1)},$.ajax({url:e,data:i,type:"POST",modal:!1,global:!1,headers:l,contentType:"application/json",dataType:"json",success:_.bind(function(e){u.resolve(e)},this),error:_.bind(function(e){u.reject({httpRespCode:e.status,httpRespBody:e.responseText})},this)})},this)),u},_generateJSONforAgreementsCall:function(){o+="{",o+='  "fileInfos": [',o+="    <%= transient_document_ids%>],",o+='    "name": "<%= agreement_name%>",',o+='    "state": "ARCHIVED", "message":"<%= agreement_msg%>",',o+='    "locale": "<%= current_locale%>",',o+='    "emailOption": {"sendOptions": {"completionEmails": "NONE" } } }'}}),i.CreateSendACopyAgreementOp}),define("pdmplugins/send-for-sign/js/ops/plugin/fetch-send-a-copy-view-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/http-util"],function(e,i,t,s){var n="";return i.FetchPublicLinkOp=e.Op.extend({run:function(){var e,i,o,a,r,l,d=this.options,p=d.appApi,c=$.Deferred();return p.rnaApi.done(_.bind(function(p){if(a=p.esApi.getEchoSignServiceParams(),i=a.apiURL,o=d.esAuthUiModel.get("access_token"),l=d.agreementId,_.isEmpty(i)||_.isEmpty(o))return void c.reject();e=i+t.API_SUBPATH_V6+"/agreements/"+l+"/views";var h=s.getClientIdQueryParam(),u=h.lastIndexOf("=");r={Accept:"application/json",Authorization:"Bearer "+o,"x-api-client-id":h.substr(u+1)},n+="{",n+='  "name": "PUBLIC_LINK"',n+="}",console.log(n),$.ajax({url:e,type:"POST",data:n,modal:!1,global:!1,headers:r,contentType:"application/json",dataType:"json",success:_.bind(function(e,i,t){_.isEmpty(e)?c.reject():c.resolve(e,t)},this),error:_.bind(function(e){c.reject({httpRespCode:e.status,httpRespBody:e.responseText})},this)})},this)),c}}),i.FetchPublicLinkOp}),define("pdmplugins/send-for-sign/js/ops/plugin/do-send-completed-copy-op",["core/ac-core","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","core/utils/util","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/utils/file-types","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/constants/sfs-constants"],function(e,i,t,s,n,o,a,r){var l,d=0,p=100;return t.SendCompletedCopyOp=e.Op.extend({run:function(){var e=this.options,i=$.Deferred();return _.extend(this.options,{promise:i}),this._startworkflow(e),i},_createESAuthSessionAndUpload:function(e){var t=i.esApi.authApi,s=t.createAuthSession(e);s.then(_.bind(function(){this.options.esAuthUiModel.get("access_token")||this.options.esAuthUiModel.set("access_token",this.options.appApi.rnaApi.accessToken);var i=this.options.sfsAppSendACopyUiModel;i.get("is_agreement_opened")===!0?this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"GetOpenDocAgreementID"}).done(_.bind(function(e){i.set("agreementId",e),1==i.get("is_getalink_workflow")?this._getViewData():this._shareAgreement()},this))},this)):this._createUploadRequestsQueue(e)},this),_.bind(function(){e.sfsAppSendACopyUiModel.set("failed_workflow","AUTH_FAILED"),e.promise.reject("OpFailed")},this))},_createUploadRequestsQueue:function(e){var i,t,s=e.sfsAppSendACopyUiModel;t=s.get("is_upload_only")?e.sfsAppLandingPageUiModel.get("selected_files"):s.get("selectedFiles"),i=_.map(t,_.bind(function(e,i){return{file:e,fileIdx:i,responseObj:{},progressObj:{},bytesUploaded:0,bytesTotal:0,uploadStatus:""}},this)),s.set("upload_req_queue",i),this._startUploadRequestForAllFiles(e)},_startUploadRequestForAllFiles:function(e){var i=e.sfsAppSendACopyUiModel,t=i.get("upload_req_queue");_.each(t,_.bind(function(i){e.currentFileUploadReq=i,this._uploadFileToEchoSign(e)},this))},_uploadFileToEchoSign:function(e){var t=e.currentFileUploadReq,s=t.file,a=r.API_SUBPATH_V6,l=s.get("ext").toLowerCase();("tmp"==l&&"Untitled"==s.get("name")||s.get("isTemp")&&s.get("name").toLowerCase().endsWith(".pdf"))&&(l="pdf");var d=o.getFileMimeType(l);this.options.appApi.rnaApi.done(_.bind(function(o){var p=o.esApi.getEchoSignServiceParams(),c=p.apiURL,h=this.options.esAuthUiModel,u=h.get("access_token"),g=r.API_VERSION_V6;l=l,d=d;var f=_.extend({docToUpload:s,esAccessToken:u,esUploadEndpoint:c+a+"/transientDocuments",mimeType:d,apiVersion:g},this.options);i.opFactory.create("UploadDocumentToEchoSignOp",f).run().then(_.bind(function(s){t.responseObj=s,t.progressObj=s.progressObj,e.currentFileUploadReq=t;var n=s.status,o=i.UploadDocumentToEchoSignOp.prototype.UPLOAD_STATES;n===o.STARTED?(console.log("UploadStarted"),this._listenForUploadProgressEvents(e)):n===o.FINISHED?(console.log("UploadFinished"),this._processUploadFinishedResult(e)):n===o.QUEUED&&(console.log("UploadQueued"),this._listenForUploadProgressEvents(e))},this),_.bind(function(i){t.responseObj=i,e.currentFileUploadReq=t;var s="";if(_.isUndefined(i))s=n.SFS_ERR_GENERAL_WORKFLOW_FAILURE;else{fileToUploadBody=i.respBody;try{fileToUploadBody=JSON.parse(fileToUploadBody)}catch(o){}s=fileToUploadBody.message?fileToUploadBody.message:fileToUploadBody}e.sfsAppSendACopyUiModel.set("failed_workflow",s),this.options.promise.reject("OpFailed")},this))},this))},_listenForUploadProgressEvents:function(e){console.log("Upload listen event");var t,s,n=e.currentFileUploadReq,o=n.responseObj,a=n.progressObj;t=i.uiModelFactory.create("ESDocUploadProgressUiModel",this.options),t.set("upload_response",o),t.set("progress_obj",a),t.on("all",_.bind(function(i){if("change"!==i)switch(s=t.get("progress_status"),e.currentFileUploadReq=n,s){case"ongoing":n.bytesUploaded=t.get("bytes_uploaded"),n.bytesTotal=t.get("bytes_total"),console.log("uploading ...");break;case"finished":n.responseObj=t.get("upload_response"),console.log("_listenForUploadProgressEvents : finished !"),this._processUploadFinishedResult(e)}},this)),i.opFactory.create("ListeningForESDocUploadProgressEventsOp",_.extend({esDocUploadProgressUiModel:t},this.options)).run()},_fetchAndSendPageURL:function(e){var i,t=this.options.sfsAppSendACopyUiModel,s=t.get("upload_req_queue");if(i=_.every(s,_.bind(function(e){return"success"===e.uploadStatus},this))){if(t.set("last_action_success","docupload_success"),t.get("is_upload_only"))return void this.options.promise.resolve("OpSuccess");if(t.get("is_getalink_workflow")||_.isEmpty(t.get("agreement_subject"))){var n=s[0].file.get("name"),o=n.substr(0,n.lastIndexOf("."))||n;t.set("agreement_subject",o)}this._createAgreementForSendACopyWorkflow(e)}},_processUploadFinishedResult:function(e){console.log("_processUploadFinishedResult : reached");var t=this.options.sfsAppSendACopyUiModel,s=e.currentFileUploadReq;if(s.responseObj.errorSet){console.log("Upload Error");var o=s.responseObj.respBody;try{o=JSON.parse(o)}catch(a){}console.log(o);var r=o?o.message?o.message:o:n.SFS_ERR_GENERAL_WORKFLOW_FAILURE;return t.set("failed_workflow",r),_.isUndefined(o)||e.sfsAppSendACopyUiModel.set("error_code",o.code),t.set("workflow_success_status",!1),void this.options.promise.reject("OpFailed")}console.log("upload and run sfs op : transient ID : "+String(s.responseObj.respBody.transientDocumentId)),s.uploadStatus="success","undefined"!=typeof e.currentFileUploadReq&&"undefined"!=typeof e.currentFileUploadReq.responseObj&&"undefined"!=typeof e.currentFileUploadReq.responseObj.clusterTokenFetched&&e.currentFileUploadReq.responseObj.clusterTokenFetched?i.opFactory.create("FetchExistingESAuthSessionOp",this.options).run().then(_.bind(function(i){this.options.appApi.rnaApi.done(_.bind(function(){var t=this.options.esAuthUiModel;this.options.appApi.rnaApi.accessToken=i.accessToken,t.set("access_token",i.accessToken),t.set("expiration_time",i.expiryTime),t.set("refresh_token",i.refreshToken),t.set("signin_profile_id",i.signProfileID),t.set("signin_profile_name",i.signProfileName),t.set("loggedin_profile_name",i.loggedinProfileName),this._fetchAndSendPageURL(e)},this))},this),_.bind(function(){console.log("_processUploadFinishedResult_failure, clusterToken fetch failure");var e=n.SFS_ERR_GENERAL_WORKFLOW_FAILURE;t.set("failed_workflow",e),t.set("workflow_success_status",!1),this.options.promise.reject("OpFailed")},this)):this._fetchAndSendPageURL(e)},_createAgreementForSendACopyWorkflow:function(e){var i,s=this.options.sfsAppSendACopyUiModel,o=s.get("upload_req_queue"),a=o.length,i=_.map(o,function(e){return e.responseObj&&e.responseObj.respBody?e.responseObj.respBody.transientDocumentId:void 0});return i=_.compact(i),_.isEmpty(i)||i.length<a?(s.set("failed_workflow","Missing_TransientIDs"),void this.options.promise.reject("OpFailed")):void t.opFactory.create("CreateSendACopyAgreementOp",_.extend({transientDocumentIds:i,agreementName:s.get("agreement_subject"),agreementMsg:s.get("agreement_msg")},this.options)).run().then(_.bind(function(i){s.set("agreementId",i.id),console.log("Agreement ID: "+i.id),s.set("last_action_success","Agreement_Creation_success");var t=this;d=0,l=window.setInterval(function(){t._waitForDocProcessing(e)},2e3)},this),_.bind(function(i){e.createSendCopyAgreementResponseFetchHttpCode=i.httpRespCode,e.createSendCopyAgreementResponseFetchRespBody=i.httpRespBody;var t;try{t=JSON.parse(i.httpRespBody)}catch(o){}var a=t?t.message?t.message:t:n.SFS_ERR_GENERAL_WORKFLOW_FAILURE;s.set("failed_workflow",a),this.options.promise.reject("OpFailed")},this))},_waitForDocProcessing:function(){console.log("_waitForDocProcessing : "+o);var e=this.options.sfsAppSendACopyUiModel,i=this.options.appApi,s=e.get("agreementId"),o=o+1;return o>p?(console.log("Wait exceeded"),clearInterval(l),e.set("failed_workflow","Agreement_Wait_Exceeded"),void this.options.promise.reject("OpFailed")):void t.opFactory.create("FetchAgreementStatusOp",_.extend({agreementId:s},this.options)).run().then(_.bind(function(t){console.log("_waitForDocProcessing success"+o),"DOCUMENTS_NOT_YET_PROCESSED"!=t.status&&(clearInterval(l),e.get("is_locked_copy_workflow")?i.rnaApi.done(_.bind(function(i){var t={},n=i.esApi.getEchoSignApiURL();t.agreementID=s,t.agreementURL=n+"/api/rest/v6/agreements/"+s+"/combinedDocument",t.agreementName=e.get("agreement_subject"),t.accessToken=this.options.esAuthUiModel.get("access_token"),t.agreementState=e.get("last_action_success"),i.rnaSignWorkflowServicesAPI.invokeMethod({methodName:"openFSSSignedFile",methodArgs:t})},this)):e.get("is_getalink_workflow")?this._getViewData():this._shareAgreement())},this),_.bind(function(i){console.log("_waitForDocProcessing_failure"+o),clearInterval(l);var t;try{t=JSON.parse(i.httpRespBody)}catch(s){}var a=t?t.message?t.message:t:n.SFS_ERR_GENERAL_WORKFLOW_FAILURE;e.set("failed_workflow",a),this.options.promise.reject("OpFailed")},this))},_getViewData:function(){var e=this.options.sfsAppSendACopyUiModel,i=e.get("agreementId");(_.isUndefined(i)||0===i)&&(i=t.QueryParams.agreementId),t.opFactory.create("FetchPublicLinkOp",_.extend({agreementId:i},this.options)).run().then(_.bind(function(i){var t=i.agreementViewList[0].url;console.log("URL: "+t),e.set("certified_email_link",t),e.set("workflow_success_status",!0),this.options.promise.resolve("OpSuccess")},this),_.bind(function(i){var t;try{t=JSON.parse(i.httpRespBody)}catch(s){}var o=t?t.message?t.message:t:n.SFS_ERR_GENERAL_WORKFLOW_FAILURE;e.set("failed_workflow",o),this.options.promise.reject("OpFailed")},this))},_shareAgreement:function(){var e=this.options.sfsAppSendACopyUiModel,i=e.get("agreementId"),s=e.get("recipientlist");t.opFactory.create("ShareAgreementOp",_.extend({agreementId:i,recipientlist:s},this.options)).run().then(_.bind(function(){console.log("_shareAgreement: Success"),e.set("workflow_success_status",!0),this.options.promise.resolve("OpSuccess")},this),_.bind(function(i){var t;try{t=JSON.parse(i.httpRespBody)}catch(s){}var o=t?t.message?t.message:t:n.SFS_ERR_GENERAL_WORKFLOW_FAILURE;e.set("failed_workflow",o),e.set("workflow_success_status",!1),this.options.promise.reject("OpFailed")},this))},_startworkflow:function(e){this._createESAuthSessionAndUpload(e)}}),t.SendCompletedCopyOp}),define("pdmplugins/send-for-sign/js/views/fss-post-sign-page-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-post-sign-page-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","core/utils/image-loader"],function(e,i,t,s,n){return i.FSSPostSignPageView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addKeyEventListener()},events:function(){return{"click #sfs-postsign-page-view-button":"_onViewDocBtnClick"}},render:function(){return e.View.prototype.render.call(this),this.$el.html(),this.$el.html(this._template({title:s.FFS_SENT_DOC_TITLE,docname:"",subtitle:"",viewdocument:s.SFS_VIEW_DOCUMENT_BUTTON,managedoc:s.SFS_MANAGE_DOC,sfslink:s.SFS_OPTION_SEND_FOR_SIGNATURE})),this._initWrappers(),this._loadDocthumbnail(),this},_initWrappers:function(){this.$signPageIframe=this.$(".sign-page-iframe"),this.$previewImage=this.$(".sfs-postsign-thumbnail-image")},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){{var i=e.keyCode;$(e.target),$.Event("click")}switch(i){case 13:case 27:}},_loadDocthumbnail:function(){this._getRenditionUrl().then(_.bind(function(e){n.cancelPendingRequests(),this.$previewImage.attr("src",""),this.options.appApi.rnaApi.then(_.bind(function(){n.loadImage(this.$previewImage,e,void 0,!0)},this))},this))},_getRenditionUrl:function(){var e,i,t,s,n,o,a=$.Deferred(),r=this.options,l=r.appApi;return this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){l.rnaApi.done(_.bind(function(l){return s=l.esApi.getEchoSignServiceParams(),i=s.apiURL,t=r.esAuthUiModel.get("access_token"),o=this.options.sfsAppSendACopyUiModel.get("agreementId"),_.isEmpty(o)||_.isEmpty(i)||_.isEmpty(t)?void a.reject():(e=i+"/api/rest/v6/agreements/"+o+"/documents/imageUrls",n={Accept:"application/json",Authorization:"Bearer "+t},void $.ajax({url:e,type:"GET",modal:!1,headers:n,contentType:"application/json",dataType:"json",success:_.bind(function(e){if(_.isEmpty(e))a.reject();else{for(var i=e.originalDocumentsImageUrlsInfo[0].documentImageUrlsList,t=0;t<i.length;t++)if("FIXED_WIDTH_250px"===i[t].imageSize){var s=i[t].imageURLs[0].url;a.resolve(s)}a.reject()}},this),error:_.bind(function(){a.reject()},this)}))},this))},this)),a.promise()},_onViewDocBtnClick:function(){var e,i,t,s,n,o;this.options.appApi.rnaApi.done(_.bind(function(a){if(e=a.esApi.getEchoSignServiceParams(),i=e.apiURL,t=this.options.esAuthUiModel.get("access_token"),n=this.options.sfsAppSendACopyUiModel.get("agreementId"),o=this.options.sfsAppSendACopyUiModel.get("agreement_name"),!_.isEmpty(i)&&!_.isEmpty(t)){s=i+"/api/rest/v6/agreements/"+n+"/combinedDocument";var r={requestURL:s,accessToken:t,agreementName:o};a.esApi.invokeMethod({methodName:"viewSignedDoc",methodArgs:r}).then(function(e){promise.resolve(e)},function(e){promise.reject(e)})}},this))},show:function(){$(".sfs-landing-page-container").empty(),this.render()}}),i.FSSPostSignPageView}),define("pdmplugins/send-for-sign/js/ops/plugin/show-fss-post-sign-page-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/ops/op","pdmplugins/send-for-sign/js/views/fss-post-sign-page-view"],function(e,i){return i.ShowFssPostSignPageOp=e.Op.extend({run:function(){var e,t=this.options;e=new i.FSSPostSignPageView(_.extend({el:".sfs-landing-page-container"},t)),e.show()}}),i.ShowFssPostSignPageOp}),define("pdmplugins/send-for-sign/js/ops/plugin/fetch-signing-token-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants"],function(e,i){var t="";return i.FetchSigningTokenOp=e.Op.extend({run:function(){var e,i,s,n,o,a,r,l,d=this.options,p=d.appApi,c=$.Deferred();return p.rnaApi.done(_.bind(function(p){if(n=p.esApi.getEchoSignServiceParams(),i=n.apiURL,s=d.esAuthUiModel.get("access_token"),a=d.agreementId,r=d.participantsetId,l=d.participantId,_.isEmpty(i)||_.isEmpty(s)||_.isEmpty(a)||_.isEmpty(r)||_.isEmpty(l))return void c.reject();e=i+"/api/rest/v6/agreements/"+a+"/participantSets/"+r+"/participants/"+l+"/signingTokens",console.log(e),o={Accept:"application/json",Authorization:"Bearer "+s},this._generateJSONforSigningTokenCall();var h=t;console.log(h),$.ajax({url:e,type:"POST",modal:!1,data:h,headers:o,contentType:"application/json",dataType:"json",success:_.bind(function(e){_.isEmpty(e)?c.reject():c.resolve(e)},this),error:_.bind(function(){c.reject()},this)})},this)),c},_generateJSONforSigningTokenCall:function(){t+="{",t+='  "securityInfo": {',t+='    "authenticationMethod": "NONE",',t+='    "authenticationString": ""',t+="    },",t+='    "supportedFeatures":["ESIGN"]',t+="}"}}),i.FetchSigningTokenOp}),define("pdmplugins/send-for-sign/js/ops/plugin/sign-agreement-send-copy-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/util"],function(e,i,t){var s="";return i.SignAgreementForSendCopyWorkflowOp=e.Op.extend({run:function(){var e,i,n,o,a,r,l,d=this.options,p=d.appApi,c=$.Deferred(),h=d.signature_transient_id,u=d.participantsetId,g=d.participantId,f=d.agreement_etag,S=d.signingtoken,m=d.user,E=d.agreementId;return p.rnaApi.done(_.bind(function(p){return a=p.esApi.getEchoSignServiceParams(),n=a.apiURL,o=d.esAuthUiModel.get("access_token"),_.isEmpty(n)||_.isEmpty(o)?void c.reject():_.isEmpty(h)||_.isEmpty(u)||_.isEmpty(g)||_.isEmpty(f)||_.isEmpty(S)||_.isEmpty(m)||_.isEmpty(E)?void c.reject():(l=t.API_SUBPATH_V6,e=n+l+"/agreements/"+E+"/participantSets/"+u+"/participants/"+g+"/status",this._generateJSONforStatusCall(h,m),i=s,r={Accept:"application/json",Authorization:"Bearer "+o,"If-Match":f,"X-Signing-Token":S},void $.ajax({url:e,data:i,type:"PUT",modal:!1,headers:r,contentType:"application/json",dataType:"json",success:_.bind(function(e){c.resolve(e)},this),error:_.bind(function(e){c.reject({httpRespCode:e.status,httpRespBody:e.responseText})},this)}))},this)),c},_generateJSONforStatusCall:function(e,i){s+=' {"deviceInfo": {  "applicationDescription": "Adobe Acrobat",  "deviceDescription": "Windows",',s+='"location": { "latitude": "0","longitude": "0"} }, ',s+='"signatureFieldValue": {"signature": {"content": {"imageInfo": {"fileInfo": { "transientDocumentId":"'+e+'" ',s+=' }  } },"fieldNames": [ "echosign_signatureblock_0_signature"],"name": "'+i+'" } },"status": "SIGNED"}'}}),i.SignAgreementForSendCopyWorkflowOp}),define("pdmplugins/send-for-sign/js/ops/plugin/fetch-agreement-state-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/http-util"],function(e,i,t,s){return i.FetchAgreementStatusOp=e.Op.extend({run:function(){var e,i,n,o,a,r,l=this.options,d=l.appApi,p=$.Deferred();return d.rnaApi.done(_.bind(function(d){if(o=d.esApi.getEchoSignServiceParams(),i=o.apiURL,n=l.esAuthUiModel.get("access_token"),_.isEmpty(n)&&(n=l.esAccessToken),r=l.agreementId,_.isEmpty(i)||_.isEmpty(n))return void p.reject();var c=s.getClientIdQueryParam(),h=c.lastIndexOf("=");e=i+t.API_SUBPATH_V6+"/agreements/"+r,a={Accept:"application/json","x-api-client-id":c.substr(h+1)},a.Authorization=n.startsWith("Bearer ")?n:"Bearer "+n,$.ajax({url:e,type:"GET",modal:!1,global:!1,headers:a,contentType:"application/json",dataType:"json",success:_.bind(function(e,i,t){_.isEmpty(e)?p.reject():p.resolve(e,t)},this),error:_.bind(function(e){p.reject({httpRespCode:e.status,httpRespBody:e.responseText})},this)})},this)),p}}),i.FetchAgreementStatusOp}),define("pdmplugins/send-for-sign/js/ops/plugin/fetch-users-me-settings-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/http-util"],function(e,i,t,s){return i.FetchUsersMeSettingsOp=e.Op.extend({run:function(){var e,i,n,o,a,r=this.options,l=r.appApi,d=$.Deferred();return l.rnaApi.done(_.bind(function(l){if(o=l.esApi.getEchoSignServiceParams(),i=o.apiURL,n=r.esAuthUiModel.get("access_token"),_.isEmpty(i)||_.isEmpty(n))return void d.reject();e=i+t.API_SUBPATH_V6+"/users/me/settings";var p=s.getClientIdQueryParam(),c=p.lastIndexOf("=");a={Accept:"application/json",Authorization:"Bearer "+n,"x-api-client-id":p.substr(c+1)},$.ajax({url:e,type:"GET",modal:!1,headers:a,contentType:"application/json",dataType:"json",global:!1,success:_.bind(function(e){_.isEmpty(e)?d.reject():d.resolve(e)},this),error:_.bind(function(){d.reject()},this)})},this)),d}}),i.FetchUsersMeSettingsOp}),define("pdmplugins/send-for-sign/js/ops/plugin/getting-agreement-limit",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants"],function(e,i){return i.GettingAgreementLimitOp=e.Op.extend({run:function(){var e,t,s,n,o,a,r=this.options,l=r.appApi,d=$.Deferred();return l.rnaApi.done(_.bind(function(l){if(n=l.esApi.getEchoSignServiceParams(),t=n.apiURL,s=r.esAuthUiModel.get("access_token"),a=i.QueryParams.AgreementId,_.isEmpty(t)||_.isEmpty(s))return void d.reject();var p=["WAITING_FOR_MY_SIGNATURE","WAITING_FOR_MY_APPROVAL","WAITING_FOR_MY_DELEGATION","WAITING_FOR_MY_ACKNOWLEDGEMENT","WAITING_FOR_MY_ACCEPTANCE","WAITING_FOR_MY_FORM_FILLING","OUT_FOR_SIGNATURE","OUT_FOR_APPROVAL","OUT_FOR_DELIVERY","OUT_FOR_ACCEPTANCE","OUT_FOR_FORM_FILLING","SIGNED","APPROVED","FORM_FILLED","DELIVERED","ACCEPTED","ARCHIVED","CANCELLED","EXPIRED","LIBRARY_TEMPLATE"];e=t+"/api/gateway/search",o={Accept:"application/json",Authorization:"Bearer "+s};var c={};c.scope=[],c.scope.push("sign"),c.roles=[],c.roles.push("ORIGINATOR"),c.agreement_type=[],c.agreement_type.push("ESIGN"),c.state=p,c.create_date={},c.create_date.range={},c.create_date.range.gt={};var h=new Date,u=h.getTime(),g=new Date(u-2592e6),f=g.toISOString();c.create_date.range.gt=f,$.ajax({url:e,type:"POST",modal:!1,headers:o,contentType:"application/json",dataType:"json",data:JSON.stringify(c),global:!1,success:_.bind(function(e){_.isEmpty(e)?d.reject():d.resolve(e)},this),error:_.bind(function(e){403==e.status&&"INVALID_API_ACCESS_POINT"==e.responseJSON.code&&this.options.appApi.rnaApiObj.esApi.authApi.clearESAuthSession(),d.reject()},this)})},this)),d}}),i.GettingAgreementLimitOp}),define("pdmplugins/send-for-sign/js/templates/sfs-app-trial-bar-template",[],function(){return'    <div id="sfs-free-transaction"  style="width:100%; height:100%;">		<div class="sfs-trial-bar-left-view">    		<div class="sfsFreeTransactionTitle theme-text"><%= trial_title_1  %><%= trial_title_2  %><%= trial_title_3  %></div>		</div>		<div class="sfs-trial-bar-right-view">			<div class="sfs-rem-trans-uppgrade-grp">               <div class="sfs-upgrade-grp-inner-div">                   <div class="sfsRemainingTransaction "> <%= remaining_transaction  %> </div>                   <div class="sfs-trial-left-text">                       <%= left %> | </div>				    <div class="sfs-upgrade-btn ">						<%= upgradeNowLabel %>				    </div>               </div>			</div>		</div>    </div>'}),define("pdmplugins/send-for-sign/js/views/sfs-app-trial-bar-view",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/sfs-app-trial-bar-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants"],function(e,i,t,s,n){return i.SFSAppTrialBarView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addUiModelEventListeners()},events:function(){return{"click .sfs-upgrade-btn":"_onUpgradeBtnClick"}},render:function(){e.View.prototype.render.call(this);var i=this.options.appApi.rnaApiObj.esApi.getTotalTrialTransactionsForFreeUser();if(!this.options.sfsAppTrialBarUiModel.get("is_visible"))return this.$el.hide(),this;this.$el.show();var t=this.options.sfsAppTrialBarUiModel.get("remaining_transaction");return 0===this.$el.children().length&&(this.$el.html(this._template({trial_title_1:s.SFS_TRIAL_TITLE7,trial_title_2:i,trial_title_3:s.SFS_TRIAL_TITLE8,left:s.SFS_TRANSACTIONS_LEFT,upgradeNowLabel:s.SFS_SUBSCRIBE_UPGRADE1,remaining_transaction:t})),this._initWrappers(),this._listenForWindowResizeEvents(),this.options.appApi.rnaApi.then(_.bind(function(e){e.isHighContrastEnabled()&&(this.$trialBar.css("border-color","white"),this.$trialBar.css("border","1px"),this.$trialBar.css("border-style","solid"))},this))),this},_initWrappers:function(){this.$remTransCount=this.$(".sfsRemainingTransaction"),this.$upgradeGropup=this.$(".sfs-rem-trans-uppgrade-grp"),this.$trialBar=this.$("#sfs-free-transaction")},_onDataUpdate:function(){console.log("just entered _onDataUpdate"),this.render(),this._updateTrialBarAppearance()},_addUiModelEventListeners:function(){var e=this.options.sfsAppTrialBarUiModel;e.on("change:remaining_transaction",this._onDataUpdate),e.on("change:is_visible",this._onDataUpdate)},_listenForWindowResizeEvents:function(){},_adjustMarginForProgressContainer:function(){},_onUpgradeBtnClick:function(){this.options.appApi.rnaApi.done(_.bind(function(e){this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,n.SEND_FOR_SIG,n.FREE_TRANS_BAR,n.UPGRADE,n.CLICKED]);var i;i=s.SFS_FREE_TRANSACTION_BAR_UPGRADE,_.isEmpty(i)||e.openDecoratedUrl(i)},this))},_updateTrialBarAppearance:function(){var e=this.options.sfsAppTrialBarUiModel.get("remaining_transaction");this.$remTransCount.text(e),e>=2?(this.$trialBar.removeClass(),this.$trialBar.addClass("theme-sfs-trial-bar-state1-color"),this.$upgradeGropup.css("background-color","#2680EB")):1==e?(this.$trialBar.removeClass(),this.$trialBar.addClass("theme-sfs-trial-bar-state2-color"),this.$upgradeGropup.css("background-color","#E68619")):0==e&&(this.$trialBar.removeClass(),this.$trialBar.addClass("theme-sfs-trial-bar-state3-color"),this.$upgradeGropup.css("background-color","#E34850"))
},show:function(){this.render()}}),i.SFSAppTrialBarView}),define("pdmplugins/send-for-sign/js/ops/plugin/show-sfs-trial-bar-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/ops/op","pdmplugins/send-for-sign/js/views/sfs-app-trial-bar-view"],function(e,i){return i.ShowSFSTrialBarOp=e.Op.extend({run:function(){this.options.sfsAppTrialBarUiModel.set("is_visible",!0),this.options.sfsAppTrialBarUiModel.set("remaining_transaction",this.options.remaining_transaction);var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t="FSS_VARIANT_1"==e||"FSS_VARIANT_2"==e;this.options.sfsAppUiModel.hasAppWorkflowRestartedOnce()||this.options.sfsAppTrialBarUiModel.get("upsell_dialog_shown")||0!==this.options.sfsAppTrialBarUiModel.get("remaining_transaction")||"server"!==this.options.data_source||!t||"Share_popup"==i.QueryParams.app||(this.options.sfsAppTrialBarUiModel.set("upsell_dialog_shown",!0),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"})),delete this.options.remaining_transaction}}),i.ShowSFSTrialBarOp}),define("pdmplugins/send-for-sign/js/ops/plugin/share-agreement-op",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-constants","core/utils/http-util"],function(e,i,t,s){var n="";return i.ShareAgreementOp=e.Op.extend({run:function(){var e,o,a,r,l,d,p,c=this.options,h=c.appApi,u=$.Deferred();return h.rnaApi.done(_.bind(function(h){r=h.esApi.getEchoSignServiceParams(),o=r.apiURL,a=c.esAuthUiModel.get("access_token"),d=c.agreementId,(_.isUndefined(d)||0===d)&&(d=i.QueryParams.agreementId),p=c.recipientlist;var g=c.sfsAppSendACopyUiModel.get("agreement_msg");if(console.log("ShareAgreementOp"),_.isEmpty(o)||_.isEmpty(a))return void u.reject();e=o+t.API_SUBPATH_V6+"/agreements/"+d+"/members/share";var f=s.getClientIdQueryParam(),S=f.lastIndexOf("=");l={Accept:"application/json",Authorization:"Bearer "+a,"x-api-client-id":f.substr(S+1)};var m="";return _.isEmpty(p)?void u.reject():(_.each(p,function(e){m+=_.isEmpty(m)?'{"email":"'+e+'","message": "'+g+'"}':',{"email":"'+e+'","message": "'+g+'"}'}),n+='{  "shareCreationInfo": [',n+=m,n+="]}",console.log(n),void $.ajax({url:e,type:"POST",data:n,modal:!1,global:!1,headers:l,contentType:"application/json",dataType:"json",success:_.bind(function(e,i,t){_.isEmpty(e)?u.reject():u.resolve(e,t)},this),error:_.bind(function(e){u.reject({httpRespCode:e.status,httpRespBody:e.responseText})},this)}))},this)),u}}),i.ShareAgreementOp}),define("pdmplugins/send-for-sign/js/ops/plugin/modernize-listen-for-send-copy-flow",["core/ac-core","core/utils/util","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/templates/share/share-popup-view-template","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/views/plugin-content-view",""],function(e,i,t,s,n,o,a){return s.ListenForSendCopy=e.Op.extend({run:function(){var e=$.Deferred();return this._deferred=e,this._sendCopyEvenCallback(),e.promise()},_sendCopyEvenCallback:function(){this._UploadAndOpenLockedCopy(),console.log("send copy op working")},_UploadAndOpenLockedCopy:function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.FSS_SHARE_POPUP,t=this.options.sfsAppSendACopyUiModel.get("current_share_choice");this.options.sfsAppSendACopyUiModel.set("is_locked_copy_workflow",!0),"locked-copy"===t&&(this.options.appApi.siteCatalystApi.logScEvent([i,"LockedCopy"]),this.options.appApi.siteCatalystApi.logScEvent(this.options.appApi.rnaApiObj.esApi.isSavingSignCertifiedCopyEnabled()?[i,"LockedCopy_SaveLocalCopyEnabled"]:[i,"LockedCopy_SaveLocalCopyDisabled"])),this.options.sfsAppSendACopyUiModel.set("is_locked_copy_workflow",!0),this.options.appApi.sessionApi.ensureSignedInV2().then(_.bind(function(){this._notifyProgressBar("StartProgressBar"),this.options.sfsAppSendACopyUiModel.set("workflow_running",!0),s.opFactory.create("SendCompletedCopyOp",_.extend({},this.options)).run().then(_.bind(function(){this._workflowcomplete(),this._notifyProgressBar("AgreementCreated")},this),_.bind(function(e){this._workflowError(e)},this))},this))},_CloseSharePopUpDialog:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"closeSharePopUpDialog"})},_notifyProgressBar:function(e,t){this.options.appApi.rnaApi.done(_.bind(function(s){(!i.isReader()||s.isSignedInReader())&&s.esApi.invokeMethod({methodName:"FSSProgessBar",methodArgs:{State:e,Message:t}})},this))},_workflowError:function(){var e="";"LARGE_FILE_SIZE"==this.options.sfsAppSendACopyUiModel.get("error_code")&&(e=o.FSS_ERR_LARGE_FILE_MSG),this._notifyProgressBar("Error",e)}}),s.ListenForSendCopy}),define("pdmplugins/send-for-sign/js/ops/op-factory",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/ops/plugin/initializing-plugin-op","pdmplugins/send-for-sign/js/ops/plugin/running-plugin-op","pdmplugins/send-for-sign/js/ops/plugin/starting-plugin-op","pdmplugins/send-for-sign/js/ops/listening/listening-for-view-events-op","pdmplugins/send-for-sign/js/ops/listening/listening-for-workflow-events-op","pdmplugins/send-for-sign/js/ops/listening/listening-for-send-page-events-op","pdmplugins/send-for-sign/js/ops/plugin/fetch-send-for-sign-page-url-op","pdmplugins/send-for-sign/js/ops/plugin/fetch-send-for-sign-page-url-v6-op","pdmplugins/send-for-sign/js/ops/plugin/open-send-for-sign-page-in-app-op","pdmplugins/send-for-sign/js/ops/plugin/show-sfs-landing-page-op","pdmplugins/send-for-sign/js/ops/plugin/fetch-manage-agreements-url-op","pdmplugins/send-for-sign/js/ops/plugin/fetch-signing-url-op","pdmplugins/send-for-sign/js/ops/plugin/open-sign-page-in-app-op","pdmplugins/send-for-sign/js/ops/plugin/sfs-files-validator-op","pdmplugins/send-for-sign/js/ops/plugin/sfs-combine-files-op","pdmplugins/send-for-sign/js/ops/plugin/show-sfs-subscribe-page-op","pdmplugins/send-for-sign/js/ops/plugin/show-post-sign-page-op","pdmplugins/send-for-sign/js/ops/plugin/create-send-copy-agreement-op","pdmplugins/send-for-sign/js/ops/plugin/fetch-send-a-copy-view-op","pdmplugins/send-for-sign/js/ops/plugin/do-send-completed-copy-op","pdmplugins/send-for-sign/js/ops/plugin/show-fss-post-sign-page-op","pdmplugins/send-for-sign/js/ops/plugin/fetch-signing-token-op","pdmplugins/send-for-sign/js/ops/plugin/sign-agreement-send-copy-op","pdmplugins/send-for-sign/js/ops/plugin/fetch-agreement-state-op","pdmplugins/send-for-sign/js/ops/plugin/fetch-users-me-settings-op","pdmplugins/send-for-sign/js/ops/plugin/getting-agreement-limit","pdmplugins/send-for-sign/js/ops/plugin/show-sfs-trial-bar-op","pdmplugins/send-for-sign/js/ops/plugin/share-agreement-op","pdmplugins/send-for-sign/js/ops/plugin/get-from-addressbook-op","pdmplugins/send-for-sign/js/ops/plugin/modernize-listen-for-send-copy-flow"],function(e,i){i.OpFactory=e.Op.extend({create:function(e,t){var s=i[e];return s?new s(t):void LOG(0,"AcSendForSign.OpFactory.create: Unrecognized class: "+e)}})}),define("pdmplugins/send-for-sign/js/fsm/sfs-app-fsm",["pdmplugins/esign/js/fsm/fsm","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-error-codes","pdmplugins/esign/js/ac-esign","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/utils/sfs-ts-utils"],function(e,i,t,s,n,o){var a={IDLE:0,WAITING_FOR_WORKFLOW_STATUS:1,WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS:2,WAITING_FOR_LANDING_PAGE_STATUS:3,SHOWING_FILE_SELECTION_DIALOG:4,SHOWING_NETWORK_OFFLINE_MODE:5,SHOWING_ERROR_MSG:6,WAITING_FOR_SIGN_WORKFLOW_STATUS:7,WAITING_FOR_FSS_WORKFLOW_STATUS:8};return i.SFSAppFSM=e.extend({_initFSM:function(){this._setSupportedStates(_.values(a)),this._setCurrentState(a.IDLE),this._defineEventTransitions()},_defineEventTransitions:function(){this._defineTransition(a.IDLE,"AppStartNewWorkflow",function(e){this._setCurrentState(a.WAITING_FOR_WORKFLOW_STATUS),this._invokeController("AppListenForESAuthStatusChangeOp",e),this._invokeController("AppStartNewWorkflowOp",e)}),this._defineTransition(a.IDLE,"AppStartNewUnifiedShareWorkflow",function(e){this._setCurrentState(a.WAITING_FOR_WORKFLOW_STATUS),this._invokeController("AppListenForESAuthStatusChangeOp",e),this._invokeController("AppStartNewUnifiedShareWorkflowOp",e)}),this._defineTransition(a.IDLE,"AppStartNewSignWorkflow",function(e){this._setCurrentState(a.WAITING_FOR_SIGN_WORKFLOW_STATUS),this._invokeController("AppStartNewSignWorkflowOp",e)}),this._defineTransition(a.IDLE,"AppStartNewFSSWorkflow",function(e){console.log("sfs-app-fsm:: AppStartNewFSSWorkflow"),this._setCurrentState(a.WAITING_FOR_FSS_WORKFLOW_STATUS),this._invokeController("AppStartNewFSSWorkflowOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppShowLandingPage",function(e){this._setCurrentState(a.WAITING_FOR_LANDING_PAGE_STATUS),this._invokeController("AppShowLandingPageOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppHideLandingPage",function(e){this._setCurrentState(a.WAITING_FOR_WORKFLOW_STATUS),this._invokeController("AppHideLandingPageOp",e)}),this._defineTransition(a.WAITING_FOR_LANDING_PAGE_STATUS,"UserClickedBrowseFileDlg",function(e){this._setCurrentState(a.SHOWING_FILE_SELECTION_DIALOG),this._invokeController("AppNotifyWorkflowToShowBrowseFileDlgOp",e)}),this._defineTransition(a.WAITING_FOR_LANDING_PAGE_STATUS,"UserClickedSendACopyBtn",function(e){e.appApi.networkConnectivityApi.isOnline()?this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.isAnySFSWorkflowsRunning().then(_.bind(function(i){if(i)e.errorOptions={errorType:t.MultipleWorkflowsRunning,noResetApp:!0},this._setCurrentState(a.SHOWING_ERROR_MSG),this._invokeController("AppShowErrorMessageOp",e);else{this._invokeController("AppStartSendACopyWorkflow",e)}},this))},this)):(i.sfsAppApi.handleNetworkDisconnectedEvent(),i.sfsAppApi.workflowApi.handleNetworkDisconnectedEvent(),i.sfsAppApi.subscriptionApi.handleNetworkDisconnectedEvent(),s.esApi.authApi.handleNetworkDisconnectedEvent())}),this._defineTransition(a.WAITING_FOR_LANDING_PAGE_STATUS,"UserClickedSendFilesBtn",function(e){e.appApi.networkConnectivityApi.isOnline()?this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.isAnySFSWorkflowsRunning().then(_.bind(function(i){i?(e.errorOptions={errorType:t.MultipleWorkflowsRunning,noResetApp:!0},this._setCurrentState(a.SHOWING_ERROR_MSG),this._invokeController("AppShowErrorMessageOp",e)):(this._setCurrentState(a.WAITING_FOR_WORKFLOW_STATUS),this._invokeController("AppNotifyLandingPageSuccess",e))},this))},this)):(i.sfsAppApi.handleNetworkDisconnectedEvent(),i.sfsAppApi.workflowApi.handleNetworkDisconnectedEvent(),i.sfsAppApi.subscriptionApi.handleNetworkDisconnectedEvent(),s.esApi.authApi.handleNetworkDisconnectedEvent())}),this._defineTransition(a.WAITING_FOR_LANDING_PAGE_STATUS,"UserClickedPrepareFormBtn",function(e){_.size(e.appSelectedFiles)>1?(e.errorOptions={errorType:t.PrepareFormsMultipleFilesSelect,noResetApp:!0},this._setCurrentState(a.SHOWING_ERROR_MSG),this._invokeController("AppShowErrorMessageOp",e)):this._invokeController("AppLaunchFormsAppOp",e)}),this._defineTransition(a.WAITING_FOR_LANDING_PAGE_STATUS,"UserClickedRemoveFile",function(e){this._setCurrentState(a.WAITING_FOR_LANDING_PAGE_STATUS),this._invokeController("AppRemoveFileFromSelectedFileListOp",e),this._invokeController("AppNotifyFileSelectionToLandingPageOp",e)}),this._defineTransition(a.WAITING_FOR_LANDING_PAGE_STATUS,"ErrorOccured",function(e){this._setCurrentState(a.WAITING_FOR_WORKFLOW_STATUS),this._invokeController("AppNotifyLandingPageErrorOp",e)}),this._defineTransition(a.SHOWING_FILE_SELECTION_DIALOG,"FilesAreSelected",function(e){this._setCurrentState(a.WAITING_FOR_LANDING_PAGE_STATUS),this._invokeController("AppNotifyFileSelectionToLandingPageOp",e)}),this._defineTransition(a.SHOWING_FILE_SELECTION_DIALOG,"FilesNotSelected",function(){this._setCurrentState(a.WAITING_FOR_LANDING_PAGE_STATUS)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppEvaluateESUserSubscription",function(e){this._setCurrentState(a.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS),this._invokeController("AppEvaluateESUserSubscriptionOp",e)}),this._defineTransition(a.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS,"AppESUserFoundPaid",function(e){this._setCurrentState(a.WAITING_FOR_WORKFLOW_STATUS),this._invokeController("AppNotifyESUserGotPaidSubscriptionOp",e)}),this._defineTransition(a.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS,"AppESUserFoundFree",function(e){this._setCurrentState(a.WAITING_FOR_WORKFLOW_STATUS),this._invokeController("AppNotifyESUserGotFreeSubscriptionOp",e)}),this._defineTransition(a.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS,"IMSAuthSessionCreateFailure",function(){this._setCurrentState(a.WAITING_FOR_LANDING_PAGE_STATUS)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppUploadProgressEvent",function(e){this._invokeController("AppHandleUploadProgressEventOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"ESAuthSessionCreateSuccess",function(e){i.skipUploadingForSfsOldLandingPage||this._invokeController("ShowDummyProgressOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"ESAuthSessionInProgress",function(e){i.skipUploadingForSfsOldLandingPage||this._invokeController("ShowDummyProgressOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppWorkflowStatusEvent",function(e){this._invokeController("AppHandleWorkflowStatusEventOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppWorkflowSendPageEvent",function(e){if(this._invokeController("AppHandleWorkflowSendPageEventOp",e),e.send_page_status.isVisible){var t=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),s=t+"-"+o.getFillSignReaderFreeTransVariant(this.options);this.options.appApi.siteCatalystApi.logScEvent(i.isAdvancedSign?[s,n.ADVANCED_WORKFLOW,n.AUTHORING_PAGE,n.LOADED,i.IsTrialUser?n.FREE_USER:n.ENTITLED_USER]:[s,n.AUTHORING_PAGE,n.LOADED,i.IsTrialUser?n.FREE_USER:n.ENTITLED_USER])}}),this._defineTransition(a.WAITING_FOR_SIGN_WORKFLOW_STATUS,"AppWorkflowSignPageEvent",function(e){this._invokeController("AppHandleWorkflowSignPageEventOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppWorkflowSuccess",function(e){this._setCurrentState(a.IDLE),this._invokeController("AppUnListenForESAuthStatusChangeOp",e),this._invokeController("AppHandleWorkflowSuccessOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppWorkflowFailure",function(e){this._setCurrentState(a.IDLE),this._invokeController("HideDummyProgressOp",e),this._invokeController("AppUnListenForESAuthStatusChangeOp",e),this._invokeController("AppHandleWorkflowFailureOp",e),this._invokeController("RestartAppOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"AppAbortWorkflowEvent",function(e){this._invokeController("AppAbortWorkflowOp",e),this._setCurrentState(a.IDLE)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"ShowWaitCursor",function(e){this._invokeController("ShowWaitCursorOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"HideWaitCursor",function(e){this._invokeController("HideWaitCursorOp",e)}),this._defineTransition(a.WAITING_FOR_WORKFLOW_STATUS,"RestartApp",function(e){this._invokeController("RestartAppOp",e)}),this._defineTransition(this.SPECIAL_FSM_STATE,"AppSessionSignOut",function(e){this._setCurrentState(a.IDLE),this._invokeController("HideDummyProgressOp",e),this._invokeController("AppUnListenForESAuthStatusChangeOp",e),this._invokeController("RestartAppOp",e)}),this._defineTransition(this.SPECIAL_FSM_STATE,"AppShowErrorMessage",function(e){this._getCurrentState()!==a.SHOWING_NETWORK_OFFLINE_MODE&&(this._setCurrentState(a.SHOWING_ERROR_MSG),this._invokeController("AppShowErrorMessageOp",e)),this._invokeController("HideDummyProgressOp",e),this._invokeController("AppUnListenForESAuthStatusChangeOp",e)}),this._defineTransition(a.SHOWING_ERROR_MSG,"AppErrorDialogDismissed",function(e){this._invokeController("AppHideErrorMessageOp",e),e.errorOptions&&(e.errorOptions.noResetApp?this._setCurrentState(this._getPreviousState()):(this._invokeController("RestartAppOp",e),this._setCurrentState(a.IDLE)))}),this._defineTransition(this.SPECIAL_FSM_STATE,"AppNetworkDisconnectedEvent",function(e){var i=this._getCurrentState();i!==a.SHOWING_ERROR_MSG&&(this._setCurrentState(a.SHOWING_NETWORK_OFFLINE_MODE),this._invokeController("AppShowNetworkOfflineViewOp",e)),this._invokeController("HideDummyProgressOp",e),this._invokeController("AppUnListenForESAuthStatusChangeOp",e)}),this._defineTransition(a.SHOWING_NETWORK_OFFLINE_MODE,"AppOfflineViewDismissed",function(e){this._setCurrentState(a.IDLE),this._invokeController("AppHideNetworkOfflineViewOp",e),this._invokeController("RestartAppOp",e)}),this._defineTransition(a.WAITING_FOR_LANDING_PAGE_STATUS,"CombineSelectedFilesEvent",function(e){this._setCurrentState(a.WAITING_FOR_LANDING_PAGE_STATUS),this._invokeController("SFSCombineFilesOp",e),this.options.appApi.displayApi.showSpinner(!1)}),this._defineTransition(a.WAITING_FOR_LANDING_PAGE_STATUS,"CombineSelectedFilesEventFailed",function(e){e.errorOptions={errorType:t.CombineFilesFailed,noResetApp:!0,appErrorPromise:$.Deferred()},this._setCurrentState(a.SHOWING_ERROR_MSG),this._invokeController("AppShowErrorMessageOp",e)})}}),i.SFSAppFSM}),define("pdmplugins/send-for-sign/js/fsm/sfs-workflow-fsm",["core/ac-core","pdmplugins/esign/js/fsm/fsm","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-error-codes","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","core/utils/util","pdmplugins/send-for-sign/js/utils/sfs-ts-utils"],function(e,i,t,s,n,o,a){var r={IDLE:0,FETCHING_ACTIVE_DOCUMENT:1,WAITING_FOR_LANDING_PAGE_ACTION:2,VALIDATING_OPENED_FILE:3,VALIDATING_DLG_SELECTED_FILES:4,WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS:5,UPLOADING_ALL_FILES_TO_ECHOSIGN:6,FETCHING_PREPARE_FORMS_RECIPIENTS:7,FETCHING_SEND_FOR_SIGN_PAGE_URL_OP:8,OPENING_SEND_FOR_SIGN_PAGE_IN_APP:9,LISTENING_FOR_SEND_PAGE_EVENTS:10,CREATING_ES_AUTH_SESSION:11,FETCHING_MANAGE_AGREEMENTS_URL:12,CREATING_ES_AUTH_SESSION_FOR_MANAGE_URL:13,SHOWING_FILE_BROWSE_DLG:14,SHOWING_INVALID_FILES_ERROR_MSG:15,SHOWING_WORKFLOW_FAILURE_MSG:16,WAITING_TO_FETCH_SFS_PAGE_URL:17,CREATING_ES_AUTH_SESSION_FOR_SIGNING_URL:18,FETCHING_SIGNING_URL:19,OPENING_IN_APP_SIGN_PAGE:20,LISTENING_FOR_INAPP_SIGN_PAGE_EVENTS:21,SHOWING_AGREEMENT_COMPLETION_WORKFLOW:22,SHOWING_SIGN_WORKFLOW_FAILURE_MSG:23,FETCHING_ACTIVE_DOCUMENT_FSS:24,TRYING_FREE_TRANSACTIONS:25};return t.SFSWorkflowFSM=i.extend({_initFSM:function(){this._setSupportedStates(_.values(r)),this._setCurrentState(r.IDLE),this._defineEventTransitions()},_defineEventTransitions:function(){this._defineTransition(r.IDLE,"StartWorkflow",function(e){t.IsTrialUser=!1,this._invokeController("CheckTrialBarStatusOp",e);var i=e.workflowUiModel;i.get("workflow_restarted_once")?(this._setCurrentState(r.WAITING_FOR_LANDING_PAGE_ACTION),this._invokeController("ShowAppLandingPageOp",e),this.options.appApi.rnaApi.done(_.bind(function(i){o.isReader()&&i.isSignedInReader()&&i.esApi.isTrialFeatureEnabled()&&!i.esApi.isSpecialSignUser()&&(console.log("before ShowCachedTrialInfoIfExistsOp"),this._invokeController("ShowCachedTrialInfoIfExistsOp",e))},this))):(this._setCurrentState(r.FETCHING_ACTIVE_DOCUMENT),this._invokeController("FetchActiveDocumentOp",e))}),this._defineTransition(r.IDLE,"StartFSSWorkflow",function(e){console.log("sfs-workflow-fsm::StartFSSWorkflow"),this._setCurrentState(r.FETCHING_ACTIVE_DOCUMENT_FSS),this._invokeController("FetchActiveDocumentOp",e)}),this._defineTransition(r.IDLE,"StartUnifiedShareWorkflow",function(e){this._setCurrentState(r.WAITING_TO_FETCH_SFS_PAGE_URL),this._invokeController("GetUnifiedShareParamsOp",e),this._invokeController("SetSFSWorkflowInProgressOp",e)}),this._defineTransition(r.IDLE,"StartInAppSignWorkflow",function(e){this.options.appApi.networkConnectivityApi.isOnline()?(this.options.appApi.displayApi.showSpinner(!0),this._setCurrentState(r.CREATING_ES_AUTH_SESSION_FOR_SIGNING_URL),this._invokeController("CreateESAuthSessionOp",e)):(this.options.appApi.displayApi.clearSpinnerRefs(),t.sfsAppApi.handleNetworkDisconnectedEvent(),t.sfsAppApi.workflowApi.handleNetworkDisconnectedEvent(),t.sfsAppApi.subscriptionApi.handleNetworkDisconnectedEvent())}),this._defineTransition(this.SPECIAL_FSM_STATE,"AbortWorkflow",function(e){this._setCurrentState(r.IDLE),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("NotifyWorkflowFailureOp",e)}),this._defineTransition(r.FETCHING_ACTIVE_DOCUMENT,"ActiveDocFound",function(e){e.filesToValidate=e.workflowSelectedFiles,this._setCurrentState(r.VALIDATING_OPENED_FILE),this._invokeController("ValidateSelectedFilesOp",e)}),this._defineTransition(r.VALIDATING_OPENED_FILE,"FilesValidationComplete",function(e){e.workflowSelectedFiles=e.validFiles,this._setCurrentState(r.WAITING_FOR_LANDING_PAGE_ACTION),this._invokeController("ShowAppLandingPageOp",e),console.log("FilesValidationComplete"),this.options.appApi.rnaApi.done(_.bind(function(i){o.isReader()&&i.isSignedInReader()&&i.esApi.isTrialFeatureEnabled()&&!i.esApi.isSpecialSignUser()&&"FSS_RHP"!=t.QueryParams.app&&(console.log("before ShowCachedTrialInfoIfExistsOp"),this._invokeController("ShowCachedTrialInfoIfExistsOp",e),console.log("refresh trial from server"),this._invokeController("CheckTrialBarStatusOp",e))},this))}),this._defineTransition(r.FETCHING_ACTIVE_DOCUMENT,"ActiveDocNotFound",function(e){this._setCurrentState(r.WAITING_FOR_LANDING_PAGE_ACTION),this._invokeController("ShowAppLandingPageOp",e),this.options.appApi.rnaApi.done(_.bind(function(i){o.isReader()&&i.isSignedInReader()&&i.esApi.isTrialFeatureEnabled()&&!i.esApi.isSpecialSignUser()&&(console.log("start checking for trial"),this._invokeController("ShowCachedTrialInfoIfExistsOp",e),this._invokeController("CheckTrialBarStatusOp",e))},this))}),this._defineTransition(r.WAITING_FOR_LANDING_PAGE_ACTION,"ShowFileBrowseDlg",function(e){this._setCurrentState(r.SHOWING_FILE_BROWSE_DLG),this._invokeController("ShowFileSelectionDlgOp",e)}),this._defineTransition(r.SHOWING_FILE_BROWSE_DLG,"FilesAreSelected",function(e){e.filesToValidate=e.dlgSelectedFiles,this._setCurrentState(r.VALIDATING_DLG_SELECTED_FILES),this._invokeController("ValidateSelectedFilesOp",e)}),this._defineTransition(r.SHOWING_FILE_BROWSE_DLG,"FilesNotSelected",function(e){this._invokeController("NotifyDlgFilesNotSelectedToClientsOp",e),this._setCurrentState(r.WAITING_FOR_LANDING_PAGE_ACTION)}),this._defineTransition(r.WAITING_FOR_LANDING_PAGE_ACTION,"FileSelectedInLandingPage",function(e){this._setCurrentState(r.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS),this._invokeController("HideAppLandingPageOp",e),this._invokeController("HideTrialBarOp",e),this._invokeController("SetSFSWorkflowInProgressOp",e),this._invokeController("CheckESUserSubscriptionOp",e)}),this._defineTransition(r.WAITING_FOR_LANDING_PAGE_ACTION,"ErrorOccuredInLandingPage",function(e){this._setCurrentState(r.IDLE),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("NotifyWorkflowFailureOp",e)}),this._defineTransition(r.VALIDATING_DLG_SELECTED_FILES,"FilesValidationComplete",function(e){var i=e.invalidFiles,t=e.validFiles;e.dlgSelectedFiles=t,_.isEmpty(e.dlgSelectedFiles)?this._invokeController("NotifyDlgFilesNotSelectedToClientsOp",e):this._invokeController("NotifyDlgFilesSelectedToClientsOp",e),_.isEmpty(i)?this._setCurrentState(r.WAITING_FOR_LANDING_PAGE_ACTION):(e.errorOptions={errorType:i[0].errorCode,invalidFiles:i,multipleFiles:_.size(i)>1,noResetApp:!0},this._setCurrentState(r.SHOWING_INVALID_FILES_ERROR_MSG),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e))}),this._defineTransition(r.SHOWING_INVALID_FILES_ERROR_MSG,"ErrorDialogDismissed",function(e){this._setCurrentState(r.WAITING_FOR_LANDING_PAGE_ACTION),this._invokeController("ShowAppLandingPageOp",e),this.options.appApi.rnaApi.done(_.bind(function(i){o.isReader()&&this.options.appApi.sessionApi.isSignedInReader()&&i.esApi.isTrialFeatureEnabled()&&!i.esApi.isSpecialSignUser()&&(console.log("start checking for trial"),this._invokeController("ShowCachedTrialInfoIfExistsOp",e),this._invokeController("CheckTrialBarStatusOp",e))},this))}),this._defineTransition(r.SHOWING_SIGN_WORKFLOW_FAILURE_MSG,"ErrorDialogDismissed",function(e){this._invokeController("ClearInAppSigningWorkflowInProgressOp",e),this.options.appApi.rnaApiObj.esApi.closeInAppSignApp()}),this._defineTransition(r.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS,"ESUserFoundPaid",function(e){this._setCurrentState(r.CREATING_ES_AUTH_SESSION),this._invokeController("ClearSignTrialInfoOp",e),this._invokeController("CreateESAuthSessionOp",e)}),this._defineTransition(r.WAITING_FOR_LANDING_PAGE_ACTION,"TrialAdobeSignUser",function(e){console.log("calling GettingAgreementLimitOp"),t.IsTrialUser=!0,this._invokeController("GettingAgreementLimitOp",e)}),this._defineTransition(r.WAITING_FOR_LANDING_PAGE_ACTION,"NotTrialAdobeSignUser",function(e){t.IsTrialUser=!1,this._invokeController("ClearSignTrialInfoOp",e),this._invokeController("HideTrialBarOp",e)}),this._defineTransition(r.WAITING_FOR_LANDING_PAGE_ACTION,"GettingESLimitSuccess",function(e){this._invokeController("ShowSFSTrialBarOp",e)}),this._defineTransition(r.CREATING_ES_AUTH_SESSION,"ESAuthSessionCreateSuccess",function(e){t.skipUploadingForSfsOldLandingPage?(t.skipUploadingForSfsOldLandingPage=!1,this._invokeController("RestartWorkflowOp",e)):(this._setCurrentState(r.UPLOADING_ALL_FILES_TO_ECHOSIGN),this._invokeController("CreateUploadRequestsQueueOp",e),this._invokeController("NotifyUploadStartedOp",e),this._invokeController("StartUploadRequestForAllFilesOp",e))}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"BeginNextFileUpload",function(e){this._invokeController("UploadFileToEchoSignOp",e)}),this._defineTransition(r.CREATING_ES_AUTH_SESSION,"ESAuthSessionCreateFailure",function(e){this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),this._invokeController("ClearSFSWorkflowInProgressOp",e),e.errorOptions={errorType:s.ESAuthSessionCreateError},this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(r.SHOWING_WORKFLOW_FAILURE_MSG,"ErrorDialogDismissed",function(e){this._setCurrentState(r.IDLE),this._invokeController("NotifyWorkflowFailureOp",e)}),this._defineTransition(r.SHOWING_SIGN_WORKFLOW_FAILURE_MSG,"ErrorDialogDismissed",function(){this._setCurrentState(r.IDLE)}),this._defineTransition(r.SHOWING_WORKFLOW_FAILURE_MSG,"ErrorDialogAlreadyShown",function(e){this._setCurrentState(r.IDLE),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("NotifyWorkflowFailureOp",e)}),this._defineTransition(r.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS,"ESUserFoundFree",function(e){this.options.appApi.rnaApi.done(_.bind(function(i){o.isReader()&&i.esApi.isTrialFeatureEnabled()?i.esApi.isSpecialSignUser()?(this._setCurrentState(r.CREATING_ES_AUTH_SESSION),this._invokeController("CreateESAuthSessionOp",e)):(this._setCurrentState(r.TRYING_FREE_TRANSACTIONS),this._invokeController("TryFreeTransactionWorkflowOp",e)):(this._setCurrentState(r.IDLE),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("NotifyWorkflowFailureOp",e))},this))}),this._defineTransition(r.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS,"TrialAdobeSignUser",function(e){t.IsTrialUser=!0,this._invokeController("GettingAgreementLimitOp",e)}),this._defineTransition(r.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS,"NotTrialAdobeSignUser",function(e){t.IsTrialUser=!1,this._setCurrentState(r.WAITING_FOR_LANDING_PAGE_ACTION),this._invokeController("ClearSignTrialInfoOp",e),this._invokeController("HideTrialBarOp",e)}),this._defineTransition(r.WAITING_FOR_ES_USER_SUBSCRIPTION_STATUS,"GettingESLimitSuccess",function(e){this._invokeController("ResumeFreeUserWorkflow",e)}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"UploadStarted",function(e){this._invokeController("ListenForUploadProgressEventsOp",e)}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"UploadFinished",function(e){this._invokeController("ProcessUploadFinishedResultOp",e)}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"UploadQueued",function(e){this._setCurrentState(r.UPLOADING_ALL_FILES_TO_ECHOSIGN),this._invokeController("ListenForUploadProgressEventsOp",e)}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"UploadProgress",function(e){this._setCurrentState(r.UPLOADING_ALL_FILES_TO_ECHOSIGN),this._invokeController("NotifyUploadProgressOp",e)}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"UploadSuccess",function(e){this._invokeController("NotifyUploadSuccessOp",e)}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"UploadFailure",function(e){var i=e.currentFileUploadReq,t=i.responseObj,n=t.respStatusCode,o=t.respBody,a=s.FileUploadError;try{o=JSON.parse(o)}catch(l){}403===n?"LARGE_FILE_SIZE"===o.code?a=s.LargeFileSize:"INVALID_API_ACCESS_POINT"===o.code&&this._invokeController("ClearESAuthSessionOp",e):401===n&&this._invokeController("ClearESAuthSessionOp",e);var d=o?o.message?o.message:o:sfsUiStrings.SFS_ERR_GENERAL_WORKFLOW_FAILURE;e.errorOptions={errorType:a,errorMsg:d},this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e),this._invokeController("NotifyUploadFailureOp",e)}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"AbortWorkflow",function(e){this._setCurrentState(r.IDLE),this._invokeController("CancelUploadOp",e),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("NotifyWorkflowFailureOp",e)}),this._defineTransition(r.UPLOADING_ALL_FILES_TO_ECHOSIGN,"FetchPrepareFormRecipients",function(e){this._setCurrentState(r.FETCHING_PREPARE_FORMS_RECIPIENTS),this._invokeController("FetchPrepareFormRecipientsOp",e)}),this._defineTransition(r.FETCHING_PREPARE_FORMS_RECIPIENTS,"FetchSendForSignPageUrl",function(e){this._setCurrentState(r.FETCHING_SEND_FOR_SIGN_PAGE_URL_OP),this._invokeController("FetchSendForSignaturePageUrlOp",e)}),this._defineTransition(r.WAITING_TO_FETCH_SFS_PAGE_URL,"FetchSendForSignPageUrl",function(e){this._setCurrentState(r.FETCHING_SEND_FOR_SIGN_PAGE_URL_OP),this._invokeController("FetchSFSPageUrlExternalParamsOp",e)}),this._defineTransition(r.FETCHING_SEND_FOR_SIGN_PAGE_URL_OP,"SendUrlFetchSuccess",function(e){this._setCurrentState(r.OPENING_SEND_FOR_SIGN_PAGE_IN_APP),this._invokeController("NotifySendUrlFetchSuccessOp",e),this._invokeController("OpenSendForSignPageInAppOp",e),this._invokeController("ListenForSendPageEventsOp",e)}),this._defineTransition(r.FETCHING_SEND_FOR_SIGN_PAGE_URL_OP,"SendUrlFetchFailure",function(e){this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),this.options.appApi.siteCatalystApi.logScEvent([n.SEND_FOR_SIG,n.FETCH_SEND_PG_URL,n.FAILURE]);var i=e.sendUrlFetchHttpCode,o=e.sendUrlFetchRespBody,a=s.SendUrlFetchError;try{o=JSON.parse(o)}catch(l){}if(401===i)"AUTOLOGIN_DENIED"===o.code&&(a=s.ESAutoLoginDenied),this._invokeController("ClearESAuthSessionOp",e);else if(403===i)if("SEND_LIMIT_EXCEEDED"===o.code){var d=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),p=d==FSS_VARIANT_1||d==FSS_VARIANT_2;1==t.IsTrialUser&&p&&this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"})}else"PERMISSION_DENIED"===o.code&&(a=s.PermissionDenied);else 400===i&&"VIEW_NOT_AVAILABLE"===o.code&&(a=s.PageLimitExceedError);var c=o?o.message?o.message:o:sfsUiStrings.SFS_ERR_GENERAL_WORKFLOW_FAILURE;e.errorOptions={errorType:a,errorMsg:c},this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(r.OPENING_SEND_FOR_SIGN_PAGE_IN_APP,"OpenSendPageSuccess",function(e){this._setCurrentState(r.LISTENING_FOR_SEND_PAGE_EVENTS),this._invokeController("HandleOpenSendPageSuccessOp",e)
}),this._defineTransition(r.OPENING_SEND_FOR_SIGN_PAGE_IN_APP,"OpenSendPageFailure",function(e){this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),this.options.appApi.siteCatalystApi.logScEvent([n.SEND_FOR_SIG,n.OPEN_SEND_PAGE_IN_APP,n.FAILURE]),e.errorOptions={errorType:s.OpenSendPageError},this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(r.LISTENING_FOR_SEND_PAGE_EVENTS,"PostSendPageLoadEvent",function(e){this._invokeController("ClearSFSWorkflowInProgressOp",e),this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.logSignServicesActivity()},this))}),this._defineTransition(r.LISTENING_FOR_SEND_PAGE_EVENTS,"AuthoringSendPageLoadEvent",function(){var e=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),i=e+"-"+a.getFillSignReaderFreeTransVariant(this.options);this.options.appApi.siteCatalystApi.logScEvent(t.isAdvancedSign?[i,n.SIGN_EVENT,n.ADVANCED_WORKFLOW,n.AUTHORING_PAGE,n.LOADED,t.IsTrialUser?n.FREE_USER:n.ENTITLED_USER]:[i,n.SIGN_EVENT,n.AUTHORING_PAGE,n.LOADED,t.IsTrialUser?n.FREE_USER:n.ENTITLED_USER])}),this._defineTransition(this.SPECIAL_FSM_STATE,"PostSendPageLoadEvent",function(e){this._invokeController("HideWaitCursorOp",e),this._invokeController("ClearSFSWorkflowInProgressOp",e)}),this._defineTransition(r.LISTENING_FOR_SEND_PAGE_EVENTS,"PostSendPageClickEvent",function(e){var i=e.sendPageEventData,t=i.target;switch(t){case"MANAGE_LINK":this.options.appApi.siteCatalystApi.logScEvent([n.SEND_FOR_SIG,n.POST_SEND_PAGE,n.MANAGE,n.CLICKED]),e.agreementId=i.apiAgreementId,this._setCurrentState(r.CREATING_ES_AUTH_SESSION_FOR_MANAGE_URL),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ShowWaitCursorOp",e),this._invokeController("CreateESAuthSessionOp",e);break;case"SEND_ANOTHER_LINK":this.options.appApi.siteCatalystApi.logScEvent([n.SEND_FOR_SIG,n.POST_SEND_PAGE,n.SEND_ANOTHER,n.CLICKED]),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("RestartWorkflowOp",e)}}),this._defineTransition(r.LISTENING_FOR_SEND_PAGE_EVENTS,"SendPageSessionTimeOutEvent",function(e){var i=e.sendPageEventData,t=e.sendPageName;_.isUndefined(i)||("AUTHORING"!==t&&"SIMPLIFIED_AUTHORING"!==t||"PRE_SESSION_TIMEOUT"!==i.message)&&("PRE_SESSION_TIMEOUT"===i.message||"POST_SESSION_TIMEOUT"===i.message)&&(this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),e.errorOptions={errorType:s.SendPageSessionTimeOut},this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e))}),this._defineTransition(r.LISTENING_FOR_SEND_PAGE_EVENTS,"SendPageErrorEvent",function(e){this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(r.LISTENING_FOR_INAPP_SIGN_PAGE_EVENTS,"SignPageErrorEvent",function(e){this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ClearInAppSigningWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(r.LISTENING_FOR_INAPP_SIGN_PAGE_EVENTS,"InAppSessionTimeOut",function(e){this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),e.errorOptions={errorType:s.InAppSessionTimeOutError,showOpaqueOverlay:!0},this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ClearInAppSigningWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(r.CREATING_ES_AUTH_SESSION_FOR_MANAGE_URL,"ESAuthSessionCreateSuccess",function(e){this._setCurrentState(r.FETCHING_MANAGE_AGREEMENTS_URL),this._invokeController("FetchManageAgreementsURLOp",e)}),this._defineTransition(r.CREATING_ES_AUTH_SESSION_FOR_MANAGE_URL,"ESAuthSessionCreateFailure",function(e){this._setCurrentState(r.LISTENING_FOR_SEND_PAGE_EVENTS),this._invokeController("HideWaitCursorOp",e)}),this._defineTransition(r.CREATING_ES_AUTH_SESSION_FOR_SIGNING_URL,"ESAuthSessionCreateSuccess",function(e){this._setCurrentState(r.FETCHING_SIGNING_URL),console.log("sfs-workflow-fsm: CreateESAuthSessionOp :  Success"),this._invokeController("FetchSigningURLOp",e)}),this._defineTransition(r.CREATING_ES_AUTH_SESSION_FOR_SIGNING_URL,"ESAuthSessionCreateFailure",function(e){this._setCurrentState(r.SHOWING_SIGN_WORKFLOW_FAILURE_MSG),this.options.appApi.displayApi.showSpinner(!1),this._invokeController("HideWaitCursorOp",e),e.errorOptions={errorType:s.ESAuthSessionCreateForSigningUrlError,noResetApp:!0},this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ClearInAppSigningWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(r.LISTENING_FOR_INAPP_SIGN_PAGE_EVENTS,"ShowPostSignPage",function(e){this._invokeController("ClearInAppSigningWorkflowInProgressOp",e),this._invokeController("ShowPostSignPageOp",e)}),this._defineTransition(r.FETCHING_MANAGE_AGREEMENTS_URL,"FetchManageAgreementURLSuccess",function(e){this._setCurrentState(r.LISTENING_FOR_SEND_PAGE_EVENTS),this._invokeController("LaunchManageAgreementsURLOp",e),this._invokeController("HideWaitCursorOp",e)}),this._defineTransition(r.FETCHING_MANAGE_AGREEMENTS_URL,"FetchManageAgreementURLFailure",function(e){this._setCurrentState(r.SHOWING_WORKFLOW_FAILURE_MSG),this._invokeController("HideWaitCursorOp",e),e.errorOptions={errorType:s.FetchManageAgreementURLError},this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(r.FETCHING_SIGNING_URL,"FetchSigningURLSuccess",function(e){this._setCurrentState(r.LISTENING_FOR_INAPP_SIGN_PAGE_EVENTS),console.log("sfs-workflow-fsm: FetchSigningURLSuccess :  Success"),this._invokeController("ListenForSignPageEventsOp",e),this._invokeController("OpenSignPageInAppOp",e),this.options.appApi.displayApi.clearSpinnerRefs()}),this._defineTransition(r.FETCHING_SIGNING_URL,"FetchSigningURLFailure",function(e){this.options.appApi.displayApi.clearSpinnerRefs(),this._setCurrentState(r.SHOWING_SIGN_WORKFLOW_FAILURE_MSG),this._invokeController("HideWaitCursorOp",e),e.errorOptions={errorType:s.FetchSigningURLInAppSigningError,noResetApp:!0},this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ClearInAppSigningWorkflowInProgressOp",e),this._invokeController("ShowWorkflowErrorMsgOp",e)}),this._defineTransition(this.SPECIAL_FSM_STATE,"SessionSignOut",function(e){this._setCurrentState(r.IDLE),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ClearInAppSigningWorkflowInProgressOp",e),this.options.appApi.displayApi.showSpinner(!1)}),this._defineTransition(this.SPECIAL_FSM_STATE,"NetworkDisconnectedEvent",function(e){this._setCurrentState(r.IDLE),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("ClearInAppSigningWorkflowInProgressOp",e),this.options.appApi.displayApi.showSpinner(!1)}),this._defineTransition(r.FETCHING_ACTIVE_DOCUMENT_FSS,"ActiveDocFound",function(e){console.log("FSSActiveDocFound"),this._invokeController("SetActiveDocumentForFSSOp",e)}),this._defineTransition(r.TRYING_FREE_TRANSACTIONS,"UploadFiles",function(e){this._setCurrentState(r.CREATING_ES_AUTH_SESSION),this._invokeController("CreateESAuthSessionOp",e)}),this._defineTransition(r.TRYING_FREE_TRANSACTIONS,"TransactionsExhausted",function(e){var i=this.options.appApi.rnaApiObj.esApi.getFillSignVariant(),t="FSS_VARIANT_1"==i||"FSS_VARIANT_2"==i;t&&this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"launchUpsellForAdobeSign"}),this._invokeController("ClearSFSWorkflowInProgressOp",e),this._invokeController("RestartWorkflowOp",e)})}}),t.SFSWorkflowFSM}),define("pdmplugins/send-for-sign/js/templates/sfs-error-body-template",[],function(){return"<div>  <div class='sfs-error-body-heading'></div>  <div class='sfs-error-body-content'></div></div>"}),define("pdmplugins/send-for-sign/js/fsm/sfs-error-fsm",["pdmplugins/esign/js/fsm/fsm","pdmplugins/send-for-sign/js/ac-send-for-sign","i18n!pdmplugins/send-for-sign/js/nls/ui-strings","pdmplugins/send-for-sign/js/templates/sfs-error-body-template","pdmplugins/send-for-sign/js/constants/sfs-error-codes"],function(e,i,t,s,n){var o={IDLE:0,SHOWING_GENERIC_ERROR_DIALOG:1};return i.SFSErrorFSM=e.extend({_initFSM:function(){this._setSupportedStates(_.values(o)),this._setCurrentState(o.IDLE),this._defineEventTransitions()},_defineEventTransitions:function(){this._defineTransition(o.IDLE,n.PDFIsPortfolio,function(e){this._handleInvalidFileTypeErrorEvent(e)}),this._defineTransition(o.IDLE,n.PDFIsPasswordProtected,function(e){this._handleInvalidFileTypeErrorEvent(e)}),this._defineTransition(o.IDLE,n.PDFIsCertificateProtected,function(e){this._handleInvalidFileTypeErrorEvent(e)}),this._defineTransition(o.IDLE,n.PDFIsPolicyProtected,function(e){this._handleInvalidFileTypeErrorEvent(e)}),this._defineTransition(o.IDLE,n.PDFIsDynamicXFA,function(e){this._handleInvalidFileTypeErrorEvent(e)}),this._defineTransition(o.IDLE,n.PDFIsOfInvalidType,function(e){this._handleInvalidFileTypeErrorEvent(e)}),this._defineTransition(o.IDLE,n.InvalidFileExtn,function(e){this._handleInvalidFileTypeErrorEvent(e)}),this._defineTransition(o.IDLE,n.GeneralWorkflowError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_GENERAL_WORKFLOW_FAILURE,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.FileUploadError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:e.errorMsg,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.ESAuthSessionCreateError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_ESAUTH_SESSION_CREATE,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.SendUrlFetchError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:e.errorMsg,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.OpenSendPageError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_OPEN_SEND_PAGE,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.SendPageError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:e.errorMsg,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.FetchManageAgreementURLError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_FETCH_MANAGE_AGREEMENT_URL,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.GeneralInAppSignWorkflowError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_INAPP_SIGN_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_INAPP_SIGN_ERR_GENERAL_WORKFLOW_FAILURE,closeLabel:t.SFS_INAPP_SIGN_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.SignPageEventError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_INAPP_SIGN_ERR_GENERIC_TITLE,errorBodyTitle:e.errorMsg,closeLabel:t.SFS_INAPP_SIGN_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.ESAuthSessionCreateForSigningUrlError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_INAPP_SIGN_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_INAPP_SIGN_ESAUTH_SESSION_CREATE,closeLabel:t.SFS_INAPP_SIGN_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.FetchSigningURLInAppSigningError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_INAPP_SIGN_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_INAPP_SIGN_FETCH_SIGNING_URL,closeLabel:t.SFS_INAPP_SIGN_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.InAppSessionTimeOutError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_INAPP_SIGN_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_INAPP_SIGN_ERR_GENERAL_WORKFLOW_FAILURE,closeLabel:t.SFS_INAPP_SIGN_ERR_RELOAD_BTN})}),this._defineTransition(o.IDLE,n.LargeFileSize,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_LARGE_FILE_SIZE,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.ESAutoLoginDenied,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_ES_AUTO_LOGIN_DENIED,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.SendPageSessionTimeOut,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_TIMEOUT_TITLE,errorBodyTitle:t.SFS_ERR_CONTENT_TIMEOUT_TITLE,errorBodyContent:t.SFS_ERR_CONTENT_TIMEOUT_BODY,closeLabel:t.SFS_ERR_CLOSE_BTN,width:650})}),this._defineTransition(o.IDLE,n.EnterpriseServiceAccessDenied,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_ENTERPRISE_SERVICE_ACCS_DENIED,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.PrepareFormsMultipleFilesSelect,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_PREPARE_FORM_MUL_FILES_SEL,closeLabel:t.SFS_ERR_CLOSE_BTN})}),this._defineTransition(o.IDLE,n.MultipleWorkflowsRunning,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_FILE_NOT_SENT,errorBodyTitle:t.SFS_MULTIPLE_WORKFLOWS_DENIED,closeLabel:t.SFS_ERR_OK_BUTTON})}),this._defineTransition(o.IDLE,n.CombineFilesFailed,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_FILES_NOT_COMBINED_ERROR_TITLE,errorBodyTitle:t.SFS_FILES_NOT_COMBINED_ERROR,closeLabel:t.SFS_ERR_OK_BUTTON})}),this._defineTransition(o.IDLE,n.PermissionDenied,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_ACCESS_DENIED_TITLE,errorBodyTitle:t.SFS_ERR_ACCESS_DENIED,closeLabel:t.SFS_ERR_OK_BUTTON})}),this._defineTransition(this.SPECIAL_FSM_STATE,"HideErrorDialog",function(e){this._setCurrentState(o.IDLE),this._invokeController("HideGenericErrorDialogOp",e)}),this._defineTransition(o.IDLE,n.PageLimitExceedError,function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_HIGH_PAGE_LIMIT_ERR_TITLE,errorBodyTitle:t.SFS_HIGH_PAGE_LIMIT_ERR_BODY,closeLabel:t.SFS_ERR_OK_BUTTON})})},_handleErrorEvent:function(e,i){var t=this._prepareErrorContentTitle(e,i.errorBodyTitle,i.errorBodyTitle_N),s=this._prepareErrorContentBody(e,i.errorBodyContent);e.titleTag=i.errorTitle,e.bodyTag=this._createErrorBodyTag(t,s),e.closeTag=i.closeLabel,e.width=i.width,e.height=i.height,this._setCurrentState(o.SHOWING_GENERIC_ERROR_DIALOG),this._invokeController("ShowGenericErrorDialogOp",e)},_handleInvalidFileTypeErrorEvent:function(e){this._handleErrorEvent(e,{errorTitle:t.SFS_ERR_GENERIC_TITLE,errorBodyTitle:t.SFS_ERR_CONTENT_TITLE_UNSUPPORTED,errorBodyTitle_N:t.SFS_ERR_CONTENT_TITLE_UNSUPPORTED_N,errorBodyContent:t.SFS_ERR_CONTENT_BODY_UNSUPPORTED,closeLabel:t.SFS_ERR_CLOSE_BTN})},_cheapTruncate:function(e,i){return e.length>i-5&&(i-=5,e=e.substr(0,i/2)+" ... "+e.substr(e.length-i/2)),e},_createErrorBodyTag:function(e,i){var t,n,o=$(_.template(s,{}));return t=o.find(".sfs-error-body-heading"),n=o.find(".sfs-error-body-content"),_.isEmpty(e)?t.addClass("hidden"):t.html(e),_.isEmpty(i)?n.addClass("hidden"):n.html(i),o[0].outerHTML},_prepareFileListDisplayString:function(e){var i,t=0,s="";return t=_.size(e),_.each(e,_.bind(function(e,n){i=e.file.get("name"),i=this._cheapTruncate(i,30),s+=i,t-1>n&&(s+=", ")},this)),s},_prepareErrorContentTitle:function(e,i,t){var s="",n="",o=i;return _.size(e.invalidFiles)>1&&(_.isEmpty(t)||(o=t)),n=this._prepareFileListDisplayString(e.invalidFiles),_.isUndefined(o)||(s=_.template(o,{name:n})),s},_prepareErrorContentBody:function(e,i){var t="",s="";return s=this._prepareFileListDisplayString(e.invalidFiles),_.isUndefined(i)||(t=_.template(i,{name:s})),t}}),i.SFSErrorFSM}),define("pdmplugins/send-for-sign/js/fsm/sfs-subscription-fsm",["core/ac-core","pdmplugins/esign/js/fsm/fsm","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/constants/sfs-error-codes","pdmplugins/send-for-sign/js/constants/sfs-sc-constants","pdmplugins/send-for-sign/js/utils/sfs-ts-utils"],function(e,i,t,s,n,o){var a={IDLE:0,EVALUATING_IMS_USER_LOGIN_STATUS:1,CHECKING_FOR_ES_USER_LOGIN_STATUS:2,FETCHING_ES_USER_SUBSCRIPTION_STATUS:3,SHOWING_ES_SUBSCRIBE_PAGE_USER_SIGNED_IN:4,SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN:5,WAITING_FOR_IMS_AUTH_SESSION_TO_CREATE:6,SHOWING_ES_SUBSCRIBE_PAGE_USER_SIGNED_IN_AND_UPGRADE_CLICKED:7,CHECKING_FOR_ENTERPRISE_ACCOUNT_TYPE:8,SHOWING_SUBSCRIPTION_ERR_MSG:9,UPDATING_IMS_AUTH_SESSION_OP:10};return t.SFSSubscriptionFSM=i.extend({_initFSM:function(){this._setSupportedStates(_.values(a)),this._setCurrentState(a.IDLE),this._defineEventTransitions()},_defineEventTransitions:function(){this._defineTransition(a.IDLE,"EvaluateSubscriptionStatus",function(e){this._setCurrentState(a.EVALUATING_IMS_USER_LOGIN_STATUS),this._invokeController("ShowWaitCursorOp",e),this._invokeController("EvaluateIMSUserLoginStatusOp",e)}),this._defineTransition(a.EVALUATING_IMS_USER_LOGIN_STATUS,"IMSUserSignedIn",function(e){this._setCurrentState(a.UPDATING_IMS_AUTH_SESSION_OP),this._invokeController("UpdateIMSAuthSessionOp",e)}),this._defineTransition(a.UPDATING_IMS_AUTH_SESSION_OP,"IMSSessionUpdateSuccess",function(e){this._setCurrentState(a.FETCHING_ES_USER_SUBSCRIPTION_STATUS),this._invokeController("FetchESUserSubscriptionStatusOp",e)}),this._defineTransition(a.UPDATING_IMS_AUTH_SESSION_OP,"IMSSessionUpdateFailure",function(e){this._setCurrentState(a.IDLE),this._invokeController("HideWaitCursorOp",e),this._invokeController("NotifyESUserGotFreeSubscriptionOp",e)}),this._defineTransition(a.EVALUATING_IMS_USER_LOGIN_STATUS,"IMSUserNotSignedIn",function(e){this._invokeController("HideWaitCursorOp",e),this._setCurrentState(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN),this.options.appApi.rnaApiObj.esApi.isTrialFeatureEnabled()||this._invokeController("ShowSubscribePageESUserNotSignedInOp",e),this._invokeController("ClearSFSWorkflowInProgressOp",e),this.options.appApi.rnaApiObj.esApi.isTrialFeatureEnabled()&&(this._setCurrentState(a.WAITING_FOR_IMS_AUTH_SESSION_TO_CREATE),this.options.appApi.rnaApi.done(_.bind(function(i){1==i.rnaServicesAPI.isSFSUpsellExperimentEnabled()&&this._invokeController("LaunchSubscribeWebPageOp",e)},this)),this._invokeController("CreateIMSAuthSessionOp",e),this.options.appApi.siteCatalystApi.logScEvent([o.getFillSignReaderFreeTransVariant(this.options),n.NEW_LANDING_PAGE,n.SHOW_SIGN_IN_DIALOG]))}),this._defineTransition(a.FETCHING_ES_USER_SUBSCRIPTION_STATUS,"ESUserFoundFree",function(e){this.options.appApi.rnaApiObj.esApi.isTrialFeatureEnabled()?(this._setCurrentState(a.IDLE),this._invokeController("HideWaitCursorOp",e),this._invokeController("NotifyESUserGotFreeSubscriptionOp",e)):(this._setCurrentState(a.CHECKING_FOR_ENTERPRISE_ACCOUNT_TYPE),this._invokeController("CheckIfUserOfEnterpriseTypeOp",e),this._invokeController("ClearSFSWorkflowInProgressOp",e))}),this._defineTransition(a.FETCHING_ES_USER_SUBSCRIPTION_STATUS,"ESUserFoundPaid",function(e){this._setCurrentState(a.IDLE),this._invokeController("HideWaitCursorOp",e),this._invokeController("NotifyESUserGotPaidSubscriptionOp",e)}),this._defineTransition(a.FETCHING_ES_USER_SUBSCRIPTION_STATUS,"ESSubscriptionError",function(e){this._setCurrentState(a.IDLE),this._invokeController("HideWaitCursorOp",e),this._invokeController("NotifyESUserGotFreeSubscriptionOp",e)}),this._defineTransition(a.CHECKING_FOR_ENTERPRISE_ACCOUNT_TYPE,"EnterpriseUser",function(e){this._invokeController("HideWaitCursorOp",e),this._setCurrentState(a.SHOWING_SUBSCRIPTION_ERR_MSG),e.errorOptions={errorType:s.EnterpriseServiceAccessDenied},this._invokeController("ShowSubscriptionErrorMsgOp",e)}),this._defineTransition(a.CHECKING_FOR_ENTERPRISE_ACCOUNT_TYPE,"NotAnEnterpriseUser",function(e){this._invokeController("HideWaitCursorOp",e),this._setCurrentState(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_SIGNED_IN),this._invokeController("ShowSubscribePageESUserSignedInOp",e)}),this._defineTransition(a.SHOWING_SUBSCRIPTION_ERR_MSG,"ErrorDialogDismissed",function(e){this._setCurrentState(a.IDLE),this._invokeController("NotifyESUserGotFreeSubscriptionOp",e)}),this._defineTransition(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_SIGNED_IN,"UserClickedCancel",function(e){this._setCurrentState(a.IDLE),this._invokeController("NotifyESUserGotFreeSubscriptionOp",e)}),this._defineTransition(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_SIGNED_IN,"UserClickedUpgradeNow",function(e){this._setCurrentState(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_SIGNED_IN_AND_UPGRADE_CLICKED),this._invokeController("LaunchSubscribeWebPageOp",e),this._invokeController("ShowSubscribePageESUserSignedInAndUpgradeClickedOp",e)}),this._defineTransition(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN,"UserClickedCancel",function(e){this._setCurrentState(a.IDLE),this._invokeController("NotifyESUserGotFreeSubscriptionOp",e)}),this._defineTransition(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN,"UserClickedUpgradeNow",function(e){this._setCurrentState(a.WAITING_FOR_IMS_AUTH_SESSION_TO_CREATE),this.options.appApi.rnaApi.done(_.bind(function(i){0==i.rnaServicesAPI.isSFSUpsellExperimentEnabled()&&this._invokeController("LaunchSubscribeWebPageOp",e)},this)),this._invokeController("CreateIMSAuthSessionOp",e)}),this._defineTransition(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN,"UserClickedSignIn",function(e){this._setCurrentState(a.WAITING_FOR_IMS_AUTH_SESSION_TO_CREATE),this.options.appApi.rnaApi.done(_.bind(function(i){1==i.rnaServicesAPI.isSFSUpsellExperimentEnabled()&&this._invokeController("LaunchSubscribeWebPageOp",e)},this)),this._invokeController("CreateIMSAuthSessionOp",e)}),this._defineTransition(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN,"SessionSignOut",function(){this._setCurrentState(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN)}),this._defineTransition(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN,"SessionSignedIn",function(){}),this._defineTransition(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_SIGNED_IN_AND_UPGRADE_CLICKED,"UserClickedStartNow",function(e){this._invokeController("ShowWaitCursorOp",e),this._setCurrentState(a.FETCHING_ES_USER_SUBSCRIPTION_STATUS),this._invokeController("FetchESUserSubscriptionStatusOp",e)}),this._defineTransition(a.WAITING_FOR_IMS_AUTH_SESSION_TO_CREATE,"SessionSignedIn",function(e){this._setCurrentState(a.WAITING_FOR_IMS_AUTH_SESSION_TO_CREATE),this._invokeController("ShowWaitCursorOp",e)}),this._defineTransition(a.WAITING_FOR_IMS_AUTH_SESSION_TO_CREATE,"IMSAuthSessionCreateSuccess",function(e){this.options.appApi.siteCatalystApi.logScEvent([o.getFillSignReaderFreeTransVariant(this.options),n.NEW_LANDING_PAGE,n.SIGN_IN_SUCCESS]),this._setCurrentState(a.FETCHING_ES_USER_SUBSCRIPTION_STATUS),this._invokeController("FetchESUserSubscriptionStatusOp",e)}),this._defineTransition(a.WAITING_FOR_IMS_AUTH_SESSION_TO_CREATE,"IMSAuthSessionCreateFailure",function(e){this.options.appApi.siteCatalystApi.logScEvent([o.getFillSignReaderFreeTransVariant(this.options),n.NEW_LANDING_PAGE,n.SIGN_IN_FAILURE]),o.getFillSignReaderFreeTransVariant(this.options)!==n.SEND_FOR_SIGN_NEW_EXP_READER_FREE_TRANS?(this._setCurrentState(a.SHOWING_ES_SUBSCRIBE_PAGE_USER_NOT_SIGNED_IN),this._invokeController("ShowSubscribePageESUserNotSignedInOp",e)):(this._setCurrentState(a.IDLE),this._invokeController("HideWaitCursorOp",e),this._invokeController("NotifyIMSAuthSessionCreateFailureOp",e))}),this._defineTransition(this.SPECIAL_FSM_STATE,"SessionSignOut",function(e){this._setCurrentState(a.IDLE),this._invokeController("HideWaitCursorOp",e)}),this._defineTransition(this.SPECIAL_FSM_STATE,"NetworkDisconnectedEvent",function(e){this._setCurrentState(a.IDLE),this._invokeController("HideWaitCursorOp",e)})}}),t.SFSSubscriptionFSM}),define("pdmplugins/send-for-sign/js/fsm/fsm-factory",["core/ac-core","pdmplugins/esign/js/fsm/fsm","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/fsm/sfs-app-fsm","pdmplugins/send-for-sign/js/fsm/sfs-workflow-fsm","pdmplugins/send-for-sign/js/fsm/sfs-error-fsm","pdmplugins/send-for-sign/js/fsm/sfs-subscription-fsm"],function(e,i,t){return t.FSMFactory=i.extend({create:function(e,i){var s=t[e];return s?new s(i):void LOG(0,"AcCore.OpFactory.create: Unrecognized class: "+e)}}),t.FSMFactory}),define("pdmplugins/send-for-sign/js/models/ui/sfs-workflow-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){i.SFSWorkflowUiModel=e.UiModel.extend({recognized:{workflow_id:{type:"string",optional:!0},workfow_status:{type:"object",optional:!0},send_page_status:{type:"object",optional:!0},sign_page_status:{type:"object",optional:!0},upload_req_queue:{type:"array",optional:!0},workflow_restarted_once:{type:"array",optional:!0}},defaults:{workflow_id:"",workfow_status:{},send_page_status:{},sign_page_status:{},upload_req_queue:[]}})}),define("pdmplugins/send-for-sign/js/models/ui/sfs-app-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){var t=!1;i.SFSAppUiModel=e.UiModel.extend({recognized:{network_connected:{type:"boolean",optional:!0},user_signed_in:{type:"boolean",optional:!0},app_state_updated:{type:"boolean",optional:!0},workflow_ui_model:{type:"object",optional:!0},wait_cursor_visible:{type:"boolean",optional:!0},restart_app:{type:"boolean",optional:!0},mode_type:{type:"string",optional:!0},trigger_type:{type:"string",optional:!0}},defaults:{network_connected:!0,user_signed_in:!1,app_state_updated:!1,workflow_ui_model:{},restart_app:!1},isSendPageVisible:function(){var e=this.get("workflow_ui_model"),i=e.get("send_page_status");return i.isVisible===!0&&!_.isEmpty(i.url)},notifyAppStateChange:function(){this.set("app_state_updated",!1,{silent:!0}),this.set("app_state_updated",!0)},areMultipleFilesSelected:function(){var e=this.get("workflow_ui_model"),i=e.get("upload_req_queue");return!(_.isEmpty(i)&&i.length>1)},setAppWorkflowRestartedOnce:function(e){t=e},hasAppWorkflowRestartedOnce:function(){return t},canRunInUIMode:function(){return _.isEmpty(this.get("mode_type"))},getTriggerType:function(){return this.get("trigger_type")}})}),define("pdmplugins/send-for-sign/js/models/ui/sfs-app-progress-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){i.SFSAppUploadProgressUiModel=e.UiModel.extend({recognized:{is_visible:{type:"boolean",optional:!0},dummy_progress_fraction:{type:"boolean",optional:!0},doc_upload_progress_fraction:{type:"number",optional:!0},send_page_url_fetch_progress_fraction:{type:"number",optional:!0},send_page_load_progress_fraction:{type:"number",optional:!0},upload_progress_percentage:{type:"number",optional:!0},send_page_url_fetch_percentage:{type:"number",optional:!0},max_dummy_percentage:{type:"number",optional:!0},dummy_progress_incr:{type:"number",optional:!0},abort_progress:{type:"boolean",optional:!0}},defaults:{doc_upload_progress_fraction:.6,send_page_url_fetch_progress_fraction:.4,is_visible:!1,upload_progress_percentage:0,send_page_url_fetch_percentage:0,max_dummy_percentage:30,dummy_progress_incr:10,abort_progress:!1},setProgressName:function(e){"send_page_url_fetch"===e&&(this.set("auth_progress_percentage",100),this.set("upload_progress_percentage",100))},getTotalProgressPercentage:function(){return this.get("doc_upload_progress_fraction")*this.get("upload_progress_percentage")+this.get("send_page_url_fetch_progress_fraction")*this.get("send_page_url_fetch_percentage")}})}),define("pdmplugins/send-for-sign/js/models/ui/sfs-app-send-page-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){i.SFSAppSendPageUiModel=e.UiModel.extend({recognized:{url:{type:"string",optional:!0},is_visible:{type:"boolean",optional:!0},is_loaded:{type:"boolean",optional:!0}},defaults:{url:"",is_visible:!1,is_loaded:!1}})}),define("pdmplugins/send-for-sign/js/models/ui/sfs-app-signing-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){i.SFSAppSigningPageUiModel=e.UiModel.extend({recognized:{url:{type:"string",optional:!0},is_visible:{type:"boolean",optional:!1},is_loaded:{type:"boolean",optional:!0}},defaults:{url:"",is_visible:!1,is_loaded:!1}})}),define("pdmplugins/send-for-sign/js/models/ui/sfs-app-landing-page-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){i.SFSAppLandingPageUiModel=e.UiModel.extend({recognized:{is_visible:{type:"boolean",optional:!0},is_refreshed:{type:"boolean",optional:!0},user_action:{type:"string",optional:!0},selected_files:{type:"array",optional:!0},user_removed_file:{type:"object",optional:!0},file_collection_visible:{type:"boolean",optional:!0},app_info_txt_visible:{type:"boolean",optional:!0},app_info_txt1:{type:"string",optional:!0},app_info_txt2:{type:"string",optional:!0},app_info_txt3:{type:"string",optional:!0},action_btn1_visible:{type:"boolean",optional:!0},action_btn2_visible:{type:"boolean",optional:!0},action_btn1_enabled:{type:"boolean",optional:!0},action_btn2_enabled:{type:"boolean",optional:!0},action_btn1_label:{type:"string",optional:!0},action_btn2_label:{type:"string",optional:!0},action_btn_descr_visible:{type:"boolean",optional:!0},action_btn1_descr_txt:{type:"string",optional:!0},action_btn2_descr_txt:{type:"string",optional:!0},action_btn_separator_label:{type:"string",optional:!0},enable_autocomplete:{type:"boolean",optional:!1},enable_autoc_arrows:{type:"boolean",optional:!1},autocomplete_local_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},showSFSNewLandingPage:{type:"boolean",optional:!0},fssVariant:{type:"string",optional:!0},decidedWhichPageToShow:{type:"boolean",optional:!0},landedAsSignedInUser:{type:"boolean",optional:!0}},defaults:{is_visible:!1,user_action:"",selected_files:[],user_removed_file:{},action_btn1_enabled:!0,action_btn2_enabled:!0,action_btn1_visible:!0,enable_autocomplete:!0,enable_autoc_arrows:!0,autocomplete_local_contacts_imported:!1,autocomplete_scroll:!1,autocomplete_eventual_click:!1,autocomplete_immediate_click:!1,autocomplete_avoided:!1,showSFSNewLandingPage:!0,fssVariant:"",decidedWhichPageToShow:!1,landedAsSignedInUser:!1},clearLastUserAction:function(){this.set("user_action","",{silent:!0})},clearLastRefreshState:function(){this.set("is_refreshed","",{silent:!0})},resetTodefaults:function(){this.set({enable_autocomplete:!0,enable_autoc_arrows:!0,autocomplete_local_contacts_imported:!1,showSFSNewLandingPage:!0,fssVariant:"",decidedWhichPageToShow:!1,landedAsSignedInUser:!1}),this.set("user_removed_file",{},{silent:!0}),this.set("selected_files",[],{silent:!0}),this.resetAutocomplete()},resetAutocomplete:function(){this.set({autocomplete_avoided:!1,autocomplete_scroll:!1,autocomplete_immediate_click:!1,autocomplete_eventual_click:!1})}})}),define("pdmplugins/send-for-sign/js/models/ui/sfs-es-web-page-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){i.SFSEchoSignWebPageUiModel=e.UiModel.extend({recognized:{eventData:{type:"object",optional:!0}},defaults:{eventData:{}},clearLastEventState:function(){this.set("eventData",{},{silent:!0})}})}),define("pdmplugins/send-for-sign/js/models/ui/sfs-subscribe-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){return i.SFSSubscribeUiModel=e.UiModel.extend({recognized:{close:{type:"boolean",optional:!0},visible_btn_name:{type:"string",optional:!0},user_action:{type:"string",optional:!0},cancel_clicked:{type:"boolean",optional:!0},upgrade_clicked:{type:"boolean",optional:!0},sign_in_clicked:{type:"boolean",optional:!0},wait_cursor_visible:{type:"boolean",optional:!0}},defaults:{user_action:"",visible_btn_name:"",cancel_clicked:!1,upgrade_clicked:!1,sign_in_clicked:!1},reset:function(){this.set({user_action:"",visible_btn_name:"",cancel_clicked:!1,upgrade_clicked:!1,sign_in_clicked:!1})}}),i.SFSSubscribeUiModel}),define("pdmplugins/send-for-sign/js/models/ui/sfs-app-sendacopy-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){i.SFSAppSendCompletedCopyModel=e.UiModel.extend({recognized:{current_share_choice:{type:"string",optional:!0,choices:["locked-copy","request-signature"]},last_action_success:{type:"string",optional:!0},failed_workflow:{type:"string",optional:!0},error_code:{type:"string",optional:!0},transient_id:{type:"string",optional:!0},agreementId:{type:"string",optional:!0},selectedFiles:{type:"array",optional:!0},is_locked_copy_workflow:{type:"boolean",optional:!0},is_link_generated:{type:"boolean",optional:!0},is_agreement_opened:{type:"boolean",optional:!0},share_modal_workflow:{type:"string",optional:!0},agreement_subject:{type:"string",optional:!0},agreement_msg:{type:"string",optional:!0},is_getalink_workflow:{type:"boolean",optional:!0},is_upload_only:{type:"boolean",optional:!0},workflow_complete:{type:"boolean",optional:!0},workflow_running:{type:"boolean",optional:!0},workflow_success_status:{type:"boolean",optional:!0},certified_email_link:{type:"string",optional:!0},upload_req_queue:{type:"array",optional:!0},UserIsOffline:{type:"boolean",optional:!0},recipientlist:{type:"array",optional:!0}},defaults:{current_share_choice:"locked-copy",last_action_success:"",failed_workflow:"",error_code:"",transient_id:"",agreementId:"",agreement_subject:"",is_locked_copy_workflow:!1,is_link_generated:!1,is_agreement_opened:!1,share_modal_workflow:"get_link",certified_email_link:"",is_getalink_workflow:!1,is_upload_only:!1,workflow_complete:!1,workflow_success_status:!1,workflow_running:!1,selectedFiles:[],upload_req_queue:[],UserIsOffline:!0,recipientlist:[],agreement_msg:""},reset:function(){this.set({current_share_choice:"locked-copy",last_action_success:"",failed_workflow:"",error_code:"",transient_id:"",agreementId:"",agreement_subject:"",certified_email_link:"",is_locked_copy_workflow:!1,is_link_generated:!1,is_agreement_opened:!1,share_modal_workflow:"get_link",is_getalink_workflow:!1,is_upload_only:!1,workflow_complete:!1,workflow_success_status:!1,workflow_running:!1,upload_req_queue:[],UserIsOffline:!0,recipientlist:[],agreement_msg:""})
}})}),define("pdmplugins/send-for-sign/js/models/email-addr-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/models/model"],function(e,i){i.EmailAddrModel=e.Model.extend({})}),define("pdmplugins/send-for-sign/js/collections/email-addr-collection",["pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/models/email-addr-model"],function(e){return e.EmailAddrCollection=Backbone.Collection.extend({model:e.EmailAddrModel}),e.EmailAddrCollection}),define("pdmplugins/send-for-sign/js/models/ui/sfs-app-share-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/collections/email-addr-collection"],function(e,i){i.SFSAppShareUiModel=e.UiModel.extend({recognized:{current_tab:{type:"string",optional:!0,choices:["get-a-link","send-a-copy","get-others-to-sign"]},is_signed_in:{type:"boolean",optional:!0},get_a_link_status:{type:"string",optional:!0,choices:["idle","creating","successful","failed"]},email_addr_collection:{type:"object",optional:!0},autocomplete_local_contacts_imported:{type:"boolean",optional:!1},autocomplete_cloud_contacts_imported:{type:"boolean",optional:!1},autocomplete_msgraph_contacts_imported:{type:"boolean",optional:!1},enable_autocomplete:{type:"boolean",optional:!0},enable_autoc_arrows:{type:"boolean",optional:!0}},defaults:{current_tab:"get-a-link",is_signed_in:!0,get_a_link_status:"idle",autocomplete_local_contacts_imported:!1,autocomplete_cloud_contacts_imported:!1,autocomplete_msgraph_contacts_imported:!1,enable_autocomplete:!0,enable_autoc_arrows:!0},initialize:function(){var e;e=new i.EmailAddrCollection,this.set({email_addr_collection:e})},resetEmailCollection:function(){this.get("email_addr_collection").reset()},reset:function(){this.set({current_tab:"get-a-link",is_signed_in:!0,get_a_link_status:"idle",autocomplete_local_contacts_imported:!1,autocomplete_cloud_contacts_imported:!1,autocomplete_msgraph_contacts_imported:!1,enable_autocomplete:!0,enable_autoc_arrows:!0}),this.resetEmailCollection()},addRecipientsToCollection:function(e){var i=this.get("email_addr_collection");i.add(e,{silent:!0}),i.trigger("set",{})},setRecipientsCollection:function(e,i){var t=this.get("email_addr_collection");t.set(e,{silent:!0}),t.trigger("set",i)},getRecipientsArray:function(){var e=this.get("email_addr_collection"),i=e.map(function(e){return e.get("friendly")?e.get("friendly")+" <"+e.get("email")+">":e.get("email")});return i},isSenderOnlyRecipient:function(e){for(var i=this.getRecipientsArray(),t=0;t<i.length;++t)if(i[t]!==e)return!1;return!0},parseEmailArray:function(e,t){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 r,l,d,p=a,c=a.match(/\s*<(\S+)>/),_=t?t:"";return(a=$.trim(a))?(c?(p=c[1],l=a.substring(0,c.index),l=l.replace(/^\s+/,"")):p=$.trim(p),d=p.match(s)?!0:!1,d&&(d=p.match(n)?!1:!0,d=d?o.test(p):!1),r=new i.EmailAddrModel({email:p,friendly:l,valid:d,name:_}),e.push(r),e):e},[]);return a}})}),define("pdmplugins/send-for-sign/js/models/ui/sfs-trial-bar-ui-model",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign"],function(e,i){i.SFSAppTrialBarUiModel=e.UiModel.extend({recognized:{remaining_transaction:{type:"string",optional:!0},is_visible:{type:"boolean",optional:!0},upsell_shown_already:{type:"boolean",optional:!0}},defaults:{remaining_transaction:"",is_visible:!1,upsell_shown_already:!1},reset:function(){this.set({remaining_transaction:"",is_visible:!1,upsell_shown_already:!1})}})}),define("pdmplugins/send-for-sign/js/models/ui/ui-model-factory",["core/ac-core","pdmplugins/send-for-sign/js/ac-send-for-sign","core/models/model","pdmplugins/send-for-sign/js/models/ui/sfs-workflow-ui-model","pdmplugins/send-for-sign/js/models/ui/sfs-app-ui-model","pdmplugins/send-for-sign/js/models/ui/sfs-app-progress-ui-model","pdmplugins/send-for-sign/js/models/ui/sfs-app-send-page-ui-model","pdmplugins/send-for-sign/js/models/ui/sfs-app-signing-ui-model","pdmplugins/send-for-sign/js/models/ui/sfs-app-landing-page-ui-model","pdmplugins/send-for-sign/js/models/ui/sfs-es-web-page-ui-model","pdmplugins/send-for-sign/js/models/ui/sfs-subscribe-ui-model","pdmplugins/send-for-sign/js/models/ui/sfs-app-sendacopy-model","pdmplugins/send-for-sign/js/models/ui/sfs-app-share-model","pdmplugins/send-for-sign/js/models/ui/sfs-trial-bar-ui-model"],function(e,i){return i.UiModelFactory=e.Model.extend({create:function(e,t,s){var n=i[e];return n?new n(t,s):void LOG(0,"AcSendForSign.UiModelFactory.create: Unrecognized class: "+e)}}),i.UiModelFactory}),define("pdmplugins/send-for-sign/js/send-for-sign",["pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/esign/js/ac-esign-init","pdmplugins/send-for-sign/js/views/plugin-view","pdmplugins/send-for-sign/js/ops/op-factory","pdmplugins/send-for-sign/js/fsm/fsm-factory","pdmplugins/send-for-sign/js/models/ui/ui-model-factory"],function(e){_.extend(e,{init:function(){e.opFactory=new e.OpFactory,e.fsmFactory=new e.FSMFactory,e.uiModelFactory=new e.UiModelFactory}})}),define("pdmplugins/send-for-sign/js/plugin",["pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/send-for-sign/js/send-for-sign"],function(e){e.init()});