Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

outlook-15.02.debug.js 125KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568
  1. /* Outlook specific API library */
  2. /* Version: 15.0.4726.1000 */
  3. /*
  4. Copyright (c) Microsoft Corporation. All rights reserved.
  5. */
  6. /*
  7. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  8. */
  9. Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");
  10. Microsoft.Office.WebExtension.MailboxEnums.EntityType={
  11. MeetingSuggestion: "meetingSuggestion",
  12. TaskSuggestion: "taskSuggestion",
  13. Address: "address",
  14. EmailAddress: "emailAddress",
  15. Url: "url",
  16. PhoneNumber: "phoneNumber",
  17. Contact: "contact"
  18. };
  19. Microsoft.Office.WebExtension.MailboxEnums.ItemType={
  20. Message: "message",
  21. Appointment: "appointment"
  22. };
  23. Microsoft.Office.WebExtension.MailboxEnums.ResponseType={
  24. None: "none",
  25. Organizer: "organizer",
  26. Tentative: "tentative",
  27. Accepted: "accepted",
  28. Declined: "declined"
  29. };
  30. Microsoft.Office.WebExtension.MailboxEnums.RecipientType={
  31. Other: "other",
  32. DistributionList: "distributionList",
  33. User: "user",
  34. ExternalUser: "externalUser"
  35. };
  36. Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={
  37. File: "file",
  38. Item: "item"
  39. };
  40. Microsoft.Office.WebExtension.MailboxEnums.BodyType={
  41. Text: "text",
  42. Html: "html"
  43. };
  44. Microsoft.Office.WebExtension.CoercionType={
  45. Text: "text",
  46. Html: "html"
  47. };
  48. Type.registerNamespace("OSF.DDA");
  49. OSF.DDA.OutlookAppOm=function(officeAppContext, targetWindow, appReadyCallback)
  50. {
  51. this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this,this._callAppReadyCallback$p$0);
  52. this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this,this._displayNewAppointmentFormApi$p$0);
  53. this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);
  54. this.$$d__getEwsUrl$p$0=Function.createDelegate(this,this._getEwsUrl$p$0);
  55. this.$$d__getDiagnostics$p$0=Function.createDelegate(this,this._getDiagnostics$p$0);
  56. this.$$d__getUserProfile$p$0=Function.createDelegate(this,this._getUserProfile$p$0);
  57. this.$$d__getItem$p$0=Function.createDelegate(this,this._getItem$p$0);
  58. this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this,this._getInitialDataResponseHandler$p$0);
  59. OSF.DDA.OutlookAppOm._instance$p=this;
  60. this._officeAppContext$p$0=officeAppContext;
  61. this._appReadyCallback$p$0=appReadyCallback;
  62. var $$t_4=this;
  63. var stringLoadedCallback=function()
  64. {
  65. if(appReadyCallback)
  66. $$t_4._invokeHostMethod$i$0(1,"GetInitialData",null,$$t_4.$$d__getInitialDataResponseHandler$p$0)
  67. };
  68. if(this._areStringsLoaded$p$0())
  69. stringLoadedCallback();
  70. else
  71. this._loadLocalizedScript$p$0(stringLoadedCallback)
  72. };
  73. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function(currentPermissionLevel)
  74. {
  75. if(!currentPermissionLevel)
  76. throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);
  77. };
  78. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i=function(value, minValue, maxValue, argumentName)
  79. {
  80. if(value < minValue || value > maxValue)
  81. throw Error.argumentOutOfRange(argumentName);
  82. };
  83. OSF.DDA.OutlookAppOm._getHtmlBody$p=function(data)
  84. {
  85. var htmlBody="";
  86. if("htmlBody" in data)
  87. {
  88. OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p(data["htmlBody"]);
  89. htmlBody=data["htmlBody"]
  90. }
  91. return htmlBody
  92. };
  93. OSF.DDA.OutlookAppOm._getAttachments$p=function(data)
  94. {
  95. var attachments=[];
  96. if("attachments" in data)
  97. {
  98. attachments=data["attachments"];
  99. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p(attachments)
  100. }
  101. return attachments
  102. };
  103. OSF.DDA.OutlookAppOm._getOptionsAndCallback$p=function(data)
  104. {
  105. var args=[];
  106. if("options" in data)
  107. args[0]=data["options"];
  108. if("callback" in data)
  109. args[args.length]=data["callback"];
  110. return args
  111. };
  112. OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p=function(attachments)
  113. {
  114. var attachmentsData=new Array(0);
  115. if(Array.isInstanceOfType(attachments))
  116. for(var i=0; i < attachments.length; i++)
  117. if(Object.isInstanceOfType(attachments[i]))
  118. {
  119. var attachment=attachments[i];
  120. OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p(attachment);
  121. attachmentsData[i]=OSF.DDA.OutlookAppOm._createAttachmentData$p(attachment)
  122. }
  123. else
  124. throw Error.argument("attachments");
  125. return attachmentsData
  126. };
  127. OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p=function(htmlBody)
  128. {
  129. if(!String.isInstanceOfType(htmlBody))
  130. throw Error.argument("htmlBody");
  131. if($h.ScriptHelpers.isNullOrUndefined(htmlBody))
  132. throw Error.argument("htmlBody");
  133. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length,0,OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody")
  134. };
  135. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p=function(attachments)
  136. {
  137. if(!Array.isInstanceOfType(attachments))
  138. throw Error.argument("attachments");
  139. };
  140. OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p=function(attachment)
  141. {
  142. if(!Object.isInstanceOfType(attachment))
  143. throw Error.argument("attachments");
  144. if(!("type" in attachment) || !("name" in attachment))
  145. throw Error.argument("attachments");
  146. if(!("url" in attachment || "itemId" in attachment))
  147. throw Error.argument("attachments");
  148. };
  149. OSF.DDA.OutlookAppOm._createAttachmentData$p=function(attachment)
  150. {
  151. var attachmentData=null;
  152. if(attachment["type"]==="file")
  153. {
  154. var url=attachment["url"];
  155. var name=attachment["name"];
  156. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p(url,name);
  157. attachmentData=OSF.DDA.OutlookAppOm._createFileAttachmentData$p(url,name)
  158. }
  159. else if(attachment["type"]==="item")
  160. {
  161. var itemId=attachment["itemId"];
  162. var name=attachment["name"];
  163. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p(itemId,name);
  164. attachmentData=OSF.DDA.OutlookAppOm._createItemAttachmentData$p(itemId,name)
  165. }
  166. else
  167. throw Error.argument("attachments");
  168. return attachmentData
  169. };
  170. OSF.DDA.OutlookAppOm._createFileAttachmentData$p=function(url, name)
  171. {
  172. return["file",name,url]
  173. };
  174. OSF.DDA.OutlookAppOm._createItemAttachmentData$p=function(itemId, name)
  175. {
  176. return["item",name,itemId]
  177. };
  178. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p=function(url, name)
  179. {
  180. if(!String.isInstanceOfType(url) || !String.isInstanceOfType(name))
  181. throw Error.argument("attachments");
  182. if(url.length > 2048)
  183. throw Error.argumentOutOfRange("attachments",url.length,_u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text);
  184. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(name)
  185. };
  186. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p=function(itemId, name)
  187. {
  188. if(!String.isInstanceOfType(itemId) || !String.isInstanceOfType(name))
  189. throw Error.argument("attachments");
  190. if(itemId.length > 200)
  191. throw Error.argumentOutOfRange("attachments",itemId.length,_u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text);
  192. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(name)
  193. };
  194. OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p=function(name)
  195. {
  196. if(name.length > 255)
  197. throw Error.argumentOutOfRange("attachments",name.length,_u.ExtensibilityStrings.l_AttachmentNameTooLong_Text);
  198. };
  199. OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function(value, expectedType, argumentName)
  200. {
  201. if(Object.getType(value) !==expectedType)
  202. throw Error.argumentType(argumentName);
  203. };
  204. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function(value, minLength, maxLength, name)
  205. {
  206. if($h.ScriptHelpers.isNullOrUndefined(value))
  207. return;
  208. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value,String,name);
  209. var stringValue=value;
  210. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(stringValue.length,minLength,maxLength,name)
  211. };
  212. OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function(dispid, data)
  213. {
  214. var executeParameters=null;
  215. switch(dispid)
  216. {
  217. case 1:
  218. case 2:
  219. case 12:
  220. case 3:
  221. case 14:
  222. case 18:
  223. case 26:
  224. break;
  225. case 4:
  226. var jsonProperty=JSON.stringify(data["customProperties"]);
  227. executeParameters=[jsonProperty];
  228. break;
  229. case 5:
  230. executeParameters=[data["body"]];
  231. break;
  232. case 8:
  233. case 9:
  234. executeParameters=[data["itemId"]];
  235. break;
  236. case 7:
  237. executeParameters=[OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["requiredAttendees"]),OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["optionalAttendees"]),data["start"],data["end"],data["location"],OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["resources"]),data["subject"],data["body"]];
  238. break;
  239. case 11:
  240. case 10:
  241. executeParameters=[data["htmlBody"]];
  242. break;
  243. case 31:
  244. case 30:
  245. executeParameters=[data["htmlBody"],data["attachments"]];
  246. break;
  247. case 23:
  248. case 13:
  249. case 29:
  250. executeParameters=[data["data"],data["coercionType"]];
  251. break;
  252. case 28:
  253. executeParameters=[data["coercionType"]];
  254. break;
  255. case 17:
  256. executeParameters=[data["subject"]];
  257. break;
  258. case 15:
  259. executeParameters=[data["recipientField"]];
  260. break;
  261. case 22:
  262. case 21:
  263. executeParameters=[data["recipientField"],OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(data["recipientArray"])];
  264. break;
  265. case 19:
  266. executeParameters=[data["itemId"],data["name"]];
  267. break;
  268. case 16:
  269. executeParameters=[data["uri"],data["name"]];
  270. break;
  271. case 20:
  272. executeParameters=[data["attachmentIndex"]];
  273. break;
  274. case 25:
  275. executeParameters=[data["TimeProperty"],data["time"]];
  276. break;
  277. case 24:
  278. executeParameters=[data["TimeProperty"]];
  279. break;
  280. case 27:
  281. executeParameters=[data["location"]];
  282. break;
  283. default:
  284. Sys.Debug.fail("Unexpected method dispid");
  285. break
  286. }
  287. return executeParameters
  288. };
  289. OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function(array)
  290. {
  291. return array ? array.join(";") : null
  292. };
  293. OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function(recipients)
  294. {
  295. if(!recipients)
  296. return null;
  297. var results=new Array(recipients.length);
  298. for(var i=0; i < recipients.length; i++)
  299. results[i]=[recipients[i]["address"],recipients[i]["name"]];
  300. return results
  301. };
  302. OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function(emailset, name)
  303. {
  304. if($h.ScriptHelpers.isNullOrUndefined(emailset))
  305. return null;
  306. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset,Array,name);
  307. var originalAttendees=emailset;
  308. var updatedAttendees=null;
  309. var normalizationNeeded=false;
  310. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(originalAttendees.length,0,OSF.DDA.OutlookAppOm._maxRecipients$p,String.format("{0}.length",name));
  311. for(var i=0; i < originalAttendees.length; i++)
  312. if($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]))
  313. {
  314. normalizationNeeded=true;
  315. break
  316. }
  317. if(normalizationNeeded)
  318. updatedAttendees=[];
  319. for(var i=0; i < originalAttendees.length; i++)
  320. if(normalizationNeeded)
  321. {
  322. updatedAttendees[i]=$h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]) ? originalAttendees[i].emailAddress : originalAttendees[i];
  323. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i],String,String.format("{0}[{1}]",name,i))
  324. }
  325. else
  326. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i],String,String.format("{0}[{1}]",name,i));
  327. return updatedAttendees
  328. };
  329. OSF.DDA.OutlookAppOm.prototype={
  330. _initialData$p$0: null,
  331. _item$p$0: null,
  332. _userProfile$p$0: null,
  333. _diagnostics$p$0: null,
  334. _officeAppContext$p$0: null,
  335. _appReadyCallback$p$0: null,
  336. _clientEndPoint$p$0: null,
  337. get_clientEndPoint: function()
  338. {
  339. if(!this._clientEndPoint$p$0)
  340. this._clientEndPoint$p$0=OSF._OfficeAppFactory.getClientEndPoint();
  341. return this._clientEndPoint$p$0
  342. },
  343. set_clientEndPoint: function(value)
  344. {
  345. this._clientEndPoint$p$0=value;
  346. return value
  347. },
  348. get_initialData: function()
  349. {
  350. return this._initialData$p$0
  351. },
  352. get__appName$i$0: function()
  353. {
  354. return this._officeAppContext$p$0.get_appName()
  355. },
  356. initialize: function(initialData)
  357. {
  358. var ItemTypeKey="itemType";
  359. this._initialData$p$0=new $h.InitialData(initialData);
  360. if(1===initialData[ItemTypeKey])
  361. this._item$p$0=new $h.Message(this._initialData$p$0);
  362. else if(3===initialData[ItemTypeKey])
  363. this._item$p$0=new $h.MeetingRequest(this._initialData$p$0);
  364. else if(2===initialData[ItemTypeKey])
  365. this._item$p$0=new $h.Appointment(this._initialData$p$0);
  366. else if(4===initialData[ItemTypeKey])
  367. this._item$p$0=new $h.MessageCompose(this._initialData$p$0);
  368. else if(5===initialData[ItemTypeKey])
  369. this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0);
  370. else
  371. Sys.Debug.trace("Unexpected item type was received from the host.");
  372. this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0);
  373. this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0,this._officeAppContext$p$0.get_appName());
  374. this._initializeMethods$p$0();
  375. $h.InitialData._defineReadOnlyProperty$i(this,"item",this.$$d__getItem$p$0);
  376. $h.InitialData._defineReadOnlyProperty$i(this,"userProfile",this.$$d__getUserProfile$p$0);
  377. $h.InitialData._defineReadOnlyProperty$i(this,"diagnostics",this.$$d__getDiagnostics$p$0);
  378. $h.InitialData._defineReadOnlyProperty$i(this,"ewsUrl",this.$$d__getEwsUrl$p$0);
  379. if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64)
  380. if(this._initialData$p$0.get__overrideWindowOpen$i$0())
  381. window.open=this.$$d_windowOpenOverrideHandler
  382. },
  383. windowOpenOverrideHandler: function(url, targetName, features, replace)
  384. {
  385. this._invokeHostMethod$i$0(0,"LaunchPalUrl",{launchUrl: url},null)
  386. },
  387. makeEwsRequestAsync: function(data)
  388. {
  389. var args=[];
  390. for(var $$pai_5=1; $$pai_5 < arguments.length;++$$pai_5)
  391. args[$$pai_5 - 1]=arguments[$$pai_5];
  392. if($h.ScriptHelpers.isNullOrUndefined(data))
  393. throw Error.argumentNull("data");
  394. if(data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p)
  395. throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);
  396. this._throwOnMethodCallForInsufficientPermission$i$0(3,"makeEwsRequestAsync");
  397. var parameters=$h.CommonParameters.parse(args,true,true);
  398. var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0);
  399. var $$t_4=this;
  400. ewsRequest.onreadystatechange=function()
  401. {
  402. if(4===ewsRequest.get__requestState$i$1())
  403. parameters._callback$p$0(ewsRequest._asyncResult$p$0)
  404. };
  405. ewsRequest.send(data)
  406. },
  407. recordDataPoint: function(data)
  408. {
  409. if($h.ScriptHelpers.isNullOrUndefined(data))
  410. throw Error.argumentNull("data");
  411. this._invokeHostMethod$i$0(0,"RecordDataPoint",data,null)
  412. },
  413. recordTrace: function(data)
  414. {
  415. if($h.ScriptHelpers.isNullOrUndefined(data))
  416. throw Error.argumentNull("data");
  417. this._invokeHostMethod$i$0(0,"RecordTrace",data,null)
  418. },
  419. trackCtq: function(data)
  420. {
  421. if($h.ScriptHelpers.isNullOrUndefined(data))
  422. throw Error.argumentNull("data");
  423. this._invokeHostMethod$i$0(0,"TrackCtq",data,null)
  424. },
  425. convertToLocalClientTime: function(timeValue)
  426. {
  427. var date=new Date(timeValue.getTime());
  428. var offset=date.getTimezoneOffset() * -1;
  429. if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0())
  430. {
  431. date.setUTCMinutes(date.getUTCMinutes() - offset);
  432. offset=this._findOffset$p$0(date);
  433. date.setUTCMinutes(date.getUTCMinutes()+offset)
  434. }
  435. var retValue=this._dateToDictionary$i$0(date);
  436. retValue["timezoneOffset"]=offset;
  437. return retValue
  438. },
  439. convertToUtcClientTime: function(input)
  440. {
  441. var retValue=this._dictionaryToDate$i$0(input);
  442. if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0())
  443. {
  444. var offset=this._findOffset$p$0(retValue);
  445. retValue.setUTCMinutes(retValue.getUTCMinutes() - offset);
  446. offset=!input["timezoneOffset"] ? retValue.getTimezoneOffset() * -1 : input["timezoneOffset"];
  447. retValue.setUTCMinutes(retValue.getUTCMinutes()+offset)
  448. }
  449. return retValue
  450. },
  451. getUserIdentityTokenAsync: function()
  452. {
  453. var args=[];
  454. for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  455. args[$$pai_2]=arguments[$$pai_2];
  456. this._throwOnMethodCallForInsufficientPermission$i$0(1,"getUserIdentityTokenAsync");
  457. var parameters=$h.CommonParameters.parse(args,true,true);
  458. this._invokeGetTokenMethodAsync$p$0(2,"GetUserIdentityToken",parameters._callback$p$0,parameters._asyncContext$p$0)
  459. },
  460. getCallbackTokenAsync: function()
  461. {
  462. var args=[];
  463. for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  464. args[$$pai_2]=arguments[$$pai_2];
  465. this._throwOnMethodCallForInsufficientPermission$i$0(1,"getCallbackTokenAsync");
  466. var parameters=$h.CommonParameters.parse(args,true,true);
  467. this._invokeGetTokenMethodAsync$p$0(12,"GetCallbackToken",parameters._callback$p$0,parameters._asyncContext$p$0)
  468. },
  469. displayMessageForm: function(itemId)
  470. {
  471. if($h.ScriptHelpers.isNullOrUndefined(itemId))
  472. throw Error.argumentNull("itemId");
  473. this._invokeHostMethod$i$0(8,"DisplayExistingMessageForm",{itemId: itemId},null)
  474. },
  475. displayAppointmentForm: function(itemId)
  476. {
  477. if($h.ScriptHelpers.isNullOrUndefined(itemId))
  478. throw Error.argumentNull("itemId");
  479. this._invokeHostMethod$i$0(9,"DisplayExistingAppointmentForm",{itemId: itemId},null)
  480. },
  481. createAsyncResult: function(value, errorCode, errorDescription, userContext)
  482. {
  483. var initArgs={};
  484. var errorArgs=null;
  485. initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value;
  486. initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext;
  487. if(0 !==errorCode)
  488. {
  489. errorArgs={};
  490. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorCode;
  491. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorDescription
  492. }
  493. return new OSF.DDA.AsyncResult(initArgs,errorArgs)
  494. },
  495. standardCreateAsyncResult: function(value, errorCode, detailedErrorCode, userContext)
  496. {
  497. var initArgs={};
  498. var errorArgs=null;
  499. initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value;
  500. initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext;
  501. if(0 !==errorCode)
  502. {
  503. errorArgs={};
  504. var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode);
  505. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorProperties["name"];
  506. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorProperties["message"];
  507. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=detailedErrorCode
  508. }
  509. return new OSF.DDA.AsyncResult(initArgs,errorArgs)
  510. },
  511. _throwOnMethodCallForInsufficientPermission$i$0: function(requiredPermissionLevel, methodName)
  512. {
  513. if(this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel)
  514. throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text,methodName));
  515. },
  516. _displayReplyForm$i$0: function(obj)
  517. {
  518. this._displayReplyFormHelper$p$0(obj,false)
  519. },
  520. _displayReplyAllForm$i$0: function(obj)
  521. {
  522. this._displayReplyFormHelper$p$0(obj,true)
  523. },
  524. _displayReplyFormHelper$p$0: function(obj, isReplyAll)
  525. {
  526. if(String.isInstanceOfType(obj))
  527. this._doDisplayReplyForm$p$0(obj,isReplyAll);
  528. else if(Object.isInstanceOfType(obj) && Object.getTypeName(obj)==="Object")
  529. {
  530. var data={};
  531. data=$.extend(true,data,obj);
  532. this._doDisplayReplyFormWithAttachments$p$0(data,isReplyAll)
  533. }
  534. else
  535. throw Error.argumentType();
  536. },
  537. _doDisplayReplyForm$p$0: function(htmlBody, isReplyAll)
  538. {
  539. if(!$h.ScriptHelpers.isNullOrUndefined(htmlBody))
  540. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length,0,OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody");
  541. this._invokeHostMethod$i$0(isReplyAll ? 11 : 10,isReplyAll ? "DisplayReplyAllForm" : "DisplayReplyForm",{htmlBody: htmlBody},null)
  542. },
  543. _doDisplayReplyFormWithAttachments$p$0: function(data, isReplyAll)
  544. {
  545. var htmlBody=OSF.DDA.OutlookAppOm._getHtmlBody$p(data);
  546. var attachments=OSF.DDA.OutlookAppOm._getAttachments$p(data);
  547. var parameters=$h.CommonParameters.parse(OSF.DDA.OutlookAppOm._getOptionsAndCallback$p(data),false);
  548. var $$t_6=this;
  549. this._standardInvokeHostMethod$i$0(isReplyAll ? 31 : 30,isReplyAll ? "DisplayReplyAllForm" : "DisplayReplyForm",{
  550. htmlBody: htmlBody,
  551. attachments: OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p(attachments)
  552. },function(rawInput)
  553. {
  554. return rawInput
  555. },parameters._asyncContext$p$0,parameters._callback$p$0)
  556. },
  557. _standardInvokeHostMethod$i$0: function(dispid, name, data, format, userContext, callback)
  558. {
  559. var $$t_C=this;
  560. this._invokeHostMethod$i$0(dispid,name,data,function(resultCode, response)
  561. {
  562. if(callback)
  563. {
  564. var asyncResult=null;
  565. if(Object.isInstanceOfType(response))
  566. {
  567. var responseDictionary=response;
  568. if("error" in responseDictionary || "data" in responseDictionary || "errorCode" in responseDictionary)
  569. if(!responseDictionary["error"])
  570. {
  571. var formattedData=format ? format(responseDictionary["data"]) : responseDictionary["data"];
  572. asyncResult=$$t_C.standardCreateAsyncResult(formattedData,0,0,userContext)
  573. }
  574. else
  575. {
  576. var errorCode=responseDictionary["errorCode"];
  577. asyncResult=$$t_C.standardCreateAsyncResult(null,1,errorCode,userContext)
  578. }
  579. }
  580. if(!asyncResult && resultCode)
  581. asyncResult=$$t_C.standardCreateAsyncResult(null,1,9002,userContext);
  582. callback(asyncResult)
  583. }
  584. })
  585. },
  586. _invokeHostMethod$i$0: function(dispid, name, data, responseCallback)
  587. {
  588. if(64===this._officeAppContext$p$0.get_appName())
  589. this.get_clientEndPoint().invoke(name,responseCallback,data);
  590. else if(dispid)
  591. {
  592. var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid,data);
  593. var $$t_B=this;
  594. window.external.execute(dispid,executeParameters,function(nativeData, resultCode)
  595. {
  596. if(responseCallback)
  597. {
  598. var responseData=nativeData.toArray();
  599. var rawData=JSON.parse(responseData[0]);
  600. if(Object.isInstanceOfType(rawData))
  601. {
  602. var deserializedData=rawData;
  603. if(responseData.length > 1 && responseData[1])
  604. {
  605. deserializedData["error"]=true;
  606. deserializedData["errorCode"]=responseData[1]
  607. }
  608. else
  609. deserializedData["error"]=false;
  610. responseCallback(resultCode,deserializedData)
  611. }
  612. else if(Number.isInstanceOfType(rawData))
  613. {
  614. var returnDict={};
  615. returnDict["error"]=true;
  616. returnDict["errorCode"]=rawData;
  617. responseCallback(resultCode,returnDict)
  618. }
  619. else
  620. throw Error.notImplemented("Return data type from host must be Dictionary or int");
  621. }
  622. })
  623. }
  624. else if(responseCallback)
  625. responseCallback(-2,null)
  626. },
  627. _dictionaryToDate$i$0: function(input)
  628. {
  629. var retValue=new Date(input["year"],input["month"],input["date"],input["hours"],input["minutes"],input["seconds"],!input["milliseconds"] ? 0 : input["milliseconds"]);
  630. if(isNaN(retValue.getTime()))
  631. throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);
  632. return retValue
  633. },
  634. _dateToDictionary$i$0: function(input)
  635. {
  636. var retValue={};
  637. retValue["month"]=input.getMonth();
  638. retValue["date"]=input.getDate();
  639. retValue["year"]=input.getFullYear();
  640. retValue["hours"]=input.getHours();
  641. retValue["minutes"]=input.getMinutes();
  642. retValue["seconds"]=input.getSeconds();
  643. retValue["milliseconds"]=input.getMilliseconds();
  644. return retValue
  645. },
  646. _displayNewAppointmentFormApi$p$0: function(parameters)
  647. {
  648. var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters["requiredAttendees"],"requiredAttendees");
  649. var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters["optionalAttendees"],"optionalAttendees");
  650. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["location"],0,OSF.DDA.OutlookAppOm._maxLocationLength$p,"location");
  651. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["body"],0,OSF.DDA.OutlookAppOm.maxBodyLength,"body");
  652. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters["subject"],0,OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject");
  653. if(!$h.ScriptHelpers.isNullOrUndefined(parameters["start"]))
  654. {
  655. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters["start"],Date,"start");
  656. var startDateTime=parameters["start"];
  657. parameters["start"]=startDateTime.getTime();
  658. if(!$h.ScriptHelpers.isNullOrUndefined(parameters["end"]))
  659. {
  660. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters["end"],Date,"end");
  661. var endDateTime=parameters["end"];
  662. if(endDateTime < startDateTime)
  663. throw Error.argumentOutOfRange("end",endDateTime,_u.ExtensibilityStrings.l_InvalidEventDates_Text);
  664. parameters["end"]=endDateTime.getTime()
  665. }
  666. }
  667. var updatedParameters=null;
  668. if(normalizedRequiredAttendees || normalizedOptionalAttendees)
  669. {
  670. updatedParameters={};
  671. var $$dict_7=parameters;
  672. for(var $$key_8 in $$dict_7)
  673. {
  674. var entry={
  675. key: $$key_8,
  676. value: $$dict_7[$$key_8]
  677. };
  678. updatedParameters[entry.key]=entry.value
  679. }
  680. if(normalizedRequiredAttendees)
  681. updatedParameters["requiredAttendees"]=normalizedRequiredAttendees;
  682. if(normalizedOptionalAttendees)
  683. updatedParameters["optionalAttendees"]=normalizedOptionalAttendees
  684. }
  685. this._invokeHostMethod$i$0(7,"DisplayNewAppointmentForm",updatedParameters || parameters,null)
  686. },
  687. _initializeMethods$p$0: function()
  688. {
  689. var currentInstance=this;
  690. if($h.Item.isInstanceOfType(this._item$p$0))
  691. currentInstance.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0
  692. },
  693. _getInitialDataResponseHandler$p$0: function(resultCode, data)
  694. {
  695. if(resultCode)
  696. return;
  697. this.initialize(data);
  698. this.displayName="mailbox";
  699. window.setTimeout(this.$$d__callAppReadyCallback$p$0,0)
  700. },
  701. _callAppReadyCallback$p$0: function()
  702. {
  703. this._appReadyCallback$p$0()
  704. },
  705. _invokeGetTokenMethodAsync$p$0: function(outlookDispid, methodName, callback, userContext)
  706. {
  707. if($h.ScriptHelpers.isNullOrUndefined(callback))
  708. throw Error.argumentNull("callback");
  709. var $$t_8=this;
  710. this._invokeHostMethod$i$0(outlookDispid,methodName,null,function(resultCode, response)
  711. {
  712. var asyncResult;
  713. if(resultCode)
  714. asyncResult=$$t_8.createAsyncResult(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode),userContext);
  715. else
  716. {
  717. var responseDictionary=response;
  718. if(responseDictionary["wasSuccessful"])
  719. asyncResult=$$t_8.createAsyncResult(responseDictionary["token"],0,null,userContext);
  720. else
  721. asyncResult=$$t_8.createAsyncResult(null,1,responseDictionary["errorMessage"],userContext)
  722. }
  723. callback(asyncResult)
  724. })
  725. },
  726. _getItem$p$0: function()
  727. {
  728. return this._item$p$0
  729. },
  730. _getUserProfile$p$0: function()
  731. {
  732. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);
  733. return this._userProfile$p$0
  734. },
  735. _getDiagnostics$p$0: function()
  736. {
  737. return this._diagnostics$p$0
  738. },
  739. _getEwsUrl$p$0: function()
  740. {
  741. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);
  742. return this._initialData$p$0.get__ewsUrl$i$0()
  743. },
  744. _findOffset$p$0: function(value)
  745. {
  746. var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0();
  747. for(var r=0; r < ranges.length; r++)
  748. {
  749. var range=ranges[r];
  750. var start=parseInt(range["start"]);
  751. var end=parseInt(range["end"]);
  752. if(value.getTime() - start >=0 && value.getTime() - end < 0)
  753. return parseInt(range["offset"])
  754. }
  755. throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);
  756. },
  757. _areStringsLoaded$p$0: function()
  758. {
  759. var stringsLoaded=false;
  760. try
  761. {
  762. stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)
  763. }
  764. catch($$e_1){}
  765. return stringsLoaded
  766. },
  767. _loadLocalizedScript$p$0: function(stringLoadedCallback)
  768. {
  769. var url=null;
  770. var baseUrl="";
  771. var scripts=document.getElementsByTagName("script");
  772. for(var i=scripts.length - 1; i >=0; i--)
  773. {
  774. var filename=null;
  775. var attributes=scripts[i].attributes;
  776. if(attributes)
  777. {
  778. var attribute=attributes.getNamedItem("src");
  779. if(attribute)
  780. filename=attribute.value;
  781. if(filename)
  782. {
  783. var debug=false;
  784. filename=filename.toLowerCase();
  785. var officeIndex=filename.indexOf("office_strings.js");
  786. if(officeIndex < 0)
  787. {
  788. officeIndex=filename.indexOf("office_strings.debug.js");
  789. debug=true
  790. }
  791. if(officeIndex > 0 && officeIndex < filename.length)
  792. {
  793. url=filename.replace(debug ? "office_strings.debug.js" : "office_strings.js","outlook_strings.js");
  794. var languageUrl=filename.substring(0,officeIndex);
  795. var lastIndexOfSlash=languageUrl.lastIndexOf("/",languageUrl.length - 2);
  796. if(lastIndexOfSlash===-1)
  797. lastIndexOfSlash=languageUrl.lastIndexOf("\\",languageUrl.length - 2);
  798. if(lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1)
  799. baseUrl=languageUrl.substring(0,lastIndexOfSlash+1);
  800. break
  801. }
  802. }
  803. }
  804. }
  805. if(url)
  806. {
  807. var head=document.getElementsByTagName("head")[0];
  808. var scriptElement=null;
  809. var $$t_H=this;
  810. var scriptElementCallback=function()
  811. {
  812. if(stringLoadedCallback && (!scriptElement.readyState || scriptElement.readyState && (scriptElement.readyState==="loaded" || scriptElement.readyState==="complete")))
  813. {
  814. scriptElement.onload=null;
  815. scriptElement.onreadystatechange=null;
  816. stringLoadedCallback()
  817. }
  818. };
  819. var $$t_I=this;
  820. var failureCallback=function()
  821. {
  822. if(!$$t_I._areStringsLoaded$p$0())
  823. {
  824. var fallbackUrl=baseUrl+"en-us/"+"outlook_strings.js";
  825. scriptElement.onload=null;
  826. scriptElement.onreadystatechange=null;
  827. scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl);
  828. scriptElement.onload=scriptElementCallback;
  829. scriptElement.onreadystatechange=scriptElementCallback;
  830. head.appendChild(scriptElement)
  831. }
  832. };
  833. scriptElement=this._createScriptElement$p$0(url);
  834. scriptElement.onload=scriptElementCallback;
  835. scriptElement.onreadystatechange=scriptElementCallback;
  836. window.setTimeout(failureCallback,2e3);
  837. head.appendChild(scriptElement)
  838. }
  839. },
  840. _createScriptElement$p$0: function(url)
  841. {
  842. var scriptElement=document.createElement("script");
  843. scriptElement.type="text/javascript";
  844. scriptElement.src=url;
  845. return scriptElement
  846. }
  847. };
  848. OSF.DDA.Settings=function(data)
  849. {
  850. this._rawData$p$0=data
  851. };
  852. OSF.DDA.Settings._convertFromRawSettings$p=function(rawSettings)
  853. {
  854. if(!rawSettings)
  855. return{};
  856. if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8)
  857. {
  858. var outlookSettings=rawSettings["SettingsKey"];
  859. if(outlookSettings)
  860. return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings)
  861. }
  862. return rawSettings
  863. };
  864. OSF.DDA.Settings.prototype={
  865. _rawData$p$0: null,
  866. _settingsData$p$0: null,
  867. get__data$p$0: function()
  868. {
  869. if(!this._settingsData$p$0)
  870. {
  871. this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0);
  872. this._rawData$p$0=null
  873. }
  874. return this._settingsData$p$0
  875. },
  876. get: function(name)
  877. {
  878. return this.get__data$p$0()[name]
  879. },
  880. set: function(name, value)
  881. {
  882. this.get__data$p$0()[name]=value
  883. },
  884. remove: function(name)
  885. {
  886. delete this.get__data$p$0()[name]
  887. },
  888. saveAsync: function()
  889. {
  890. var args=[];
  891. for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  892. args[$$pai_2]=arguments[$$pai_2];
  893. var commonParameters=$h.CommonParameters.parse(args,false);
  894. if(OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64)
  895. this._saveSettingsForOwa$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0);
  896. else
  897. this._saveSettingsForOutlook$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0)
  898. },
  899. _saveSettingsForOutlook$p$0: function(callback, userContext)
  900. {
  901. var storedException=null;
  902. try
  903. {
  904. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0());
  905. var jsonSettings=JSON.stringify(serializedSettings);
  906. var settingsObjectToSave={SettingsKey: jsonSettings};
  907. OSF.DDA.RichClientSettingsManager.write(settingsObjectToSave)
  908. }
  909. catch(ex)
  910. {
  911. storedException=ex
  912. }
  913. if(callback)
  914. {
  915. var asyncResult;
  916. if(storedException)
  917. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,storedException.message,userContext);
  918. else
  919. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,null,userContext);
  920. callback(asyncResult)
  921. }
  922. },
  923. _saveSettingsForOwa$p$0: function(callback, userContext)
  924. {
  925. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0());
  926. var $$t_7=this;
  927. OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",function(resultCode, response)
  928. {
  929. if(callback)
  930. {
  931. var asyncResult;
  932. if(resultCode)
  933. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode),userContext);
  934. else
  935. {
  936. var responseDictionary=response;
  937. if(!responseDictionary["error"])
  938. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,null,userContext);
  939. else
  940. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,responseDictionary["errorMessage"],userContext)
  941. }
  942. callback(asyncResult)
  943. }
  944. },[serializedSettings])
  945. }
  946. };
  947. Type.registerNamespace("$h");
  948. Type.registerNamespace("Office.cast");
  949. $h.Appointment=function(dataDictionary)
  950. {
  951. this.$$d__getOrganizer$p$2=Function.createDelegate(this,this._getOrganizer$p$2);
  952. this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2);
  953. this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2);
  954. this.$$d__getResources$p$2=Function.createDelegate(this,this._getResources$p$2);
  955. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2);
  956. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2);
  957. this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2);
  958. this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2);
  959. this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2);
  960. $h.Appointment.initializeBase(this,[dataDictionary]);
  961. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2);
  962. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2);
  963. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2);
  964. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2);
  965. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2);
  966. $h.InitialData._defineReadOnlyProperty$i(this,"resources",this.$$d__getResources$p$2);
  967. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2);
  968. $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2);
  969. $h.InitialData._defineReadOnlyProperty$i(this,"organizer",this.$$d__getOrganizer$p$2)
  970. };
  971. $h.Appointment.prototype={
  972. getEntities: function()
  973. {
  974. return this._data$p$0._getEntities$i$0()
  975. },
  976. getEntitiesByType: function(entityType)
  977. {
  978. return this._data$p$0._getEntitiesByType$i$0(entityType)
  979. },
  980. getRegExMatches: function()
  981. {
  982. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches");
  983. return this._data$p$0._getRegExMatches$i$0()
  984. },
  985. getFilteredEntitiesByName: function(name)
  986. {
  987. return this._data$p$0._getFilteredEntitiesByName$i$0(name)
  988. },
  989. getRegExMatchesByName: function(name)
  990. {
  991. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName");
  992. return this._data$p$0._getRegExMatchesByName$i$0(name)
  993. },
  994. displayReplyForm: function(obj)
  995. {
  996. OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(obj)
  997. },
  998. displayReplyAllForm: function(obj)
  999. {
  1000. OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(obj)
  1001. },
  1002. getItemType: function()
  1003. {
  1004. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment
  1005. },
  1006. _getStart$p$2: function()
  1007. {
  1008. return this._data$p$0.get__start$i$0()
  1009. },
  1010. _getEnd$p$2: function()
  1011. {
  1012. return this._data$p$0.get__end$i$0()
  1013. },
  1014. _getLocation$p$2: function()
  1015. {
  1016. return this._data$p$0.get__location$i$0()
  1017. },
  1018. _getOptionalAttendees$p$2: function()
  1019. {
  1020. return this._data$p$0.get__cc$i$0()
  1021. },
  1022. _getRequiredAttendees$p$2: function()
  1023. {
  1024. return this._data$p$0.get__to$i$0()
  1025. },
  1026. _getResources$p$2: function()
  1027. {
  1028. return this._data$p$0.get__resources$i$0()
  1029. },
  1030. _getSubject$p$2: function()
  1031. {
  1032. return this._data$p$0.get__subject$i$0()
  1033. },
  1034. _getNormalizedSubject$p$2: function()
  1035. {
  1036. return this._data$p$0.get__normalizedSubject$i$0()
  1037. },
  1038. _getOrganizer$p$2: function()
  1039. {
  1040. return this._data$p$0.get__organizer$i$0()
  1041. }
  1042. };
  1043. $h.AppointmentCompose=function(data)
  1044. {
  1045. this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2);
  1046. this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2);
  1047. this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2);
  1048. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2);
  1049. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2);
  1050. $h.AppointmentCompose.initializeBase(this,[data]);
  1051. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2);
  1052. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2);
  1053. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2);
  1054. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2);
  1055. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2)
  1056. };
  1057. $h.AppointmentCompose.prototype={
  1058. _requiredAttendees$p$2: null,
  1059. _optionalAttendees$p$2: null,
  1060. _start$p$2: null,
  1061. _end$p$2: null,
  1062. _location$p$2: null,
  1063. getItemType: function()
  1064. {
  1065. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment
  1066. },
  1067. _getRequiredAttendees$p$2: function()
  1068. {
  1069. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1070. if(!this._requiredAttendees$p$2)
  1071. this._requiredAttendees$p$2=new $h.ComposeRecipient(0,"requiredAttendees");
  1072. return this._requiredAttendees$p$2
  1073. },
  1074. _getOptionalAttendees$p$2: function()
  1075. {
  1076. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1077. if(!this._optionalAttendees$p$2)
  1078. this._optionalAttendees$p$2=new $h.ComposeRecipient(1,"optionalAttendees");
  1079. return this._optionalAttendees$p$2
  1080. },
  1081. _getStart$p$2: function()
  1082. {
  1083. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1084. if(!this._start$p$2)
  1085. this._start$p$2=new $h.ComposeTime(1);
  1086. return this._start$p$2
  1087. },
  1088. _getEnd$p$2: function()
  1089. {
  1090. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1091. if(!this._end$p$2)
  1092. this._end$p$2=new $h.ComposeTime(2);
  1093. return this._end$p$2
  1094. },
  1095. _getLocation$p$2: function()
  1096. {
  1097. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1098. if(!this._location$p$2)
  1099. this._location$p$2=new $h.ComposeLocation;
  1100. return this._location$p$2
  1101. }
  1102. };
  1103. $h.AttachmentConstants=function(){};
  1104. $h.AttachmentDetails=function(data)
  1105. {
  1106. this.$$d__getIsInline$p$0=Function.createDelegate(this,this._getIsInline$p$0);
  1107. this.$$d__getAttachmentType$p$0=Function.createDelegate(this,this._getAttachmentType$p$0);
  1108. this.$$d__getSize$p$0=Function.createDelegate(this,this._getSize$p$0);
  1109. this.$$d__getContentType$p$0=Function.createDelegate(this,this._getContentType$p$0);
  1110. this.$$d__getName$p$0=Function.createDelegate(this,this._getName$p$0);
  1111. this.$$d__getId$p$0=Function.createDelegate(this,this._getId$p$0);
  1112. this._data$p$0=data;
  1113. $h.InitialData._defineReadOnlyProperty$i(this,"id",this.$$d__getId$p$0);
  1114. $h.InitialData._defineReadOnlyProperty$i(this,"name",this.$$d__getName$p$0);
  1115. $h.InitialData._defineReadOnlyProperty$i(this,"contentType",this.$$d__getContentType$p$0);
  1116. $h.InitialData._defineReadOnlyProperty$i(this,"size",this.$$d__getSize$p$0);
  1117. $h.InitialData._defineReadOnlyProperty$i(this,"attachmentType",this.$$d__getAttachmentType$p$0);
  1118. $h.InitialData._defineReadOnlyProperty$i(this,"isInline",this.$$d__getIsInline$p$0)
  1119. };
  1120. $h.AttachmentDetails.prototype={
  1121. _data$p$0: null,
  1122. _getId$p$0: function()
  1123. {
  1124. return this._data$p$0["id"]
  1125. },
  1126. _getName$p$0: function()
  1127. {
  1128. return this._data$p$0["name"]
  1129. },
  1130. _getContentType$p$0: function()
  1131. {
  1132. return this._data$p$0["contentType"]
  1133. },
  1134. _getSize$p$0: function()
  1135. {
  1136. return this._data$p$0["size"]
  1137. },
  1138. _getAttachmentType$p$0: function()
  1139. {
  1140. var response=this._data$p$0["attachmentType"];
  1141. return response < $h.AttachmentDetails._attachmentTypeMap$p.length ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File
  1142. },
  1143. _getIsInline$p$0: function()
  1144. {
  1145. return this._data$p$0["isInline"]
  1146. }
  1147. };
  1148. $h.ComposeBody=function(){};
  1149. $h.ComposeBody._createParameterDictionaryToHost$i=function(data, parameters)
  1150. {
  1151. var dataToHost={data: data};
  1152. if(parameters._options$p$0 && !$h.ScriptHelpers.isNull(parameters._options$p$0["coercionType"]))
  1153. {
  1154. var hostCoercionType;
  1155. var $$t_4,
  1156. $$t_5;
  1157. if(!($$t_5=$h.ComposeBody._tryMapToHostCoercionType$i(parameters._options$p$0["coercionType"],$$t_4={val: hostCoercionType}),hostCoercionType=$$t_4.val,$$t_5))
  1158. {
  1159. if(parameters._callback$p$0)
  1160. parameters._callback$p$0(OSF.DDA.OutlookAppOm._instance$p.standardCreateAsyncResult(null,1,1e3,parameters._asyncContext$p$0));
  1161. return null
  1162. }
  1163. dataToHost["coercionType"]=hostCoercionType
  1164. }
  1165. else
  1166. dataToHost["coercionType"]=0;
  1167. return dataToHost
  1168. };
  1169. $h.ComposeBody._tryMapToHostCoercionType$i=function(coercionType, hostCoercionType)
  1170. {
  1171. hostCoercionType.val=undefined;
  1172. if(coercionType===Microsoft.Office.WebExtension.CoercionType.Html)
  1173. hostCoercionType.val=3;
  1174. else if(coercionType===Microsoft.Office.WebExtension.CoercionType.Text)
  1175. hostCoercionType.val=0;
  1176. else
  1177. return false;
  1178. return true
  1179. };
  1180. $h.ComposeBody.prototype={
  1181. getTypeAsync: function()
  1182. {
  1183. var args=[];
  1184. for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1185. args[$$pai_2]=arguments[$$pai_2];
  1186. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getTypeAsync");
  1187. var parameters=$h.CommonParameters.parse(args,true);
  1188. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14,"GetBodyTypeAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1189. },
  1190. setSelectedDataAsync: function(data)
  1191. {
  1192. var args=[];
  1193. for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4)
  1194. args[$$pai_4 - 1]=arguments[$$pai_4];
  1195. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setSelectedDataAsync");
  1196. var parameters=$h.CommonParameters.parse(args,false);
  1197. if(!String.isInstanceOfType(data))
  1198. throw Error.argumentType("data",Object.getType(data),String);
  1199. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data");
  1200. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  1201. if(!dataToHost)
  1202. return;
  1203. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13,"BodySetSelectedDataAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1204. },
  1205. prependAsync: function(data)
  1206. {
  1207. var args=[];
  1208. for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4)
  1209. args[$$pai_4 - 1]=arguments[$$pai_4];
  1210. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.prependAsync");
  1211. var parameters=$h.CommonParameters.parse(args,false);
  1212. if(!String.isInstanceOfType(data))
  1213. throw Error.argumentType("data",Object.getType(data),String);
  1214. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data");
  1215. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  1216. if(!dataToHost)
  1217. return;
  1218. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23,"BodyPrependAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1219. }
  1220. };
  1221. $h.ComposeItem=function(data)
  1222. {
  1223. this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1);
  1224. this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1);
  1225. $h.ComposeItem.initializeBase(this,[data]);
  1226. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1);
  1227. $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1)
  1228. };
  1229. $h.ComposeItem.prototype={
  1230. _subject$p$1: null,
  1231. _body$p$1: null,
  1232. addFileAttachmentAsync: function(uri, attachmentName)
  1233. {
  1234. var args=[];
  1235. for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5)
  1236. args[$$pai_5 - 2]=arguments[$$pai_5];
  1237. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addFileAttachmentAsync");
  1238. if(!$h.ScriptHelpers.isNonEmptyString(uri))
  1239. throw Error.argument("uri");
  1240. if(!$h.ScriptHelpers.isNonEmptyString(attachmentName))
  1241. throw Error.argument("attachmentName");
  1242. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(uri.length,0,2048,"uri");
  1243. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length,0,255,"attachmentName");
  1244. var commonParameters=$h.CommonParameters.parse(args,false);
  1245. var parameters={
  1246. uri: uri,
  1247. name: attachmentName,
  1248. __timeout__: 6e5
  1249. };
  1250. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16,"AddFileAttachmentAsync",parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  1251. },
  1252. addItemAttachmentAsync: function(itemId, attachmentName)
  1253. {
  1254. var args=[];
  1255. for(var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5)
  1256. args[$$pai_5 - 2]=arguments[$$pai_5];
  1257. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addItemAttachmentAsync");
  1258. if(!$h.ScriptHelpers.isNonEmptyString(itemId))
  1259. throw Error.argument("itemId");
  1260. if(!$h.ScriptHelpers.isNonEmptyString(attachmentName))
  1261. throw Error.argument("attachmentName");
  1262. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(itemId.length,0,200,"itemId");
  1263. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length,0,255,"attachmentName");
  1264. var commonParameters=$h.CommonParameters.parse(args,false);
  1265. var parameters={
  1266. itemId: itemId,
  1267. name: attachmentName,
  1268. __timeout__: 6e5
  1269. };
  1270. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19,"AddItemAttachmentAsync",parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  1271. },
  1272. removeAttachmentAsync: function(attachmentId)
  1273. {
  1274. var args=[];
  1275. for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3)
  1276. args[$$pai_3 - 1]=arguments[$$pai_3];
  1277. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"removeAttachmentAsync");
  1278. if(!$h.ScriptHelpers.isNonEmptyString(attachmentId))
  1279. throw Error.argument("attachmentId");
  1280. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentId.length,0,200,"attachmentId");
  1281. var commonParameters=$h.CommonParameters.parse(args,false);
  1282. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20,"RemoveAttachmentAsync",{attachmentIndex: attachmentId},null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  1283. },
  1284. getSelectedDataAsync: function(coercionType)
  1285. {
  1286. var args=[];
  1287. for(var $$pai_7=1; $$pai_7 < arguments.length;++$$pai_7)
  1288. args[$$pai_7 - 1]=arguments[$$pai_7];
  1289. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getSelectedDataAsync");
  1290. var commonParameters=$h.CommonParameters.parse(args,true);
  1291. var hostCoercionType;
  1292. var $$t_5,
  1293. $$t_6;
  1294. if(coercionType !==Microsoft.Office.WebExtension.CoercionType.Html && coercionType !==Microsoft.Office.WebExtension.CoercionType.Text || !($$t_6=$h.ComposeBody._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5.val,$$t_6))
  1295. throw Error.argument("coercionType");
  1296. var dataToHost={coercionType: hostCoercionType};
  1297. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(28,"GetSelectedDataAsync",dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  1298. },
  1299. setSelectedDataAsync: function(data)
  1300. {
  1301. var args=[];
  1302. for(var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4)
  1303. args[$$pai_4 - 1]=arguments[$$pai_4];
  1304. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"setSelectedDataAsync");
  1305. var parameters=$h.CommonParameters.parse(args,false);
  1306. if(!String.isInstanceOfType(data))
  1307. throw Error.argumentType("data",Object.getType(data),String);
  1308. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,1e6,"data");
  1309. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  1310. if(!dataToHost)
  1311. return;
  1312. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(29,"SetSelectedDataAsync",dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1313. },
  1314. _getBody$p$1: function()
  1315. {
  1316. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1317. if(!this._body$p$1)
  1318. this._body$p$1=new $h.ComposeBody;
  1319. return this._body$p$1
  1320. },
  1321. _getSubject$p$1: function()
  1322. {
  1323. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1324. if(!this._subject$p$1)
  1325. this._subject$p$1=new $h.ComposeSubject;
  1326. return this._subject$p$1
  1327. }
  1328. };
  1329. $h.ComposeRecipient=function(type, propertyName)
  1330. {
  1331. this._type$p$0=type;
  1332. this._propertyName$p$0=propertyName
  1333. };
  1334. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function(displayName, emailAddress)
  1335. {
  1336. if(!displayName && !emailAddress)
  1337. throw Error.argument("recipients");
  1338. if(displayName && displayName.length > 255)
  1339. throw Error.argumentOutOfRange("recipients",displayName.length,_u.ExtensibilityStrings.l_DisplayNameTooLong_Text);
  1340. if(emailAddress && emailAddress.length > 571)
  1341. throw Error.argumentOutOfRange("recipients",emailAddress.length,_u.ExtensibilityStrings.l_EmailAddressTooLong_Text);
  1342. };
  1343. $h.ComposeRecipient._getAsyncFormatter$p=function(rawInput)
  1344. {
  1345. var input=rawInput;
  1346. var output=[];
  1347. for(var i=0; i < input.length; i++)
  1348. {
  1349. var email=new $h.EmailAddressDetails(input[i]);
  1350. output[i]=email
  1351. }
  1352. return output
  1353. };
  1354. $h.ComposeRecipient._createEmailDictionaryForHost$p=function(address, name)
  1355. {
  1356. return{
  1357. address: address,
  1358. name: name
  1359. }
  1360. };
  1361. $h.ComposeRecipient.prototype={
  1362. _propertyName$p$0: null,
  1363. _type$p$0: 0,
  1364. getAsync: function()
  1365. {
  1366. var args=[];
  1367. for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1368. args[$$pai_2]=arguments[$$pai_2];
  1369. var parameters=$h.CommonParameters.parse(args,true);
  1370. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._propertyName$p$0+".getAsync");
  1371. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(15,"GetRecipientsAsync",{recipientField: this._type$p$0},$h.ComposeRecipient._getAsyncFormatter$p,parameters._asyncContext$p$0,parameters._callback$p$0)
  1372. },
  1373. setAsync: function(recipients)
  1374. {
  1375. var args=[];
  1376. for(var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2)
  1377. args[$$pai_2 - 1]=arguments[$$pai_2];
  1378. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".setAsync");
  1379. this.setAddHelper(recipients,args,true)
  1380. },
  1381. addAsync: function(recipients)
  1382. {
  1383. var args=[];
  1384. for(var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2)
  1385. args[$$pai_2 - 1]=arguments[$$pai_2];
  1386. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".addAsync");
  1387. this.setAddHelper(recipients,args,false)
  1388. },
  1389. setAddHelper: function(recipients, args, isSet)
  1390. {
  1391. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(recipients.length,0,100,"recipients");
  1392. var parameters=$h.CommonParameters.parse(args,false);
  1393. var recipientData=[];
  1394. if(Array.isInstanceOfType(recipients))
  1395. for(var i=0; i < recipients.length; i++)
  1396. if(String.isInstanceOfType(recipients[i]))
  1397. {
  1398. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i],recipients[i]);
  1399. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i],recipients[i])
  1400. }
  1401. else if($h.EmailAddressDetails.isInstanceOfType(recipients[i]))
  1402. {
  1403. var address=recipients[i];
  1404. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address.displayName,address.emailAddress);
  1405. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address.emailAddress,address.displayName)
  1406. }
  1407. else if(Object.isInstanceOfType(recipients[i]))
  1408. {
  1409. var input=recipients[i];
  1410. var emailAddress=input["emailAddress"];
  1411. var displayName=input["displayName"];
  1412. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName,emailAddress);
  1413. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress,displayName)
  1414. }
  1415. else
  1416. throw Error.argument("recipients");
  1417. else
  1418. throw Error.argument("recipients");
  1419. var $$t_B=this;
  1420. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(isSet ? 21 : 22,isSet ? "SetRecipientsAsync" : "AddRecipientsAsync",{
  1421. recipientField: this._type$p$0,
  1422. recipientArray: recipientData
  1423. },function(rawInput)
  1424. {
  1425. return rawInput
  1426. },parameters._asyncContext$p$0,parameters._callback$p$0)
  1427. }
  1428. };
  1429. $h.ComposeRecipient.RecipientField=function(){};
  1430. $h.ComposeRecipient.RecipientField.prototype={
  1431. to: 0,
  1432. cc: 1,
  1433. bcc: 2,
  1434. requiredAttendees: 0,
  1435. optionalAttendees: 1
  1436. };
  1437. $h.ComposeRecipient.RecipientField.registerEnum("$h.ComposeRecipient.RecipientField",false);
  1438. $h.ComposeLocation=function(){};
  1439. $h.ComposeLocation.prototype={
  1440. getAsync: function()
  1441. {
  1442. var args=[];
  1443. for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1444. args[$$pai_2]=arguments[$$pai_2];
  1445. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"location.getAsync");
  1446. var parameters=$h.CommonParameters.parse(args,true);
  1447. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26,"GetLocationAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1448. },
  1449. setAsync: function(location)
  1450. {
  1451. var args=[];
  1452. for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3)
  1453. args[$$pai_3 - 1]=arguments[$$pai_3];
  1454. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"location.setAsync");
  1455. var parameters=$h.CommonParameters.parse(args,false);
  1456. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(location.length,0,255,"location");
  1457. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27,"SetLocationAsync",{location: location},null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1458. }
  1459. };
  1460. $h.ComposeSubject=function(){};
  1461. $h.ComposeSubject.prototype={
  1462. getAsync: function()
  1463. {
  1464. var args=[];
  1465. for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1466. args[$$pai_2]=arguments[$$pai_2];
  1467. var parameters=$h.CommonParameters.parse(args,true);
  1468. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"subject.getAsync");
  1469. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18,"GetSubjectAsync",null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1470. },
  1471. setAsync: function(data)
  1472. {
  1473. var args=[];
  1474. for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3)
  1475. args[$$pai_3 - 1]=arguments[$$pai_3];
  1476. var parameters=$h.CommonParameters.parse(args,false);
  1477. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"subject.setAsync");
  1478. if(!String.isInstanceOfType(data))
  1479. throw Error.argument("data");
  1480. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length,0,255,"data");
  1481. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17,"SetSubjectAsync",{subject: data},null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1482. }
  1483. };
  1484. $h.ComposeTime=function(type)
  1485. {
  1486. this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this,this._ticksToDateFormatter$p$0);
  1487. this._timeType$p$0=type
  1488. };
  1489. $h.ComposeTime.prototype={
  1490. _timeType$p$0: 0,
  1491. getAsync: function()
  1492. {
  1493. var args=[];
  1494. for(var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1495. args[$$pai_2]=arguments[$$pai_2];
  1496. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._getPropertyName$p$0()+".getAsync");
  1497. var parameters=$h.CommonParameters.parse(args,true);
  1498. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24,"GetTimeAsync",{TimeProperty: this._timeType$p$0},this.$$d__ticksToDateFormatter$p$0,parameters._asyncContext$p$0,parameters._callback$p$0)
  1499. },
  1500. setAsync: function(dateTime)
  1501. {
  1502. var args=[];
  1503. for(var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3)
  1504. args[$$pai_3 - 1]=arguments[$$pai_3];
  1505. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._getPropertyName$p$0()+".setAsync");
  1506. if(!Date.isInstanceOfType(dateTime))
  1507. throw Error.argumentType("dateTime",Object.getType(dateTime),Date);
  1508. if(isNaN(dateTime.getTime()))
  1509. throw Error.argument("dateTime");
  1510. if(dateTime.getTime() < -864e13 || dateTime.getTime() > 864e13)
  1511. throw Error.argumentOutOfRange("dateTime");
  1512. var parameters=$h.CommonParameters.parse(args,false);
  1513. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25,"SetTimeAsync",{
  1514. TimeProperty: this._timeType$p$0,
  1515. time: dateTime.getTime()
  1516. },null,parameters._asyncContext$p$0,parameters._callback$p$0)
  1517. },
  1518. _ticksToDateFormatter$p$0: function(rawInput)
  1519. {
  1520. var ticks=rawInput;
  1521. return new Date(ticks)
  1522. },
  1523. _getPropertyName$p$0: function()
  1524. {
  1525. return this._timeType$p$0===1 ? "start" : "end"
  1526. }
  1527. };
  1528. $h.ComposeTime.TimeType=function(){};
  1529. $h.ComposeTime.TimeType.prototype={
  1530. start: 1,
  1531. end: 2
  1532. };
  1533. $h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",false);
  1534. $h.Contact=function(data)
  1535. {
  1536. this.$$d__getContactString$p$0=Function.createDelegate(this,this._getContactString$p$0);
  1537. this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0);
  1538. this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0);
  1539. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0);
  1540. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0);
  1541. this.$$d__getBusinessName$p$0=Function.createDelegate(this,this._getBusinessName$p$0);
  1542. this.$$d__getPersonName$p$0=Function.createDelegate(this,this._getPersonName$p$0);
  1543. this._data$p$0=data;
  1544. $h.InitialData._defineReadOnlyProperty$i(this,"personName",this.$$d__getPersonName$p$0);
  1545. $h.InitialData._defineReadOnlyProperty$i(this,"businessName",this.$$d__getBusinessName$p$0);
  1546. $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0);
  1547. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0);
  1548. $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0);
  1549. $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0);
  1550. $h.InitialData._defineReadOnlyProperty$i(this,"contactString",this.$$d__getContactString$p$0)
  1551. };
  1552. $h.Contact.prototype={
  1553. _data$p$0: null,
  1554. _phoneNumbers$p$0: null,
  1555. _getPersonName$p$0: function()
  1556. {
  1557. return this._data$p$0["PersonName"]
  1558. },
  1559. _getBusinessName$p$0: function()
  1560. {
  1561. return this._data$p$0["BusinessName"]
  1562. },
  1563. _getAddresses$p$0: function()
  1564. {
  1565. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses")
  1566. },
  1567. _getEmailAddresses$p$0: function()
  1568. {
  1569. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses")
  1570. },
  1571. _getUrls$p$0: function()
  1572. {
  1573. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls")
  1574. },
  1575. _getPhoneNumbers$p$0: function()
  1576. {
  1577. if(!this._phoneNumbers$p$0)
  1578. {
  1579. var $$t_1=this;
  1580. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",function(data)
  1581. {
  1582. return new $h.PhoneNumber(data)
  1583. })
  1584. }
  1585. return this._phoneNumbers$p$0
  1586. },
  1587. _getContactString$p$0: function()
  1588. {
  1589. return this._data$p$0["ContactString"]
  1590. }
  1591. };
  1592. $h.CustomProperties=function(data)
  1593. {
  1594. if($h.ScriptHelpers.isNullOrUndefined(data))
  1595. throw Error.argumentNull("data");
  1596. if(Array.isInstanceOfType(data))
  1597. {
  1598. var customPropertiesArray=data;
  1599. if(customPropertiesArray.length > 0)
  1600. this._data$p$0=customPropertiesArray[0];
  1601. else
  1602. throw Error.argument("data");
  1603. }
  1604. else
  1605. this._data$p$0=data
  1606. };
  1607. $h.CustomProperties.prototype={
  1608. _data$p$0: null,
  1609. get: function(name)
  1610. {
  1611. var value=this._data$p$0[name];
  1612. if(typeof value==="string")
  1613. {
  1614. var valueString=value;
  1615. if(valueString.length > 6 && valueString.startsWith("Date(") && valueString.endsWith(")"))
  1616. {
  1617. var ticksString=valueString.substring(5,valueString.length - 1);
  1618. var ticks=parseInt(ticksString);
  1619. if(!isNaN(ticks))
  1620. {
  1621. var dateTimeValue=new Date(ticks);
  1622. if(dateTimeValue)
  1623. value=dateTimeValue
  1624. }
  1625. }
  1626. }
  1627. return value
  1628. },
  1629. set: function(name, value)
  1630. {
  1631. if(OSF.OUtil.isDate(value))
  1632. value="Date("+value.getTime()+")";
  1633. this._data$p$0[name]=value
  1634. },
  1635. remove: function(name)
  1636. {
  1637. delete this._data$p$0[name]
  1638. },
  1639. saveAsync: function()
  1640. {
  1641. var args=[];
  1642. for(var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4)
  1643. args[$$pai_4]=arguments[$$pai_4];
  1644. var MaxCustomPropertiesLength=2500;
  1645. if(JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength)
  1646. throw Error.argument();
  1647. var parameters=$h.CommonParameters.parse(args,false,true);
  1648. var saveCustomProperties=new $h._saveDictionaryRequest(parameters._callback$p$0,parameters._asyncContext$p$0);
  1649. saveCustomProperties._sendRequest$i$0(4,"SaveCustomProperties",{customProperties: this._data$p$0})
  1650. }
  1651. };
  1652. $h.Diagnostics=function(data, appName)
  1653. {
  1654. this.$$d__getOwaView$p$0=Function.createDelegate(this,this._getOwaView$p$0);
  1655. this.$$d__getHostVersion$p$0=Function.createDelegate(this,this._getHostVersion$p$0);
  1656. this.$$d__getHostName$p$0=Function.createDelegate(this,this._getHostName$p$0);
  1657. this._data$p$0=data;
  1658. this._appName$p$0=appName;
  1659. $h.InitialData._defineReadOnlyProperty$i(this,"hostName",this.$$d__getHostName$p$0);
  1660. $h.InitialData._defineReadOnlyProperty$i(this,"hostVersion",this.$$d__getHostVersion$p$0);
  1661. if(64===this._appName$p$0)
  1662. $h.InitialData._defineReadOnlyProperty$i(this,"OWAView",this.$$d__getOwaView$p$0)
  1663. };
  1664. $h.Diagnostics.prototype={
  1665. _data$p$0: null,
  1666. _appName$p$0: 0,
  1667. _getHostName$p$0: function()
  1668. {
  1669. if(8===this._appName$p$0)
  1670. return"Outlook";
  1671. else if(64===this._appName$p$0)
  1672. return"OutlookWebApp";
  1673. return null
  1674. },
  1675. _getHostVersion$p$0: function()
  1676. {
  1677. return this._data$p$0.get__hostVersion$i$0()
  1678. },
  1679. _getOwaView$p$0: function()
  1680. {
  1681. return this._data$p$0.get__owaView$i$0()
  1682. }
  1683. };
  1684. $h.EmailAddressDetails=function(data)
  1685. {
  1686. this.$$d__getRecipientType$p$0=Function.createDelegate(this,this._getRecipientType$p$0);
  1687. this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this,this._getAppointmentResponse$p$0);
  1688. this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0);
  1689. this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0);
  1690. this._data$p$0=data;
  1691. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0);
  1692. $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0);
  1693. if($h.ScriptHelpers.dictionaryContainsKey(data,"appointmentResponse"))
  1694. $h.InitialData._defineReadOnlyProperty$i(this,"appointmentResponse",this.$$d__getAppointmentResponse$p$0);
  1695. if($h.ScriptHelpers.dictionaryContainsKey(data,"recipientType"))
  1696. $h.InitialData._defineReadOnlyProperty$i(this,"recipientType",this.$$d__getRecipientType$p$0)
  1697. };
  1698. $h.EmailAddressDetails._createFromEmailUserDictionary$i=function(data)
  1699. {
  1700. var emailAddressDetailsDictionary={};
  1701. var displayName=data["Name"];
  1702. var emailAddress=data["UserId"];
  1703. emailAddressDetailsDictionary["name"]=displayName || $h.EmailAddressDetails._emptyString$p;
  1704. emailAddressDetailsDictionary["address"]=emailAddress || $h.EmailAddressDetails._emptyString$p;
  1705. return new $h.EmailAddressDetails(emailAddressDetailsDictionary)
  1706. };
  1707. $h.EmailAddressDetails.prototype={
  1708. _data$p$0: null,
  1709. toJSON: function()
  1710. {
  1711. var result={};
  1712. result["emailAddress"]=this._getEmailAddress$p$0();
  1713. result["displayName"]=this._getDisplayName$p$0();
  1714. if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"appointmentResponse"))
  1715. result["appointmentResponse"]=this._getAppointmentResponse$p$0();
  1716. if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"recipientType"))
  1717. result["recipientType"]=this._getRecipientType$p$0();
  1718. return result
  1719. },
  1720. _getEmailAddress$p$0: function()
  1721. {
  1722. return this._data$p$0["address"]
  1723. },
  1724. _getDisplayName$p$0: function()
  1725. {
  1726. return this._data$p$0["name"]
  1727. },
  1728. _getAppointmentResponse$p$0: function()
  1729. {
  1730. var response=this._data$p$0["appointmentResponse"];
  1731. return response < $h.EmailAddressDetails._responseTypeMap$p.length ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None
  1732. },
  1733. _getRecipientType$p$0: function()
  1734. {
  1735. var response=this._data$p$0["recipientType"];
  1736. return response < $h.EmailAddressDetails._recipientTypeMap$p.length ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other
  1737. }
  1738. };
  1739. $h.Entities=function(data, filteredEntitiesData, timeSent, permissionLevel)
  1740. {
  1741. this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this,this._createMeetingSuggestion$p$0);
  1742. this.$$d__getContacts$p$0=Function.createDelegate(this,this._getContacts$p$0);
  1743. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0);
  1744. this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0);
  1745. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0);
  1746. this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this,this._getMeetingSuggestions$p$0);
  1747. this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this,this._getTaskSuggestions$p$0);
  1748. this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0);
  1749. this._data$p$0=data || {};
  1750. this._filteredData$p$0=filteredEntitiesData || {};
  1751. this._dateTimeSent$p$0=timeSent;
  1752. $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0);
  1753. $h.InitialData._defineReadOnlyProperty$i(this,"taskSuggestions",this.$$d__getTaskSuggestions$p$0);
  1754. $h.InitialData._defineReadOnlyProperty$i(this,"meetingSuggestions",this.$$d__getMeetingSuggestions$p$0);
  1755. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0);
  1756. $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0);
  1757. $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0);
  1758. $h.InitialData._defineReadOnlyProperty$i(this,"contacts",this.$$d__getContacts$p$0);
  1759. this._permissionLevel$p$0=permissionLevel
  1760. };
  1761. $h.Entities._getExtractedObjects$i=function(T, data, name, creator, removeDuplicates, stringPropertyName)
  1762. {
  1763. var results=null;
  1764. var extractedObjects=data[name];
  1765. if(!extractedObjects)
  1766. return new Array(0);
  1767. if(removeDuplicates)
  1768. extractedObjects=$h.Entities._removeDuplicate$p(Object,extractedObjects,$h.Entities._entityDictionaryEquals$p,stringPropertyName);
  1769. results=new Array(extractedObjects.length);
  1770. var count=0;
  1771. for(var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B)
  1772. {
  1773. var extractedObject=$$arr_9[$$idx_B];
  1774. results[count++]=creator(extractedObject)
  1775. }
  1776. return results
  1777. };
  1778. $h.Entities._getExtractedStringProperty$i=function(data, name, removeDuplicate)
  1779. {
  1780. var extractedProperties=data[name];
  1781. if(!extractedProperties)
  1782. return new Array(0);
  1783. if(removeDuplicate)
  1784. extractedProperties=$h.Entities._removeDuplicate$p(String,extractedProperties,$h.Entities._stringEquals$p,null);
  1785. return extractedProperties
  1786. };
  1787. $h.Entities._createContact$p=function(data)
  1788. {
  1789. return new $h.Contact(data)
  1790. };
  1791. $h.Entities._createTaskSuggestion$p=function(data)
  1792. {
  1793. return new $h.TaskSuggestion(data)
  1794. };
  1795. $h.Entities._createPhoneNumber$p=function(data)
  1796. {
  1797. return new $h.PhoneNumber(data)
  1798. };
  1799. $h.Entities._entityDictionaryEquals$p=function(dictionary1, dictionary2, entityPropertyIdentifier)
  1800. {
  1801. if(dictionary1===dictionary2)
  1802. return true;
  1803. if(!dictionary1 || !dictionary2)
  1804. return false;
  1805. if(dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier])
  1806. return true;
  1807. return false
  1808. };
  1809. $h.Entities._stringEquals$p=function(string1, string2, entityProperty)
  1810. {
  1811. return string1===string2
  1812. };
  1813. $h.Entities._removeDuplicate$p=function(T, array, entityEquals, entityPropertyIdentifier)
  1814. {
  1815. for(var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--)
  1816. {
  1817. var removeMatch=false;
  1818. for(var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--)
  1819. if(entityEquals(array[matchIndex1],array[matchIndex2],entityPropertyIdentifier))
  1820. {
  1821. removeMatch=true;
  1822. break
  1823. }
  1824. if(removeMatch)
  1825. Array.removeAt(array,matchIndex1)
  1826. }
  1827. return array
  1828. };
  1829. $h.Entities.prototype={
  1830. _dateTimeSent$p$0: null,
  1831. _data$p$0: null,
  1832. _filteredData$p$0: null,
  1833. _filteredEntitiesCache$p$0: null,
  1834. _permissionLevel$p$0: 0,
  1835. _taskSuggestions$p$0: null,
  1836. _meetingSuggestions$p$0: null,
  1837. _phoneNumbers$p$0: null,
  1838. _contacts$p$0: null,
  1839. _addresses$p$0: null,
  1840. _emailAddresses$p$0: null,
  1841. _urls$p$0: null,
  1842. _getByType$i$0: function(entityType)
  1843. {
  1844. if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)
  1845. return this._getMeetingSuggestions$p$0();
  1846. else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)
  1847. return this._getTaskSuggestions$p$0();
  1848. else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)
  1849. return this._getAddresses$p$0();
  1850. else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)
  1851. return this._getPhoneNumbers$p$0();
  1852. else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)
  1853. return this._getEmailAddresses$p$0();
  1854. else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)
  1855. return this._getUrls$p$0();
  1856. else if(entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)
  1857. return this._getContacts$p$0();
  1858. return null
  1859. },
  1860. _getFilteredEntitiesByName$i$0: function(name)
  1861. {
  1862. if(!this._filteredEntitiesCache$p$0)
  1863. this._filteredEntitiesCache$p$0={};
  1864. if(!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0,name))
  1865. {
  1866. var found=false;
  1867. for(var i=0; i < $h.Entities._allEntityKeys$p.length; i++)
  1868. {
  1869. var entityTypeKey=$h.Entities._allEntityKeys$p[i];
  1870. var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey];
  1871. if(!perEntityTypeDictionary)
  1872. continue;
  1873. if($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary,name))
  1874. {
  1875. switch(entityTypeKey)
  1876. {
  1877. case"EmailAddresses":
  1878. case"Urls":
  1879. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name);
  1880. break;
  1881. case"Addresses":
  1882. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name,true);
  1883. break;
  1884. case"PhoneNumbers":
  1885. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber,perEntityTypeDictionary,name,$h.Entities._createPhoneNumber$p,false,null);
  1886. break;
  1887. case"TaskSuggestions":
  1888. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,perEntityTypeDictionary,name,$h.Entities._createTaskSuggestion$p,true,"TaskString");
  1889. break;
  1890. case"MeetingSuggestions":
  1891. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,perEntityTypeDictionary,name,this.$$d__createMeetingSuggestion$p$0,true,"MeetingString");
  1892. break;
  1893. case"Contacts":
  1894. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact,perEntityTypeDictionary,name,$h.Entities._createContact$p,true,"ContactString");
  1895. break
  1896. }
  1897. found=true;
  1898. break
  1899. }
  1900. }
  1901. if(!found)
  1902. this._filteredEntitiesCache$p$0[name]=null
  1903. }
  1904. return this._filteredEntitiesCache$p$0[name]
  1905. },
  1906. _createMeetingSuggestion$p$0: function(data)
  1907. {
  1908. return new $h.MeetingSuggestion(data,this._dateTimeSent$p$0)
  1909. },
  1910. _getAddresses$p$0: function()
  1911. {
  1912. if(!this._addresses$p$0)
  1913. this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses",true);
  1914. return this._addresses$p$0
  1915. },
  1916. _getEmailAddresses$p$0: function()
  1917. {
  1918. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1919. if(!this._emailAddresses$p$0)
  1920. this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses",false);
  1921. return this._emailAddresses$p$0
  1922. },
  1923. _getUrls$p$0: function()
  1924. {
  1925. if(!this._urls$p$0)
  1926. this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls",false);
  1927. return this._urls$p$0
  1928. },
  1929. _getPhoneNumbers$p$0: function()
  1930. {
  1931. if(!this._phoneNumbers$p$0)
  1932. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",$h.Entities._createPhoneNumber$p);
  1933. return this._phoneNumbers$p$0
  1934. },
  1935. _getTaskSuggestions$p$0: function()
  1936. {
  1937. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1938. if(!this._taskSuggestions$p$0)
  1939. this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,this._data$p$0,"TaskSuggestions",$h.Entities._createTaskSuggestion$p,true,"TaskString");
  1940. return this._taskSuggestions$p$0
  1941. },
  1942. _getMeetingSuggestions$p$0: function()
  1943. {
  1944. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1945. if(!this._meetingSuggestions$p$0)
  1946. this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,this._data$p$0,"MeetingSuggestions",this.$$d__createMeetingSuggestion$p$0,true,"MeetingString");
  1947. return this._meetingSuggestions$p$0
  1948. },
  1949. _getContacts$p$0: function()
  1950. {
  1951. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1952. if(!this._contacts$p$0)
  1953. this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact,this._data$p$0,"Contacts",$h.Entities._createContact$p,true,"ContactString");
  1954. return this._contacts$p$0
  1955. }
  1956. };
  1957. $h.ReplyConstants=function(){};
  1958. $h.AsyncConstants=function(){};
  1959. Office.cast.item=function(){};
  1960. Office.cast.item.toItemRead=function(item)
  1961. {
  1962. if($h.Item.isInstanceOfType(item))
  1963. return item;
  1964. throw Error.argumentType();
  1965. };
  1966. Office.cast.item.toItemCompose=function(item)
  1967. {
  1968. if($h.ComposeItem.isInstanceOfType(item))
  1969. return item;
  1970. throw Error.argumentType();
  1971. };
  1972. Office.cast.item.toMessage=function(item)
  1973. {
  1974. return Office.cast.item.toMessageRead(item)
  1975. };
  1976. Office.cast.item.toMessageRead=function(item)
  1977. {
  1978. if($h.Message.isInstanceOfType(item))
  1979. return item;
  1980. throw Error.argumentType();
  1981. };
  1982. Office.cast.item.toMessageCompose=function(item)
  1983. {
  1984. if($h.MessageCompose.isInstanceOfType(item))
  1985. return item;
  1986. throw Error.argumentType();
  1987. };
  1988. Office.cast.item.toMeetingRequest=function(item)
  1989. {
  1990. if($h.MeetingRequest.isInstanceOfType(item))
  1991. return item;
  1992. throw Error.argumentType();
  1993. };
  1994. Office.cast.item.toAppointment=function(item)
  1995. {
  1996. return Office.cast.item.toAppointmentRead(item)
  1997. };
  1998. Office.cast.item.toAppointmentRead=function(item)
  1999. {
  2000. if($h.Appointment.isInstanceOfType(item))
  2001. return item;
  2002. throw Error.argumentType();
  2003. };
  2004. Office.cast.item.toAppointmentCompose=function(item)
  2005. {
  2006. if($h.AppointmentCompose.isInstanceOfType(item))
  2007. return item;
  2008. throw Error.argumentType();
  2009. };
  2010. $h.Item=function(data)
  2011. {
  2012. this.$$d__getAttachments$p$1=Function.createDelegate(this,this._getAttachments$p$1);
  2013. this.$$d__getItemClass$p$1=Function.createDelegate(this,this._getItemClass$p$1);
  2014. this.$$d__getItemId$p$1=Function.createDelegate(this,this._getItemId$p$1);
  2015. this.$$d__getDateTimeModified$p$1=Function.createDelegate(this,this._getDateTimeModified$p$1);
  2016. this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this,this._getDateTimeCreated$p$1);
  2017. $h.Item.initializeBase(this,[data]);
  2018. $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeCreated",this.$$d__getDateTimeCreated$p$1);
  2019. $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeModified",this.$$d__getDateTimeModified$p$1);
  2020. $h.InitialData._defineReadOnlyProperty$i(this,"itemId",this.$$d__getItemId$p$1);
  2021. $h.InitialData._defineReadOnlyProperty$i(this,"itemClass",this.$$d__getItemClass$p$1);
  2022. $h.InitialData._defineReadOnlyProperty$i(this,"attachments",this.$$d__getAttachments$p$1)
  2023. };
  2024. $h.Item.prototype={
  2025. _getItemId$p$1: function()
  2026. {
  2027. return this._data$p$0.get__itemId$i$0()
  2028. },
  2029. _getItemClass$p$1: function()
  2030. {
  2031. return this._data$p$0.get__itemClass$i$0()
  2032. },
  2033. _getDateTimeCreated$p$1: function()
  2034. {
  2035. return this._data$p$0.get__dateTimeCreated$i$0()
  2036. },
  2037. _getDateTimeModified$p$1: function()
  2038. {
  2039. return this._data$p$0.get__dateTimeModified$i$0()
  2040. },
  2041. _getAttachments$p$1: function()
  2042. {
  2043. return this._data$p$0.get__attachments$i$0()
  2044. }
  2045. };
  2046. $h.ItemBase=function(data)
  2047. {
  2048. this.$$d__createCustomProperties$i$0=Function.createDelegate(this,this._createCustomProperties$i$0);
  2049. this.$$d_getItemType=Function.createDelegate(this,this.getItemType);
  2050. this._data$p$0=data;
  2051. $h.InitialData._defineReadOnlyProperty$i(this,"itemType",this.$$d_getItemType)
  2052. };
  2053. $h.ItemBase.prototype={
  2054. _data$p$0: null,
  2055. get_data: function()
  2056. {
  2057. return this._data$p$0
  2058. },
  2059. loadCustomPropertiesAsync: function()
  2060. {
  2061. var args=[];
  2062. for(var $$pai_3=0; $$pai_3 < arguments.length;++$$pai_3)
  2063. args[$$pai_3]=arguments[$$pai_3];
  2064. var parameters=$h.CommonParameters.parse(args,true,true);
  2065. var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0,"customProperties",parameters._callback$p$0,parameters._asyncContext$p$0);
  2066. loadCustomProperties._sendRequest$i$0(3,"LoadCustomProperties",{})
  2067. },
  2068. _createCustomProperties$i$0: function(data)
  2069. {
  2070. return new $h.CustomProperties(data)
  2071. }
  2072. };
  2073. $h.MeetingRequest=function(data)
  2074. {
  2075. this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this,this._getRequiredAttendees$p$3);
  2076. this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this,this._getOptionalAttendees$p$3);
  2077. this.$$d__getLocation$p$3=Function.createDelegate(this,this._getLocation$p$3);
  2078. this.$$d__getEnd$p$3=Function.createDelegate(this,this._getEnd$p$3);
  2079. this.$$d__getStart$p$3=Function.createDelegate(this,this._getStart$p$3);
  2080. $h.MeetingRequest.initializeBase(this,[data]);
  2081. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$3);
  2082. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$3);
  2083. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$3);
  2084. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$3);
  2085. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$3)
  2086. };
  2087. $h.MeetingRequest.prototype={
  2088. _getStart$p$3: function()
  2089. {
  2090. return this._data$p$0.get__start$i$0()
  2091. },
  2092. _getEnd$p$3: function()
  2093. {
  2094. return this._data$p$0.get__end$i$0()
  2095. },
  2096. _getLocation$p$3: function()
  2097. {
  2098. return this._data$p$0.get__location$i$0()
  2099. },
  2100. _getOptionalAttendees$p$3: function()
  2101. {
  2102. return this._data$p$0.get__cc$i$0()
  2103. },
  2104. _getRequiredAttendees$p$3: function()
  2105. {
  2106. return this._data$p$0.get__to$i$0()
  2107. }
  2108. };
  2109. $h.MeetingSuggestion=function(data, dateTimeSent)
  2110. {
  2111. this.$$d__getEndTime$p$0=Function.createDelegate(this,this._getEndTime$p$0);
  2112. this.$$d__getStartTime$p$0=Function.createDelegate(this,this._getStartTime$p$0);
  2113. this.$$d__getSubject$p$0=Function.createDelegate(this,this._getSubject$p$0);
  2114. this.$$d__getLocation$p$0=Function.createDelegate(this,this._getLocation$p$0);
  2115. this.$$d__getAttendees$p$0=Function.createDelegate(this,this._getAttendees$p$0);
  2116. this.$$d__getMeetingString$p$0=Function.createDelegate(this,this._getMeetingString$p$0);
  2117. this._data$p$0=data;
  2118. this._dateTimeSent$p$0=dateTimeSent;
  2119. $h.InitialData._defineReadOnlyProperty$i(this,"meetingString",this.$$d__getMeetingString$p$0);
  2120. $h.InitialData._defineReadOnlyProperty$i(this,"attendees",this.$$d__getAttendees$p$0);
  2121. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$0);
  2122. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$0);
  2123. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStartTime$p$0);
  2124. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEndTime$p$0)
  2125. };
  2126. $h.MeetingSuggestion.prototype={
  2127. _dateTimeSent$p$0: null,
  2128. _data$p$0: null,
  2129. _attendees$p$0: null,
  2130. _getMeetingString$p$0: function()
  2131. {
  2132. return this._data$p$0["MeetingString"]
  2133. },
  2134. _getLocation$p$0: function()
  2135. {
  2136. return this._data$p$0["Location"]
  2137. },
  2138. _getSubject$p$0: function()
  2139. {
  2140. return this._data$p$0["Subject"]
  2141. },
  2142. _getStartTime$p$0: function()
  2143. {
  2144. var time=this._createDateTimeFromParameter$p$0("StartTime");
  2145. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0);
  2146. if(resolvedTime.getTime() !==time.getTime())
  2147. return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime));
  2148. return time
  2149. },
  2150. _getEndTime$p$0: function()
  2151. {
  2152. var time=this._createDateTimeFromParameter$p$0("EndTime");
  2153. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0);
  2154. if(resolvedTime.getTime() !==time.getTime())
  2155. return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime));
  2156. return time
  2157. },
  2158. _createDateTimeFromParameter$p$0: function(keyName)
  2159. {
  2160. var dateTimeString=this._data$p$0[keyName];
  2161. if(!dateTimeString)
  2162. return null;
  2163. return new Date(dateTimeString)
  2164. },
  2165. _getAttendees$p$0: function()
  2166. {
  2167. if(!this._attendees$p$0)
  2168. {
  2169. var $$t_1=this;
  2170. this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Attendees",function(data)
  2171. {
  2172. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data)
  2173. })
  2174. }
  2175. return this._attendees$p$0
  2176. }
  2177. };
  2178. $h.MeetingSuggestionTimeDecoder=function(){};
  2179. $h.MeetingSuggestionTimeDecoder.resolve=function(inTime, sentTime)
  2180. {
  2181. if(!sentTime)
  2182. return inTime;
  2183. try
  2184. {
  2185. var tod;
  2186. var outDate;
  2187. var extractedDate;
  2188. var sentDate=new Date(sentTime.getFullYear(),sentTime.getMonth(),sentTime.getDate(),0,0,0,0);
  2189. var $$t_7,
  2190. $$t_8,
  2191. $$t_9;
  2192. if(!($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime,$$t_7={val: extractedDate},$$t_8={val: tod}),extractedDate=$$t_7.val,tod=$$t_8.val,$$t_9))
  2193. return inTime;
  2194. else
  2195. {
  2196. if($h._preciseDate.isInstanceOfType(extractedDate))
  2197. outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate,extractedDate);
  2198. else if($h._relativeDate.isInstanceOfType(extractedDate))
  2199. outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate,extractedDate);
  2200. else
  2201. outDate=sentDate;
  2202. if(isNaN(outDate.getTime()))
  2203. return sentTime;
  2204. outDate.setMilliseconds(outDate.getMilliseconds()+tod);
  2205. return outDate
  2206. }
  2207. }
  2208. catch($$e_6)
  2209. {
  2210. return sentTime
  2211. }
  2212. };
  2213. $h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function(value)
  2214. {
  2215. return null===value || value===undefined
  2216. };
  2217. $h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function(sentDate, precise)
  2218. {
  2219. var year=precise._year$i$1;
  2220. var month=!precise._month$i$1 ? sentDate.getMonth() : precise._month$i$1 - 1;
  2221. var day=precise._day$i$1;
  2222. if(!day)
  2223. return sentDate;
  2224. var candidate;
  2225. if($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year))
  2226. {
  2227. candidate=new Date(sentDate.getFullYear(),month,day);
  2228. if(candidate.getTime() < sentDate.getTime())
  2229. candidate=new Date(sentDate.getFullYear()+1,month,day)
  2230. }
  2231. else
  2232. candidate=new Date(year < 50 ? 2e3+year : 1900+year,month,day);
  2233. if(candidate.getMonth() !==month)
  2234. return sentDate;
  2235. return candidate
  2236. };
  2237. $h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function(sentDate, relative)
  2238. {
  2239. var date;
  2240. switch(relative._unit$i$1)
  2241. {
  2242. case 0:
  2243. date=new Date(sentDate.getFullYear(),sentDate.getMonth(),sentDate.getDate());
  2244. date.setDate(date.getDate()+relative._offset$i$1);
  2245. return date;
  2246. case 5:
  2247. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate,relative._offset$i$1,relative._tag$i$1);
  2248. case 2:
  2249. var days=1;
  2250. switch(relative._modifier$i$1)
  2251. {
  2252. case 1:
  2253. break;
  2254. case 2:
  2255. days=16;
  2256. break;
  2257. default:
  2258. if(!relative._offset$i$1)
  2259. days=sentDate.getDate();
  2260. break
  2261. }
  2262. date=new Date(sentDate.getFullYear(),sentDate.getMonth(),days);
  2263. date.setMonth(date.getMonth()+relative._offset$i$1);
  2264. if(date.getTime() < sentDate.getTime())
  2265. date.setDate(date.getDate()+sentDate.getDate() - 1);
  2266. return date;
  2267. case 1:
  2268. date=new Date(sentDate.getFullYear(),sentDate.getMonth(),sentDate.getDate());
  2269. date.setDate(sentDate.getDate()+7 * relative._offset$i$1);
  2270. if(relative._modifier$i$1===1 || !relative._modifier$i$1)
  2271. {
  2272. date.setDate(date.getDate()+1 - date.getDay());
  2273. if(date.getTime() < sentDate.getTime())
  2274. return sentDate;
  2275. return date
  2276. }
  2277. else if(relative._modifier$i$1===2)
  2278. {
  2279. date.setDate(date.getDate()+5 - date.getDay());
  2280. return date
  2281. }
  2282. break;
  2283. case 4:
  2284. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate,relative);
  2285. case 3:
  2286. if(relative._offset$i$1 > 0)
  2287. return new Date(sentDate.getFullYear()+relative._offset$i$1,0,1);
  2288. break;
  2289. default:
  2290. break
  2291. }
  2292. return sentDate
  2293. };
  2294. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function(sentDate, offset, tag)
  2295. {
  2296. if(offset > -5 && offset < 5)
  2297. {
  2298. var dayOfWeek;
  2299. var days;
  2300. dayOfWeek=(tag+6) % 7+1;
  2301. days=7 * offset+(dayOfWeek - sentDate.getDay());
  2302. sentDate.setDate(sentDate.getDate()+days);
  2303. return sentDate
  2304. }
  2305. else
  2306. {
  2307. var days=(tag - sentDate.getDay()) % 7;
  2308. if(days < 0)
  2309. days+=7;
  2310. sentDate.setDate(sentDate.getDate()+days);
  2311. return sentDate
  2312. }
  2313. };
  2314. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function(sentDate, relative)
  2315. {
  2316. var date;
  2317. var firstDay;
  2318. var newDate;
  2319. date=sentDate;
  2320. if(relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5)
  2321. return sentDate;
  2322. var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12;
  2323. firstDay=new Date(date.getFullYear(),date.getMonth()+monthOffset,1);
  2324. if(relative._modifier$i$1===1)
  2325. if(relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay())
  2326. return firstDay;
  2327. else
  2328. {
  2329. newDate=new Date(firstDay.getFullYear(),firstDay.getMonth(),firstDay.getDate());
  2330. newDate.setDate(newDate.getDate()+(7+(1 - firstDay.getDay())) % 7);
  2331. if(firstDay.getDay() !==6 && firstDay.getDay() && firstDay.getDay() !==1)
  2332. newDate.setDate(newDate.getDate() - 7);
  2333. newDate.setDate(newDate.getDate()+7 * (relative._offset$i$1 - 1));
  2334. if(newDate.getMonth()+1 !==relative._tag$i$1)
  2335. return sentDate;
  2336. return newDate
  2337. }
  2338. else
  2339. {
  2340. newDate=new Date(firstDay.getFullYear(),firstDay.getMonth(),$h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(),firstDay.getFullYear()));
  2341. var offset=1 - newDate.getDay();
  2342. if(offset > 0)
  2343. offset=offset - 7;
  2344. newDate.setDate(newDate.getDate()+offset);
  2345. newDate.setDate(newDate.getDate()+7 * (1 - relative._offset$i$1));
  2346. if(newDate.getMonth()+1 !==relative._tag$i$1)
  2347. if(firstDay.getDay() !==6 && firstDay.getDay())
  2348. return firstDay;
  2349. else
  2350. return sentDate;
  2351. else
  2352. return newDate
  2353. }
  2354. };
  2355. $h.MeetingSuggestionTimeDecoder._decode$p=function(inDate, date, time)
  2356. {
  2357. var DateValueMask=32767;
  2358. date.val=null;
  2359. time.val=0;
  2360. if(!inDate)
  2361. return false;
  2362. time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate);
  2363. var inDateAtMidnight=inDate.getTime() - time.val;
  2364. var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 864e5;
  2365. if(value < 0)
  2366. return false;
  2367. else if(value >=262144)
  2368. return false;
  2369. else
  2370. {
  2371. var type=value >> 15;
  2372. value=value & DateValueMask;
  2373. switch(type)
  2374. {
  2375. case 0:
  2376. return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value,date);
  2377. case 1:
  2378. return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value,date);
  2379. default:
  2380. return false
  2381. }
  2382. }
  2383. };
  2384. $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function(value, date)
  2385. {
  2386. var c_SubTypeMask=7;
  2387. var c_MonthMask=15;
  2388. var c_DayMask=31;
  2389. var c_YearMask=127;
  2390. var year=null;
  2391. var month=0;
  2392. var day=0;
  2393. date.val=null;
  2394. var subType=value >> 12 & c_SubTypeMask;
  2395. if((subType & 4)===4)
  2396. {
  2397. year=value >> 5 & c_YearMask;
  2398. if((subType & 2)===2)
  2399. {
  2400. if((subType & 1)===1)
  2401. return false;
  2402. month=value >> 1 & c_MonthMask
  2403. }
  2404. }
  2405. else
  2406. {
  2407. if((subType & 2)===2)
  2408. month=value >> 8 & c_MonthMask;
  2409. if((subType & 1)===1)
  2410. day=value >> 3 & c_DayMask
  2411. }
  2412. date.val=new $h._preciseDate(day,month,year);
  2413. return true
  2414. };
  2415. $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function(value, date)
  2416. {
  2417. var TagMask=15;
  2418. var OffsetMask=63;
  2419. var UnitMask=7;
  2420. var ModifierMask=3;
  2421. var tag=value & TagMask;
  2422. value >>=4;
  2423. var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask,6);
  2424. value >>=6;
  2425. var unit=value & UnitMask;
  2426. value >>=3;
  2427. var modifier=value & ModifierMask;
  2428. try
  2429. {
  2430. date.val=new $h._relativeDate(modifier,offset,unit,tag);
  2431. return true
  2432. }
  2433. catch($$e_A)
  2434. {
  2435. date.val=null;
  2436. return false
  2437. }
  2438. };
  2439. $h.MeetingSuggestionTimeDecoder._fromComplement$p=function(value, n)
  2440. {
  2441. var signed=1 << n - 1;
  2442. var mask=(1 << n) - 1;
  2443. if((value & signed)===signed)
  2444. return-((value ^ mask)+1);
  2445. else
  2446. return value
  2447. };
  2448. $h.MeetingSuggestionTimeDecoder._daysInMonth$p=function(month, year)
  2449. {
  2450. return 32 - new Date(year,month,32).getDate()
  2451. };
  2452. $h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function(inputTime)
  2453. {
  2454. var timeOfDay=0;
  2455. timeOfDay+=inputTime.getUTCHours() * 3600;
  2456. timeOfDay+=inputTime.getUTCMinutes() * 60;
  2457. timeOfDay+=inputTime.getUTCSeconds();
  2458. timeOfDay *=1e3;
  2459. timeOfDay+=inputTime.getUTCMilliseconds();
  2460. return timeOfDay
  2461. };
  2462. $h._extractedDate=function(){};
  2463. $h._preciseDate=function(day, month, year)
  2464. {
  2465. $h._preciseDate.initializeBase(this);
  2466. if(day < 0 || day > 31)
  2467. throw Error.argumentOutOfRange("day");
  2468. if(month < 0 || month > 12)
  2469. throw Error.argumentOutOfRange("month");
  2470. this._day$i$1=day;
  2471. this._month$i$1=month;
  2472. if(!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year))
  2473. {
  2474. if(!month && day)
  2475. throw Error.argument("Invalid arguments");
  2476. if(year < 0 || year > 2099)
  2477. throw Error.argumentOutOfRange("year");
  2478. this._year$i$1=year % 100
  2479. }
  2480. else if(!this._month$i$1 && !this._day$i$1)
  2481. throw Error.argument("Invalid datetime");
  2482. };
  2483. $h._preciseDate.prototype={
  2484. _day$i$1: 0,
  2485. _month$i$1: 0,
  2486. _year$i$1: null
  2487. };
  2488. $h._relativeDate=function(modifier, offset, unit, tag)
  2489. {
  2490. $h._relativeDate.initializeBase(this);
  2491. if(offset < -32 || offset > 31)
  2492. throw Error.argumentOutOfRange("offset");
  2493. if(tag < 0 || tag > 15)
  2494. throw Error.argumentOutOfRange("tag");
  2495. if(!unit && offset < 0)
  2496. throw Error.argument("unit & offset do not form a valid date");
  2497. this._modifier$i$1=modifier;
  2498. this._offset$i$1=offset;
  2499. this._unit$i$1=unit;
  2500. this._tag$i$1=tag
  2501. };
  2502. $h._relativeDate.prototype={
  2503. _modifier$i$1: 0,
  2504. _offset$i$1: 0,
  2505. _unit$i$1: 0,
  2506. _tag$i$1: 0
  2507. };
  2508. $h.Message=function(dataDictionary)
  2509. {
  2510. this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2);
  2511. this.$$d__getInternetMessageId$p$2=Function.createDelegate(this,this._getInternetMessageId$p$2);
  2512. this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2);
  2513. this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2);
  2514. this.$$d__getFrom$p$2=Function.createDelegate(this,this._getFrom$p$2);
  2515. this.$$d__getSender$p$2=Function.createDelegate(this,this._getSender$p$2);
  2516. this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2);
  2517. this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2);
  2518. $h.Message.initializeBase(this,[dataDictionary]);
  2519. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2);
  2520. $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2);
  2521. $h.InitialData._defineReadOnlyProperty$i(this,"sender",this.$$d__getSender$p$2);
  2522. $h.InitialData._defineReadOnlyProperty$i(this,"from",this.$$d__getFrom$p$2);
  2523. $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2);
  2524. $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2);
  2525. $h.InitialData._defineReadOnlyProperty$i(this,"internetMessageId",this.$$d__getInternetMessageId$p$2);
  2526. $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2)
  2527. };
  2528. $h.Message.prototype={
  2529. getEntities: function()
  2530. {
  2531. return this._data$p$0._getEntities$i$0()
  2532. },
  2533. getEntitiesByType: function(entityType)
  2534. {
  2535. return this._data$p$0._getEntitiesByType$i$0(entityType)
  2536. },
  2537. getFilteredEntitiesByName: function(name)
  2538. {
  2539. return this._data$p$0._getFilteredEntitiesByName$i$0(name)
  2540. },
  2541. getRegExMatches: function()
  2542. {
  2543. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches");
  2544. return this._data$p$0._getRegExMatches$i$0()
  2545. },
  2546. getRegExMatchesByName: function(name)
  2547. {
  2548. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName");
  2549. return this._data$p$0._getRegExMatchesByName$i$0(name)
  2550. },
  2551. displayReplyForm: function(obj)
  2552. {
  2553. OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(obj)
  2554. },
  2555. displayReplyAllForm: function(obj)
  2556. {
  2557. OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(obj)
  2558. },
  2559. getItemType: function()
  2560. {
  2561. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message
  2562. },
  2563. _getSubject$p$2: function()
  2564. {
  2565. return this._data$p$0.get__subject$i$0()
  2566. },
  2567. _getNormalizedSubject$p$2: function()
  2568. {
  2569. return this._data$p$0.get__normalizedSubject$i$0()
  2570. },
  2571. _getSender$p$2: function()
  2572. {
  2573. return this._data$p$0.get__sender$i$0()
  2574. },
  2575. _getFrom$p$2: function()
  2576. {
  2577. return this._data$p$0.get__from$i$0()
  2578. },
  2579. _getTo$p$2: function()
  2580. {
  2581. return this._data$p$0.get__to$i$0()
  2582. },
  2583. _getCc$p$2: function()
  2584. {
  2585. return this._data$p$0.get__cc$i$0()
  2586. },
  2587. _getInternetMessageId$p$2: function()
  2588. {
  2589. return this._data$p$0.get__internetMessageId$i$0()
  2590. },
  2591. _getConversationId$p$2: function()
  2592. {
  2593. return this._data$p$0.get__conversationId$i$0()
  2594. }
  2595. };
  2596. $h.MessageCompose=function(data)
  2597. {
  2598. this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2);
  2599. this.$$d__getBcc$p$2=Function.createDelegate(this,this._getBcc$p$2);
  2600. this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2);
  2601. this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2);
  2602. $h.MessageCompose.initializeBase(this,[data]);
  2603. $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2);
  2604. $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2);
  2605. $h.InitialData._defineReadOnlyProperty$i(this,"bcc",this.$$d__getBcc$p$2);
  2606. $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2)
  2607. };
  2608. $h.MessageCompose.prototype={
  2609. _to$p$2: null,
  2610. _cc$p$2: null,
  2611. _bcc$p$2: null,
  2612. getItemType: function()
  2613. {
  2614. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message
  2615. },
  2616. _getTo$p$2: function()
  2617. {
  2618. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  2619. if(!this._to$p$2)
  2620. this._to$p$2=new $h.ComposeRecipient(0,"to");
  2621. return this._to$p$2
  2622. },
  2623. _getCc$p$2: function()
  2624. {
  2625. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  2626. if(!this._cc$p$2)
  2627. this._cc$p$2=new $h.ComposeRecipient(1,"cc");
  2628. return this._cc$p$2
  2629. },
  2630. _getBcc$p$2: function()
  2631. {
  2632. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  2633. if(!this._bcc$p$2)
  2634. this._bcc$p$2=new $h.ComposeRecipient(2,"bcc");
  2635. return this._bcc$p$2
  2636. },
  2637. _getConversationId$p$2: function()
  2638. {
  2639. return this._data$p$0.get__conversationId$i$0()
  2640. }
  2641. };
  2642. $h.OutlookErrorManager=function(){};
  2643. $h.OutlookErrorManager.getErrorArgs=function(errorCode)
  2644. {
  2645. if(!$h.OutlookErrorManager._isInitialized$p)
  2646. $h.OutlookErrorManager._initialize$p();
  2647. return OSF.DDA.ErrorCodeManager.getErrorArgs(errorCode)
  2648. };
  2649. $h.OutlookErrorManager._initialize$p=function()
  2650. {
  2651. $h.OutlookErrorManager._addErrorMessage$p(9e3,"AttachmentSizeExceeded",_u.ExtensibilityStrings.l_AttachmentExceededSize_Text);
  2652. $h.OutlookErrorManager._addErrorMessage$p(9001,"NumberOfAttachmentsExceeded",_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text);
  2653. $h.OutlookErrorManager._addErrorMessage$p(9002,"InternalFormatError",_u.ExtensibilityStrings.l_InternalFormatError_Text);
  2654. $h.OutlookErrorManager._addErrorMessage$p(9003,"InvalidAttachmentId",_u.ExtensibilityStrings.l_InvalidAttachmentId_Text);
  2655. $h.OutlookErrorManager._addErrorMessage$p(9004,"InvalidAttachmentPath",_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text);
  2656. $h.OutlookErrorManager._addErrorMessage$p(9005,"CannotAddAttachmentBeforeUpgrade",_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text);
  2657. $h.OutlookErrorManager._addErrorMessage$p(9006,"AttachmentDeletedBeforeUploadCompletes",_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text);
  2658. $h.OutlookErrorManager._addErrorMessage$p(9007,"AttachmentUploadGeneralFailure",_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text);
  2659. $h.OutlookErrorManager._addErrorMessage$p(9008,"AttachmentToDeleteDoesNotExist",_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text);
  2660. $h.OutlookErrorManager._addErrorMessage$p(9009,"AttachmentDeleteGeneralFailure",_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text);
  2661. $h.OutlookErrorManager._addErrorMessage$p(9010,"InvalidEndTime",_u.ExtensibilityStrings.l_InvalidEndTime_Text);
  2662. $h.OutlookErrorManager._addErrorMessage$p(9011,"HtmlSanitizationFailure",_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text);
  2663. $h.OutlookErrorManager._addErrorMessage$p(9012,"NumberOfRecipientsExceeded",String.format(_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text,100));
  2664. $h.OutlookErrorManager._addErrorMessage$p(9013,"NoValidRecipientsProvided",_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text);
  2665. $h.OutlookErrorManager._addErrorMessage$p(9014,"CursorPositionChanged",_u.ExtensibilityStrings.l_CursorPositionChanged_Text);
  2666. $h.OutlookErrorManager._addErrorMessage$p(9016,"InvalidSelection",_u.ExtensibilityStrings.l_InvalidSelection_Text);
  2667. $h.OutlookErrorManager._isInitialized$p=true
  2668. };
  2669. $h.OutlookErrorManager._addErrorMessage$p=function(errorCode, errorName, errorMessage)
  2670. {
  2671. OSF.DDA.ErrorCodeManager.addErrorMessage(errorCode,{
  2672. name: errorName,
  2673. message: errorMessage
  2674. })
  2675. };
  2676. $h.OutlookErrorManager.OutlookErrorCodes=function(){};
  2677. $h.OutlookErrorManager.OsfDdaErrorCodes=function(){};
  2678. $h.PhoneNumber=function(data)
  2679. {
  2680. this.$$d__getPhoneType$p$0=Function.createDelegate(this,this._getPhoneType$p$0);
  2681. this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this,this._getOriginalPhoneString$p$0);
  2682. this.$$d__getPhoneString$p$0=Function.createDelegate(this,this._getPhoneString$p$0);
  2683. this._data$p$0=data;
  2684. $h.InitialData._defineReadOnlyProperty$i(this,"phoneString",this.$$d__getPhoneString$p$0);
  2685. $h.InitialData._defineReadOnlyProperty$i(this,"originalPhoneString",this.$$d__getOriginalPhoneString$p$0);
  2686. $h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getPhoneType$p$0)
  2687. };
  2688. $h.PhoneNumber.prototype={
  2689. _data$p$0: null,
  2690. _getPhoneString$p$0: function()
  2691. {
  2692. return this._data$p$0["PhoneString"]
  2693. },
  2694. _getOriginalPhoneString$p$0: function()
  2695. {
  2696. return this._data$p$0["OriginalPhoneString"]
  2697. },
  2698. _getPhoneType$p$0: function()
  2699. {
  2700. return this._data$p$0["Type"]
  2701. }
  2702. };
  2703. $h.TaskSuggestion=function(data)
  2704. {
  2705. this.$$d__getAssignees$p$0=Function.createDelegate(this,this._getAssignees$p$0);
  2706. this.$$d__getTaskString$p$0=Function.createDelegate(this,this._getTaskString$p$0);
  2707. this._data$p$0=data;
  2708. $h.InitialData._defineReadOnlyProperty$i(this,"taskString",this.$$d__getTaskString$p$0);
  2709. $h.InitialData._defineReadOnlyProperty$i(this,"assignees",this.$$d__getAssignees$p$0)
  2710. };
  2711. $h.TaskSuggestion.prototype={
  2712. _data$p$0: null,
  2713. _assignees$p$0: null,
  2714. _getTaskString$p$0: function()
  2715. {
  2716. return this._data$p$0["TaskString"]
  2717. },
  2718. _getAssignees$p$0: function()
  2719. {
  2720. if(!this._assignees$p$0)
  2721. {
  2722. var $$t_1=this;
  2723. this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Assignees",function(data)
  2724. {
  2725. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data)
  2726. })
  2727. }
  2728. return this._assignees$p$0
  2729. }
  2730. };
  2731. $h.UserProfile=function(data)
  2732. {
  2733. this.$$d__getTimeZone$p$0=Function.createDelegate(this,this._getTimeZone$p$0);
  2734. this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0);
  2735. this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0);
  2736. this._data$p$0=data;
  2737. $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0);
  2738. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0);
  2739. $h.InitialData._defineReadOnlyProperty$i(this,"timeZone",this.$$d__getTimeZone$p$0)
  2740. };
  2741. $h.UserProfile.prototype={
  2742. _data$p$0: null,
  2743. _getDisplayName$p$0: function()
  2744. {
  2745. return this._data$p$0.get__userDisplayName$i$0()
  2746. },
  2747. _getEmailAddress$p$0: function()
  2748. {
  2749. return this._data$p$0.get__userEmailAddress$i$0()
  2750. },
  2751. _getTimeZone$p$0: function()
  2752. {
  2753. return this._data$p$0.get__userTimeZone$i$0()
  2754. }
  2755. };
  2756. $h.RequestState=function(){};
  2757. $h.RequestState.prototype={
  2758. unsent: 0,
  2759. opened: 1,
  2760. headersReceived: 2,
  2761. loading: 3,
  2762. done: 4
  2763. };
  2764. $h.RequestState.registerEnum("$h.RequestState",false);
  2765. $h.CommonParameters=function(options, callback, asyncContext)
  2766. {
  2767. this._options$p$0=options;
  2768. this._callback$p$0=callback;
  2769. this._asyncContext$p$0=asyncContext
  2770. };
  2771. $h.CommonParameters.parse=function(args, isCallbackRequired, tryLegacy)
  2772. {
  2773. var legacyParameters;
  2774. var $$t_8,
  2775. $$t_9;
  2776. if(tryLegacy && ($$t_9=$h.CommonParameters._tryParseLegacy$p(args,$$t_8={val: legacyParameters}),legacyParameters=$$t_8.val,$$t_9))
  2777. return legacyParameters;
  2778. var argsLength=args.length;
  2779. var options=null;
  2780. var callback=null;
  2781. var asyncContext=null;
  2782. if(argsLength===1)
  2783. if(Function.isInstanceOfType(args[0]))
  2784. callback=args[0];
  2785. else if(Object.isInstanceOfType(args[0]))
  2786. options=args[0];
  2787. else
  2788. throw Error.argumentType();
  2789. else if(argsLength===2)
  2790. {
  2791. if(!Object.isInstanceOfType(args[0]))
  2792. throw Error.argument("options");
  2793. if(!Function.isInstanceOfType(args[1]))
  2794. throw Error.argument("callback");
  2795. options=args[0];
  2796. callback=args[1]
  2797. }
  2798. else if(argsLength)
  2799. throw Error.parameterCount(_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text);
  2800. if(isCallbackRequired && !callback)
  2801. throw Error.argumentNull("callback");
  2802. if(options && !$h.ScriptHelpers.isNullOrUndefined(options["asyncContext"]))
  2803. asyncContext=options["asyncContext"];
  2804. return new $h.CommonParameters(options,callback,asyncContext)
  2805. };
  2806. $h.CommonParameters._tryParseLegacy$p=function(args, commonParameters)
  2807. {
  2808. commonParameters.val=null;
  2809. var argsLength=args.length;
  2810. var callback=null;
  2811. var userContext=null;
  2812. if(!argsLength || argsLength > 2)
  2813. return false;
  2814. if(!Function.isInstanceOfType(args[0]))
  2815. return false;
  2816. callback=args[0];
  2817. if(argsLength > 1)
  2818. userContext=args[1];
  2819. commonParameters.val=new $h.CommonParameters(null,callback,userContext);
  2820. return true
  2821. };
  2822. $h.CommonParameters.prototype={
  2823. _options$p$0: null,
  2824. _callback$p$0: null,
  2825. _asyncContext$p$0: null,
  2826. get_options: function()
  2827. {
  2828. return this._options$p$0
  2829. },
  2830. get_callback: function()
  2831. {
  2832. return this._callback$p$0
  2833. },
  2834. get_asyncContext: function()
  2835. {
  2836. return this._asyncContext$p$0
  2837. }
  2838. };
  2839. $h.EwsRequest=function(userContext)
  2840. {
  2841. $h.EwsRequest.initializeBase(this,[userContext])
  2842. };
  2843. $h.EwsRequest.prototype={
  2844. readyState: 1,
  2845. status: 0,
  2846. statusText: null,
  2847. onreadystatechange: null,
  2848. responseText: null,
  2849. get__statusCode$i$1: function()
  2850. {
  2851. return this.status
  2852. },
  2853. set__statusCode$i$1: function(value)
  2854. {
  2855. this.status=value;
  2856. return value
  2857. },
  2858. get__statusDescription$i$1: function()
  2859. {
  2860. return this.statusText
  2861. },
  2862. set__statusDescription$i$1: function(value)
  2863. {
  2864. this.statusText=value;
  2865. return value
  2866. },
  2867. get__requestState$i$1: function()
  2868. {
  2869. return this.readyState
  2870. },
  2871. set__requestState$i$1: function(value)
  2872. {
  2873. this.readyState=value;
  2874. return value
  2875. },
  2876. get_hasOnReadyStateChangeCallback: function()
  2877. {
  2878. return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)
  2879. },
  2880. get__response$i$1: function()
  2881. {
  2882. return this.responseText
  2883. },
  2884. set__response$i$1: function(value)
  2885. {
  2886. this.responseText=value;
  2887. return value
  2888. },
  2889. send: function(data)
  2890. {
  2891. this._checkSendConditions$i$1();
  2892. if($h.ScriptHelpers.isNullOrUndefined(data))
  2893. this._throwInvalidStateException$i$1();
  2894. this._sendRequest$i$0(5,"EwsRequest",{body: data})
  2895. },
  2896. _callOnReadyStateChangeCallback$i$1: function()
  2897. {
  2898. if(!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange))
  2899. this.onreadystatechange()
  2900. },
  2901. _parseExtraResponseData$i$1: function(response){},
  2902. executeExtraFailedResponseSteps: function(){}
  2903. };
  2904. $h.InitialData=function(data)
  2905. {
  2906. this._data$p$0=data;
  2907. this._permissionLevel$p$0=this._calculatePermissionLevel$p$0()
  2908. };
  2909. $h.InitialData._defineReadOnlyProperty$i=function(o, methodName, getter)
  2910. {
  2911. var propertyDescriptor={
  2912. get: getter,
  2913. configurable: false
  2914. };
  2915. Object.defineProperty(o,methodName,propertyDescriptor)
  2916. };
  2917. $h.InitialData.prototype={
  2918. _toRecipients$p$0: null,
  2919. _ccRecipients$p$0: null,
  2920. _attachments$p$0: null,
  2921. _resources$p$0: null,
  2922. _entities$p$0: null,
  2923. _data$p$0: null,
  2924. _permissionLevel$p$0: 0,
  2925. get__itemId$i$0: function()
  2926. {
  2927. return this._data$p$0["id"]
  2928. },
  2929. get__itemClass$i$0: function()
  2930. {
  2931. return this._data$p$0["itemClass"]
  2932. },
  2933. get__dateTimeCreated$i$0: function()
  2934. {
  2935. return new Date(this._data$p$0["dateTimeCreated"])
  2936. },
  2937. get__dateTimeModified$i$0: function()
  2938. {
  2939. return new Date(this._data$p$0["dateTimeModified"])
  2940. },
  2941. get__dateTimeSent$i$0: function()
  2942. {
  2943. return new Date(this._data$p$0["dateTimeSent"])
  2944. },
  2945. get__subject$i$0: function()
  2946. {
  2947. this._throwOnRestrictedPermissionLevel$i$0();
  2948. return this._data$p$0["subject"]
  2949. },
  2950. get__normalizedSubject$i$0: function()
  2951. {
  2952. this._throwOnRestrictedPermissionLevel$i$0();
  2953. return this._data$p$0["normalizedSubject"]
  2954. },
  2955. get__internetMessageId$i$0: function()
  2956. {
  2957. return this._data$p$0["internetMessageId"]
  2958. },
  2959. get__conversationId$i$0: function()
  2960. {
  2961. return this._data$p$0["conversationId"]
  2962. },
  2963. get__sender$i$0: function()
  2964. {
  2965. this._throwOnRestrictedPermissionLevel$i$0();
  2966. var sender=this._data$p$0["sender"];
  2967. return $h.ScriptHelpers.isNullOrUndefined(sender) ? null : new $h.EmailAddressDetails(sender)
  2968. },
  2969. get__from$i$0: function()
  2970. {
  2971. this._throwOnRestrictedPermissionLevel$i$0();
  2972. var from=this._data$p$0["from"];
  2973. return $h.ScriptHelpers.isNullOrUndefined(from) ? null : new $h.EmailAddressDetails(from)
  2974. },
  2975. get__to$i$0: function()
  2976. {
  2977. this._throwOnRestrictedPermissionLevel$i$0();
  2978. if(null===this._toRecipients$p$0)
  2979. this._toRecipients$p$0=this._createEmailAddressDetails$p$0("to");
  2980. return this._toRecipients$p$0
  2981. },
  2982. get__cc$i$0: function()
  2983. {
  2984. this._throwOnRestrictedPermissionLevel$i$0();
  2985. if(null===this._ccRecipients$p$0)
  2986. this._ccRecipients$p$0=this._createEmailAddressDetails$p$0("cc");
  2987. return this._ccRecipients$p$0
  2988. },
  2989. get__attachments$i$0: function()
  2990. {
  2991. this._throwOnRestrictedPermissionLevel$i$0();
  2992. if(null===this._attachments$p$0)
  2993. this._attachments$p$0=this._createAttachmentDetails$p$0();
  2994. return this._attachments$p$0
  2995. },
  2996. get__ewsUrl$i$0: function()
  2997. {
  2998. return this._data$p$0["ewsUrl"]
  2999. },
  3000. get__start$i$0: function()
  3001. {
  3002. return new Date(this._data$p$0["start"])
  3003. },
  3004. get__end$i$0: function()
  3005. {
  3006. return new Date(this._data$p$0["end"])
  3007. },
  3008. get__location$i$0: function()
  3009. {
  3010. return this._data$p$0["location"]
  3011. },
  3012. get__resources$i$0: function()
  3013. {
  3014. this._throwOnRestrictedPermissionLevel$i$0();
  3015. if(null===this._resources$p$0)
  3016. this._resources$p$0=this._createEmailAddressDetails$p$0("resources");
  3017. return this._resources$p$0
  3018. },
  3019. get__organizer$i$0: function()
  3020. {
  3021. this._throwOnRestrictedPermissionLevel$i$0();
  3022. var organizer=this._data$p$0["organizer"];
  3023. return $h.ScriptHelpers.isNullOrUndefined(organizer) ? null : new $h.EmailAddressDetails(organizer)
  3024. },
  3025. get__userDisplayName$i$0: function()
  3026. {
  3027. return this._data$p$0["userDisplayName"]
  3028. },
  3029. get__userEmailAddress$i$0: function()
  3030. {
  3031. return this._data$p$0["userEmailAddress"]
  3032. },
  3033. get__userTimeZone$i$0: function()
  3034. {
  3035. return this._data$p$0["userTimeZone"]
  3036. },
  3037. get__timeZoneOffsets$i$0: function()
  3038. {
  3039. return this._data$p$0["timeZoneOffsets"]
  3040. },
  3041. get__hostVersion$i$0: function()
  3042. {
  3043. return this._data$p$0["hostVersion"]
  3044. },
  3045. get__owaView$i$0: function()
  3046. {
  3047. return this._data$p$0["owaView"]
  3048. },
  3049. get__overrideWindowOpen$i$0: function()
  3050. {
  3051. return this._data$p$0["overrideWindowOpen"]
  3052. },
  3053. _getEntities$i$0: function()
  3054. {
  3055. if(!this._entities$p$0)
  3056. this._entities$p$0=new $h.Entities(this._data$p$0["entities"],this._data$p$0["filteredEntities"],this.get__dateTimeSent$i$0(),this._permissionLevel$p$0);
  3057. return this._entities$p$0
  3058. },
  3059. _getEntitiesByType$i$0: function(entityType)
  3060. {
  3061. var entites=this._getEntities$i$0();
  3062. return entites._getByType$i$0(entityType)
  3063. },
  3064. _getFilteredEntitiesByName$i$0: function(name)
  3065. {
  3066. var entities=this._getEntities$i$0();
  3067. return entities._getFilteredEntitiesByName$i$0(name)
  3068. },
  3069. _getRegExMatches$i$0: function()
  3070. {
  3071. if(!this._data$p$0["regExMatches"])
  3072. return null;
  3073. return this._data$p$0["regExMatches"]
  3074. },
  3075. _getRegExMatchesByName$i$0: function(regexName)
  3076. {
  3077. var regexMatches=this._getRegExMatches$i$0();
  3078. if(!regexMatches || !regexMatches[regexName])
  3079. return null;
  3080. return regexMatches[regexName]
  3081. },
  3082. _throwOnRestrictedPermissionLevel$i$0: function()
  3083. {
  3084. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0)
  3085. },
  3086. _createEmailAddressDetails$p$0: function(key)
  3087. {
  3088. var to=this._data$p$0[key];
  3089. if($h.ScriptHelpers.isNullOrUndefined(to))
  3090. return[];
  3091. var recipients=[];
  3092. for(var i=0; i < to.length; i++)
  3093. if(!$h.ScriptHelpers.isNullOrUndefined(to[i]))
  3094. recipients[i]=new $h.EmailAddressDetails(to[i]);
  3095. return recipients
  3096. },
  3097. _createAttachmentDetails$p$0: function()
  3098. {
  3099. var attachments=this._data$p$0["attachments"];
  3100. if($h.ScriptHelpers.isNullOrUndefined(attachments))
  3101. return[];
  3102. var attachmentDetails=[];
  3103. for(var i=0; i < attachments.length; i++)
  3104. if(!$h.ScriptHelpers.isNullOrUndefined(attachments[i]))
  3105. attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]);
  3106. return attachmentDetails
  3107. },
  3108. _calculatePermissionLevel$p$0: function()
  3109. {
  3110. var HostReadItem=1;
  3111. var HostReadWriteMailbox=2;
  3112. var HostReadWriteItem=3;
  3113. var permissionLevelFromHost=this._data$p$0["permissionLevel"];
  3114. if($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0))
  3115. return 0;
  3116. switch(permissionLevelFromHost)
  3117. {
  3118. case HostReadItem:
  3119. return 1;
  3120. case HostReadWriteItem:
  3121. return 2;
  3122. case HostReadWriteMailbox:
  3123. return 3;
  3124. default:
  3125. return 0
  3126. }
  3127. }
  3128. };
  3129. $h._loadDictionaryRequest=function(createResultObject, dictionaryName, callback, userContext)
  3130. {
  3131. $h._loadDictionaryRequest.initializeBase(this,[userContext]);
  3132. this._createResultObject$p$1=createResultObject;
  3133. this._dictionaryName$p$1=dictionaryName;
  3134. this._callback$p$1=callback
  3135. };
  3136. $h._loadDictionaryRequest.prototype={
  3137. _dictionaryName$p$1: null,
  3138. _createResultObject$p$1: null,
  3139. _callback$p$1: null,
  3140. handleResponse: function(response)
  3141. {
  3142. if(response["wasSuccessful"])
  3143. {
  3144. var value=response[this._dictionaryName$p$1];
  3145. var responseData=JSON.parse(value);
  3146. this.createAsyncResult(this._createResultObject$p$1(responseData),0,null)
  3147. }
  3148. else
  3149. this.createAsyncResult(null,1,response["errorMessage"]);
  3150. this._callback$p$1(this._asyncResult$p$0)
  3151. }
  3152. };
  3153. $h.ProxyRequestBase=function(userContext)
  3154. {
  3155. $h.ProxyRequestBase.initializeBase(this,[userContext])
  3156. };
  3157. $h.ProxyRequestBase.prototype={
  3158. handleResponse: function(response)
  3159. {
  3160. if(!response["wasProxySuccessful"])
  3161. {
  3162. this.set__statusCode$i$1(500);
  3163. this.set__statusDescription$i$1("Error");
  3164. var errorMessage=response["errorMessage"];
  3165. this.set__response$i$1(errorMessage);
  3166. this.createAsyncResult(null,1,errorMessage)
  3167. }
  3168. else
  3169. {
  3170. this.set__statusCode$i$1(response["statusCode"]);
  3171. this.set__statusDescription$i$1(response["statusDescription"]);
  3172. this.set__response$i$1(response["body"]);
  3173. this.createAsyncResult(this.get__response$i$1(),0,null)
  3174. }
  3175. this._parseExtraResponseData$i$1(response);
  3176. this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1()
  3177. },
  3178. _throwInvalidStateException$i$1: function()
  3179. {
  3180. throw Error.create("DOMException",{
  3181. code: 11,
  3182. message: "INVALID_STATE_ERR"
  3183. });
  3184. },
  3185. _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function()
  3186. {
  3187. var $$t_0=this;
  3188. this._changeReadyState$i$1(2,function()
  3189. {
  3190. $$t_0._changeReadyState$i$1(3,function()
  3191. {
  3192. $$t_0._changeReadyState$i$1(4,null)
  3193. })
  3194. })
  3195. },
  3196. _changeReadyState$i$1: function(state, nextStep)
  3197. {
  3198. this.set__requestState$i$1(state);
  3199. var $$t_2=this;
  3200. window.setTimeout(function()
  3201. {
  3202. try
  3203. {
  3204. $$t_2._callOnReadyStateChangeCallback$i$1()
  3205. }
  3206. finally
  3207. {
  3208. if(!$h.ScriptHelpers.isNullOrUndefined(nextStep))
  3209. nextStep()
  3210. }
  3211. },0)
  3212. },
  3213. _checkSendConditions$i$1: function()
  3214. {
  3215. if(this.get__requestState$i$1() !==1)
  3216. this._throwInvalidStateException$i$1();
  3217. if(this._isSent$p$0)
  3218. this._throwInvalidStateException$i$1()
  3219. }
  3220. };
  3221. $h.RequestBase=function(userContext)
  3222. {
  3223. this._userContext$p$0=userContext
  3224. };
  3225. $h.RequestBase.prototype={
  3226. _isSent$p$0: false,
  3227. _asyncResult$p$0: null,
  3228. _userContext$p$0: null,
  3229. _sendRequest$i$0: function(dispid, methodName, dataToSend)
  3230. {
  3231. this._isSent$p$0=true;
  3232. var $$t_5=this;
  3233. OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid,methodName,dataToSend,function(resultCode, response)
  3234. {
  3235. if(resultCode)
  3236. $$t_5.createAsyncResult(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,resultCode));
  3237. else
  3238. $$t_5.handleResponse(response)
  3239. })
  3240. },
  3241. createAsyncResult: function(value, errorCode, errorDescription)
  3242. {
  3243. this._asyncResult$p$0=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(value,errorCode,errorDescription,this._userContext$p$0)
  3244. }
  3245. };
  3246. $h._saveDictionaryRequest=function(callback, userContext)
  3247. {
  3248. $h._saveDictionaryRequest.initializeBase(this,[userContext]);
  3249. if(!$h.ScriptHelpers.isNullOrUndefined(callback))
  3250. this._callback$p$1=callback
  3251. };
  3252. $h._saveDictionaryRequest.prototype={
  3253. _callback$p$1: null,
  3254. handleResponse: function(response)
  3255. {
  3256. if(response["wasSuccessful"])
  3257. this.createAsyncResult(null,0,null);
  3258. else
  3259. this.createAsyncResult(null,1,response["errorMessage"]);
  3260. if(!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1))
  3261. this._callback$p$1(this._asyncResult$p$0)
  3262. }
  3263. };
  3264. $h.ScriptHelpers=function(){};
  3265. $h.ScriptHelpers.isNull=function(value)
  3266. {
  3267. return null===value
  3268. };
  3269. $h.ScriptHelpers.isNullOrUndefined=function(value)
  3270. {
  3271. return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value)
  3272. };
  3273. $h.ScriptHelpers.isUndefined=function(value)
  3274. {
  3275. return value===undefined
  3276. };
  3277. $h.ScriptHelpers.dictionaryContainsKey=function(obj, keyName)
  3278. {
  3279. return Object.isInstanceOfType(obj) ? keyName in obj : false
  3280. };
  3281. $h.ScriptHelpers.isNonEmptyString=function(value)
  3282. {
  3283. if(!value)
  3284. return false;
  3285. return String.isInstanceOfType(value)
  3286. };
  3287. OSF.DDA.OutlookAppOm.registerClass("OSF.DDA.OutlookAppOm");
  3288. OSF.DDA.Settings.registerClass("OSF.DDA.Settings");
  3289. $h.ItemBase.registerClass("$h.ItemBase");
  3290. $h.Item.registerClass("$h.Item",$h.ItemBase);
  3291. $h.Appointment.registerClass("$h.Appointment",$h.Item);
  3292. $h.ComposeItem.registerClass("$h.ComposeItem",$h.ItemBase);
  3293. $h.AppointmentCompose.registerClass("$h.AppointmentCompose",$h.ComposeItem);
  3294. $h.AttachmentConstants.registerClass("$h.AttachmentConstants");
  3295. $h.AttachmentDetails.registerClass("$h.AttachmentDetails");
  3296. $h.ComposeBody.registerClass("$h.ComposeBody");
  3297. $h.ComposeRecipient.registerClass("$h.ComposeRecipient");
  3298. $h.ComposeLocation.registerClass("$h.ComposeLocation");
  3299. $h.ComposeSubject.registerClass("$h.ComposeSubject");
  3300. $h.ComposeTime.registerClass("$h.ComposeTime");
  3301. $h.Contact.registerClass("$h.Contact");
  3302. $h.CustomProperties.registerClass("$h.CustomProperties");
  3303. $h.Diagnostics.registerClass("$h.Diagnostics");
  3304. $h.EmailAddressDetails.registerClass("$h.EmailAddressDetails");
  3305. $h.Entities.registerClass("$h.Entities");
  3306. $h.ReplyConstants.registerClass("$h.ReplyConstants");
  3307. $h.AsyncConstants.registerClass("$h.AsyncConstants");
  3308. Office.cast.item.registerClass("Office.cast.item");
  3309. $h.Message.registerClass("$h.Message",$h.Item);
  3310. $h.MeetingRequest.registerClass("$h.MeetingRequest",$h.Message);
  3311. $h.MeetingSuggestion.registerClass("$h.MeetingSuggestion");
  3312. $h.MeetingSuggestionTimeDecoder.registerClass("$h.MeetingSuggestionTimeDecoder");
  3313. $h._extractedDate.registerClass("$h._extractedDate");
  3314. $h._preciseDate.registerClass("$h._preciseDate",$h._extractedDate);
  3315. $h._relativeDate.registerClass("$h._relativeDate",$h._extractedDate);
  3316. $h.MessageCompose.registerClass("$h.MessageCompose",$h.ComposeItem);
  3317. $h.OutlookErrorManager.registerClass("$h.OutlookErrorManager");
  3318. $h.OutlookErrorManager.OutlookErrorCodes.registerClass("$h.OutlookErrorManager.OutlookErrorCodes");
  3319. $h.OutlookErrorManager.OsfDdaErrorCodes.registerClass("$h.OutlookErrorManager.OsfDdaErrorCodes");
  3320. $h.PhoneNumber.registerClass("$h.PhoneNumber");
  3321. $h.TaskSuggestion.registerClass("$h.TaskSuggestion");
  3322. $h.UserProfile.registerClass("$h.UserProfile");
  3323. $h.CommonParameters.registerClass("$h.CommonParameters");
  3324. $h.RequestBase.registerClass("$h.RequestBase");
  3325. $h.ProxyRequestBase.registerClass("$h.ProxyRequestBase",$h.RequestBase);
  3326. $h.EwsRequest.registerClass("$h.EwsRequest",$h.ProxyRequestBase);
  3327. $h.InitialData.registerClass("$h.InitialData");
  3328. $h._loadDictionaryRequest.registerClass("$h._loadDictionaryRequest",$h.RequestBase);
  3329. $h._saveDictionaryRequest.registerClass("$h._saveDictionaryRequest",$h.RequestBase);
  3330. $h.ScriptHelpers.registerClass("$h.ScriptHelpers");
  3331. OSF.DDA.OutlookAppOm.asyncMethodTimeoutKeyName="__timeout__";
  3332. OSF.DDA.OutlookAppOm._maxRecipients$p=100;
  3333. OSF.DDA.OutlookAppOm._maxSubjectLength$p=255;
  3334. OSF.DDA.OutlookAppOm.maxBodyLength=32768;
  3335. OSF.DDA.OutlookAppOm._maxLocationLength$p=255;
  3336. OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1e6;
  3337. OSF.DDA.OutlookAppOm._instance$p=null;
  3338. $h.AttachmentConstants.maxAttachmentNameLength=255;
  3339. $h.AttachmentConstants.maxUrlLength=2048;
  3340. $h.AttachmentConstants.maxItemIdLength=200;
  3341. $h.AttachmentConstants.maxRemoveIdLength=200;
  3342. $h.AttachmentConstants.attachmentParameterName="attachments";
  3343. $h.AttachmentConstants.attachmentTypeParameterName="type";
  3344. $h.AttachmentConstants.attachmentUrlParameterName="url";
  3345. $h.AttachmentConstants.attachmentItemIdParameterName="itemId";
  3346. $h.AttachmentConstants.attachmentNameParameterName="name";
  3347. $h.AttachmentConstants.attachmentTypeFileName="file";
  3348. $h.AttachmentConstants.attachmentTypeItemName="item";
  3349. $h.AttachmentDetails._attachmentTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File,Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item];
  3350. $h.ComposeBody.coercionTypeParameterName="coercionType";
  3351. $h.ComposeRecipient.displayNameLengthLimit=255;
  3352. $h.ComposeRecipient.maxSmtpLength=571;
  3353. $h.ComposeRecipient.recipientsLimit=100;
  3354. $h.ComposeRecipient.addressParameterName="address";
  3355. $h.ComposeRecipient.nameParameterName="name";
  3356. $h.ComposeLocation.locationKey="location";
  3357. $h.ComposeLocation.maximumLocationLength=255;
  3358. $h.ComposeSubject.maximumSubjectLength=255;
  3359. $h.ComposeTime.timeTypeName="TimeProperty";
  3360. $h.ComposeTime.timeDataName="time";
  3361. $h.Diagnostics.outlookAppName="Outlook";
  3362. $h.Diagnostics.outlookWebAppName="OutlookWebApp";
  3363. $h.EmailAddressDetails._emptyString$p="";
  3364. $h.EmailAddressDetails._responseTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined];
  3365. $h.EmailAddressDetails._recipientTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser];
  3366. $h.Entities._allEntityKeys$p=["Addresses","EmailAddresses","Urls","PhoneNumbers","TaskSuggestions","MeetingSuggestions","Contacts"];
  3367. $h.ReplyConstants.htmlBodyKeyName="htmlBody";
  3368. $h.AsyncConstants.optionsKeyName="options";
  3369. $h.AsyncConstants.callbackKeyName="callback";
  3370. $h.AsyncConstants.asyncResultKeyName="asyncResult";
  3371. $h.MeetingSuggestionTimeDecoder._baseDate$p=new Date("0001-01-01T00:00:00Z");
  3372. $h.OutlookErrorManager.errorNameKey="name";
  3373. $h.OutlookErrorManager.errorMessageKey="message";
  3374. $h.OutlookErrorManager._isInitialized$p=false;
  3375. $h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9e3;
  3376. $h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001;
  3377. $h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002;
  3378. $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003;
  3379. $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004;
  3380. $h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005;
  3381. $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006;
  3382. $h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007;
  3383. $h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008;
  3384. $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009;
  3385. $h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010;
  3386. $h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011;
  3387. $h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012;
  3388. $h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013;
  3389. $h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014;
  3390. $h.OutlookErrorManager.OutlookErrorCodes.invalidSelection=9016;
  3391. $h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1e3;
  3392. $h.CommonParameters.asyncContextKeyName="asyncContext";
  3393. $h.ScriptHelpers.emptyString="";
  3394. OSF.ClientMode={
  3395. ReadWrite: 0,
  3396. ReadOnly: 1
  3397. };
  3398. OSF.DDA.RichInitializationReason={
  3399. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  3400. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  3401. };
  3402. Microsoft.Office.WebExtension.FileType={
  3403. Text: "text",
  3404. Compressed: "compressed"
  3405. };
  3406. OSF.DDA.RichClientSettingsManager={
  3407. read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onReceiving)
  3408. {
  3409. var keys=[];
  3410. var values=[];
  3411. if(onCalling)
  3412. onCalling();
  3413. window.external.GetContext().GetSettings().Read(keys,values);
  3414. if(onReceiving)
  3415. onReceiving();
  3416. var serializedSettings={};
  3417. for(var index=0; index < keys.length; index++)
  3418. serializedSettings[keys[index]]=values[index];
  3419. return serializedSettings
  3420. },
  3421. write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onReceiving)
  3422. {
  3423. var keys=[];
  3424. var values=[];
  3425. for(var key in serializedSettings)
  3426. {
  3427. keys.push(key);
  3428. values.push(serializedSettings[key])
  3429. }
  3430. if(onCalling)
  3431. onCalling();
  3432. window.external.GetContext().GetSettings().Write(keys,values);
  3433. if(onReceiving)
  3434. onReceiving()
  3435. }
  3436. };
  3437. OSF.DDA.DispIdHost.getRichClientDelegateMethods=function(actionId)
  3438. {
  3439. var delegateMethods={};
  3440. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  3441. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  3442. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  3443. function getSettingsExecuteMethod(hostDelegateMethod)
  3444. {
  3445. return function(args)
  3446. {
  3447. var status,
  3448. response;
  3449. try
  3450. {
  3451. response=hostDelegateMethod(args.hostCallArgs,args.onCalling,args.onReceiving);
  3452. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess
  3453. }
  3454. catch(ex)
  3455. {
  3456. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3457. response={
  3458. name: Strings.OfficeOM.L_InternalError,
  3459. message: ex
  3460. }
  3461. }
  3462. if(args.onComplete)
  3463. args.onComplete(status,response)
  3464. }
  3465. }
  3466. function readSerializedSettings(hostCallArgs, onCalling, onReceiving)
  3467. {
  3468. return OSF.DDA.RichClientSettingsManager.read(onCalling,onReceiving)
  3469. }
  3470. function writeSerializedSettings(hostCallArgs, onCalling, onReceiving)
  3471. {
  3472. return OSF.DDA.RichClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings],hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale],onCalling,onReceiving)
  3473. }
  3474. switch(actionId)
  3475. {
  3476. case OSF.DDA.AsyncMethodNames.RefreshAsync.id:
  3477. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings);
  3478. break;
  3479. case OSF.DDA.AsyncMethodNames.SaveAsync.id:
  3480. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings);
  3481. break;
  3482. default:
  3483. break
  3484. }
  3485. return delegateMethods
  3486. };
  3487. OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize)
  3488. {
  3489. OSF.OUtil.defineEnumerableProperties(this,{
  3490. size: {value: fileSize},
  3491. sliceCount: {value: Math.ceil(fileSize / sliceSize)}
  3492. });
  3493. var privateState={};
  3494. privateState[OSF.DDA.FileProperties.Handle]=handle;
  3495. privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize;
  3496. var am=OSF.DDA.AsyncMethodNames;
  3497. OSF.DDA.DispIdHost.addAsyncMethods(this,[am.GetDocumentCopyChunkAsync,am.ReleaseDocumentCopyAsync],privateState)
  3498. };
  3499. OSF.DDA.FileSliceOffset="fileSliceoffset";
  3500. OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts()
  3501. {
  3502. this._eventDispatches=[];
  3503. var am=OSF.DDA.AsyncMethodNames;
  3504. OSF.DDA.DispIdHost.addAsyncMethods(this,[am.AddDataPartAsync,am.GetDataPartByIdAsync,am.GetDataPartsByNameSpaceAsync])
  3505. };
  3506. OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn)
  3507. {
  3508. OSF.OUtil.defineEnumerableProperties(this,{
  3509. builtIn: {value: builtIn},
  3510. id: {value: id},
  3511. namespaceManager: {value: new OSF.DDA.CustomXmlPrefixMappings(id)}
  3512. });
  3513. var am=OSF.DDA.AsyncMethodNames;
  3514. OSF.DDA.DispIdHost.addAsyncMethods(this,[am.DeleteDataPartAsync,am.GetPartNodesAsync,am.GetPartXmlAsync]);
  3515. var customXmlPartEventDispatches=customXmlParts._eventDispatches;
  3516. var dispatch=customXmlPartEventDispatches[id];
  3517. if(!dispatch)
  3518. {
  3519. var et=Microsoft.Office.WebExtension.EventType;
  3520. dispatch=new OSF.EventDispatch([et.DataNodeDeleted,et.DataNodeInserted,et.DataNodeReplaced]);
  3521. customXmlPartEventDispatches[id]=dispatch
  3522. }
  3523. OSF.DDA.DispIdHost.addEventSupport(this,dispatch)
  3524. };
  3525. OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId)
  3526. {
  3527. var am=OSF.DDA.AsyncMethodNames;
  3528. OSF.DDA.DispIdHost.addAsyncMethods(this,[am.AddDataPartNamespaceAsync,am.GetDataPartNamespaceAsync,am.GetDataPartPrefixAsync],partId)
  3529. };
  3530. OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName)
  3531. {
  3532. OSF.OUtil.defineEnumerableProperties(this,{
  3533. baseName: {value: baseName},
  3534. namespaceUri: {value: ns},
  3535. nodeType: {value: nodeType}
  3536. });
  3537. var am=OSF.DDA.AsyncMethodNames;
  3538. OSF.DDA.DispIdHost.addAsyncMethods(this,[am.GetRelativeNodesAsync,am.GetNodeValueAsync,am.GetNodeXmlAsync,am.SetNodeValueAsync,am.SetNodeXmlAsync],handle)
  3539. };
  3540. OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo)
  3541. {
  3542. OSF.OUtil.defineEnumerableProperties(this,{
  3543. type: {value: Microsoft.Office.WebExtension.EventType.DataNodeInserted},
  3544. newNode: {value: newNode},
  3545. inUndoRedo: {value: inUndoRedo}
  3546. })
  3547. };
  3548. OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo)
  3549. {
  3550. OSF.OUtil.defineEnumerableProperties(this,{
  3551. type: {value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced},
  3552. oldNode: {value: oldNode},
  3553. newNode: {value: newNode},
  3554. inUndoRedo: {value: inUndoRedo}
  3555. })
  3556. };
  3557. OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo)
  3558. {
  3559. OSF.OUtil.defineEnumerableProperties(this,{
  3560. type: {value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted},
  3561. oldNode: {value: oldNode},
  3562. oldNextSibling: {value: oldNextSibling},
  3563. inUndoRedo: {value: inUndoRedo}
  3564. })
  3565. }