YUI.add("mail-services-message-service",function(e){function t(){var t=arguments[0]||{},n=t.stopwatch||null,r=t.cacheKey||"Prime",i=t.truncateAt||null;return{get:function(t,s){return new Promise(function(o,u){n&&(n.CMGStart=new Date),NeoConfig.yodaReadEnabled&&NeoConfig.yodaControllerLoaded?e.mail.controller.v3.api.getSimpleBodyofMessages({messageList:[{mid:t}],sourceFid:s,filter:{truncateAt:i},success:function(e){n&&(n.CMGEnd=new Date,n.wasCached=!1),o(e[0])},failure:function(){u()}}):e.mail.Controller.Messages.get({fid:s,msg:{mid:t},cachekey:r,ovparams:{truncateAt:i}},{success:function(e,t){n&&(n.CMGEnd=new Date,n.wasCached=t.respProps.wasCached),(!e||!e.mid)&&u(),o(e)},failure:function(){u()}})})}}}e.namespace("mail.Services").MessageService=t},"1.0.0",{requires:["mail-controller-messages"]}); YUI.add("mail-ui-composeview-compose-loader",function(e){var t=function(e){this.context=e.context||{},this.workspace=e.workspace||null,this.is_tab_deactive=e.force||!1,this.tabs=e.tabs||null,this.strings=e.strings||{},this.openAsDraft=e.openAsDraft||!1,this.composeDeps=["_shared_module_toolbar_compose","_shared_module_compose_message_header_fresh","_shared_module_offscreen_bin_compose","_shared_module_offscreen_bin_compose_menu_color_picker","_shared_module_offscreen_bin_compose_menu_spellcheck","_shared_module_offscreen_bin_compose_modal_cancel_compose","_shared_module_offscreen_bin_compose_menu_spell_langs","_shared_module_compose_reply","mail-ui-authorview-v3"]};t.prototype.addModule=function(e){this.composeDeps.push(e)},t.prototype.removeModule=function(e){var t=this.composeDeps.indexOf(e);t>-1&&this.composeDeps.splice(t,1)},t.prototype.load=function(){var t=this,n=new e.common.Utils.Stopwatch("Compose","start"),r=[].concat(t.composeDeps);t.stopwatch=n,e.fire("Y.mail.ui.Workspace:composeMessage:start"),t.prefetch_message(),r.push(e.bind(this.show_compose,t)),e.fire("load-load-address-book-contacts"),n.start(1,"moduleLoad"),e.use.apply(e,r)},t.prototype.prefetch_message=function(){var t=this,n=this.context.draf;if(n&&!n.get("passive")){var r=t.context.oMsg,i=t.context.fid,s=new e.mail.Services.MessageService({stopwatch:t.stopwatch,cacheKey:"ComposeOrigin"});s.get(r.mid,i)}},t.prototype.show_compose=function(){var t=this,n,r=t.strings.str_tabs_compose_fresh,i=t.context.action,s=t.context.widget,o=t.stopwatch;o.start(1,"initView"),window.UploaderService=window.UploaderService||e.mail.UploaderService;if(t.canSwitchToComposeview(t.context))return;n=new e.mail.ui.AuthorViewConv,o.action=i,t.context.stopwatch=o,t.context&&t.context.calCompose&&(t.context.cbfn=function(t,n){e.use("mail-services-calservice",function(e){e.Mail.Services.calService.setCalDraft(t,n)})}),n.initCompose(t.context,t.openAsDraft),t.context.oMsg&&t.context.oMsg.header&&(r=e.common.Utils.escapeHtml(e.common.Utils.unescapeHtml(t.context.oMsg.header.subject))),n.set("title",r);if(s)t.prepare_tab_for_compose(n,s,i);else{var u=t.composify_tab(n);if(!u)return}n.bindComposeView(),e.common.Utils.log({m:"composeView bound to the tab with which it is housed"}),t.show_compose_end(n)},t.prototype.prepare_tab_for_compose=function(t,n,r){var i=this,s=n&&n.msgPane,o=n.tab||i.tabs.getActiveTab(),u=r==="reply_all"||r==="reply_sender"||r==="forward",a=!i.context.hasMsgList&&u&&s&&NeoConfig.send_confirm_nav_enabled;if(a){var f=i.context.oMsg&&i.context.oMsg.header&&i.context.oMsg.header.subject;t.backToMessageTab=function(r){var i=function(){f?o.set("title",f):o.set("title",null),o.set("canDeactivate",-1),o.once("widgetChange",function(t){o.set("canDeactivate",1),e.fire("bindContentWidget",{cw:t.newVal,tab:o})}),t.after("closeChange",function(){o.set("widget",n)}),o.removeChild(t)};r==="next"||r==="prev"?e.use("mail-ui-messagelist-base","mail-ui-messagepane-next-prev",function(){s&&s.stepMail(r,i,0,0,1)}):i()}}o.set("title",t.get("title")),o.once("widgetChange",function(t){t.prevVal.after("closeChange",function(e){e.newVal&&o.removeChild(t.prevVal)}),t.newVal.after("closeChange",function(e){e.newVal&&o.set("close",1)}),e.fire("bindContentWidget",{cw:t.newVal,tab:o})}),o.set("hideToolbar",!0),o.set("widget",t)},t.prototype.composify_tab=function(t){var n=this,r,i,s=n.stopwatch,o=e.common.Utils.features.enabled("instantCloseOnSend"),u={s_label:t.get("title"),widget:t,forcePane:!1,noToolbar:!0,sync:!0,isRemovable:!0,noScroll:n.context.noScroll};return o&&(u.invisible=!1),i=n.workspace.addContentWidget(u),i?(i.detach("closeHalted"),i.on("closeHalted",function(e){e.halt(!0)}),r=t.view,r.once("renderComplete",function(){s.stop()}),!0):!1},t.prototype.show_compose_end=function(t){var n=this;e.fire("Y.mail.ui.Workspace:composeMessage:complete"),n.context.callFromLaunch&&!NeoConfig.noDarla&&e.common.Utils.loadDarlaAndExecute(function(e){e.fire("darlaEvent",{action:NeoConfig.low_bandwidth?"launch_compose_low":NeoConfig.isSSL?"launch_compose_ssl":"launch_compose"})},!1),t.on("closeChange",function(){e.fire("Nav:ComposeClosed")})},t.prototype.create_conv_compose_view=function(t,n,r,i,s){var o=new e.mail.Controller.ComposeController(r,s,t,i,n);return o.bindComposeView(),o},t.prototype.canSwitchToComposeview=function(t){var n=e.mail.Tabs,r=function(e){return e.type==="author"&&e.view&&e.view.draft&&e.view.draft.mid===t.oMsg.mid},i;if(t.oMsg){i=n.getTab(r);if(i)return n.switchToTab(i),!0}return!1},NeoGV.hasSessionStorage&&sessionStorage.setItem("MTTC",Math.round(Neo.performance.now())),NeoGV.composeLoaderReady=Date.now(),e.namespace("mail.ui.Compose").ComposeLoader=t,e.fire("mail-ui-composeview-compose-loader:loaded")},"1.0.0",{requires:["mail-platform","common-utils","common-utils-stats","mail-services-message-service","mail-common-utils-features"]}); YUI.add("common-ui-dd",function(e){var t=150,n=e.one("body"),r=e.Node.create("
"),i=function(){var e=n.get("docHeight"),t=n.get("docWidth");r.setStyles({height:e+"px",width:t+"px"})},s=!1,o,u=e.common.Utils,a="transparent";r.setStyles({opacity:"0",position:"absolute",zIndex:"99999",overflow:"hidden",backgroundColor:a,display:"none",height:"5px",width:"5px",borderWidth:"0 0 0 2px !important"}),r.set("id",e.stamp(r)),e.on("window:resize",i),n.prepend(r);var f=function(a){this.handles=[];var f=a.scope,l=!1,c=a.node,h=function(t){this.dragging=!0,o=null,this.startXY=[t.pageX,t.pageY],this.lastXY=t.target.getXY(),t.dd=this,this.f1=c.on("mousemove",e.bind(v,this)),this.f2=r.on("mousemove",e.bind(v,this)),this.f3=n.on("mousemove",e.bind(v,this)),a.start&&(a.start.apply(f,[t]),t.notDragging&&(this.dragging=!1))},p=function(n){if(NeoConfig.isWinApp&&!NeoGV.winAppDDActive)return!1;n.button===1&&!o&&n.target&&n.target.get("type")!=="text"&&(s=n.target,o=e.later(t,this,h,n))},d=function(e){if(this.dragging)return this.f1.detach(),this.f2.detach(),this.f3.detach(),e.dd=this,r.setStyle("display","none"),l=!1,this.dragging=!1,a.end&&a.end.apply(f,[e]),e.halt(!0),!1;o&&(o.cancel(),o=null)},v=function(e){if(this.dragging&&a.move)return!l&&this.dragging&&(l=!0,i(),r.setStyle("display","block"),a.cursor?r.setStyle("cursor",a.cursor):r.setStyle("cursor","default")),e.dd=this,e.target.lastXY=[e.pageX,e.pageY],e.target.startXY=this.startXY,a.move.apply(f,[e]),!1};u.setSelect(r,!1),u.setSelect(e.one("#msg-list"),!1),a.dragSelector?(this.handles.push(c.delegate("mousedown",e.bind(p,this),a.dragSelector)),this.handles.push(c.delegate("mouseup",e.bind(d,this),a.dragSelector))):(this.handles.push(c.on("mousedown",e.bind(p,this))),this.handles.push(c.on("mouseup",e.bind(d,this)))),this.handles.push(r.on("mouseup",e.bind(d,this))),this.handles.push(n.on("mouseup",e.bind(d,this)))};f.prototype.destroy=function(){var e=this.handles;if(e){var t=e.length,n;for(n=0;n');L.dd.proxy.appendChild(Q);P.clonedLozenge=Q;P.dummyElement=P.targetNode.cloneNode(true);}};var M=function(R){var S,Q=R.target;S=(B.Node.getDOMNode(Q)).nodeName;if(S==="LI"&&Q.hasClass("hLozenge")){P.targetNode=Q;}else{P.targetNode=Q.ancestor("li.hLozenge");}return P.targetNode;};K=L.target.ancestor("ul");if(!K){P.targetNode=null;}else{if(L.target.hasClass("lozenge-edit")){P.targetNode=null;L.notDragging=true;}else{if(K.one("li.focus")){O=M(L);P.targetNode=K.all("li.focus");J=P.targetNode.size();if(J===1||!O.hasClass("focus")){if(O.hasClass("focus")){P.wasHighlighted=true;}N();}else{P.wasHighlighted=true;L.dd.proxy=B.Node.create('
'+J+"
");P.clonedLozenge=L.dd.proxy;if(!P.dummyElement){P.dummyElement=P.targetNode.item(0).cloneNode(true);}P.selectMultipleLozenges=true;}}else{N();}}}if(L.dd.proxy){B.one("body").append(L.dd.proxy);}};var G=function(){this.dd.destroy();};F.prototype={destroy:G,start:A,end:E,move:D,getTargetNode:C,init:I};B.common.ui.lozengeDD=F;},"1.0.0",{requires:["common-ui-dd","common-utils"]});