Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

outlook-win32-16.01.debug.js 334KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705
  1. /* Outlook specific API library */
  2. /* Version: 16.0.6807.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. var __extends=this && this.__extends || function(d, b)
  10. {
  11. for(var p in b)
  12. if(b.hasOwnProperty(p))
  13. d[p]=b[p];
  14. function __()
  15. {
  16. this.constructor=d
  17. }
  18. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype,new __)
  19. };
  20. var OfficeExt;
  21. (function(OfficeExt)
  22. {
  23. var MicrosoftAjaxFactory=function()
  24. {
  25. function MicrosoftAjaxFactory(){}
  26. MicrosoftAjaxFactory.prototype.isMsAjaxLoaded=function()
  27. {
  28. if(typeof Sys !=="undefined" && typeof Type !=="undefined" && Sys.StringBuilder && typeof Sys.StringBuilder==="function" && Type.registerNamespace && typeof Type.registerNamespace==="function" && Type.registerClass && typeof Type.registerClass==="function" && typeof Function._validateParams==="function")
  29. return true;
  30. else
  31. return false
  32. };
  33. MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function(callback)
  34. {
  35. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==="https:" ? "https:" : "http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";
  36. OSF.OUtil.loadScript(msAjaxCDNPath,callback)
  37. };
  38. Object.defineProperty(MicrosoftAjaxFactory.prototype,"msAjaxError",{
  39. get: function()
  40. {
  41. if(this._msAjaxError==null && this.isMsAjaxLoaded())
  42. this._msAjaxError=Error;
  43. return this._msAjaxError
  44. },
  45. set: function(errorClass)
  46. {
  47. this._msAjaxError=errorClass
  48. },
  49. enumerable: true,
  50. configurable: true
  51. });
  52. Object.defineProperty(MicrosoftAjaxFactory.prototype,"msAjaxSerializer",{
  53. get: function()
  54. {
  55. if(this._msAjaxSerializer==null && this.isMsAjaxLoaded())
  56. this._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;
  57. return this._msAjaxSerializer
  58. },
  59. set: function(serializerClass)
  60. {
  61. this._msAjaxSerializer=serializerClass
  62. },
  63. enumerable: true,
  64. configurable: true
  65. });
  66. Object.defineProperty(MicrosoftAjaxFactory.prototype,"msAjaxString",{
  67. get: function()
  68. {
  69. if(this._msAjaxString==null && this.isMsAjaxLoaded())
  70. this._msAjaxSerializer=String;
  71. return this._msAjaxString
  72. },
  73. set: function(stringClass)
  74. {
  75. this._msAjaxString=stringClass
  76. },
  77. enumerable: true,
  78. configurable: true
  79. });
  80. Object.defineProperty(MicrosoftAjaxFactory.prototype,"msAjaxDebug",{
  81. get: function()
  82. {
  83. if(this._msAjaxDebug==null && this.isMsAjaxLoaded())
  84. this._msAjaxDebug=Sys.Debug;
  85. return this._msAjaxDebug
  86. },
  87. set: function(debugClass)
  88. {
  89. this._msAjaxDebug=debugClass
  90. },
  91. enumerable: true,
  92. configurable: true
  93. });
  94. return MicrosoftAjaxFactory
  95. }();
  96. OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory
  97. })(OfficeExt || (OfficeExt={}));
  98. var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory;
  99. var OSF=OSF || {};
  100. var OfficeExt;
  101. (function(OfficeExt)
  102. {
  103. var SafeStorage=function()
  104. {
  105. function SafeStorage(_internalStorage)
  106. {
  107. this._internalStorage=_internalStorage
  108. }
  109. SafeStorage.prototype.getItem=function(key)
  110. {
  111. try
  112. {
  113. return this._internalStorage && this._internalStorage.getItem(key)
  114. }
  115. catch(e)
  116. {
  117. return null
  118. }
  119. };
  120. SafeStorage.prototype.setItem=function(key, data)
  121. {
  122. try
  123. {
  124. this._internalStorage && this._internalStorage.setItem(key,data)
  125. }
  126. catch(e){}
  127. };
  128. SafeStorage.prototype.clear=function()
  129. {
  130. try
  131. {
  132. this._internalStorage && this._internalStorage.clear()
  133. }
  134. catch(e){}
  135. };
  136. SafeStorage.prototype.removeItem=function(key)
  137. {
  138. try
  139. {
  140. this._internalStorage && this._internalStorage.removeItem(key)
  141. }
  142. catch(e){}
  143. };
  144. SafeStorage.prototype.getKeysWithPrefix=function(keyPrefix)
  145. {
  146. var keyList=[];
  147. try
  148. {
  149. var len=this._internalStorage && this._internalStorage.length || 0;
  150. for(var i=0; i < len; i++)
  151. {
  152. var key=this._internalStorage.key(i);
  153. if(key.indexOf(keyPrefix)===0)
  154. keyList.push(key)
  155. }
  156. }
  157. catch(e){}
  158. return keyList
  159. };
  160. return SafeStorage
  161. }();
  162. OfficeExt.SafeStorage=SafeStorage
  163. })(OfficeExt || (OfficeExt={}));
  164. OSF.OUtil=function()
  165. {
  166. var _uniqueId=-1;
  167. var _xdmInfoKey="&_xdm_Info=";
  168. var _serializerVersionKey="&_serializer_version=";
  169. var _xdmSessionKeyPrefix="_xdm_";
  170. var _serializerVersionKeyPrefix="_serializer_version=";
  171. var _fragmentSeparator="#";
  172. var _loadedScripts={};
  173. var _defaultScriptLoadingTimeout=3e4;
  174. var _safeSessionStorage=null;
  175. var _safeLocalStorage=null;
  176. var _rndentropy=(new Date).getTime();
  177. function _random()
  178. {
  179. var nextrand=2147483647 * Math.random();
  180. nextrand ^=_rndentropy ^ (new Date).getMilliseconds() << Math.floor(Math.random() * (31 - 10));
  181. return nextrand.toString(16)
  182. }
  183. function _getSessionStorage()
  184. {
  185. if(!_safeSessionStorage)
  186. {
  187. try
  188. {
  189. var sessionStorage=window.sessionStorage
  190. }
  191. catch(ex)
  192. {
  193. sessionStorage=null
  194. }
  195. _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage)
  196. }
  197. return _safeSessionStorage
  198. }
  199. return{
  200. set_entropy: function OSF_OUtil$set_entropy(entropy)
  201. {
  202. if(typeof entropy=="string")
  203. for(var i=0; i < entropy.length; i+=4)
  204. {
  205. var temp=0;
  206. for(var j=0; j < 4 && i+j < entropy.length; j++)
  207. temp=(temp << 8)+entropy.charCodeAt(i+j);
  208. _rndentropy ^=temp
  209. }
  210. else if(typeof entropy=="number")
  211. _rndentropy ^=entropy;
  212. else
  213. _rndentropy ^=2147483647 * Math.random();
  214. _rndentropy &=2147483647
  215. },
  216. extend: function OSF_OUtil$extend(child, parent)
  217. {
  218. var F=function(){};
  219. F.prototype=parent.prototype;
  220. child.prototype=new F;
  221. child.prototype.constructor=child;
  222. child.uber=parent.prototype;
  223. if(parent.prototype.constructor===Object.prototype.constructor)
  224. parent.prototype.constructor=parent
  225. },
  226. setNamespace: function OSF_OUtil$setNamespace(name, parent)
  227. {
  228. if(parent && name && !parent[name])
  229. parent[name]={}
  230. },
  231. unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent)
  232. {
  233. if(parent && name && parent[name])
  234. delete parent[name]
  235. },
  236. loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs)
  237. {
  238. if(url && callback)
  239. {
  240. var doc=window.document;
  241. var _loadedScriptEntry=_loadedScripts[url];
  242. if(!_loadedScriptEntry)
  243. {
  244. var script=doc.createElement("script");
  245. script.type="text/javascript";
  246. _loadedScriptEntry={
  247. loaded: false,
  248. pendingCallbacks: [callback],
  249. timer: null
  250. };
  251. _loadedScripts[url]=_loadedScriptEntry;
  252. var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback()
  253. {
  254. if(_loadedScriptEntry.timer !=null)
  255. {
  256. clearTimeout(_loadedScriptEntry.timer);
  257. delete _loadedScriptEntry.timer
  258. }
  259. _loadedScriptEntry.loaded=true;
  260. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  261. for(var i=0; i < pendingCallbackCount; i++)
  262. {
  263. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  264. currentCallback()
  265. }
  266. };
  267. var onLoadError=function OSF_OUtil_loadScript$onLoadError()
  268. {
  269. delete _loadedScripts[url];
  270. if(_loadedScriptEntry.timer !=null)
  271. {
  272. clearTimeout(_loadedScriptEntry.timer);
  273. delete _loadedScriptEntry.timer
  274. }
  275. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  276. for(var i=0; i < pendingCallbackCount; i++)
  277. {
  278. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  279. currentCallback()
  280. }
  281. };
  282. if(script.readyState)
  283. script.onreadystatechange=function()
  284. {
  285. if(script.readyState=="loaded" || script.readyState=="complete")
  286. {
  287. script.onreadystatechange=null;
  288. onLoadCallback()
  289. }
  290. };
  291. else
  292. script.onload=onLoadCallback;
  293. script.onerror=onLoadError;
  294. timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout;
  295. _loadedScriptEntry.timer=setTimeout(onLoadError,timeoutInMs);
  296. script.src=url;
  297. doc.getElementsByTagName("head")[0].appendChild(script)
  298. }
  299. else if(_loadedScriptEntry.loaded)
  300. callback();
  301. else
  302. _loadedScriptEntry.pendingCallbacks.push(callback)
  303. }
  304. },
  305. loadCSS: function OSF_OUtil$loadCSS(url)
  306. {
  307. if(url)
  308. {
  309. var doc=window.document;
  310. var link=doc.createElement("link");
  311. link.type="text/css";
  312. link.rel="stylesheet";
  313. link.href=url;
  314. doc.getElementsByTagName("head")[0].appendChild(link)
  315. }
  316. },
  317. parseEnum: function OSF_OUtil$parseEnum(str, enumObject)
  318. {
  319. var parsed=enumObject[str.trim()];
  320. if(typeof parsed=="undefined")
  321. {
  322. OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str);
  323. throw OsfMsAjaxFactory.msAjaxError.argument("str");
  324. }
  325. return parsed
  326. },
  327. delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache()
  328. {
  329. var obj={calc: arguments[0]};
  330. return function()
  331. {
  332. if(obj.calc)
  333. {
  334. obj.val=obj.calc.apply(this,arguments);
  335. delete obj.calc
  336. }
  337. return obj.val
  338. }
  339. },
  340. getUniqueId: function OSF_OUtil$getUniqueId()
  341. {
  342. _uniqueId=_uniqueId+1;
  343. return _uniqueId.toString()
  344. },
  345. formatString: function OSF_OUtil$formatString()
  346. {
  347. var args=arguments;
  348. var source=args[0];
  349. return source.replace(/{(\d+)}/gm,function(match, number)
  350. {
  351. var index=parseInt(number,10)+1;
  352. return args[index]===undefined ? "{"+number+"}" : args[index]
  353. })
  354. },
  355. generateConversationId: function OSF_OUtil$generateConversationId()
  356. {
  357. return[_random(),_random(),(new Date).getTime().toString()].join("_")
  358. },
  359. getFrameNameAndConversationId: function OSF_OUtil$getFrameNameAndConversationId(cacheKey, frame)
  360. {
  361. var frameName=_xdmSessionKeyPrefix+cacheKey+this.generateConversationId();
  362. frame.setAttribute("name",frameName);
  363. return this.generateConversationId()
  364. },
  365. addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue)
  366. {
  367. return OSF.OUtil.addInfoAsHash(url,_xdmInfoKey,xdmInfoValue)
  368. },
  369. addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion)
  370. {
  371. return OSF.OUtil.addInfoAsHash(url,_serializerVersionKey,serializerVersion)
  372. },
  373. addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue)
  374. {
  375. url=url.trim() || "";
  376. var urlParts=url.split(_fragmentSeparator);
  377. var urlWithoutFragment=urlParts.shift();
  378. var fragment=urlParts.join(_fragmentSeparator);
  379. return[urlWithoutFragment,_fragmentSeparator,fragment,keyName,infoValue].join("")
  380. },
  381. parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage)
  382. {
  383. return OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage,window.location.hash)
  384. },
  385. parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment)
  386. {
  387. return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey,_xdmSessionKeyPrefix,skipSessionStorage,fragment)
  388. },
  389. parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage)
  390. {
  391. return OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage,window.location.hash)
  392. },
  393. parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment)
  394. {
  395. return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey,_serializerVersionKeyPrefix,skipSessionStorage,fragment))
  396. },
  397. parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, skipSessionStorage, fragment)
  398. {
  399. var fragmentParts=fragment.split(infoKey);
  400. var xdmInfoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null;
  401. var osfSessionStorage=_getSessionStorage();
  402. if(!skipSessionStorage && osfSessionStorage)
  403. {
  404. var sessionKeyStart=window.name.indexOf(infoKeyPrefix);
  405. if(sessionKeyStart > -1)
  406. {
  407. var sessionKeyEnd=window.name.indexOf(";",sessionKeyStart);
  408. if(sessionKeyEnd==-1)
  409. sessionKeyEnd=window.name.length;
  410. var sessionKey=window.name.substring(sessionKeyStart,sessionKeyEnd);
  411. if(xdmInfoValue)
  412. osfSessionStorage.setItem(sessionKey,xdmInfoValue);
  413. else
  414. xdmInfoValue=osfSessionStorage.getItem(sessionKey)
  415. }
  416. }
  417. return xdmInfoValue
  418. },
  419. getConversationId: function OSF_OUtil$getConversationId()
  420. {
  421. var searchString=window.location.search;
  422. var conversationId=null;
  423. if(searchString)
  424. {
  425. var index=searchString.indexOf("&");
  426. conversationId=index > 0 ? searchString.substring(1,index) : searchString.substr(1);
  427. if(conversationId && conversationId.charAt(conversationId.length - 1)==="=")
  428. {
  429. conversationId=conversationId.substring(0,conversationId.length - 1);
  430. if(conversationId)
  431. conversationId=decodeURIComponent(conversationId)
  432. }
  433. }
  434. return conversationId
  435. },
  436. getInfoItems: function OSF_OUtil$getInfoItems(strInfo)
  437. {
  438. var items=strInfo.split("$");
  439. if(typeof items[1]=="undefined")
  440. items=strInfo.split("|");
  441. return items
  442. },
  443. getConversationUrl: function OSF_OUtil$getConversationUrl()
  444. {
  445. var conversationUrl="";
  446. var xdmInfoValue=OSF.OUtil.parseXdmInfo(true);
  447. if(xdmInfoValue)
  448. {
  449. var items=OSF.OUtil.getInfoItems(xdmInfoValue);
  450. if(items !=undefined && items.length >=3)
  451. conversationUrl=items[2]
  452. }
  453. return conversationUrl
  454. },
  455. validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback)
  456. {
  457. var e=Function._validateParams(arguments,[{
  458. name: "params",
  459. type: Object,
  460. mayBeNull: false
  461. },{
  462. name: "expectedProperties",
  463. type: Object,
  464. mayBeNull: false
  465. },{
  466. name: "callback",
  467. type: Function,
  468. mayBeNull: true
  469. }]);
  470. if(e)
  471. throw e;
  472. for(var p in expectedProperties)
  473. {
  474. e=Function._validateParameter(params[p],expectedProperties[p],p);
  475. if(e)
  476. throw e;
  477. }
  478. },
  479. writeProfilerMark: function OSF_OUtil$writeProfilerMark(text)
  480. {
  481. if(window.msWriteProfilerMark)
  482. {
  483. window.msWriteProfilerMark(text);
  484. OsfMsAjaxFactory.msAjaxDebug.trace(text)
  485. }
  486. },
  487. outputDebug: function OSF_OUtil$outputDebug(text)
  488. {
  489. if(typeof Sys !=="undefined" && Sys && Sys.Debug)
  490. OsfMsAjaxFactory.msAjaxDebug.trace(text)
  491. },
  492. defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes)
  493. {
  494. descriptor=descriptor || {};
  495. for(var nd in attributes)
  496. {
  497. var attribute=attributes[nd];
  498. if(descriptor[attribute]==undefined)
  499. descriptor[attribute]=true
  500. }
  501. Object.defineProperty(obj,prop,descriptor);
  502. return obj
  503. },
  504. defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes)
  505. {
  506. descriptors=descriptors || {};
  507. for(var prop in descriptors)
  508. OSF.OUtil.defineNondefaultProperty(obj,prop,descriptors[prop],attributes);
  509. return obj
  510. },
  511. defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor)
  512. {
  513. return OSF.OUtil.defineNondefaultProperty(obj,prop,descriptor,["enumerable"])
  514. },
  515. defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors)
  516. {
  517. return OSF.OUtil.defineNondefaultProperties(obj,descriptors,["enumerable"])
  518. },
  519. defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor)
  520. {
  521. return OSF.OUtil.defineNondefaultProperty(obj,prop,descriptor,["writable","enumerable","configurable"])
  522. },
  523. defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors)
  524. {
  525. return OSF.OUtil.defineNondefaultProperties(obj,descriptors,["writable","enumerable","configurable"])
  526. },
  527. finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor)
  528. {
  529. descriptor=descriptor || {};
  530. var props=Object.getOwnPropertyNames(obj);
  531. var propsLength=props.length;
  532. for(var i=0; i < propsLength; i++)
  533. {
  534. var prop=props[i];
  535. var desc=Object.getOwnPropertyDescriptor(obj,prop);
  536. if(!desc.get && !desc.set)
  537. desc.writable=descriptor.writable || false;
  538. desc.configurable=descriptor.configurable || false;
  539. desc.enumerable=descriptor.enumerable || true;
  540. Object.defineProperty(obj,prop,desc)
  541. }
  542. return obj
  543. },
  544. mapList: function OSF_OUtil$MapList(list, mapFunction)
  545. {
  546. var ret=[];
  547. if(list)
  548. for(var item in list)
  549. ret.push(mapFunction(list[item]));
  550. return ret
  551. },
  552. listContainsKey: function OSF_OUtil$listContainsKey(list, key)
  553. {
  554. for(var item in list)
  555. if(key==item)
  556. return true;
  557. return false
  558. },
  559. listContainsValue: function OSF_OUtil$listContainsElement(list, value)
  560. {
  561. for(var item in list)
  562. if(value==list[item])
  563. return true;
  564. return false
  565. },
  566. augmentList: function OSF_OUtil$augmentList(list, addenda)
  567. {
  568. var add=list.push ? function(key, value)
  569. {
  570. list.push(value)
  571. } : function(key, value)
  572. {
  573. list[key]=value
  574. };
  575. for(var key in addenda)
  576. add(key,addenda[key])
  577. },
  578. redefineList: function OSF_Outil$redefineList(oldList, newList)
  579. {
  580. for(var key1 in oldList)
  581. delete oldList[key1];
  582. for(var key2 in newList)
  583. oldList[key2]=newList[key2]
  584. },
  585. isArray: function OSF_OUtil$isArray(obj)
  586. {
  587. return Object.prototype.toString.apply(obj)==="[object Array]"
  588. },
  589. isFunction: function OSF_OUtil$isFunction(obj)
  590. {
  591. return Object.prototype.toString.apply(obj)==="[object Function]"
  592. },
  593. isDate: function OSF_OUtil$isDate(obj)
  594. {
  595. return Object.prototype.toString.apply(obj)==="[object Date]"
  596. },
  597. addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener)
  598. {
  599. if(element.addEventListener)
  600. element.addEventListener(eventName,listener,false);
  601. else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && element.attachEvent)
  602. element.attachEvent("on"+eventName,listener);
  603. else
  604. element["on"+eventName]=listener
  605. },
  606. removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener)
  607. {
  608. if(element.removeEventListener)
  609. element.removeEventListener(eventName,listener,false);
  610. else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && element.detachEvent)
  611. element.detachEvent("on"+eventName,listener);
  612. else
  613. element["on"+eventName]=null
  614. },
  615. getCookieValue: function OSF_OUtil$getCookieValue(cookieName)
  616. {
  617. var tmpCookieString=RegExp(cookieName+"[^;]+").exec(document.cookie);
  618. return tmpCookieString.toString().replace(/^[^=]+./,"")
  619. },
  620. xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError)
  621. {
  622. var xmlhttp;
  623. try
  624. {
  625. xmlhttp=new XMLHttpRequest;
  626. xmlhttp.onreadystatechange=function()
  627. {
  628. if(xmlhttp.readyState==4)
  629. if(xmlhttp.status==200)
  630. onSuccess(xmlhttp.responseText);
  631. else
  632. onError(xmlhttp.status)
  633. };
  634. xmlhttp.open("GET",url,true);
  635. xmlhttp.send()
  636. }
  637. catch(ex)
  638. {
  639. onError(ex)
  640. }
  641. },
  642. xhrGetFull: function OSF_OUtil$xhrGetFull(url, oneDriveFileName, onSuccess, onError)
  643. {
  644. var xmlhttp;
  645. var requestedFileName=oneDriveFileName;
  646. try
  647. {
  648. xmlhttp=new XMLHttpRequest;
  649. xmlhttp.onreadystatechange=function()
  650. {
  651. if(xmlhttp.readyState==4)
  652. if(xmlhttp.status==200)
  653. onSuccess(xmlhttp,requestedFileName);
  654. else
  655. onError(xmlhttp.status)
  656. };
  657. xmlhttp.open("GET",url,true);
  658. xmlhttp.send()
  659. }
  660. catch(ex)
  661. {
  662. onError(ex)
  663. }
  664. },
  665. encodeBase64: function OSF_Outil$encodeBase64(input)
  666. {
  667. if(!input)
  668. return input;
  669. var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/=";
  670. var output=[];
  671. var temp=[];
  672. var index=0;
  673. var c1,
  674. c2,
  675. c3,
  676. a,
  677. b,
  678. c;
  679. var i;
  680. var length=input.length;
  681. do
  682. {
  683. c1=input.charCodeAt(index++);
  684. c2=input.charCodeAt(index++);
  685. c3=input.charCodeAt(index++);
  686. i=0;
  687. a=c1 & 255;
  688. b=c1 >> 8;
  689. c=c2 & 255;
  690. temp[i++]=a >> 2;
  691. temp[i++]=(a & 3) << 4 | b >> 4;
  692. temp[i++]=(b & 15) << 2 | c >> 6;
  693. temp[i++]=c & 63;
  694. if(!isNaN(c2))
  695. {
  696. a=c2 >> 8;
  697. b=c3 & 255;
  698. c=c3 >> 8;
  699. temp[i++]=a >> 2;
  700. temp[i++]=(a & 3) << 4 | b >> 4;
  701. temp[i++]=(b & 15) << 2 | c >> 6;
  702. temp[i++]=c & 63
  703. }
  704. if(isNaN(c2))
  705. temp[i - 1]=64;
  706. else if(isNaN(c3))
  707. {
  708. temp[i - 2]=64;
  709. temp[i - 1]=64
  710. }
  711. for(var t=0; t < i; t++)
  712. output.push(codex.charAt(temp[t]))
  713. } while(index < length);
  714. return output.join("")
  715. },
  716. getSessionStorage: function OSF_Outil$getSessionStorage()
  717. {
  718. return _getSessionStorage()
  719. },
  720. getLocalStorage: function OSF_Outil$getLocalStorage()
  721. {
  722. if(!_safeLocalStorage)
  723. {
  724. try
  725. {
  726. var localStorage=window.localStorage
  727. }
  728. catch(ex)
  729. {
  730. localStorage=null
  731. }
  732. _safeLocalStorage=new OfficeExt.SafeStorage(localStorage)
  733. }
  734. return _safeLocalStorage
  735. },
  736. convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val)
  737. {
  738. var hex="#"+(Number(val)+16777216).toString(16).slice(-6);
  739. return hex
  740. },
  741. attachClickHandler: function OSF_Outil$attachClickHandler(element, handler)
  742. {
  743. element.onclick=function(e)
  744. {
  745. handler()
  746. };
  747. element.ontouchend=function(e)
  748. {
  749. handler();
  750. e.preventDefault()
  751. }
  752. },
  753. getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName)
  754. {
  755. var e=Function._validateParams(arguments,[{
  756. name: "queryString",
  757. type: String,
  758. mayBeNull: false
  759. },{
  760. name: "paramName",
  761. type: String,
  762. mayBeNull: false
  763. }]);
  764. if(e)
  765. {
  766. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null.");
  767. return""
  768. }
  769. var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)","i");
  770. if(!queryExp.test(queryString))
  771. {
  772. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found.");
  773. return""
  774. }
  775. return queryExp.exec(queryString)[1]
  776. },
  777. isiOS: function OSF_Outil$isiOS()
  778. {
  779. return window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false
  780. },
  781. shallowCopy: function OSF_Outil$shallowCopy(sourceObj)
  782. {
  783. var copyObj=sourceObj.constructor();
  784. for(var property in sourceObj)
  785. if(sourceObj.hasOwnProperty(property))
  786. copyObj[property]=sourceObj[property];
  787. return copyObj
  788. },
  789. serializeOMEXResponseErrorMessage: function OSF_Outil$serializeObjectToString(response)
  790. {
  791. if(typeof JSON !=="undefined")
  792. try
  793. {
  794. return JSON.stringify(response)
  795. }
  796. catch(ex){}
  797. return""
  798. },
  799. createObject: function OSF_Outil$createObject(properties)
  800. {
  801. var obj=null;
  802. if(properties)
  803. {
  804. obj={};
  805. var len=properties.length;
  806. for(var i=0; i < len; i++)
  807. obj[properties[i].name]=properties[i].value
  808. }
  809. return obj
  810. }
  811. }
  812. }();
  813. OSF.OUtil.Guid=function()
  814. {
  815. var hexCode=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];
  816. return{generateNewGuid: function OSF_Outil_Guid$generateNewGuid()
  817. {
  818. var result="";
  819. var tick=(new Date).getTime();
  820. var index=0;
  821. for(; index < 32 && tick > 0; index++)
  822. {
  823. if(index==8 || index==12 || index==16 || index==20)
  824. result+="-";
  825. result+=hexCode[tick % 16];
  826. tick=Math.floor(tick / 16)
  827. }
  828. for(; index < 32; index++)
  829. {
  830. if(index==8 || index==12 || index==16 || index==20)
  831. result+="-";
  832. result+=hexCode[Math.floor(Math.random() * 16)]
  833. }
  834. return result
  835. }}
  836. }();
  837. window.OSF=OSF;
  838. OSF.OUtil.setNamespace("OSF",window);
  839. OSF.AppName={
  840. Unsupported: 0,
  841. Excel: 1,
  842. Word: 2,
  843. PowerPoint: 4,
  844. Outlook: 8,
  845. ExcelWebApp: 16,
  846. WordWebApp: 32,
  847. OutlookWebApp: 64,
  848. Project: 128,
  849. AccessWebApp: 256,
  850. PowerpointWebApp: 512,
  851. ExcelIOS: 1024,
  852. Sway: 2048,
  853. WordIOS: 4096,
  854. PowerPointIOS: 8192,
  855. Access: 16384,
  856. Lync: 32768,
  857. OutlookIOS: 65536,
  858. OneNoteWebApp: 131072
  859. };
  860. OSF.InternalPerfMarker={
  861. DataCoercionBegin: "Agave.HostCall.CoerceDataStart",
  862. DataCoercionEnd: "Agave.HostCall.CoerceDataEnd"
  863. };
  864. OSF.HostCallPerfMarker={
  865. IssueCall: "Agave.HostCall.IssueCall",
  866. ReceiveResponse: "Agave.HostCall.ReceiveResponse",
  867. RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised"
  868. };
  869. OSF.AgaveHostAction={
  870. Select: 0,
  871. UnSelect: 1,
  872. CancelDialog: 2,
  873. InsertAgave: 3,
  874. CtrlF6In: 4,
  875. CtrlF6Exit: 5,
  876. CtrlF6ExitShift: 6,
  877. SelectWithError: 7,
  878. NotifyHostError: 8,
  879. RefreshAddinCommands: 9
  880. };
  881. OSF.SharedConstants={NotificationConversationIdSuffix: "_ntf"};
  882. OSF.DialogMessageType={
  883. DialogMessageReceived: 0,
  884. DialogClosed: 1,
  885. NavigationFailed: 2,
  886. InvalidSchema: 3
  887. };
  888. OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix)
  889. {
  890. this._id=id;
  891. this._appName=appName;
  892. this._appVersion=appVersion;
  893. this._appUILocale=appUILocale;
  894. this._dataLocale=dataLocale;
  895. this._docUrl=docUrl;
  896. this._clientMode=clientMode;
  897. this._settings=settings;
  898. this._reason=reason;
  899. this._osfControlType=osfControlType;
  900. this._eToken=eToken;
  901. this._correlationId=correlationId;
  902. this._appInstanceId=appInstanceId;
  903. this._touchEnabled=touchEnabled;
  904. this._commerceAllowed=commerceAllowed;
  905. this._appMinorVersion=appMinorVersion;
  906. this._requirementMatrix=requirementMatrix;
  907. this._isDialog=false;
  908. this.get_id=function get_id()
  909. {
  910. return this._id
  911. };
  912. this.get_appName=function get_appName()
  913. {
  914. return this._appName
  915. };
  916. this.get_appVersion=function get_appVersion()
  917. {
  918. return this._appVersion
  919. };
  920. this.get_appUILocale=function get_appUILocale()
  921. {
  922. return this._appUILocale
  923. };
  924. this.get_dataLocale=function get_dataLocale()
  925. {
  926. return this._dataLocale
  927. };
  928. this.get_docUrl=function get_docUrl()
  929. {
  930. return this._docUrl
  931. };
  932. this.get_clientMode=function get_clientMode()
  933. {
  934. return this._clientMode
  935. };
  936. this.get_bindings=function get_bindings()
  937. {
  938. return this._bindings
  939. };
  940. this.get_settings=function get_settings()
  941. {
  942. return this._settings
  943. };
  944. this.get_reason=function get_reason()
  945. {
  946. return this._reason
  947. };
  948. this.get_osfControlType=function get_osfControlType()
  949. {
  950. return this._osfControlType
  951. };
  952. this.get_eToken=function get_eToken()
  953. {
  954. return this._eToken
  955. };
  956. this.get_correlationId=function get_correlationId()
  957. {
  958. return this._correlationId
  959. };
  960. this.get_appInstanceId=function get_appInstanceId()
  961. {
  962. return this._appInstanceId
  963. };
  964. this.get_touchEnabled=function get_touchEnabled()
  965. {
  966. return this._touchEnabled
  967. };
  968. this.get_commerceAllowed=function get_commerceAllowed()
  969. {
  970. return this._commerceAllowed
  971. };
  972. this.get_appMinorVersion=function get_appMinorVersion()
  973. {
  974. return this._appMinorVersion
  975. };
  976. this.get_requirementMatrix=function get_requirementMatrix()
  977. {
  978. return this._requirementMatrix
  979. };
  980. this.get_isDialog=function get_isDialog()
  981. {
  982. return this._isDialog
  983. }
  984. };
  985. OSF.OsfControlType={
  986. DocumentLevel: 0,
  987. ContainerLevel: 1
  988. };
  989. OSF.ClientMode={
  990. ReadOnly: 0,
  991. ReadWrite: 1
  992. };
  993. OSF.OUtil.setNamespace("Microsoft",window);
  994. OSF.OUtil.setNamespace("Office",Microsoft);
  995. OSF.OUtil.setNamespace("Client",Microsoft.Office);
  996. OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);
  997. Microsoft.Office.WebExtension.InitializationReason={
  998. Inserted: "inserted",
  999. DocumentOpened: "documentOpened"
  1000. };
  1001. Microsoft.Office.WebExtension.ValueFormat={
  1002. Unformatted: "unformatted",
  1003. Formatted: "formatted"
  1004. };
  1005. Microsoft.Office.WebExtension.FilterType={All: "all"};
  1006. Microsoft.Office.WebExtension.Parameters={
  1007. BindingType: "bindingType",
  1008. CoercionType: "coercionType",
  1009. ValueFormat: "valueFormat",
  1010. FilterType: "filterType",
  1011. Columns: "columns",
  1012. SampleData: "sampleData",
  1013. GoToType: "goToType",
  1014. SelectionMode: "selectionMode",
  1015. Id: "id",
  1016. PromptText: "promptText",
  1017. ItemName: "itemName",
  1018. FailOnCollision: "failOnCollision",
  1019. StartRow: "startRow",
  1020. StartColumn: "startColumn",
  1021. RowCount: "rowCount",
  1022. ColumnCount: "columnCount",
  1023. Callback: "callback",
  1024. AsyncContext: "asyncContext",
  1025. Data: "data",
  1026. Rows: "rows",
  1027. OverwriteIfStale: "overwriteIfStale",
  1028. FileType: "fileType",
  1029. EventType: "eventType",
  1030. Handler: "handler",
  1031. SliceSize: "sliceSize",
  1032. SliceIndex: "sliceIndex",
  1033. ActiveView: "activeView",
  1034. Status: "status",
  1035. Xml: "xml",
  1036. Namespace: "namespace",
  1037. Prefix: "prefix",
  1038. XPath: "xPath",
  1039. Text: "text",
  1040. ImageLeft: "imageLeft",
  1041. ImageTop: "imageTop",
  1042. ImageWidth: "imageWidth",
  1043. ImageHeight: "imageHeight",
  1044. TaskId: "taskId",
  1045. FieldId: "fieldId",
  1046. FieldValue: "fieldValue",
  1047. ServerUrl: "serverUrl",
  1048. ListName: "listName",
  1049. ResourceId: "resourceId",
  1050. ViewType: "viewType",
  1051. ViewName: "viewName",
  1052. GetRawValue: "getRawValue",
  1053. CellFormat: "cellFormat",
  1054. TableOptions: "tableOptions",
  1055. TaskIndex: "taskIndex",
  1056. ResourceIndex: "resourceIndex",
  1057. Url: "url",
  1058. MessageHandler: "messageHandler",
  1059. Width: "width",
  1060. Height: "height",
  1061. RequireHTTPs: "requireHTTPS",
  1062. MessageToParent: "messageToParent",
  1063. XFrameDenySafe: "xFrameDenySafe"
  1064. };
  1065. OSF.OUtil.setNamespace("DDA",OSF);
  1066. OSF.DDA.DocumentMode={
  1067. ReadOnly: 1,
  1068. ReadWrite: 0
  1069. };
  1070. OSF.DDA.PropertyDescriptors={AsyncResultStatus: "AsyncResultStatus"};
  1071. OSF.DDA.EventDescriptors={};
  1072. OSF.DDA.ListDescriptors={};
  1073. OSF.DDA.UI={};
  1074. OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType)
  1075. {
  1076. if(eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged)
  1077. return bindingId+"_"+eventType;
  1078. else
  1079. return eventType
  1080. };
  1081. OSF.DDA.MethodDispId={
  1082. dispidMethodMin: 64,
  1083. dispidGetSelectedDataMethod: 64,
  1084. dispidSetSelectedDataMethod: 65,
  1085. dispidAddBindingFromSelectionMethod: 66,
  1086. dispidAddBindingFromPromptMethod: 67,
  1087. dispidGetBindingMethod: 68,
  1088. dispidReleaseBindingMethod: 69,
  1089. dispidGetBindingDataMethod: 70,
  1090. dispidSetBindingDataMethod: 71,
  1091. dispidAddRowsMethod: 72,
  1092. dispidClearAllRowsMethod: 73,
  1093. dispidGetAllBindingsMethod: 74,
  1094. dispidLoadSettingsMethod: 75,
  1095. dispidSaveSettingsMethod: 76,
  1096. dispidGetDocumentCopyMethod: 77,
  1097. dispidAddBindingFromNamedItemMethod: 78,
  1098. dispidAddColumnsMethod: 79,
  1099. dispidGetDocumentCopyChunkMethod: 80,
  1100. dispidReleaseDocumentCopyMethod: 81,
  1101. dispidNavigateToMethod: 82,
  1102. dispidGetActiveViewMethod: 83,
  1103. dispidGetDocumentThemeMethod: 84,
  1104. dispidGetOfficeThemeMethod: 85,
  1105. dispidGetFilePropertiesMethod: 86,
  1106. dispidClearFormatsMethod: 87,
  1107. dispidSetTableOptionsMethod: 88,
  1108. dispidSetFormatsMethod: 89,
  1109. dispidExecuteRichApiRequestMethod: 93,
  1110. dispidAppCommandInvocationCompletedMethod: 94,
  1111. dispidAddDataPartMethod: 128,
  1112. dispidGetDataPartByIdMethod: 129,
  1113. dispidGetDataPartsByNamespaceMethod: 130,
  1114. dispidGetDataPartXmlMethod: 131,
  1115. dispidGetDataPartNodesMethod: 132,
  1116. dispidDeleteDataPartMethod: 133,
  1117. dispidGetDataNodeValueMethod: 134,
  1118. dispidGetDataNodeXmlMethod: 135,
  1119. dispidGetDataNodesMethod: 136,
  1120. dispidSetDataNodeValueMethod: 137,
  1121. dispidSetDataNodeXmlMethod: 138,
  1122. dispidAddDataNamespaceMethod: 139,
  1123. dispidGetDataUriByPrefixMethod: 140,
  1124. dispidGetDataPrefixByUriMethod: 141,
  1125. dispidGetDataNodeTextMethod: 142,
  1126. dispidSetDataNodeTextMethod: 143,
  1127. dispidMethodMax: 143,
  1128. dispidGetSelectedTaskMethod: 110,
  1129. dispidGetSelectedResourceMethod: 111,
  1130. dispidGetTaskMethod: 112,
  1131. dispidGetResourceFieldMethod: 113,
  1132. dispidGetWSSUrlMethod: 114,
  1133. dispidGetTaskFieldMethod: 115,
  1134. dispidGetProjectFieldMethod: 116,
  1135. dispidGetSelectedViewMethod: 117,
  1136. dispidGetTaskByIndexMethod: 118,
  1137. dispidGetResourceByIndexMethod: 119,
  1138. dispidSetTaskFieldMethod: 120,
  1139. dispidSetResourceFieldMethod: 121,
  1140. dispidGetMaxTaskIndexMethod: 122,
  1141. dispidGetMaxResourceIndexMethod: 123,
  1142. dispidMessageParentMethod: 900
  1143. };
  1144. OSF.DDA.EventDispId={
  1145. dispidEventMin: 0,
  1146. dispidInitializeEvent: 0,
  1147. dispidSettingsChangedEvent: 1,
  1148. dispidDocumentSelectionChangedEvent: 2,
  1149. dispidBindingSelectionChangedEvent: 3,
  1150. dispidBindingDataChangedEvent: 4,
  1151. dispidDocumentOpenEvent: 5,
  1152. dispidDocumentCloseEvent: 6,
  1153. dispidActiveViewChangedEvent: 7,
  1154. dispidDocumentThemeChangedEvent: 8,
  1155. dispidOfficeThemeChangedEvent: 9,
  1156. dispidDialogMessageReceivedEvent: 10,
  1157. dispidActivationStatusChangedEvent: 32,
  1158. dispidAppCommandInvokedEvent: 39,
  1159. dispidTaskSelectionChangedEvent: 56,
  1160. dispidResourceSelectionChangedEvent: 57,
  1161. dispidViewSelectionChangedEvent: 58,
  1162. dispidDataNodeAddedEvent: 60,
  1163. dispidDataNodeReplacedEvent: 61,
  1164. dispidDataNodeDeletedEvent: 62,
  1165. dispidEventMax: 63
  1166. };
  1167. OSF.DDA.ErrorCodeManager=function()
  1168. {
  1169. var _errorMappings={};
  1170. return{
  1171. getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode)
  1172. {
  1173. var errorArgs=_errorMappings[errorCode];
  1174. if(!errorArgs)
  1175. errorArgs=_errorMappings[this.errorCodes.ooeInternalError];
  1176. if(!errorArgs.name)
  1177. errorArgs.name=_errorMappings[this.errorCodes.ooeInternalError].name;
  1178. if(!errorArgs.message)
  1179. errorArgs.message=_errorMappings[this.errorCodes.ooeInternalError].message;
  1180. return errorArgs
  1181. },
  1182. addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage)
  1183. {
  1184. _errorMappings[errorCode]=errorNameMessage
  1185. },
  1186. errorCodes: {
  1187. ooeSuccess: 0,
  1188. ooeChunkResult: 1,
  1189. ooeCoercionTypeNotSupported: 1e3,
  1190. ooeGetSelectionNotMatchDataType: 1001,
  1191. ooeCoercionTypeNotMatchBinding: 1002,
  1192. ooeInvalidGetRowColumnCounts: 1003,
  1193. ooeSelectionNotSupportCoercionType: 1004,
  1194. ooeInvalidGetStartRowColumn: 1005,
  1195. ooeNonUniformPartialGetNotSupported: 1006,
  1196. ooeGetDataIsTooLarge: 1008,
  1197. ooeFileTypeNotSupported: 1009,
  1198. ooeGetDataParametersConflict: 1010,
  1199. ooeInvalidGetColumns: 1011,
  1200. ooeInvalidGetRows: 1012,
  1201. ooeInvalidReadForBlankRow: 1013,
  1202. ooeUnsupportedDataObject: 2e3,
  1203. ooeCannotWriteToSelection: 2001,
  1204. ooeDataNotMatchSelection: 2002,
  1205. ooeOverwriteWorksheetData: 2003,
  1206. ooeDataNotMatchBindingSize: 2004,
  1207. ooeInvalidSetStartRowColumn: 2005,
  1208. ooeInvalidDataFormat: 2006,
  1209. ooeDataNotMatchCoercionType: 2007,
  1210. ooeDataNotMatchBindingType: 2008,
  1211. ooeSetDataIsTooLarge: 2009,
  1212. ooeNonUniformPartialSetNotSupported: 2010,
  1213. ooeInvalidSetColumns: 2011,
  1214. ooeInvalidSetRows: 2012,
  1215. ooeSetDataParametersConflict: 2013,
  1216. ooeCellDataAmountBeyondLimits: 2014,
  1217. ooeSelectionCannotBound: 3e3,
  1218. ooeBindingNotExist: 3002,
  1219. ooeBindingToMultipleSelection: 3003,
  1220. ooeInvalidSelectionForBindingType: 3004,
  1221. ooeOperationNotSupportedOnThisBindingType: 3005,
  1222. ooeNamedItemNotFound: 3006,
  1223. ooeMultipleNamedItemFound: 3007,
  1224. ooeInvalidNamedItemForBindingType: 3008,
  1225. ooeUnknownBindingType: 3009,
  1226. ooeOperationNotSupportedOnMatrixData: 3010,
  1227. ooeInvalidColumnsForBinding: 3011,
  1228. ooeSettingNameNotExist: 4e3,
  1229. ooeSettingsCannotSave: 4001,
  1230. ooeSettingsAreStale: 4002,
  1231. ooeOperationNotSupported: 5e3,
  1232. ooeInternalError: 5001,
  1233. ooeDocumentReadOnly: 5002,
  1234. ooeEventHandlerNotExist: 5003,
  1235. ooeInvalidApiCallInContext: 5004,
  1236. ooeShuttingDown: 5005,
  1237. ooeUnsupportedEnumeration: 5007,
  1238. ooeIndexOutOfRange: 5008,
  1239. ooeBrowserAPINotSupported: 5009,
  1240. ooeInvalidParam: 5010,
  1241. ooeRequestTimeout: 5011,
  1242. ooeTooManyIncompleteRequests: 5100,
  1243. ooeRequestTokenUnavailable: 5101,
  1244. ooeActivityLimitReached: 5102,
  1245. ooeCustomXmlNodeNotFound: 6e3,
  1246. ooeCustomXmlError: 6100,
  1247. ooeCustomXmlExceedQuota: 6101,
  1248. ooeCustomXmlOutOfDate: 6102,
  1249. ooeNoCapability: 7e3,
  1250. ooeCannotNavTo: 7001,
  1251. ooeSpecifiedIdNotExist: 7002,
  1252. ooeNavOutOfBound: 7004,
  1253. ooeElementMissing: 8e3,
  1254. ooeProtectedError: 8001,
  1255. ooeInvalidCellsValue: 8010,
  1256. ooeInvalidTableOptionValue: 8011,
  1257. ooeInvalidFormatValue: 8012,
  1258. ooeRowIndexOutOfRange: 8020,
  1259. ooeColIndexOutOfRange: 8021,
  1260. ooeFormatValueOutOfRange: 8022,
  1261. ooeCellFormatAmountBeyondLimits: 8023,
  1262. ooeMemoryFileLimit: 11e3,
  1263. ooeNetworkProblemRetrieveFile: 11001,
  1264. ooeInvalidSliceSize: 11002,
  1265. ooeInvalidCallback: 11101,
  1266. ooeInvalidWidth: 12e3,
  1267. ooeInvalidHeight: 12001,
  1268. ooeNavigationError: 12002,
  1269. ooeInvalidScheme: 12003,
  1270. ooeAppDomains: 12004,
  1271. ooeRequireHTTPS: 12005,
  1272. ooeWebDialogClosed: 12006,
  1273. ooeDialogAlreadyOpened: 12007
  1274. },
  1275. initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS)
  1276. {
  1277. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={
  1278. name: stringNS.L_InvalidCoercion,
  1279. message: stringNS.L_CoercionTypeNotSupported
  1280. };
  1281. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={
  1282. name: stringNS.L_DataReadError,
  1283. message: stringNS.L_GetSelectionNotSupported
  1284. };
  1285. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={
  1286. name: stringNS.L_InvalidCoercion,
  1287. message: stringNS.L_CoercionTypeNotMatchBinding
  1288. };
  1289. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={
  1290. name: stringNS.L_DataReadError,
  1291. message: stringNS.L_InvalidGetRowColumnCounts
  1292. };
  1293. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={
  1294. name: stringNS.L_DataReadError,
  1295. message: stringNS.L_SelectionNotSupportCoercionType
  1296. };
  1297. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={
  1298. name: stringNS.L_DataReadError,
  1299. message: stringNS.L_InvalidGetStartRowColumn
  1300. };
  1301. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={
  1302. name: stringNS.L_DataReadError,
  1303. message: stringNS.L_NonUniformPartialGetNotSupported
  1304. };
  1305. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={
  1306. name: stringNS.L_DataReadError,
  1307. message: stringNS.L_GetDataIsTooLarge
  1308. };
  1309. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={
  1310. name: stringNS.L_DataReadError,
  1311. message: stringNS.L_FileTypeNotSupported
  1312. };
  1313. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={
  1314. name: stringNS.L_DataReadError,
  1315. message: stringNS.L_GetDataParametersConflict
  1316. };
  1317. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={
  1318. name: stringNS.L_DataReadError,
  1319. message: stringNS.L_InvalidGetColumns
  1320. };
  1321. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={
  1322. name: stringNS.L_DataReadError,
  1323. message: stringNS.L_InvalidGetRows
  1324. };
  1325. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={
  1326. name: stringNS.L_DataReadError,
  1327. message: stringNS.L_InvalidReadForBlankRow
  1328. };
  1329. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={
  1330. name: stringNS.L_DataWriteError,
  1331. message: stringNS.L_UnsupportedDataObject
  1332. };
  1333. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={
  1334. name: stringNS.L_DataWriteError,
  1335. message: stringNS.L_CannotWriteToSelection
  1336. };
  1337. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={
  1338. name: stringNS.L_DataWriteError,
  1339. message: stringNS.L_DataNotMatchSelection
  1340. };
  1341. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={
  1342. name: stringNS.L_DataWriteError,
  1343. message: stringNS.L_OverwriteWorksheetData
  1344. };
  1345. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={
  1346. name: stringNS.L_DataWriteError,
  1347. message: stringNS.L_DataNotMatchBindingSize
  1348. };
  1349. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={
  1350. name: stringNS.L_DataWriteError,
  1351. message: stringNS.L_InvalidSetStartRowColumn
  1352. };
  1353. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={
  1354. name: stringNS.L_InvalidFormat,
  1355. message: stringNS.L_InvalidDataFormat
  1356. };
  1357. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={
  1358. name: stringNS.L_InvalidDataObject,
  1359. message: stringNS.L_DataNotMatchCoercionType
  1360. };
  1361. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={
  1362. name: stringNS.L_InvalidDataObject,
  1363. message: stringNS.L_DataNotMatchBindingType
  1364. };
  1365. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={
  1366. name: stringNS.L_DataWriteError,
  1367. message: stringNS.L_SetDataIsTooLarge
  1368. };
  1369. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={
  1370. name: stringNS.L_DataWriteError,
  1371. message: stringNS.L_NonUniformPartialSetNotSupported
  1372. };
  1373. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={
  1374. name: stringNS.L_DataWriteError,
  1375. message: stringNS.L_InvalidSetColumns
  1376. };
  1377. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={
  1378. name: stringNS.L_DataWriteError,
  1379. message: stringNS.L_InvalidSetRows
  1380. };
  1381. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={
  1382. name: stringNS.L_DataWriteError,
  1383. message: stringNS.L_SetDataParametersConflict
  1384. };
  1385. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={
  1386. name: stringNS.L_BindingCreationError,
  1387. message: stringNS.L_SelectionCannotBound
  1388. };
  1389. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={
  1390. name: stringNS.L_InvalidBindingError,
  1391. message: stringNS.L_BindingNotExist
  1392. };
  1393. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={
  1394. name: stringNS.L_BindingCreationError,
  1395. message: stringNS.L_BindingToMultipleSelection
  1396. };
  1397. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={
  1398. name: stringNS.L_BindingCreationError,
  1399. message: stringNS.L_InvalidSelectionForBindingType
  1400. };
  1401. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={
  1402. name: stringNS.L_InvalidBindingOperation,
  1403. message: stringNS.L_OperationNotSupportedOnThisBindingType
  1404. };
  1405. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={
  1406. name: stringNS.L_BindingCreationError,
  1407. message: stringNS.L_NamedItemNotFound
  1408. };
  1409. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={
  1410. name: stringNS.L_BindingCreationError,
  1411. message: stringNS.L_MultipleNamedItemFound
  1412. };
  1413. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={
  1414. name: stringNS.L_BindingCreationError,
  1415. message: stringNS.L_InvalidNamedItemForBindingType
  1416. };
  1417. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={
  1418. name: stringNS.L_InvalidBinding,
  1419. message: stringNS.L_UnknownBindingType
  1420. };
  1421. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={
  1422. name: stringNS.L_InvalidBindingOperation,
  1423. message: stringNS.L_OperationNotSupportedOnMatrixData
  1424. };
  1425. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={
  1426. name: stringNS.L_InvalidBinding,
  1427. message: stringNS.L_InvalidColumnsForBinding
  1428. };
  1429. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={
  1430. name: stringNS.L_ReadSettingsError,
  1431. message: stringNS.L_SettingNameNotExist
  1432. };
  1433. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={
  1434. name: stringNS.L_SaveSettingsError,
  1435. message: stringNS.L_SettingsCannotSave
  1436. };
  1437. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={
  1438. name: stringNS.L_SettingsStaleError,
  1439. message: stringNS.L_SettingsAreStale
  1440. };
  1441. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={
  1442. name: stringNS.L_HostError,
  1443. message: stringNS.L_OperationNotSupported
  1444. };
  1445. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={
  1446. name: stringNS.L_InternalError,
  1447. message: stringNS.L_InternalErrorDescription
  1448. };
  1449. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={
  1450. name: stringNS.L_PermissionDenied,
  1451. message: stringNS.L_DocumentReadOnly
  1452. };
  1453. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={
  1454. name: stringNS.L_EventRegistrationError,
  1455. message: stringNS.L_EventHandlerNotExist
  1456. };
  1457. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={
  1458. name: stringNS.L_InvalidAPICall,
  1459. message: stringNS.L_InvalidApiCallInContext
  1460. };
  1461. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={
  1462. name: stringNS.L_ShuttingDown,
  1463. message: stringNS.L_ShuttingDown
  1464. };
  1465. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={
  1466. name: stringNS.L_UnsupportedEnumeration,
  1467. message: stringNS.L_UnsupportedEnumerationMessage
  1468. };
  1469. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={
  1470. name: stringNS.L_IndexOutOfRange,
  1471. message: stringNS.L_IndexOutOfRange
  1472. };
  1473. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={
  1474. name: stringNS.L_APINotSupported,
  1475. message: stringNS.L_BrowserAPINotSupported
  1476. };
  1477. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={
  1478. name: stringNS.L_APICallFailed,
  1479. message: stringNS.L_RequestTimeout
  1480. };
  1481. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={
  1482. name: stringNS.L_APICallFailed,
  1483. message: stringNS.L_TooManyIncompleteRequests
  1484. };
  1485. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={
  1486. name: stringNS.L_APICallFailed,
  1487. message: stringNS.L_RequestTokenUnavailable
  1488. };
  1489. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={
  1490. name: stringNS.L_APICallFailed,
  1491. message: stringNS.L_ActivityLimitReached
  1492. };
  1493. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={
  1494. name: stringNS.L_InvalidNode,
  1495. message: stringNS.L_CustomXmlNodeNotFound
  1496. };
  1497. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={
  1498. name: stringNS.L_CustomXmlError,
  1499. message: stringNS.L_CustomXmlError
  1500. };
  1501. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={
  1502. name: stringNS.L_CustomXmlError,
  1503. message: stringNS.L_CustomXmlError
  1504. };
  1505. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={
  1506. name: stringNS.L_CustomXmlError,
  1507. message: stringNS.L_CustomXmlError
  1508. };
  1509. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={
  1510. name: stringNS.L_PermissionDenied,
  1511. message: stringNS.L_NoCapability
  1512. };
  1513. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={
  1514. name: stringNS.L_CannotNavigateTo,
  1515. message: stringNS.L_CannotNavigateTo
  1516. };
  1517. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={
  1518. name: stringNS.L_SpecifiedIdNotExist,
  1519. message: stringNS.L_SpecifiedIdNotExist
  1520. };
  1521. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={
  1522. name: stringNS.L_NavOutOfBound,
  1523. message: stringNS.L_NavOutOfBound
  1524. };
  1525. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={
  1526. name: stringNS.L_DataWriteReminder,
  1527. message: stringNS.L_CellDataAmountBeyondLimits
  1528. };
  1529. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={
  1530. name: stringNS.L_MissingParameter,
  1531. message: stringNS.L_ElementMissing
  1532. };
  1533. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={
  1534. name: stringNS.L_PermissionDenied,
  1535. message: stringNS.L_NoCapability
  1536. };
  1537. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={
  1538. name: stringNS.L_InvalidValue,
  1539. message: stringNS.L_InvalidCellsValue
  1540. };
  1541. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={
  1542. name: stringNS.L_InvalidValue,
  1543. message: stringNS.L_InvalidTableOptionValue
  1544. };
  1545. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={
  1546. name: stringNS.L_InvalidValue,
  1547. message: stringNS.L_InvalidFormatValue
  1548. };
  1549. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={
  1550. name: stringNS.L_OutOfRange,
  1551. message: stringNS.L_RowIndexOutOfRange
  1552. };
  1553. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={
  1554. name: stringNS.L_OutOfRange,
  1555. message: stringNS.L_ColIndexOutOfRange
  1556. };
  1557. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={
  1558. name: stringNS.L_OutOfRange,
  1559. message: stringNS.L_FormatValueOutOfRange
  1560. };
  1561. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={
  1562. name: stringNS.L_FormattingReminder,
  1563. message: stringNS.L_CellFormatAmountBeyondLimits
  1564. };
  1565. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={
  1566. name: stringNS.L_MemoryLimit,
  1567. message: stringNS.L_CloseFileBeforeRetrieve
  1568. };
  1569. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={
  1570. name: stringNS.L_NetworkProblem,
  1571. message: stringNS.L_NetworkProblemRetrieveFile
  1572. };
  1573. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={
  1574. name: stringNS.L_InvalidValue,
  1575. message: stringNS.L_SliceSizeNotSupported
  1576. };
  1577. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened]={
  1578. name: stringNS.L_DisplayDialogError,
  1579. message: stringNS.L_DialogAlreadyOpened
  1580. };
  1581. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth]={
  1582. name: stringNS.L_IndexOutOfRange,
  1583. message: stringNS.L_IndexOutOfRange
  1584. };
  1585. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight]={
  1586. name: stringNS.L_IndexOutOfRange,
  1587. message: stringNS.L_IndexOutOfRange
  1588. };
  1589. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError]={
  1590. name: stringNS.L_DisplayDialogError,
  1591. message: stringNS.L_NetworkProblem
  1592. };
  1593. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme]={
  1594. name: stringNS.L_DialogNavigateError,
  1595. message: stringNS.L_DialogAddressNotTrusted
  1596. };
  1597. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains]={
  1598. name: stringNS.L_DisplayDialogError,
  1599. message: stringNS.L_DialogAddressNotTrusted
  1600. };
  1601. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS]={
  1602. name: stringNS.L_DisplayDialogError,
  1603. message: stringNS.L_DialogAddressNotTrusted
  1604. }
  1605. }
  1606. }
  1607. }();
  1608. var OfficeExt;
  1609. (function(OfficeExt)
  1610. {
  1611. var Requirement;
  1612. (function(Requirement)
  1613. {
  1614. var RequirementMatrix=function()
  1615. {
  1616. function RequirementMatrix(_setMap)
  1617. {
  1618. this.isSetSupported=function _isSetSupported(name, minVersion)
  1619. {
  1620. if(name==undefined)
  1621. return false;
  1622. if(minVersion==undefined)
  1623. minVersion=0;
  1624. var setSupportArray=this._setMap;
  1625. var sets=setSupportArray._sets;
  1626. if(sets.hasOwnProperty(name.toLowerCase()))
  1627. {
  1628. var setMaxVersion=sets[name.toLowerCase()];
  1629. return setMaxVersion > 0 && setMaxVersion >=minVersion
  1630. }
  1631. else
  1632. return false
  1633. };
  1634. this._setMap=_setMap
  1635. }
  1636. return RequirementMatrix
  1637. }();
  1638. Requirement.RequirementMatrix=RequirementMatrix;
  1639. var DefaultSetRequirement=function()
  1640. {
  1641. function DefaultSetRequirement(setMap)
  1642. {
  1643. this._addSetMap=function DefaultSetRequirement_addSetMap(addedSet)
  1644. {
  1645. for(var name in addedSet)
  1646. this._sets[name]=addedSet[name]
  1647. };
  1648. this._sets=setMap
  1649. }
  1650. return DefaultSetRequirement
  1651. }();
  1652. Requirement.DefaultSetRequirement=DefaultSetRequirement;
  1653. var ExcelClientDefaultSetRequirement=function(_super)
  1654. {
  1655. __extends(ExcelClientDefaultSetRequirement,_super);
  1656. function ExcelClientDefaultSetRequirement()
  1657. {
  1658. _super.call(this,{
  1659. bindingevents: 1.1,
  1660. documentevents: 1.1,
  1661. excelapi: 1.1,
  1662. matrixbindings: 1.1,
  1663. matrixcoercion: 1.1,
  1664. selection: 1.1,
  1665. settings: 1.1,
  1666. tablebindings: 1.1,
  1667. tablecoercion: 1.1,
  1668. textbindings: 1.1,
  1669. textcoercion: 1.1
  1670. })
  1671. }
  1672. return ExcelClientDefaultSetRequirement
  1673. }(DefaultSetRequirement);
  1674. Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement;
  1675. var ExcelClientV1DefaultSetRequirement=function(_super)
  1676. {
  1677. __extends(ExcelClientV1DefaultSetRequirement,_super);
  1678. function ExcelClientV1DefaultSetRequirement()
  1679. {
  1680. _super.call(this);
  1681. this._addSetMap({imagecoercion: 1.1})
  1682. }
  1683. return ExcelClientV1DefaultSetRequirement
  1684. }(ExcelClientDefaultSetRequirement);
  1685. Requirement.ExcelClientV1DefaultSetRequirement=ExcelClientV1DefaultSetRequirement;
  1686. var OutlookClientDefaultSetRequirement=function(_super)
  1687. {
  1688. __extends(OutlookClientDefaultSetRequirement,_super);
  1689. function OutlookClientDefaultSetRequirement()
  1690. {
  1691. _super.call(this,{mailbox: 1.3})
  1692. }
  1693. return OutlookClientDefaultSetRequirement
  1694. }(DefaultSetRequirement);
  1695. Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement;
  1696. var WordClientDefaultSetRequirement=function(_super)
  1697. {
  1698. __extends(WordClientDefaultSetRequirement,_super);
  1699. function WordClientDefaultSetRequirement()
  1700. {
  1701. _super.call(this,{
  1702. bindingevents: 1.1,
  1703. compressedfile: 1.1,
  1704. customxmlparts: 1.1,
  1705. documentevents: 1.1,
  1706. file: 1.1,
  1707. htmlcoercion: 1.1,
  1708. matrixbindings: 1.1,
  1709. matrixcoercion: 1.1,
  1710. ooxmlcoercion: 1.1,
  1711. pdffile: 1.1,
  1712. selection: 1.1,
  1713. settings: 1.1,
  1714. tablebindings: 1.1,
  1715. tablecoercion: 1.1,
  1716. textbindings: 1.1,
  1717. textcoercion: 1.1,
  1718. textfile: 1.1,
  1719. wordapi: 1.1
  1720. })
  1721. }
  1722. return WordClientDefaultSetRequirement
  1723. }(DefaultSetRequirement);
  1724. Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement;
  1725. var WordClientV1DefaultSetRequirement=function(_super)
  1726. {
  1727. __extends(WordClientV1DefaultSetRequirement,_super);
  1728. function WordClientV1DefaultSetRequirement()
  1729. {
  1730. _super.call(this);
  1731. this._addSetMap({
  1732. customxmlparts: 1.2,
  1733. wordapi: 1.2,
  1734. imagecoercion: 1.1
  1735. })
  1736. }
  1737. return WordClientV1DefaultSetRequirement
  1738. }(WordClientDefaultSetRequirement);
  1739. Requirement.WordClientV1DefaultSetRequirement=WordClientV1DefaultSetRequirement;
  1740. var PowerpointClientDefaultSetRequirement=function(_super)
  1741. {
  1742. __extends(PowerpointClientDefaultSetRequirement,_super);
  1743. function PowerpointClientDefaultSetRequirement()
  1744. {
  1745. _super.call(this,{
  1746. activeview: 1.1,
  1747. compressedfile: 1.1,
  1748. documentevents: 1.1,
  1749. file: 1.1,
  1750. pdffile: 1.1,
  1751. selection: 1.1,
  1752. settings: 1.1,
  1753. textcoercion: 1.1
  1754. })
  1755. }
  1756. return PowerpointClientDefaultSetRequirement
  1757. }(DefaultSetRequirement);
  1758. Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement;
  1759. var PowerpointClientV1DefaultSetRequirement=function(_super)
  1760. {
  1761. __extends(PowerpointClientV1DefaultSetRequirement,_super);
  1762. function PowerpointClientV1DefaultSetRequirement()
  1763. {
  1764. _super.call(this);
  1765. this._addSetMap({imagecoercion: 1.1})
  1766. }
  1767. return PowerpointClientV1DefaultSetRequirement
  1768. }(PowerpointClientDefaultSetRequirement);
  1769. Requirement.PowerpointClientV1DefaultSetRequirement=PowerpointClientV1DefaultSetRequirement;
  1770. var ProjectClientDefaultSetRequirement=function(_super)
  1771. {
  1772. __extends(ProjectClientDefaultSetRequirement,_super);
  1773. function ProjectClientDefaultSetRequirement()
  1774. {
  1775. _super.call(this,{
  1776. selection: 1.1,
  1777. textcoercion: 1.1
  1778. })
  1779. }
  1780. return ProjectClientDefaultSetRequirement
  1781. }(DefaultSetRequirement);
  1782. Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement;
  1783. var ExcelWebDefaultSetRequirement=function(_super)
  1784. {
  1785. __extends(ExcelWebDefaultSetRequirement,_super);
  1786. function ExcelWebDefaultSetRequirement()
  1787. {
  1788. _super.call(this,{
  1789. bindingevents: 1.1,
  1790. documentevents: 1.1,
  1791. matrixbindings: 1.1,
  1792. matrixcoercion: 1.1,
  1793. selection: 1.1,
  1794. settings: 1.1,
  1795. tablebindings: 1.1,
  1796. tablecoercion: 1.1,
  1797. textbindings: 1.1,
  1798. textcoercion: 1.1,
  1799. file: 1.1
  1800. })
  1801. }
  1802. return ExcelWebDefaultSetRequirement
  1803. }(DefaultSetRequirement);
  1804. Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement;
  1805. var WordWebDefaultSetRequirement=function(_super)
  1806. {
  1807. __extends(WordWebDefaultSetRequirement,_super);
  1808. function WordWebDefaultSetRequirement()
  1809. {
  1810. _super.call(this,{
  1811. customxmlparts: 1.1,
  1812. documentevents: 1.1,
  1813. file: 1.1,
  1814. ooxmlcoercion: 1.1,
  1815. selection: 1.1,
  1816. settings: 1.1,
  1817. textcoercion: 1.1
  1818. })
  1819. }
  1820. return WordWebDefaultSetRequirement
  1821. }(DefaultSetRequirement);
  1822. Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement;
  1823. var PowerpointWebDefaultSetRequirement=function(_super)
  1824. {
  1825. __extends(PowerpointWebDefaultSetRequirement,_super);
  1826. function PowerpointWebDefaultSetRequirement()
  1827. {
  1828. _super.call(this,{
  1829. activeview: 1.1,
  1830. settings: 1.1
  1831. })
  1832. }
  1833. return PowerpointWebDefaultSetRequirement
  1834. }(DefaultSetRequirement);
  1835. Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement;
  1836. var OutlookWebDefaultSetRequirement=function(_super)
  1837. {
  1838. __extends(OutlookWebDefaultSetRequirement,_super);
  1839. function OutlookWebDefaultSetRequirement()
  1840. {
  1841. _super.call(this,{mailbox: 1.3})
  1842. }
  1843. return OutlookWebDefaultSetRequirement
  1844. }(DefaultSetRequirement);
  1845. Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement;
  1846. var SwayWebDefaultSetRequirement=function(_super)
  1847. {
  1848. __extends(SwayWebDefaultSetRequirement,_super);
  1849. function SwayWebDefaultSetRequirement()
  1850. {
  1851. _super.call(this,{
  1852. activeview: 1.1,
  1853. documentevents: 1.1,
  1854. selection: 1.1,
  1855. settings: 1.1,
  1856. textcoercion: 1.1
  1857. })
  1858. }
  1859. return SwayWebDefaultSetRequirement
  1860. }(DefaultSetRequirement);
  1861. Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement;
  1862. var AccessWebDefaultSetRequirement=function(_super)
  1863. {
  1864. __extends(AccessWebDefaultSetRequirement,_super);
  1865. function AccessWebDefaultSetRequirement()
  1866. {
  1867. _super.call(this,{
  1868. bindingevents: 1.1,
  1869. partialtablebindings: 1.1,
  1870. settings: 1.1,
  1871. tablebindings: 1.1,
  1872. tablecoercion: 1.1
  1873. })
  1874. }
  1875. return AccessWebDefaultSetRequirement
  1876. }(DefaultSetRequirement);
  1877. Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement;
  1878. var ExcelIOSDefaultSetRequirement=function(_super)
  1879. {
  1880. __extends(ExcelIOSDefaultSetRequirement,_super);
  1881. function ExcelIOSDefaultSetRequirement()
  1882. {
  1883. _super.call(this,{
  1884. bindingevents: 1.1,
  1885. documentevents: 1.1,
  1886. matrixbindings: 1.1,
  1887. matrixcoercion: 1.1,
  1888. selection: 1.1,
  1889. settings: 1.1,
  1890. tablebindings: 1.1,
  1891. tablecoercion: 1.1,
  1892. textbindings: 1.1,
  1893. textcoercion: 1.1
  1894. })
  1895. }
  1896. return ExcelIOSDefaultSetRequirement
  1897. }(DefaultSetRequirement);
  1898. Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement;
  1899. var WordIOSDefaultSetRequirement=function(_super)
  1900. {
  1901. __extends(WordIOSDefaultSetRequirement,_super);
  1902. function WordIOSDefaultSetRequirement()
  1903. {
  1904. _super.call(this,{
  1905. bindingevents: 1.1,
  1906. compressedfile: 1.1,
  1907. customxmlparts: 1.1,
  1908. documentevents: 1.1,
  1909. file: 1.1,
  1910. htmlcoercion: 1.1,
  1911. matrixbindings: 1.1,
  1912. matrixcoercion: 1.1,
  1913. ooxmlcoercion: 1.1,
  1914. pdffile: 1.1,
  1915. selection: 1.1,
  1916. settings: 1.1,
  1917. tablebindings: 1.1,
  1918. tablecoercion: 1.1,
  1919. textbindings: 1.1,
  1920. textcoercion: 1.1,
  1921. textfile: 1.1
  1922. })
  1923. }
  1924. return WordIOSDefaultSetRequirement
  1925. }(DefaultSetRequirement);
  1926. Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement;
  1927. var WordIOSV1DefaultSetRequirement=function(_super)
  1928. {
  1929. __extends(WordIOSV1DefaultSetRequirement,_super);
  1930. function WordIOSV1DefaultSetRequirement()
  1931. {
  1932. _super.call(this);
  1933. this._addSetMap({
  1934. customxmlparts: 1.2,
  1935. wordapi: 1.2
  1936. })
  1937. }
  1938. return WordIOSV1DefaultSetRequirement
  1939. }(WordIOSDefaultSetRequirement);
  1940. Requirement.WordIOSV1DefaultSetRequirement=WordIOSV1DefaultSetRequirement;
  1941. var PowerpointIOSDefaultSetRequirement=function(_super)
  1942. {
  1943. __extends(PowerpointIOSDefaultSetRequirement,_super);
  1944. function PowerpointIOSDefaultSetRequirement()
  1945. {
  1946. _super.call(this,{
  1947. activeview: 1.1,
  1948. compressedfile: 1.1,
  1949. documentevents: 1.1,
  1950. file: 1.1,
  1951. pdffile: 1.1,
  1952. selection: 1.1,
  1953. settings: 1.1,
  1954. textcoercion: 1.1
  1955. })
  1956. }
  1957. return PowerpointIOSDefaultSetRequirement
  1958. }(DefaultSetRequirement);
  1959. Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement;
  1960. var OutlookIOSDefaultSetRequirement=function(_super)
  1961. {
  1962. __extends(OutlookIOSDefaultSetRequirement,_super);
  1963. function OutlookIOSDefaultSetRequirement()
  1964. {
  1965. _super.call(this,{mailbox: 1.1})
  1966. }
  1967. return OutlookIOSDefaultSetRequirement
  1968. }(DefaultSetRequirement);
  1969. Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement;
  1970. var RequirementsMatrixFactory=function()
  1971. {
  1972. function RequirementsMatrixFactory(){}
  1973. RequirementsMatrixFactory.initializeOsfDda=function()
  1974. {
  1975. OSF.OUtil.setNamespace("Requirement",OSF.DDA)
  1976. };
  1977. RequirementsMatrixFactory.getDefaultRequirementMatrix=function(appContext)
  1978. {
  1979. this.initializeDefaultSetMatrix();
  1980. var defaultRequirementMatrix=undefined;
  1981. var clientRequirement=appContext.get_requirementMatrix();
  1982. if(clientRequirement !=undefined && clientRequirement.length > 0 && typeof JSON !=="undefined")
  1983. {
  1984. var matrixItem=JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1985. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem))
  1986. }
  1987. else
  1988. {
  1989. var appLocator=RequirementsMatrixFactory.getClientFullVersionString(appContext);
  1990. if(RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined)
  1991. defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]);
  1992. else
  1993. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({}))
  1994. }
  1995. return defaultRequirementMatrix
  1996. };
  1997. RequirementsMatrixFactory.getClientFullVersionString=function(appContext)
  1998. {
  1999. var appMinorVersion=appContext.get_appMinorVersion();
  2000. var appMinorVersionString="";
  2001. var appFullVersion="";
  2002. var appName=appContext.get_appName();
  2003. var isIOSClient=appName==1024 || appName==4096 || appName==8192 || appName==65536;
  2004. if(isIOSClient && appContext.get_appVersion()==1)
  2005. if(appName==4096 && appMinorVersion >=15)
  2006. appFullVersion="16.00.01";
  2007. else
  2008. appFullVersion="16.00";
  2009. else if(appContext.get_appName()==64)
  2010. appFullVersion=appContext.get_appVersion();
  2011. else
  2012. {
  2013. if(appMinorVersion < 10)
  2014. appMinorVersionString="0"+appMinorVersion;
  2015. else
  2016. appMinorVersionString=""+appMinorVersion;
  2017. appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString
  2018. }
  2019. return appContext.get_appName()+"-"+appFullVersion
  2020. };
  2021. RequirementsMatrixFactory.initializeDefaultSetMatrix=function()
  2022. {
  2023. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement;
  2024. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement;
  2025. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement;
  2026. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1601]=new ExcelClientV1DefaultSetRequirement;
  2027. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1601]=new WordClientV1DefaultSetRequirement;
  2028. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1601]=new PowerpointClientV1DefaultSetRequirement;
  2029. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement;
  2030. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement;
  2031. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement;
  2032. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement;
  2033. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement;
  2034. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement;
  2035. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement;
  2036. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement;
  2037. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement;
  2038. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement;
  2039. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement;
  2040. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_16001]=new WordIOSV1DefaultSetRequirement;
  2041. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement;
  2042. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement
  2043. };
  2044. RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00";
  2045. RequirementsMatrixFactory.Excel_RCLIENT_1601="1-16.01";
  2046. RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00";
  2047. RequirementsMatrixFactory.Word_RCLIENT_1601="2-16.01";
  2048. RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00";
  2049. RequirementsMatrixFactory.PowerPoint_RCLIENT_1601="4-16.01";
  2050. RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00";
  2051. RequirementsMatrixFactory.Excel_WAC_1600="16-16.00";
  2052. RequirementsMatrixFactory.Word_WAC_1600="32-16.00";
  2053. RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00";
  2054. RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01";
  2055. RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00";
  2056. RequirementsMatrixFactory.Access_WAC_1600="256-16.00";
  2057. RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00";
  2058. RequirementsMatrixFactory.Excel_IOS_1600="1024-16.00";
  2059. RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00";
  2060. RequirementsMatrixFactory.Word_IOS_1600="4096-16.00";
  2061. RequirementsMatrixFactory.Word_IOS_16001="4096-16.00.01";
  2062. RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00";
  2063. RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00";
  2064. RequirementsMatrixFactory.DefaultSetArrayMatrix={};
  2065. return RequirementsMatrixFactory
  2066. }();
  2067. Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory
  2068. })(Requirement=OfficeExt.Requirement || (OfficeExt.Requirement={}))
  2069. })(OfficeExt || (OfficeExt={}));
  2070. OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();
  2071. Microsoft.Office.WebExtension.ApplicationMode={
  2072. WebEditor: "webEditor",
  2073. WebViewer: "webViewer",
  2074. Client: "client"
  2075. };
  2076. Microsoft.Office.WebExtension.DocumentMode={
  2077. ReadOnly: "readOnly",
  2078. ReadWrite: "readWrite"
  2079. };
  2080. OSF.NamespaceManager=function OSF_NamespaceManager()
  2081. {
  2082. var _userOffice;
  2083. var _useShortcut=false;
  2084. return{
  2085. enableShortcut: function OSF_NamespaceManager$enableShortcut()
  2086. {
  2087. if(!_useShortcut)
  2088. {
  2089. if(window.Office)
  2090. _userOffice=window.Office;
  2091. else
  2092. OSF.OUtil.setNamespace("Office",window);
  2093. window.Office=Microsoft.Office.WebExtension;
  2094. _useShortcut=true
  2095. }
  2096. },
  2097. disableShortcut: function OSF_NamespaceManager$disableShortcut()
  2098. {
  2099. if(_useShortcut)
  2100. {
  2101. if(_userOffice)
  2102. window.Office=_userOffice;
  2103. else
  2104. OSF.OUtil.unsetNamespace("Office",window);
  2105. _useShortcut=false
  2106. }
  2107. }
  2108. }
  2109. }();
  2110. OSF.NamespaceManager.enableShortcut();
  2111. Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut)
  2112. {
  2113. if(useShortcut)
  2114. OSF.NamespaceManager.enableShortcut();
  2115. else
  2116. OSF.NamespaceManager.disableShortcut()
  2117. };
  2118. Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback)
  2119. {
  2120. var promise;
  2121. if(str && typeof str=="string")
  2122. {
  2123. var index=str.indexOf("#");
  2124. if(index !=-1)
  2125. {
  2126. var op=str.substring(0,index);
  2127. var target=str.substring(index+1);
  2128. switch(op)
  2129. {
  2130. case"binding":
  2131. case"bindings":
  2132. if(target)
  2133. promise=new OSF.DDA.BindingPromise(target);
  2134. break
  2135. }
  2136. }
  2137. }
  2138. if(!promise)
  2139. {
  2140. if(errorCallback)
  2141. {
  2142. var callbackType=typeof errorCallback;
  2143. if(callbackType=="function")
  2144. {
  2145. var callArgs={};
  2146. callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback;
  2147. OSF.DDA.issueAsyncResult(callArgs,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))
  2148. }
  2149. else
  2150. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,callbackType);
  2151. }
  2152. }
  2153. else
  2154. {
  2155. promise.onFail=errorCallback;
  2156. return promise
  2157. }
  2158. };
  2159. OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme)
  2160. {
  2161. OSF.OUtil.defineEnumerableProperties(this,{
  2162. contentLanguage: {value: officeAppContext.get_dataLocale()},
  2163. displayLanguage: {value: officeAppContext.get_appUILocale()},
  2164. touchEnabled: {value: officeAppContext.get_touchEnabled()},
  2165. commerceAllowed: {value: officeAppContext.get_commerceAllowed()}
  2166. });
  2167. if(license)
  2168. OSF.OUtil.defineEnumerableProperty(this,"license",{value: license});
  2169. if(officeAppContext.ui)
  2170. OSF.OUtil.defineEnumerableProperty(this,"ui",{value: officeAppContext.ui});
  2171. if(!officeAppContext.get_isDialog())
  2172. {
  2173. if(document)
  2174. OSF.OUtil.defineEnumerableProperty(this,"document",{value: document});
  2175. if(appOM)
  2176. {
  2177. var displayName=appOM.displayName || "appOM";
  2178. delete appOM.displayName;
  2179. OSF.OUtil.defineEnumerableProperty(this,displayName,{value: appOM})
  2180. }
  2181. if(getOfficeTheme)
  2182. OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get: function()
  2183. {
  2184. return getOfficeTheme()
  2185. }});
  2186. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext);
  2187. OSF.OUtil.defineEnumerableProperty(this,"requirements",{value: requirements})
  2188. }
  2189. };
  2190. OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme)
  2191. {
  2192. OSF.DDA.OutlookContext.uber.constructor.call(this,appContext,null,license,appOM,getOfficeTheme);
  2193. if(settings)
  2194. OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value: settings})
  2195. };
  2196. OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);
  2197. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady){};
  2198. OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings)
  2199. {
  2200. var mode;
  2201. switch(officeAppContext.get_clientMode())
  2202. {
  2203. case OSF.ClientMode.ReadOnly:
  2204. mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;
  2205. break;
  2206. case OSF.ClientMode.ReadWrite:
  2207. mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite;
  2208. break
  2209. }
  2210. if(settings)
  2211. OSF.OUtil.defineEnumerableProperty(this,"settings",{value: settings});
  2212. OSF.OUtil.defineMutableProperties(this,{
  2213. mode: {value: mode},
  2214. url: {value: officeAppContext.get_docUrl()}
  2215. })
  2216. };
  2217. OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings)
  2218. {
  2219. OSF.DDA.JsomDocument.uber.constructor.call(this,officeAppContext,settings);
  2220. if(bindingFacade)
  2221. OSF.OUtil.defineEnumerableProperty(this,"bindings",{get: function OSF_DDA_Document$GetBindings()
  2222. {
  2223. return bindingFacade
  2224. }});
  2225. var am=OSF.DDA.AsyncMethodNames;
  2226. OSF.DDA.DispIdHost.addAsyncMethods(this,[am.GetSelectedDataAsync,am.SetSelectedDataAsync]);
  2227. OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))
  2228. };
  2229. OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);
  2230. OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get: function Microsoft_Office_WebExtension$GetContext()
  2231. {
  2232. var context;
  2233. if(OSF && OSF._OfficeAppFactory)
  2234. context=OSF._OfficeAppFactory.getContext();
  2235. return context
  2236. }});
  2237. OSF.DDA.License=function OSF_DDA_License(eToken)
  2238. {
  2239. OSF.OUtil.defineEnumerableProperty(this,"value",{value: eToken})
  2240. };
  2241. OSF.DDA.ApiMethodCall=function OSF_DDA_ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName)
  2242. {
  2243. var requiredCount=requiredParameters.length;
  2244. var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function()
  2245. {
  2246. return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,displayName)
  2247. });
  2248. this.verifyArguments=function OSF_DDA_ApiMethodCall$VerifyArguments(params, args)
  2249. {
  2250. for(var name in params)
  2251. {
  2252. var param=params[name];
  2253. var arg=args[name];
  2254. if(param["enum"])
  2255. switch(typeof arg)
  2256. {
  2257. case"string":
  2258. if(OSF.OUtil.listContainsValue(param["enum"],arg))
  2259. break;
  2260. case"undefined":
  2261. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;
  2262. default:
  2263. throw getInvalidParameterString();
  2264. }
  2265. if(param["types"])
  2266. if(!OSF.OUtil.listContainsValue(param["types"],typeof arg))
  2267. throw getInvalidParameterString();
  2268. }
  2269. };
  2270. this.extractRequiredArguments=function OSF_DDA_ApiMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo)
  2271. {
  2272. if(userArgs.length < requiredCount)
  2273. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);
  2274. var requiredArgs=[];
  2275. var index;
  2276. for(index=0; index < requiredCount; index++)
  2277. requiredArgs.push(userArgs[index]);
  2278. this.verifyArguments(requiredParameters,requiredArgs);
  2279. var ret={};
  2280. for(index=0; index < requiredCount; index++)
  2281. {
  2282. var param=requiredParameters[index];
  2283. var arg=requiredArgs[index];
  2284. if(param.verify)
  2285. {
  2286. var isValid=param.verify(arg,caller,stateInfo);
  2287. if(!isValid)
  2288. throw getInvalidParameterString();
  2289. }
  2290. ret[param.name]=arg
  2291. }
  2292. return ret
  2293. },this.fillOptions=function OSF_DDA_ApiMethodCall$FillOptions(options, requiredArgs, caller, stateInfo)
  2294. {
  2295. options=options || {};
  2296. for(var optionName in supportedOptions)
  2297. if(!OSF.OUtil.listContainsKey(options,optionName))
  2298. {
  2299. var value=undefined;
  2300. var option=supportedOptions[optionName];
  2301. if(option.calculate && requiredArgs)
  2302. value=option.calculate(requiredArgs,caller,stateInfo);
  2303. if(!value && option.defaultValue !==undefined)
  2304. value=option.defaultValue;
  2305. options[optionName]=value
  2306. }
  2307. return options
  2308. };
  2309. this.constructCallArgs=function OSF_DAA_ApiMethodCall$ConstructCallArgs(required, options, caller, stateInfo)
  2310. {
  2311. var callArgs={};
  2312. for(var r in required)
  2313. callArgs[r]=required[r];
  2314. for(var o in options)
  2315. callArgs[o]=options[o];
  2316. for(var s in privateStateCallbacks)
  2317. callArgs[s]=privateStateCallbacks[s](caller,stateInfo);
  2318. if(checkCallArgs)
  2319. callArgs=checkCallArgs(callArgs,caller,stateInfo);
  2320. return callArgs
  2321. }
  2322. };
  2323. OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);
  2324. OSF.DDA.AsyncResultEnum.Properties={
  2325. Context: "Context",
  2326. Value: "Value",
  2327. Status: "Status",
  2328. Error: "Error"
  2329. };
  2330. Microsoft.Office.WebExtension.AsyncResultStatus={
  2331. Succeeded: "succeeded",
  2332. Failed: "failed"
  2333. };
  2334. OSF.DDA.AsyncResultEnum.ErrorCode={
  2335. Success: 0,
  2336. Failed: 1
  2337. };
  2338. OSF.DDA.AsyncResultEnum.ErrorProperties={
  2339. Name: "Name",
  2340. Message: "Message",
  2341. Code: "Code"
  2342. };
  2343. OSF.DDA.AsyncMethodNames={};
  2344. OSF.DDA.AsyncMethodNames.addNames=function(methodNames)
  2345. {
  2346. for(var entry in methodNames)
  2347. {
  2348. var am={};
  2349. OSF.OUtil.defineEnumerableProperties(am,{
  2350. id: {value: entry},
  2351. displayName: {value: methodNames[entry]}
  2352. });
  2353. OSF.DDA.AsyncMethodNames[entry]=am
  2354. }
  2355. };
  2356. OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName)
  2357. {
  2358. var requiredCount=requiredParameters.length;
  2359. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters,supportedOptions,privateStateCallbacks,checkCallArgs,displayName);
  2360. function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo)
  2361. {
  2362. if(userArgs.length > requiredCount+2)
  2363. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2364. var options,
  2365. parameterCallback;
  2366. for(var i=userArgs.length - 1; i >=requiredCount; i--)
  2367. {
  2368. var argument=userArgs[i];
  2369. switch(typeof argument)
  2370. {
  2371. case"object":
  2372. if(options)
  2373. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2374. else
  2375. options=argument;
  2376. break;
  2377. case"function":
  2378. if(parameterCallback)
  2379. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);
  2380. else
  2381. parameterCallback=argument;
  2382. break;
  2383. default:
  2384. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2385. break
  2386. }
  2387. }
  2388. options=apiMethods.fillOptions(options,requiredArgs,caller,stateInfo);
  2389. if(parameterCallback)
  2390. if(options[Microsoft.Office.WebExtension.Parameters.Callback])
  2391. throw Strings.OfficeOM.L_RedundantCallbackSpecification;
  2392. else
  2393. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2394. apiMethods.verifyArguments(supportedOptions,options);
  2395. return options
  2396. }
  2397. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo)
  2398. {
  2399. var required=apiMethods.extractRequiredArguments(userArgs,caller,stateInfo);
  2400. var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs,required,caller,stateInfo);
  2401. var callArgs=apiMethods.constructCallArgs(required,options,caller,stateInfo);
  2402. return callArgs
  2403. };
  2404. this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs)
  2405. {
  2406. var payload;
  2407. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  2408. if(onSucceeded)
  2409. payload=onSucceeded(response,caller,callArgs);
  2410. else
  2411. payload=response;
  2412. else if(onFailed)
  2413. payload=onFailed(status,response);
  2414. else
  2415. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2416. return payload
  2417. };
  2418. this.getCallArgs=function(suppliedArgs)
  2419. {
  2420. var options,
  2421. parameterCallback;
  2422. for(var i=suppliedArgs.length - 1; i >=requiredCount; i--)
  2423. {
  2424. var argument=suppliedArgs[i];
  2425. switch(typeof argument)
  2426. {
  2427. case"object":
  2428. options=argument;
  2429. break;
  2430. case"function":
  2431. parameterCallback=argument;
  2432. break
  2433. }
  2434. }
  2435. options=options || {};
  2436. if(parameterCallback)
  2437. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2438. return options
  2439. }
  2440. };
  2441. OSF.DDA.AsyncMethodCallFactory=function()
  2442. {
  2443. return{manufacture: function(params)
  2444. {
  2445. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2446. var privateStateCallbacks=params.privateStateCallbacks ? OSF.OUtil.createObject(params.privateStateCallbacks) : [];
  2447. return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [],supportedOptions,privateStateCallbacks,params.onSucceeded,params.onFailed,params.checkCallArgs,params.method.displayName)
  2448. }}
  2449. }();
  2450. OSF.DDA.AsyncMethodCalls={};
  2451. OSF.DDA.AsyncMethodCalls.define=function(callDefinition)
  2452. {
  2453. OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition)
  2454. };
  2455. OSF.DDA.Error=function OSF_DDA_Error(name, message, code)
  2456. {
  2457. OSF.OUtil.defineEnumerableProperties(this,{
  2458. name: {value: name},
  2459. message: {value: message},
  2460. code: {value: code}
  2461. })
  2462. };
  2463. OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs)
  2464. {
  2465. OSF.OUtil.defineEnumerableProperties(this,{
  2466. value: {value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]},
  2467. status: {value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded}
  2468. });
  2469. if(initArgs[OSF.DDA.AsyncResultEnum.Properties.Context])
  2470. OSF.OUtil.defineEnumerableProperty(this,"asyncContext",{value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]});
  2471. if(errorArgs)
  2472. OSF.OUtil.defineEnumerableProperty(this,"error",{value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])})
  2473. };
  2474. OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload)
  2475. {
  2476. var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback];
  2477. if(callback)
  2478. {
  2479. var asyncInitArgs={};
  2480. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext];
  2481. var errorArgs;
  2482. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  2483. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload;
  2484. else
  2485. {
  2486. errorArgs={};
  2487. payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  2488. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2489. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  2490. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload
  2491. }
  2492. callback(new OSF.DDA.AsyncResult(asyncInitArgs,errorArgs))
  2493. }
  2494. };
  2495. OSF.DDA.SyncMethodNames={};
  2496. OSF.DDA.SyncMethodNames.addNames=function(methodNames)
  2497. {
  2498. for(var entry in methodNames)
  2499. {
  2500. var am={};
  2501. OSF.OUtil.defineEnumerableProperties(am,{
  2502. id: {value: entry},
  2503. displayName: {value: methodNames[entry]}
  2504. });
  2505. OSF.DDA.SyncMethodNames[entry]=am
  2506. }
  2507. };
  2508. OSF.DDA.SyncMethodCall=function OSF_DDA_SyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName)
  2509. {
  2510. var requiredCount=requiredParameters.length;
  2511. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters,supportedOptions,privateStateCallbacks,checkCallArgs,displayName);
  2512. function OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo)
  2513. {
  2514. if(userArgs.length > requiredCount+1)
  2515. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2516. var options,
  2517. parameterCallback;
  2518. for(var i=userArgs.length - 1; i >=requiredCount; i--)
  2519. {
  2520. var argument=userArgs[i];
  2521. switch(typeof argument)
  2522. {
  2523. case"object":
  2524. if(options)
  2525. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2526. else
  2527. options=argument;
  2528. break;
  2529. default:
  2530. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2531. break
  2532. }
  2533. }
  2534. options=apiMethods.fillOptions(options,requiredArgs,caller,stateInfo);
  2535. apiMethods.verifyArguments(supportedOptions,options);
  2536. return options
  2537. }
  2538. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo)
  2539. {
  2540. var required=apiMethods.extractRequiredArguments(userArgs,caller,stateInfo);
  2541. var options=OSF_DAA_SyncMethodCall$ExtractOptions(userArgs,required,caller,stateInfo);
  2542. var callArgs=apiMethods.constructCallArgs(required,options,caller,stateInfo);
  2543. return callArgs
  2544. }
  2545. };
  2546. OSF.DDA.SyncMethodCallFactory=function()
  2547. {
  2548. return{manufacture: function(params)
  2549. {
  2550. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2551. return new OSF.DDA.SyncMethodCall(params.requiredArguments || [],supportedOptions,params.privateStateCallbacks,params.checkCallArgs,params.method.displayName)
  2552. }}
  2553. }();
  2554. OSF.DDA.SyncMethodCalls={};
  2555. OSF.DDA.SyncMethodCalls.define=function(callDefinition)
  2556. {
  2557. OSF.DDA.SyncMethodCalls[callDefinition.method.id]=OSF.DDA.SyncMethodCallFactory.manufacture(callDefinition)
  2558. };
  2559. OSF.DDA.ListType=function()
  2560. {
  2561. var listTypes={};
  2562. return{
  2563. setListType: function OSF_DDA_ListType$AddListType(t, prop)
  2564. {
  2565. listTypes[t]=prop
  2566. },
  2567. isListType: function OSF_DDA_ListType$IsListType(t)
  2568. {
  2569. return OSF.OUtil.listContainsKey(listTypes,t)
  2570. },
  2571. getDescriptor: function OSF_DDA_ListType$getDescriptor(t)
  2572. {
  2573. return listTypes[t]
  2574. }
  2575. }
  2576. }();
  2577. OSF.DDA.HostParameterMap=function(specialProcessor, mappings)
  2578. {
  2579. var toHostMap="toHost";
  2580. var fromHostMap="fromHost";
  2581. var self="self";
  2582. var dynamicTypes={};
  2583. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={
  2584. toHost: function(data)
  2585. {
  2586. if(data !=null && data.rows !==undefined)
  2587. {
  2588. var tableData={};
  2589. tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows;
  2590. tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers;
  2591. data=tableData
  2592. }
  2593. return data
  2594. },
  2595. fromHost: function(args)
  2596. {
  2597. return args
  2598. }
  2599. };
  2600. dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data];
  2601. function mapValues(preimageSet, mapping)
  2602. {
  2603. var ret=preimageSet ? {} : undefined;
  2604. for(var entry in preimageSet)
  2605. {
  2606. var preimage=preimageSet[entry];
  2607. var image;
  2608. if(OSF.DDA.ListType.isListType(entry))
  2609. {
  2610. image=[];
  2611. for(var subEntry in preimage)
  2612. image.push(mapValues(preimage[subEntry],mapping))
  2613. }
  2614. else if(OSF.OUtil.listContainsKey(dynamicTypes,entry))
  2615. image=dynamicTypes[entry][mapping](preimage);
  2616. else if(mapping==fromHostMap && specialProcessor.preserveNesting(entry))
  2617. image=mapValues(preimage,mapping);
  2618. else
  2619. {
  2620. var maps=mappings[entry];
  2621. if(maps)
  2622. {
  2623. var map=maps[mapping];
  2624. if(map)
  2625. {
  2626. image=map[preimage];
  2627. if(image===undefined)
  2628. image=preimage
  2629. }
  2630. }
  2631. else
  2632. image=preimage
  2633. }
  2634. ret[entry]=image
  2635. }
  2636. return ret
  2637. }
  2638. function generateArguments(imageSet, parameters)
  2639. {
  2640. var ret;
  2641. for(var param in parameters)
  2642. {
  2643. var arg;
  2644. if(specialProcessor.isComplexType(param))
  2645. arg=generateArguments(imageSet,mappings[param][toHostMap]);
  2646. else
  2647. arg=imageSet[param];
  2648. if(arg !=undefined)
  2649. {
  2650. if(!ret)
  2651. ret={};
  2652. var index=parameters[param];
  2653. if(index==self)
  2654. index=param;
  2655. ret[index]=specialProcessor.pack(param,arg)
  2656. }
  2657. }
  2658. return ret
  2659. }
  2660. function extractArguments(source, parameters, extracted)
  2661. {
  2662. if(!extracted)
  2663. extracted={};
  2664. for(var param in parameters)
  2665. {
  2666. var index=parameters[param];
  2667. var value;
  2668. if(index==self)
  2669. value=source;
  2670. else
  2671. value=source[index];
  2672. if(value===null || value===undefined)
  2673. extracted[param]=undefined;
  2674. else
  2675. {
  2676. value=specialProcessor.unpack(param,value);
  2677. var map;
  2678. if(specialProcessor.isComplexType(param))
  2679. {
  2680. map=mappings[param][fromHostMap];
  2681. if(specialProcessor.preserveNesting(param))
  2682. extracted[param]=extractArguments(value,map);
  2683. else
  2684. extractArguments(value,map,extracted)
  2685. }
  2686. else
  2687. {
  2688. if(OSF.DDA.ListType.isListType(param))
  2689. {
  2690. map={};
  2691. var entryDescriptor=OSF.DDA.ListType.getDescriptor(param);
  2692. map[entryDescriptor]=self;
  2693. for(var item in value)
  2694. value[item]=extractArguments(value[item],map)
  2695. }
  2696. extracted[param]=value
  2697. }
  2698. }
  2699. }
  2700. return extracted
  2701. }
  2702. function applyMap(mapName, preimage, mapping)
  2703. {
  2704. var parameters=mappings[mapName][mapping];
  2705. var image;
  2706. if(mapping=="toHost")
  2707. {
  2708. var imageSet=mapValues(preimage,mapping);
  2709. image=generateArguments(imageSet,parameters)
  2710. }
  2711. else if(mapping=="fromHost")
  2712. {
  2713. var argumentSet=extractArguments(preimage,parameters);
  2714. image=mapValues(argumentSet,mapping)
  2715. }
  2716. return image
  2717. }
  2718. if(!mappings)
  2719. mappings={};
  2720. this.addMapping=function(mapName, description)
  2721. {
  2722. var toHost,
  2723. fromHost;
  2724. if(description.map)
  2725. {
  2726. toHost=description.map;
  2727. fromHost={};
  2728. for(var preimage in toHost)
  2729. {
  2730. var image=toHost[preimage];
  2731. if(image==self)
  2732. image=preimage;
  2733. fromHost[image]=preimage
  2734. }
  2735. }
  2736. else
  2737. {
  2738. toHost=description.toHost;
  2739. fromHost=description.fromHost
  2740. }
  2741. var pair=mappings[mapName];
  2742. if(pair)
  2743. {
  2744. var currMap=pair[toHostMap];
  2745. for(var th in currMap)
  2746. toHost[th]=currMap[th];
  2747. currMap=pair[fromHostMap];
  2748. for(var fh in currMap)
  2749. fromHost[fh]=currMap[fh]
  2750. }
  2751. else
  2752. pair=mappings[mapName]={};
  2753. pair[toHostMap]=toHost;
  2754. pair[fromHostMap]=fromHost
  2755. };
  2756. this.toHost=function(mapName, preimage)
  2757. {
  2758. return applyMap(mapName,preimage,toHostMap)
  2759. };
  2760. this.fromHost=function(mapName, image)
  2761. {
  2762. return applyMap(mapName,image,fromHostMap)
  2763. };
  2764. this.self=self;
  2765. this.addComplexType=function(ct)
  2766. {
  2767. specialProcessor.addComplexType(ct)
  2768. };
  2769. this.getDynamicType=function(dt)
  2770. {
  2771. return specialProcessor.getDynamicType(dt)
  2772. };
  2773. this.setDynamicType=function(dt, handler)
  2774. {
  2775. specialProcessor.setDynamicType(dt,handler)
  2776. };
  2777. this.dynamicTypes=dynamicTypes;
  2778. this.doMapValues=function(preimageSet, mapping)
  2779. {
  2780. return mapValues(preimageSet,mapping)
  2781. }
  2782. };
  2783. OSF.DDA.SpecialProcessor=function(complexTypes, dynamicTypes)
  2784. {
  2785. this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct)
  2786. {
  2787. complexTypes.push(ct)
  2788. };
  2789. this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt)
  2790. {
  2791. return dynamicTypes[dt]
  2792. };
  2793. this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler)
  2794. {
  2795. dynamicTypes[dt]=handler
  2796. };
  2797. this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t)
  2798. {
  2799. return OSF.OUtil.listContainsValue(complexTypes,t)
  2800. };
  2801. this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p)
  2802. {
  2803. return OSF.OUtil.listContainsKey(dynamicTypes,p)
  2804. };
  2805. this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p)
  2806. {
  2807. var pn=[];
  2808. if(OSF.DDA.PropertyDescriptors)
  2809. pn.push(OSF.DDA.PropertyDescriptors.Subset);
  2810. if(OSF.DDA.DataNodeEventProperties)
  2811. pn=pn.concat([OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode]);
  2812. return OSF.OUtil.listContainsValue(pn,p)
  2813. };
  2814. this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg)
  2815. {
  2816. var value;
  2817. if(this.isDynamicType(param))
  2818. value=dynamicTypes[param].toHost(arg);
  2819. else
  2820. value=arg;
  2821. return value
  2822. };
  2823. this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg)
  2824. {
  2825. var value;
  2826. if(this.isDynamicType(param))
  2827. value=dynamicTypes[param].fromHost(arg);
  2828. else
  2829. value=arg;
  2830. return value
  2831. }
  2832. };
  2833. OSF.DDA.getDecoratedParameterMap=function(specialProcessor, initialDefs)
  2834. {
  2835. var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor);
  2836. var self=parameterMap.self;
  2837. function createObject(properties)
  2838. {
  2839. var obj=null;
  2840. if(properties)
  2841. {
  2842. obj={};
  2843. var len=properties.length;
  2844. for(var i=0; i < len; i++)
  2845. obj[properties[i].name]=properties[i].value
  2846. }
  2847. return obj
  2848. }
  2849. parameterMap.define=function define(definition)
  2850. {
  2851. var args={};
  2852. var toHost=createObject(definition.toHost);
  2853. if(definition.invertible)
  2854. args.map=toHost;
  2855. else if(definition.canonical)
  2856. args.toHost=args.fromHost=toHost;
  2857. else
  2858. {
  2859. args.toHost=toHost;
  2860. args.fromHost=createObject(definition.fromHost)
  2861. }
  2862. parameterMap.addMapping(definition.type,args);
  2863. if(definition.isComplexType)
  2864. parameterMap.addComplexType(definition.type)
  2865. };
  2866. for(var id in initialDefs)
  2867. parameterMap.define(initialDefs[id]);
  2868. return parameterMap
  2869. };
  2870. OSF.OUtil.setNamespace("DispIdHost",OSF.DDA);
  2871. OSF.DDA.DispIdHost.Methods={
  2872. InvokeMethod: "invokeMethod",
  2873. AddEventHandler: "addEventHandler",
  2874. RemoveEventHandler: "removeEventHandler",
  2875. OpenDialog: "openDialog",
  2876. CloseDialog: "closeDialog",
  2877. MessageParent: "messageParent"
  2878. };
  2879. OSF.DDA.DispIdHost.Delegates={
  2880. ExecuteAsync: "executeAsync",
  2881. RegisterEventAsync: "registerEventAsync",
  2882. UnregisterEventAsync: "unregisterEventAsync",
  2883. ParameterMap: "parameterMap",
  2884. MessageParent: "messageParent"
  2885. };
  2886. OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap)
  2887. {
  2888. var dispIdMap={};
  2889. var jsom=OSF.DDA.AsyncMethodNames;
  2890. var did=OSF.DDA.MethodDispId;
  2891. var methodMap={
  2892. GoToByIdAsync: did.dispidNavigateToMethod,
  2893. GetSelectedDataAsync: did.dispidGetSelectedDataMethod,
  2894. SetSelectedDataAsync: did.dispidSetSelectedDataMethod,
  2895. GetDocumentCopyChunkAsync: did.dispidGetDocumentCopyChunkMethod,
  2896. ReleaseDocumentCopyAsync: did.dispidReleaseDocumentCopyMethod,
  2897. GetDocumentCopyAsync: did.dispidGetDocumentCopyMethod,
  2898. AddFromSelectionAsync: did.dispidAddBindingFromSelectionMethod,
  2899. AddFromPromptAsync: did.dispidAddBindingFromPromptMethod,
  2900. AddFromNamedItemAsync: did.dispidAddBindingFromNamedItemMethod,
  2901. GetAllAsync: did.dispidGetAllBindingsMethod,
  2902. GetByIdAsync: did.dispidGetBindingMethod,
  2903. ReleaseByIdAsync: did.dispidReleaseBindingMethod,
  2904. GetDataAsync: did.dispidGetBindingDataMethod,
  2905. SetDataAsync: did.dispidSetBindingDataMethod,
  2906. AddRowsAsync: did.dispidAddRowsMethod,
  2907. AddColumnsAsync: did.dispidAddColumnsMethod,
  2908. DeleteAllDataValuesAsync: did.dispidClearAllRowsMethod,
  2909. RefreshAsync: did.dispidLoadSettingsMethod,
  2910. SaveAsync: did.dispidSaveSettingsMethod,
  2911. GetActiveViewAsync: did.dispidGetActiveViewMethod,
  2912. GetFilePropertiesAsync: did.dispidGetFilePropertiesMethod,
  2913. GetOfficeThemeAsync: did.dispidGetOfficeThemeMethod,
  2914. GetDocumentThemeAsync: did.dispidGetDocumentThemeMethod,
  2915. ClearFormatsAsync: did.dispidClearFormatsMethod,
  2916. SetTableOptionsAsync: did.dispidSetTableOptionsMethod,
  2917. SetFormatsAsync: did.dispidSetFormatsMethod,
  2918. ExecuteRichApiRequestAsync: did.dispidExecuteRichApiRequestMethod,
  2919. AppCommandInvocationCompletedAsync: did.dispidAppCommandInvocationCompletedMethod,
  2920. AddDataPartAsync: did.dispidAddDataPartMethod,
  2921. GetDataPartByIdAsync: did.dispidGetDataPartByIdMethod,
  2922. GetDataPartsByNameSpaceAsync: did.dispidGetDataPartsByNamespaceMethod,
  2923. GetPartXmlAsync: did.dispidGetDataPartXmlMethod,
  2924. GetPartNodesAsync: did.dispidGetDataPartNodesMethod,
  2925. DeleteDataPartAsync: did.dispidDeleteDataPartMethod,
  2926. GetNodeValueAsync: did.dispidGetDataNodeValueMethod,
  2927. GetNodeXmlAsync: did.dispidGetDataNodeXmlMethod,
  2928. GetRelativeNodesAsync: did.dispidGetDataNodesMethod,
  2929. SetNodeValueAsync: did.dispidSetDataNodeValueMethod,
  2930. SetNodeXmlAsync: did.dispidSetDataNodeXmlMethod,
  2931. AddDataPartNamespaceAsync: did.dispidAddDataNamespaceMethod,
  2932. GetDataPartNamespaceAsync: did.dispidGetDataUriByPrefixMethod,
  2933. GetDataPartPrefixAsync: did.dispidGetDataPrefixByUriMethod,
  2934. GetNodeTextAsync: did.dispidGetDataNodeTextMethod,
  2935. SetNodeTextAsync: did.dispidSetDataNodeTextMethod,
  2936. GetSelectedTask: did.dispidGetSelectedTaskMethod,
  2937. GetTask: did.dispidGetTaskMethod,
  2938. GetWSSUrl: did.dispidGetWSSUrlMethod,
  2939. GetTaskField: did.dispidGetTaskFieldMethod,
  2940. GetSelectedResource: did.dispidGetSelectedResourceMethod,
  2941. GetResourceField: did.dispidGetResourceFieldMethod,
  2942. GetProjectField: did.dispidGetProjectFieldMethod,
  2943. GetSelectedView: did.dispidGetSelectedViewMethod,
  2944. GetTaskByIndex: did.dispidGetTaskByIndexMethod,
  2945. GetResourceByIndex: did.dispidGetResourceByIndexMethod,
  2946. SetTaskField: did.dispidSetTaskFieldMethod,
  2947. SetResourceField: did.dispidSetResourceFieldMethod,
  2948. GetMaxTaskIndex: did.dispidGetMaxTaskIndexMethod,
  2949. GetMaxResourceIndex: did.dispidGetMaxResourceIndexMethod
  2950. };
  2951. for(var method in methodMap)
  2952. if(jsom[method])
  2953. dispIdMap[jsom[method].id]=methodMap[method];
  2954. jsom=OSF.DDA.SyncMethodNames;
  2955. did=OSF.DDA.MethodDispId;
  2956. var asyncMethodMap={MessageParent: did.dispidMessageParentMethod};
  2957. for(var method in asyncMethodMap)
  2958. if(jsom[method])
  2959. dispIdMap[jsom[method].id]=methodMap[method];
  2960. jsom=Microsoft.Office.WebExtension.EventType;
  2961. did=OSF.DDA.EventDispId;
  2962. var eventMap={
  2963. SettingsChanged: did.dispidSettingsChangedEvent,
  2964. DocumentSelectionChanged: did.dispidDocumentSelectionChangedEvent,
  2965. BindingSelectionChanged: did.dispidBindingSelectionChangedEvent,
  2966. BindingDataChanged: did.dispidBindingDataChangedEvent,
  2967. ActiveViewChanged: did.dispidActiveViewChangedEvent,
  2968. OfficeThemeChanged: did.dispidOfficeThemeChangedEvent,
  2969. DocumentThemeChanged: did.dispidDocumentThemeChangedEvent,
  2970. AppCommandInvoked: did.dispidAppCommandInvokedEvent,
  2971. DialogMessageReceived: did.dispidDialogMessageReceivedEvent,
  2972. TaskSelectionChanged: did.dispidTaskSelectionChangedEvent,
  2973. ResourceSelectionChanged: did.dispidResourceSelectionChangedEvent,
  2974. ViewSelectionChanged: did.dispidViewSelectionChangedEvent,
  2975. DataNodeInserted: did.dispidDataNodeAddedEvent,
  2976. DataNodeReplaced: did.dispidDataNodeReplacedEvent,
  2977. DataNodeDeleted: did.dispidDataNodeDeletedEvent
  2978. };
  2979. for(var event in eventMap)
  2980. if(jsom[event])
  2981. dispIdMap[jsom[event]]=eventMap[event];
  2982. function onException(ex, asyncMethodCall, suppliedArgs, callArgs)
  2983. {
  2984. if(typeof ex=="number")
  2985. {
  2986. if(!callArgs)
  2987. callArgs=asyncMethodCall.getCallArgs(suppliedArgs);
  2988. OSF.DDA.issueAsyncResult(callArgs,ex,OSF.DDA.ErrorCodeManager.getErrorArgs(ex))
  2989. }
  2990. else
  2991. throw ex;
  2992. }
  2993. this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState)
  2994. {
  2995. var callArgs;
  2996. try
  2997. {
  2998. var methodName=method.id;
  2999. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName];
  3000. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,privateState);
  3001. var dispId=dispIdMap[methodName];
  3002. var delegate=getDelegateMethods(methodName);
  3003. var hostCallArgs;
  3004. if(parameterMap.toHost)
  3005. hostCallArgs=parameterMap.toHost(dispId,callArgs);
  3006. else
  3007. hostCallArgs=callArgs;
  3008. delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({
  3009. dispId: dispId,
  3010. hostCallArgs: hostCallArgs,
  3011. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3012. {
  3013. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3014. },
  3015. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3016. {
  3017. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3018. },
  3019. onComplete: function(status, hostResponseArgs)
  3020. {
  3021. var responseArgs;
  3022. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3023. if(parameterMap.fromHost)
  3024. responseArgs=parameterMap.fromHost(dispId,hostResponseArgs);
  3025. else
  3026. responseArgs=hostResponseArgs;
  3027. else
  3028. responseArgs=hostResponseArgs;
  3029. var payload=asyncMethodCall.processResponse(status,responseArgs,caller,callArgs);
  3030. OSF.DDA.issueAsyncResult(callArgs,status,payload)
  3031. }
  3032. })
  3033. }
  3034. catch(ex)
  3035. {
  3036. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3037. }
  3038. };
  3039. this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller)
  3040. {
  3041. var callArgs;
  3042. var eventType,
  3043. handler;
  3044. function onEnsureRegistration(status)
  3045. {
  3046. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3047. {
  3048. var added=eventDispatch.addEventHandler(eventType,handler);
  3049. if(!added)
  3050. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed
  3051. }
  3052. var error;
  3053. if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3054. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3055. OSF.DDA.issueAsyncResult(callArgs,status,error)
  3056. }
  3057. try
  3058. {
  3059. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];
  3060. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch);
  3061. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3062. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3063. if(eventDispatch.getEventHandlerCount(eventType)==0)
  3064. {
  3065. var dispId=dispIdMap[eventType];
  3066. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3067. invoker({
  3068. eventType: eventType,
  3069. dispId: dispId,
  3070. targetId: caller.id || "",
  3071. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3072. {
  3073. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3074. },
  3075. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3076. {
  3077. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3078. },
  3079. onComplete: onEnsureRegistration,
  3080. onEvent: function handleEvent(hostArgs)
  3081. {
  3082. var args=parameterMap.fromHost(dispId,hostArgs);
  3083. eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType,caller,args))
  3084. }
  3085. })
  3086. }
  3087. else
  3088. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3089. }
  3090. catch(ex)
  3091. {
  3092. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3093. }
  3094. };
  3095. this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller)
  3096. {
  3097. var callArgs;
  3098. var eventType,
  3099. handler;
  3100. function onEnsureRegistration(status)
  3101. {
  3102. var error;
  3103. if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3104. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3105. OSF.DDA.issueAsyncResult(callArgs,status,error)
  3106. }
  3107. try
  3108. {
  3109. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];
  3110. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch);
  3111. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3112. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3113. var status,
  3114. removeSuccess;
  3115. if(handler===null)
  3116. {
  3117. removeSuccess=eventDispatch.clearEventHandlers(eventType);
  3118. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess
  3119. }
  3120. else
  3121. {
  3122. removeSuccess=eventDispatch.removeEventHandler(eventType,handler);
  3123. status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist
  3124. }
  3125. if(removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0)
  3126. {
  3127. var dispId=dispIdMap[eventType];
  3128. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3129. invoker({
  3130. eventType: eventType,
  3131. dispId: dispId,
  3132. targetId: caller.id || "",
  3133. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3134. {
  3135. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3136. },
  3137. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3138. {
  3139. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3140. },
  3141. onComplete: onEnsureRegistration
  3142. })
  3143. }
  3144. else
  3145. onEnsureRegistration(status)
  3146. }
  3147. catch(ex)
  3148. {
  3149. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3150. }
  3151. };
  3152. this[OSF.DDA.DispIdHost.Methods.OpenDialog]=function OSF_DDA_DispIdHost_Facade$OpenDialog(suppliedArguments, eventDispatch, caller)
  3153. {
  3154. var callArgs;
  3155. var dialogMessageEvent,
  3156. dialogOtherEvent;
  3157. var targetId;
  3158. function onEnsureRegistration(status)
  3159. {
  3160. var payload;
  3161. if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3162. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3163. else
  3164. {
  3165. var onSucceedArgs={};
  3166. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Id]=targetId;
  3167. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Data]=eventDispatch;
  3168. var payload=asyncMethodCall.processResponse(status,onSucceedArgs,caller,callArgs)
  3169. }
  3170. OSF.DDA.issueAsyncResult(callArgs,status,payload)
  3171. }
  3172. try
  3173. {
  3174. dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3175. dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3176. if(dialogMessageEvent==undefined || dialogOtherEvent==undefined)
  3177. onEnsureRegistration(OSF.DDA.ErrorCodeManager.ooeOperationNotSupported);
  3178. if(OSF.DDA.AsyncMethodNames.DisplayDialogAsync==null)
  3179. {
  3180. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3181. return
  3182. }
  3183. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.DisplayDialogAsync.id];
  3184. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch);
  3185. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3186. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3187. var dispId=dispIdMap[dialogMessageEvent];
  3188. var invoker=getDelegateMethods(dialogMessageEvent)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3189. targetId=JSON.stringify(callArgs);
  3190. invoker({
  3191. eventType: dialogMessageEvent,
  3192. dispId: dispId,
  3193. targetId: targetId,
  3194. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3195. {
  3196. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3197. },
  3198. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3199. {
  3200. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3201. },
  3202. onComplete: onEnsureRegistration,
  3203. onEvent: function handleEvent(hostArgs)
  3204. {
  3205. var args=parameterMap.fromHost(dispId,hostArgs);
  3206. var event=OSF.DDA.OMFactory.manufactureEventArgs(dialogMessageEvent,caller,args);
  3207. if(event.type==dialogOtherEvent)
  3208. {
  3209. var payload=OSF.DDA.ErrorCodeManager.getErrorArgs(event.error);
  3210. var errorArgs={};
  3211. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3212. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  3213. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  3214. event.error=new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])
  3215. }
  3216. eventDispatch.fireOrQueueEvent(event);
  3217. if(args[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogClosed)
  3218. {
  3219. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3220. eventDispatch.clearEventHandlers(dialogOtherEvent)
  3221. }
  3222. }
  3223. })
  3224. }
  3225. catch(ex)
  3226. {
  3227. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3228. }
  3229. };
  3230. this[OSF.DDA.DispIdHost.Methods.CloseDialog]=function OSF_DDA_DispIdHost_Facade$CloseDialog(suppliedArguments, targetId, eventDispatch, caller)
  3231. {
  3232. var callArgs;
  3233. var dialogMessageEvent,
  3234. dialogOtherEvent;
  3235. var closeStatus=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3236. function closeCallback(status)
  3237. {
  3238. closeStatus=status
  3239. }
  3240. try
  3241. {
  3242. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.CloseAsync.id];
  3243. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch);
  3244. dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3245. dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3246. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3247. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3248. var dispId=dispIdMap[dialogMessageEvent];
  3249. var invoker=getDelegateMethods(dialogMessageEvent)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3250. invoker({
  3251. eventType: dialogMessageEvent,
  3252. dispId: dispId,
  3253. targetId: targetId,
  3254. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3255. {
  3256. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3257. },
  3258. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3259. {
  3260. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3261. },
  3262. onComplete: closeCallback
  3263. })
  3264. }
  3265. catch(ex)
  3266. {
  3267. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3268. }
  3269. if(closeStatus !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3270. throw OSF.OUtil.formatString(Strings.OfficeOM.L_FunctionCallFailed,OSF.DDA.AsyncMethodNames.CloseAsync.displayName,closeStatus);
  3271. };
  3272. this[OSF.DDA.DispIdHost.Methods.MessageParent]=function OSF_DDA_DispIdHost_Facade$MessageParent(suppliedArguments, caller)
  3273. {
  3274. var stateInfo={};
  3275. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.MessageParent.id];
  3276. var callArgs=syncMethodCall.verifyAndExtractCall(suppliedArguments,caller,stateInfo);
  3277. var delegate=getDelegateMethods(OSF.DDA.SyncMethodNames.MessageParent.id);
  3278. var invoker=delegate[OSF.DDA.DispIdHost.Delegates.MessageParent];
  3279. var dispId=dispIdMap[syncMethodCall];
  3280. return invoker({
  3281. dispId: dispId,
  3282. hostCallArgs: callArgs[Microsoft.Office.WebExtension.Parameters.MessageToParent],
  3283. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3284. {
  3285. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3286. },
  3287. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3288. {
  3289. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3290. }
  3291. })
  3292. }
  3293. };
  3294. OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState)
  3295. {
  3296. for(var entry in asyncMethodNames)
  3297. {
  3298. var method=asyncMethodNames[entry];
  3299. var name=method.displayName;
  3300. if(!target[name])
  3301. OSF.OUtil.defineEnumerableProperty(target,name,{value: function(asyncMethod)
  3302. {
  3303. return function()
  3304. {
  3305. var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];
  3306. invokeMethod(asyncMethod,arguments,target,privateState)
  3307. }
  3308. }(method)})
  3309. }
  3310. };
  3311. OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch)
  3312. {
  3313. var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  3314. var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;
  3315. if(!target[add])
  3316. OSF.OUtil.defineEnumerableProperty(target,add,{value: function()
  3317. {
  3318. var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];
  3319. addEventHandler(arguments,eventDispatch,target)
  3320. }});
  3321. if(!target[remove])
  3322. OSF.OUtil.defineEnumerableProperty(target,remove,{value: function()
  3323. {
  3324. var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];
  3325. removeEventHandler(arguments,eventDispatch,target)
  3326. }})
  3327. };
  3328. if(!OsfMsAjaxFactory.isMsAjaxLoaded())
  3329. if(!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId)))
  3330. {
  3331. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==="https:" ? "https:" : "http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";
  3332. OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback()
  3333. {
  3334. if(!OsfMsAjaxFactory.isMsAjaxLoaded())
  3335. throw"Not able to load MicrosoftAjax.js.";
  3336. })
  3337. }
  3338. OSF.OUtil.setNamespace("SafeArray",OSF.DDA);
  3339. OSF.DDA.SafeArray.Response={
  3340. Status: 0,
  3341. Payload: 1
  3342. };
  3343. OSF.DDA.SafeArray.UniqueArguments={
  3344. Offset: "offset",
  3345. Run: "run",
  3346. BindingSpecificData: "bindingSpecificData",
  3347. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  3348. };
  3349. OSF.OUtil.setNamespace("Delegate",OSF.DDA.SafeArray);
  3350. OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args)
  3351. {
  3352. var status;
  3353. var statusNumber=ex.number;
  3354. if(statusNumber)
  3355. switch(statusNumber)
  3356. {
  3357. case-2146828218:
  3358. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3359. break;
  3360. case-2147467259:
  3361. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened;
  3362. break;
  3363. case-2146828283:
  3364. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3365. break;
  3366. case-2146827850:
  3367. default:
  3368. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3369. break
  3370. }
  3371. if(args.onComplete)
  3372. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError)
  3373. };
  3374. OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod=function OSF_DDA_SafeArray_Delegate$OnExceptionSyncMethod(ex, args)
  3375. {
  3376. var status;
  3377. var number=ex.number;
  3378. if(number)
  3379. switch(number)
  3380. {
  3381. case-2146828218:
  3382. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3383. break;
  3384. case-2146827850:
  3385. default:
  3386. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3387. break
  3388. }
  3389. return status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError
  3390. };
  3391. OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor()
  3392. {
  3393. function _2DVBArrayToJaggedArray(vbArr)
  3394. {
  3395. var ret;
  3396. try
  3397. {
  3398. var rows=vbArr.ubound(1);
  3399. var cols=vbArr.ubound(2);
  3400. vbArr=vbArr.toArray();
  3401. if(rows==1 && cols==1)
  3402. ret=[vbArr];
  3403. else
  3404. {
  3405. ret=[];
  3406. for(var row=0; row < rows; row++)
  3407. {
  3408. var rowArr=[];
  3409. for(var col=0; col < cols; col++)
  3410. {
  3411. var datum=vbArr[row * cols+col];
  3412. if(datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid)
  3413. rowArr.push(datum)
  3414. }
  3415. if(rowArr.length > 0)
  3416. ret.push(rowArr)
  3417. }
  3418. }
  3419. }
  3420. catch(ex){}
  3421. return ret
  3422. }
  3423. var complexTypes=[];
  3424. var dynamicTypes={};
  3425. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=function()
  3426. {
  3427. var tableRows=0;
  3428. var tableHeaders=1;
  3429. return{
  3430. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data)
  3431. {
  3432. if(typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined)
  3433. {
  3434. var tableData=[];
  3435. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  3436. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  3437. data=tableData
  3438. }
  3439. return data
  3440. },
  3441. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs)
  3442. {
  3443. var ret;
  3444. if(hostArgs.toArray)
  3445. {
  3446. var dimensions=hostArgs.dimensions();
  3447. if(dimensions===2)
  3448. ret=_2DVBArrayToJaggedArray(hostArgs);
  3449. else
  3450. {
  3451. var array=hostArgs.toArray();
  3452. if(array.length===2 && (array[0] !=null && array[0].toArray || array[1] !=null && array[1].toArray))
  3453. {
  3454. ret={};
  3455. ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]);
  3456. ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders])
  3457. }
  3458. else
  3459. ret=array
  3460. }
  3461. }
  3462. else
  3463. ret=hostArgs;
  3464. return ret
  3465. }
  3466. }
  3467. }();
  3468. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,complexTypes,dynamicTypes);
  3469. this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg)
  3470. {
  3471. var value;
  3472. if(this.isComplexType(param) || OSF.DDA.ListType.isListType(param))
  3473. {
  3474. var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray;
  3475. value=toArraySupported ? arg.toArray() : arg || {}
  3476. }
  3477. else if(this.isDynamicType(param))
  3478. value=dynamicTypes[param].fromHost(arg);
  3479. else
  3480. value=arg;
  3481. return value
  3482. }
  3483. };
  3484. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);
  3485. OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{
  3486. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  3487. toHost: [{
  3488. name: Microsoft.Office.WebExtension.ValueFormat.Unformatted,
  3489. value: 0
  3490. },{
  3491. name: Microsoft.Office.WebExtension.ValueFormat.Formatted,
  3492. value: 1
  3493. }]
  3494. },{
  3495. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  3496. toHost: [{
  3497. name: Microsoft.Office.WebExtension.FilterType.All,
  3498. value: 0
  3499. }]
  3500. }]);
  3501. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  3502. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  3503. fromHost: [{
  3504. name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,
  3505. value: 0
  3506. },{
  3507. name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed,
  3508. value: 1
  3509. }]
  3510. });
  3511. OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args)
  3512. {
  3513. function toArray(args)
  3514. {
  3515. var arrArgs=args;
  3516. if(OSF.OUtil.isArray(args))
  3517. {
  3518. var len=arrArgs.length;
  3519. for(var i=0; i < len; i++)
  3520. arrArgs[i]=toArray(arrArgs[i])
  3521. }
  3522. else if(OSF.OUtil.isDate(args))
  3523. arrArgs=args.getVarDate();
  3524. else if(typeof args==="object" && !OSF.OUtil.isArray(args))
  3525. {
  3526. arrArgs=[];
  3527. for(var index in args)
  3528. if(!OSF.OUtil.isFunction(args[index]))
  3529. arrArgs[index]=toArray(args[index])
  3530. }
  3531. return arrArgs
  3532. }
  3533. function fromSafeArray(value)
  3534. {
  3535. var ret=value;
  3536. if(value !=null && value.toArray)
  3537. {
  3538. var arrayResult=value.toArray();
  3539. ret=new Array(arrayResult.length);
  3540. for(var i=0; i < arrayResult.length; i++)
  3541. ret[i]=fromSafeArray(arrayResult[i])
  3542. }
  3543. return ret
  3544. }
  3545. try
  3546. {
  3547. if(args.onCalling)
  3548. args.onCalling();
  3549. var startTime=(new Date).getTime();
  3550. OSF.ClientHostController.execute(args.dispId,toArray(args.hostCallArgs),function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs)
  3551. {
  3552. var result=hostResponseArgs.toArray();
  3553. var status=result[OSF.DDA.SafeArray.Response.Status];
  3554. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult)
  3555. {
  3556. var payload=result[OSF.DDA.SafeArray.Response.Payload];
  3557. payload=fromSafeArray(payload);
  3558. if(payload !=null)
  3559. {
  3560. if(!args._chunkResultData)
  3561. args._chunkResultData=new Array;
  3562. args._chunkResultData[payload[0]]=payload[1]
  3563. }
  3564. return false
  3565. }
  3566. if(args.onReceiving)
  3567. args.onReceiving();
  3568. if(args.onComplete)
  3569. {
  3570. var payload;
  3571. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3572. {
  3573. if(result.length > 2)
  3574. {
  3575. payload=[];
  3576. for(var i=1; i < result.length; i++)
  3577. payload[i - 1]=result[i]
  3578. }
  3579. else
  3580. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3581. if(args._chunkResultData)
  3582. {
  3583. payload=fromSafeArray(payload);
  3584. if(payload !=null)
  3585. {
  3586. var expectedChunkCount=payload[payload.length - 1];
  3587. if(args._chunkResultData.length==expectedChunkCount)
  3588. payload[payload.length - 1]=args._chunkResultData;
  3589. else
  3590. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError
  3591. }
  3592. }
  3593. }
  3594. else
  3595. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3596. args.onComplete(status,payload)
  3597. }
  3598. if(OSF.AppTelemetry)
  3599. OSF.AppTelemetry.onMethodDone(args.dispId,args.hostCallArgs,Math.abs((new Date).getTime() - startTime),status);
  3600. return true
  3601. })
  3602. }
  3603. catch(ex)
  3604. {
  3605. OSF.DDA.SafeArray.Delegate._onException(ex,args)
  3606. }
  3607. };
  3608. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args)
  3609. {
  3610. var startTime=(new Date).getTime();
  3611. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs)
  3612. {
  3613. if(args.onReceiving)
  3614. args.onReceiving();
  3615. var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  3616. if(args.onComplete)
  3617. args.onComplete(status);
  3618. if(OSF.AppTelemetry)
  3619. OSF.AppTelemetry.onRegisterDone(register,args.dispId,Math.abs((new Date).getTime() - startTime),status)
  3620. }
  3621. };
  3622. OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args)
  3623. {
  3624. if(args.onCalling)
  3625. args.onCalling();
  3626. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true,args);
  3627. try
  3628. {
  3629. OSF.ClientHostController.registerEvent(args.dispId,args.targetId,function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload)
  3630. {
  3631. if(args.onEvent)
  3632. args.onEvent(payload);
  3633. if(OSF.AppTelemetry)
  3634. OSF.AppTelemetry.onEventDone(args.dispId)
  3635. },callback)
  3636. }
  3637. catch(ex)
  3638. {
  3639. OSF.DDA.SafeArray.Delegate._onException(ex,args)
  3640. }
  3641. };
  3642. OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args)
  3643. {
  3644. if(args.onCalling)
  3645. args.onCalling();
  3646. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false,args);
  3647. try
  3648. {
  3649. OSF.ClientHostController.unregisterEvent(args.dispId,args.targetId,callback)
  3650. }
  3651. catch(ex)
  3652. {
  3653. OSF.DDA.SafeArray.Delegate._onException(ex,args)
  3654. }
  3655. };
  3656. OSF.ClientMode={
  3657. ReadWrite: 0,
  3658. ReadOnly: 1
  3659. };
  3660. OSF.DDA.RichInitializationReason={
  3661. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  3662. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  3663. };
  3664. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade)
  3665. {
  3666. this._hostInfo=hostInfo;
  3667. this._webAppState=webAppState;
  3668. this._context=context;
  3669. this._settings=settings;
  3670. this._hostFacade=hostFacade;
  3671. this._initializeSettings=this.initializeSettings
  3672. };
  3673. OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported)
  3674. {
  3675. var settings;
  3676. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  3677. if(osfSessionStorage)
  3678. {
  3679. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  3680. if(storageSettings)
  3681. serializedSettings=typeof JSON !=="undefined" ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings,true);
  3682. else
  3683. {
  3684. storageSettings=typeof JSON !=="undefined" ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings);
  3685. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),storageSettings)
  3686. }
  3687. }
  3688. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  3689. if(refreshSupported)
  3690. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  3691. else
  3692. settings=new OSF.DDA.Settings(deserializedSettings);
  3693. return settings
  3694. };
  3695. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication(){};
  3696. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext)
  3697. {
  3698. this.prepareApiSurface(appContext);
  3699. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext))
  3700. };
  3701. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext)
  3702. {
  3703. var license=new OSF.DDA.License(appContext.get_eToken());
  3704. var getOfficeThemeHandler=OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme ? OSF.DDA.OfficeTheme.getOfficeTheme : null;
  3705. if(appContext.get_isDialog())
  3706. {
  3707. if(OSF.DDA.UI.ChildUI)
  3708. appContext.ui=new OSF.DDA.UI.ChildUI
  3709. }
  3710. else if(OSF.DDA.UI.ParentUI)
  3711. appContext.ui=new OSF.DDA.UI.ParentUI;
  3712. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext,appContext.doc,license,null,getOfficeThemeHandler));
  3713. var getDelegateMethods,
  3714. parameterMap;
  3715. getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods;
  3716. parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  3717. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods,parameterMap))
  3718. };
  3719. OSF.InitializationHelper.prototype.getInitializationReason=function(appContext)
  3720. {
  3721. return OSF.DDA.RichInitializationReason[appContext.get_reason()]
  3722. };
  3723. OSF.DDA.DispIdHost.getClientDelegateMethods=function(actionId)
  3724. {
  3725. var delegateMethods={};
  3726. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  3727. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  3728. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  3729. delegateMethods[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.SafeArray.Delegate.messageParent;
  3730. if(OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id)
  3731. {
  3732. var readSerializedSettings=function(hostCallArgs, onCalling, onReceiving)
  3733. {
  3734. return OSF.DDA.ClientSettingsManager.read(onCalling,onReceiving)
  3735. };
  3736. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings)
  3737. }
  3738. if(OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id)
  3739. {
  3740. var writeSerializedSettings=function(hostCallArgs, onCalling, onReceiving)
  3741. {
  3742. return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings],hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale],onCalling,onReceiving)
  3743. };
  3744. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings)
  3745. }
  3746. return delegateMethods
  3747. };
  3748. var OSFRichclient;
  3749. (function(OSFRichclient)
  3750. {
  3751. var RichClientHostController=function()
  3752. {
  3753. function RichClientHostController(){}
  3754. RichClientHostController.prototype.execute=function(id, params, callback)
  3755. {
  3756. window.external.Execute(id,params,callback)
  3757. };
  3758. RichClientHostController.prototype.registerEvent=function(id, targetId, handler, callback)
  3759. {
  3760. window.external.RegisterEvent(id,targetId,handler,callback)
  3761. };
  3762. RichClientHostController.prototype.unregisterEvent=function(id, targetId, callback)
  3763. {
  3764. window.external.UnregisterEvent(id,targetId,callback)
  3765. };
  3766. RichClientHostController.prototype.messageParent=function(message)
  3767. {
  3768. window.external.MessageParent(message)
  3769. };
  3770. return RichClientHostController
  3771. }();
  3772. OSFRichclient.RichClientHostController=RichClientHostController
  3773. })(OSFRichclient || (OSFRichclient={}));
  3774. OSF.ClientHostController=new OSFRichclient.RichClientHostController;
  3775. var OfficeExt;
  3776. (function(OfficeExt)
  3777. {
  3778. var OfficeTheme;
  3779. (function(OfficeTheme)
  3780. {
  3781. var OfficeThemeManager=function()
  3782. {
  3783. function OfficeThemeManager()
  3784. {
  3785. this._osfOfficeTheme=null;
  3786. this._osfOfficeThemeTimeStamp=null
  3787. }
  3788. OfficeThemeManager.prototype.getOfficeTheme=function()
  3789. {
  3790. if(OSF.DDA._OsfControlContext)
  3791. {
  3792. if(this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && (new Date).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)
  3793. {
  3794. if(OSF.AppTelemetry)
  3795. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo",0)
  3796. }
  3797. else
  3798. {
  3799. var startTime=(new Date).getTime();
  3800. var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo();
  3801. var endTime=(new Date).getTime();
  3802. if(OSF.AppTelemetry)
  3803. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo",Math.abs(endTime - startTime));
  3804. this._osfOfficeTheme=JSON.parse(osfOfficeTheme);
  3805. for(var color in this._osfOfficeTheme)
  3806. this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]);
  3807. this._osfOfficeThemeTimeStamp=endTime
  3808. }
  3809. return this._osfOfficeTheme
  3810. }
  3811. };
  3812. OfficeThemeManager.instance=function()
  3813. {
  3814. if(OfficeThemeManager._instance==null)
  3815. OfficeThemeManager._instance=new OfficeThemeManager;
  3816. return OfficeThemeManager._instance
  3817. };
  3818. OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5e3;
  3819. OfficeThemeManager._instance=null;
  3820. return OfficeThemeManager
  3821. }();
  3822. OfficeTheme.OfficeThemeManager=OfficeThemeManager;
  3823. OSF.OUtil.setNamespace("OfficeTheme",OSF.DDA);
  3824. OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme
  3825. })(OfficeTheme=OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={}))
  3826. })(OfficeExt || (OfficeExt={}));
  3827. OSF.DDA.ClientSettingsManager={
  3828. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod)
  3829. {
  3830. return function(args)
  3831. {
  3832. var status,
  3833. response;
  3834. try
  3835. {
  3836. response=hostDelegateMethod(args.hostCallArgs,args.onCalling,args.onReceiving);
  3837. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess
  3838. }
  3839. catch(ex)
  3840. {
  3841. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3842. response={
  3843. name: Strings.OfficeOM.L_InternalError,
  3844. message: ex
  3845. }
  3846. }
  3847. if(args.onComplete)
  3848. args.onComplete(status,response)
  3849. }
  3850. },
  3851. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving)
  3852. {
  3853. var keys=[];
  3854. var values=[];
  3855. if(onCalling)
  3856. onCalling();
  3857. OSF.DDA._OsfControlContext.GetSettings().Read(keys,values);
  3858. if(onReceiving)
  3859. onReceiving();
  3860. var serializedSettings={};
  3861. for(var index=0; index < keys.length; index++)
  3862. serializedSettings[keys[index]]=values[index];
  3863. return serializedSettings
  3864. },
  3865. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving)
  3866. {
  3867. var keys=[];
  3868. var values=[];
  3869. for(var key in serializedSettings)
  3870. {
  3871. keys.push(key);
  3872. values.push(serializedSettings[key])
  3873. }
  3874. if(onCalling)
  3875. onCalling();
  3876. OSF.DDA._OsfControlContext.GetSettings().Write(keys,values);
  3877. if(onReceiving)
  3878. onReceiving()
  3879. }
  3880. };
  3881. OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported)
  3882. {
  3883. var serializedSettings=OSF.DDA.ClientSettingsManager.read();
  3884. var settings=this.deserializeSettings(serializedSettings,refreshSupported);
  3885. return settings
  3886. };
  3887. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext)
  3888. {
  3889. var returnedContext;
  3890. var context=OSF.DDA._OsfControlContext=window.external.GetContext();
  3891. var appType=context.GetAppType();
  3892. var appTypeSupported=false;
  3893. for(var appEntry in OSF.AppName)
  3894. if(OSF.AppName[appEntry]==appType)
  3895. {
  3896. appTypeSupported=true;
  3897. break
  3898. }
  3899. if(!appTypeSupported)
  3900. throw"Unsupported client type "+appType;
  3901. var id=context.GetSolutionRef();
  3902. var version=context.GetAppVersionMajor();
  3903. var minorVersion=context.GetAppVersionMinor();
  3904. var UILocale=context.GetAppUILocale();
  3905. var dataLocale=context.GetAppDataLocale();
  3906. var docUrl=context.GetDocUrl();
  3907. var clientMode=context.GetAppCapabilities();
  3908. var reason=context.GetActivationMode();
  3909. var osfControlType=context.GetControlIntegrationLevel();
  3910. var settings=[];
  3911. var eToken;
  3912. try
  3913. {
  3914. eToken=context.GetSolutionToken()
  3915. }
  3916. catch(ex){}
  3917. var correlationId;
  3918. if(typeof context.GetCorrelationId !=="undefined")
  3919. correlationId=context.GetCorrelationId();
  3920. var appInstanceId;
  3921. if(typeof context.GetInstanceId !=="undefined")
  3922. appInstanceId=context.GetInstanceId();
  3923. var touchEnabled;
  3924. if(typeof context.GetTouchEnabled !=="undefined")
  3925. touchEnabled=context.GetTouchEnabled();
  3926. var commerceAllowed;
  3927. if(typeof context.GetCommerceAllowed !=="undefined")
  3928. commerceAllowed=context.GetCommerceAllowed();
  3929. var requirementMatrix;
  3930. if(typeof context.GetSupportedMatrix !=="undefined")
  3931. requirementMatrix=context.GetSupportedMatrix();
  3932. eToken=eToken ? eToken.toString() : "";
  3933. returnedContext=new OSF.OfficeAppContext(id,appType,version,UILocale,dataLocale,docUrl,clientMode,settings,reason,osfControlType,eToken,correlationId,appInstanceId,touchEnabled,commerceAllowed,minorVersion,requirementMatrix);
  3934. if(OSF.AppTelemetry)
  3935. OSF.AppTelemetry.initialize(returnedContext);
  3936. gotAppContext(returnedContext)
  3937. };
  3938. (function()
  3939. {
  3940. var checkScriptOverride=function OSF$checkScriptOverride()
  3941. {
  3942. var postScriptOverrideCheckAction=function OSF$postScriptOverrideCheckAction(customizedScriptPath)
  3943. {
  3944. if(customizedScriptPath)
  3945. OSF.OUtil.loadScript(customizedScriptPath,function()
  3946. {
  3947. OsfMsAjaxFactory.msAjaxDebug.trace("loaded customized script:"+customizedScriptPath)
  3948. })
  3949. };
  3950. var conversationID,
  3951. webAppUrl,
  3952. items;
  3953. var clientEndPoint=null;
  3954. var xdmInfoValue=OSF.OUtil.parseXdmInfo();
  3955. if(xdmInfoValue)
  3956. {
  3957. items=OSF.OUtil.getInfoItems(xdmInfoValue);
  3958. if(items && items.length >=3)
  3959. {
  3960. conversationID=items[0];
  3961. webAppUrl=items[2];
  3962. clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(conversationID,window.parent,webAppUrl)
  3963. }
  3964. }
  3965. var customizedScriptPath=null;
  3966. if(!clientEndPoint)
  3967. {
  3968. try
  3969. {
  3970. if(typeof window.external.getCustomizedScriptPath !=="undefined")
  3971. customizedScriptPath=window.external.getCustomizedScriptPath()
  3972. }
  3973. catch(ex)
  3974. {
  3975. OsfMsAjaxFactory.msAjaxDebug.trace("no script override through window.external.")
  3976. }
  3977. postScriptOverrideCheckAction(customizedScriptPath)
  3978. }
  3979. else
  3980. try
  3981. {
  3982. clientEndPoint.invoke("getCustomizedScriptPathAsync",function OSF$getCustomizedScriptPathAsyncCallback(errorCode, scriptPath)
  3983. {
  3984. postScriptOverrideCheckAction(errorCode===0 ? scriptPath : null)
  3985. },{__timeout__: 1e3})
  3986. }
  3987. catch(ex)
  3988. {
  3989. OsfMsAjaxFactory.msAjaxDebug.trace("no script override through cross frame communication.")
  3990. }
  3991. };
  3992. if(OSF._OfficeAppFactory.getLoadScriptHelper)
  3993. OSF._OfficeAppFactory.getLoadScriptHelper().waitForScripts([OSF.ConstantNames.MicrosoftAjaxId],checkScriptOverride)
  3994. })();
  3995. Microsoft.Office.WebExtension.EventType={};
  3996. OSF.EventDispatch=function OSF_EventDispatch(eventTypes)
  3997. {
  3998. this._eventHandlers={};
  3999. this._queuedEventsArgs={};
  4000. for(var entry in eventTypes)
  4001. {
  4002. var eventType=eventTypes[entry];
  4003. this._eventHandlers[eventType]=[];
  4004. this._queuedEventsArgs[eventType]=[]
  4005. }
  4006. };
  4007. OSF.EventDispatch.prototype={
  4008. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents()
  4009. {
  4010. var events=[];
  4011. for(var eventName in this._eventHandlers)
  4012. events.push(eventName);
  4013. return events
  4014. },
  4015. supportsEvent: function OSF_EventDispatch$supportsEvent(event)
  4016. {
  4017. var isSupported=false;
  4018. for(var eventName in this._eventHandlers)
  4019. if(event==eventName)
  4020. {
  4021. isSupported=true;
  4022. break
  4023. }
  4024. return isSupported
  4025. },
  4026. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler)
  4027. {
  4028. var handlers=this._eventHandlers[eventType];
  4029. if(handlers && handlers.length > 0)
  4030. for(var h in handlers)
  4031. if(handlers[h]===handler)
  4032. return true;
  4033. return false
  4034. },
  4035. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler)
  4036. {
  4037. if(typeof handler !="function")
  4038. return false;
  4039. var handlers=this._eventHandlers[eventType];
  4040. if(handlers && !this.hasEventHandler(eventType,handler))
  4041. {
  4042. handlers.push(handler);
  4043. return true
  4044. }
  4045. else
  4046. return false
  4047. },
  4048. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler)
  4049. {
  4050. var handlers=this._eventHandlers[eventType];
  4051. var isFirstHandler=handlers.length==0;
  4052. var succeed=this.addEventHandler(eventType,handler);
  4053. if(isFirstHandler && succeed)
  4054. this.fireQueuedEvent(eventType);
  4055. return succeed
  4056. },
  4057. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler)
  4058. {
  4059. var handlers=this._eventHandlers[eventType];
  4060. if(handlers && handlers.length > 0)
  4061. for(var index=0; index < handlers.length; index++)
  4062. if(handlers[index]===handler)
  4063. {
  4064. handlers.splice(index,1);
  4065. return true
  4066. }
  4067. return false
  4068. },
  4069. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType)
  4070. {
  4071. if(typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0)
  4072. {
  4073. this._eventHandlers[eventType]=[];
  4074. return true
  4075. }
  4076. return false
  4077. },
  4078. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType)
  4079. {
  4080. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1
  4081. },
  4082. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs)
  4083. {
  4084. if(eventArgs.type==undefined)
  4085. return false;
  4086. var eventType=eventArgs.type;
  4087. if(eventType && this._eventHandlers[eventType])
  4088. {
  4089. var eventHandlers=this._eventHandlers[eventType];
  4090. for(var handler in eventHandlers)
  4091. eventHandlers[handler](eventArgs);
  4092. return true
  4093. }
  4094. else
  4095. return false
  4096. },
  4097. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs)
  4098. {
  4099. var eventType=eventArgs.type;
  4100. if(eventType && this._eventHandlers[eventType])
  4101. {
  4102. var eventHandlers=this._eventHandlers[eventType];
  4103. var queuedEvents=this._queuedEventsArgs[eventType];
  4104. if(eventHandlers.length==0)
  4105. queuedEvents.push(eventArgs);
  4106. else
  4107. this.fireEvent(eventArgs);
  4108. return true
  4109. }
  4110. else
  4111. return false
  4112. },
  4113. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType)
  4114. {
  4115. if(eventType && this._eventHandlers[eventType])
  4116. {
  4117. var eventHandlers=this._eventHandlers[eventType];
  4118. var queuedEvents=this._queuedEventsArgs[eventType];
  4119. if(eventHandlers.length > 0)
  4120. {
  4121. var eventHandler=eventHandlers[0];
  4122. while(queuedEvents.length > 0)
  4123. {
  4124. var eventArgs=queuedEvents.shift();
  4125. eventHandler(eventArgs)
  4126. }
  4127. return true
  4128. }
  4129. }
  4130. return false
  4131. }
  4132. };
  4133. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  4134. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties)
  4135. {
  4136. var args;
  4137. switch(eventType)
  4138. {
  4139. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  4140. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  4141. break;
  4142. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  4143. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties,target.document),eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  4144. break;
  4145. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  4146. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties,target.document));
  4147. break;
  4148. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  4149. args=new OSF.DDA.SettingsChangedEventArgs(target);
  4150. break;
  4151. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  4152. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  4153. break;
  4154. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  4155. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  4156. break;
  4157. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  4158. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  4159. break;
  4160. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  4161. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  4162. break;
  4163. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  4164. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4165. break;
  4166. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  4167. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4168. break;
  4169. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  4170. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4171. break;
  4172. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  4173. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  4174. break;
  4175. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  4176. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  4177. break;
  4178. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  4179. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  4180. break;
  4181. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  4182. args=new OSF.DDA.DialogEventArgs(eventProperties);
  4183. break;
  4184. default:
  4185. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,eventType));
  4186. }
  4187. return args
  4188. };
  4189. OSF.DDA.AsyncMethodNames.addNames({
  4190. AddHandlerAsync: "addHandlerAsync",
  4191. RemoveHandlerAsync: "removeHandlerAsync"
  4192. });
  4193. OSF.DDA.AsyncMethodCalls.define({
  4194. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  4195. requiredArguments: [{
  4196. name: Microsoft.Office.WebExtension.Parameters.EventType,
  4197. "enum": Microsoft.Office.WebExtension.EventType,
  4198. verify: function(eventType, caller, eventDispatch)
  4199. {
  4200. return eventDispatch.supportsEvent(eventType)
  4201. }
  4202. },{
  4203. name: Microsoft.Office.WebExtension.Parameters.Handler,
  4204. types: ["function"]
  4205. }],
  4206. supportedOptions: [],
  4207. privateStateCallbacks: []
  4208. });
  4209. OSF.DDA.AsyncMethodCalls.define({
  4210. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  4211. requiredArguments: [{
  4212. name: Microsoft.Office.WebExtension.Parameters.EventType,
  4213. "enum": Microsoft.Office.WebExtension.EventType,
  4214. verify: function(eventType, caller, eventDispatch)
  4215. {
  4216. return eventDispatch.supportsEvent(eventType)
  4217. }
  4218. }],
  4219. supportedOptions: [{
  4220. name: Microsoft.Office.WebExtension.Parameters.Handler,
  4221. value: {
  4222. types: ["function","object"],
  4223. defaultValue: null
  4224. }
  4225. }],
  4226. privateStateCallbacks: []
  4227. });
  4228. OSF.DDA.SafeArray.Delegate.ParameterMap.define({type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent});
  4229. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DialogMessageReceivedEvent: "DialogMessageReceivedEvent"});
  4230. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{
  4231. DialogMessageReceived: "dialogMessageReceived",
  4232. DialogEventReceived: "dialogEventReceived"
  4233. });
  4234. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{
  4235. MessageType: "messageType",
  4236. MessageContent: "messageContent"
  4237. });
  4238. OSF.DDA.DialogEventType={};
  4239. OSF.OUtil.augmentList(OSF.DDA.DialogEventType,{
  4240. DialogClosed: "dialogClosed",
  4241. NavigationFailed: "naviationFailed"
  4242. });
  4243. OSF.DDA.AsyncMethodNames.addNames({
  4244. DisplayDialogAsync: "displayDialogAsync",
  4245. CloseAsync: "close"
  4246. });
  4247. OSF.DDA.SyncMethodNames.addNames({
  4248. MessageParent: "messageParent",
  4249. AddMessageHandler: "addEventHandler"
  4250. });
  4251. OSF.DDA.UI.ParentUI=function OSF_DDA_ParentUI()
  4252. {
  4253. var eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DialogMessageReceived,Microsoft.Office.WebExtension.EventType.DialogEventReceived]);
  4254. var openDialogName=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  4255. var target=this;
  4256. if(!target[openDialogName])
  4257. OSF.OUtil.defineEnumerableProperty(target,openDialogName,{value: function()
  4258. {
  4259. var openDialog=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  4260. openDialog(arguments,eventDispatch,target)
  4261. }});
  4262. OSF.OUtil.finalizeProperties(this)
  4263. };
  4264. OSF.DDA.UI.ChildUI=function OSF_DDA_ChildUI()
  4265. {
  4266. var messageParentName=OSF.DDA.SyncMethodNames.MessageParent.displayName;
  4267. var target=this;
  4268. if(!target[messageParentName])
  4269. OSF.OUtil.defineEnumerableProperty(target,messageParentName,{value: function()
  4270. {
  4271. var messageParent=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  4272. return messageParent(arguments,target)
  4273. }});
  4274. OSF.OUtil.finalizeProperties(this)
  4275. };
  4276. OSF.DialogHandler=function OSF_DialogHandler(){};
  4277. OSF.DDA.DialogEventArgs=function OSF_DDA_DialogEventArgs(message)
  4278. {
  4279. if(message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived)
  4280. OSF.OUtil.defineEnumerableProperties(this,{
  4281. type: {value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived},
  4282. message: {value: message[OSF.DDA.PropertyDescriptors.MessageContent]}
  4283. });
  4284. else
  4285. OSF.OUtil.defineEnumerableProperties(this,{
  4286. type: {value: Microsoft.Office.WebExtension.EventType.DialogEventReceived},
  4287. error: {value: message[OSF.DDA.PropertyDescriptors.MessageType]}
  4288. })
  4289. };
  4290. OSF.DDA.AsyncMethodCalls.define({
  4291. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  4292. requiredArguments: [{
  4293. name: Microsoft.Office.WebExtension.Parameters.Url,
  4294. types: ["string"]
  4295. }],
  4296. supportedOptions: [{
  4297. name: Microsoft.Office.WebExtension.Parameters.Width,
  4298. value: {
  4299. types: ["number"],
  4300. defaultValue: 99
  4301. }
  4302. },{
  4303. name: Microsoft.Office.WebExtension.Parameters.Height,
  4304. value: {
  4305. types: ["number"],
  4306. defaultValue: 99
  4307. }
  4308. },{
  4309. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  4310. value: {
  4311. types: ["boolean"],
  4312. defaultValue: true
  4313. }
  4314. },{
  4315. name: Microsoft.Office.WebExtension.Parameters.XFrameDenySafe,
  4316. value: {
  4317. types: ["boolean"],
  4318. defaultValue: true
  4319. }
  4320. }],
  4321. privateStateCallbacks: [],
  4322. onSucceeded: function(args, caller, callArgs)
  4323. {
  4324. var targetId=args[Microsoft.Office.WebExtension.Parameters.Id];
  4325. var eventDispatch=args[Microsoft.Office.WebExtension.Parameters.Data];
  4326. var dialog=new OSF.DialogHandler;
  4327. var closeDialog=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  4328. OSF.OUtil.defineEnumerableProperty(dialog,closeDialog,{value: function()
  4329. {
  4330. var closeDialogfunction=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  4331. closeDialogfunction(arguments,targetId,eventDispatch,dialog)
  4332. }});
  4333. var addHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  4334. OSF.OUtil.defineEnumerableProperty(dialog,addHandler,{value: function()
  4335. {
  4336. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  4337. var callArgs=syncMethodCall.verifyAndExtractCall(arguments,dialog,eventDispatch);
  4338. var eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  4339. var handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  4340. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType,handler)
  4341. }});
  4342. return dialog
  4343. },
  4344. checkCallArgs: function(callArgs, caller, stateInfo)
  4345. {
  4346. if(callArgs[Microsoft.Office.WebExtension.Parameters.Width] <=0)
  4347. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=1;
  4348. if(callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100)
  4349. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=99;
  4350. if(callArgs[Microsoft.Office.WebExtension.Parameters.Height] <=0)
  4351. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=1;
  4352. if(callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100)
  4353. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=99;
  4354. return callArgs
  4355. }
  4356. });
  4357. OSF.DDA.AsyncMethodCalls.define({
  4358. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  4359. requiredArguments: [],
  4360. supportedOptions: [],
  4361. privateStateCallbacks: []
  4362. });
  4363. OSF.DDA.SyncMethodCalls.define({
  4364. method: OSF.DDA.SyncMethodNames.MessageParent,
  4365. requiredArguments: [{
  4366. name: Microsoft.Office.WebExtension.Parameters.MessageToParent,
  4367. types: ["string","number","boolean"]
  4368. }],
  4369. supportedOptions: []
  4370. });
  4371. OSF.DDA.SyncMethodCalls.define({
  4372. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  4373. requiredArguments: [{
  4374. name: Microsoft.Office.WebExtension.Parameters.EventType,
  4375. "enum": Microsoft.Office.WebExtension.EventType,
  4376. verify: function(eventType, caller, eventDispatch)
  4377. {
  4378. return eventDispatch.supportsEvent(eventType)
  4379. }
  4380. },{
  4381. name: Microsoft.Office.WebExtension.Parameters.Handler,
  4382. types: ["function"]
  4383. }],
  4384. supportedOptions: []
  4385. });
  4386. OSF.DDA.SafeArray.Delegate.messageParent=function OSF_DDA_SafeArray_Delegate$MessageParent(args)
  4387. {
  4388. try
  4389. {
  4390. if(args.onCalling)
  4391. args.onCalling();
  4392. var startTime=(new Date).getTime();
  4393. var result=OSF.ClientHostController.messageParent(args.hostCallArgs);
  4394. if(args.onReceiving)
  4395. args.onReceiving();
  4396. if(OSF.AppTelemetry)
  4397. OSF.AppTelemetry.onMethodDone(args.dispId,args.hostCallArgs,Math.abs((new Date).getTime() - startTime),result);
  4398. return result
  4399. }
  4400. catch(ex)
  4401. {
  4402. return OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod(ex)
  4403. }
  4404. };
  4405. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4406. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  4407. fromHost: [{
  4408. name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  4409. value: OSF.DDA.SafeArray.Delegate.ParameterMap.self
  4410. }],
  4411. isComplexType: true
  4412. });
  4413. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4414. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  4415. fromHost: [{
  4416. name: OSF.DDA.PropertyDescriptors.MessageType,
  4417. value: 0
  4418. },{
  4419. name: OSF.DDA.PropertyDescriptors.MessageContent,
  4420. value: 1
  4421. }],
  4422. isComplexType: true
  4423. });
  4424. var OSFLog;
  4425. (function(OSFLog)
  4426. {
  4427. var BaseUsageData=function()
  4428. {
  4429. function BaseUsageData(table)
  4430. {
  4431. this._table=table;
  4432. this._fields={}
  4433. }
  4434. Object.defineProperty(BaseUsageData.prototype,"Fields",{
  4435. get: function()
  4436. {
  4437. return this._fields
  4438. },
  4439. enumerable: true,
  4440. configurable: true
  4441. });
  4442. Object.defineProperty(BaseUsageData.prototype,"Table",{
  4443. get: function()
  4444. {
  4445. return this._table
  4446. },
  4447. enumerable: true,
  4448. configurable: true
  4449. });
  4450. BaseUsageData.prototype.SerializeFields=function(){};
  4451. BaseUsageData.prototype.SetSerializedField=function(key, value)
  4452. {
  4453. if(typeof value !=="undefined" && value !==null)
  4454. this._serializedFields[key]=value.toString()
  4455. };
  4456. BaseUsageData.prototype.SerializeRow=function()
  4457. {
  4458. this._serializedFields={};
  4459. this.SetSerializedField("Table",this._table);
  4460. this.SerializeFields();
  4461. return JSON.stringify(this._serializedFields)
  4462. };
  4463. return BaseUsageData
  4464. }();
  4465. OSFLog.BaseUsageData=BaseUsageData;
  4466. var AppActivatedUsageData=function(_super)
  4467. {
  4468. __extends(AppActivatedUsageData,_super);
  4469. function AppActivatedUsageData()
  4470. {
  4471. _super.call(this,"AppActivated")
  4472. }
  4473. Object.defineProperty(AppActivatedUsageData.prototype,"CorrelationId",{
  4474. get: function()
  4475. {
  4476. return this.Fields["CorrelationId"]
  4477. },
  4478. set: function(value)
  4479. {
  4480. this.Fields["CorrelationId"]=value
  4481. },
  4482. enumerable: true,
  4483. configurable: true
  4484. });
  4485. Object.defineProperty(AppActivatedUsageData.prototype,"SessionId",{
  4486. get: function()
  4487. {
  4488. return this.Fields["SessionId"]
  4489. },
  4490. set: function(value)
  4491. {
  4492. this.Fields["SessionId"]=value
  4493. },
  4494. enumerable: true,
  4495. configurable: true
  4496. });
  4497. Object.defineProperty(AppActivatedUsageData.prototype,"AppId",{
  4498. get: function()
  4499. {
  4500. return this.Fields["AppId"]
  4501. },
  4502. set: function(value)
  4503. {
  4504. this.Fields["AppId"]=value
  4505. },
  4506. enumerable: true,
  4507. configurable: true
  4508. });
  4509. Object.defineProperty(AppActivatedUsageData.prototype,"AppInstanceId",{
  4510. get: function()
  4511. {
  4512. return this.Fields["AppInstanceId"]
  4513. },
  4514. set: function(value)
  4515. {
  4516. this.Fields["AppInstanceId"]=value
  4517. },
  4518. enumerable: true,
  4519. configurable: true
  4520. });
  4521. Object.defineProperty(AppActivatedUsageData.prototype,"AppURL",{
  4522. get: function()
  4523. {
  4524. return this.Fields["AppURL"]
  4525. },
  4526. set: function(value)
  4527. {
  4528. this.Fields["AppURL"]=value
  4529. },
  4530. enumerable: true,
  4531. configurable: true
  4532. });
  4533. Object.defineProperty(AppActivatedUsageData.prototype,"AssetId",{
  4534. get: function()
  4535. {
  4536. return this.Fields["AssetId"]
  4537. },
  4538. set: function(value)
  4539. {
  4540. this.Fields["AssetId"]=value
  4541. },
  4542. enumerable: true,
  4543. configurable: true
  4544. });
  4545. Object.defineProperty(AppActivatedUsageData.prototype,"Browser",{
  4546. get: function()
  4547. {
  4548. return this.Fields["Browser"]
  4549. },
  4550. set: function(value)
  4551. {
  4552. this.Fields["Browser"]=value
  4553. },
  4554. enumerable: true,
  4555. configurable: true
  4556. });
  4557. Object.defineProperty(AppActivatedUsageData.prototype,"UserId",{
  4558. get: function()
  4559. {
  4560. return this.Fields["UserId"]
  4561. },
  4562. set: function(value)
  4563. {
  4564. this.Fields["UserId"]=value
  4565. },
  4566. enumerable: true,
  4567. configurable: true
  4568. });
  4569. Object.defineProperty(AppActivatedUsageData.prototype,"Host",{
  4570. get: function()
  4571. {
  4572. return this.Fields["Host"]
  4573. },
  4574. set: function(value)
  4575. {
  4576. this.Fields["Host"]=value
  4577. },
  4578. enumerable: true,
  4579. configurable: true
  4580. });
  4581. Object.defineProperty(AppActivatedUsageData.prototype,"HostVersion",{
  4582. get: function()
  4583. {
  4584. return this.Fields["HostVersion"]
  4585. },
  4586. set: function(value)
  4587. {
  4588. this.Fields["HostVersion"]=value
  4589. },
  4590. enumerable: true,
  4591. configurable: true
  4592. });
  4593. Object.defineProperty(AppActivatedUsageData.prototype,"ClientId",{
  4594. get: function()
  4595. {
  4596. return this.Fields["ClientId"]
  4597. },
  4598. set: function(value)
  4599. {
  4600. this.Fields["ClientId"]=value
  4601. },
  4602. enumerable: true,
  4603. configurable: true
  4604. });
  4605. Object.defineProperty(AppActivatedUsageData.prototype,"AppSizeWidth",{
  4606. get: function()
  4607. {
  4608. return this.Fields["AppSizeWidth"]
  4609. },
  4610. set: function(value)
  4611. {
  4612. this.Fields["AppSizeWidth"]=value
  4613. },
  4614. enumerable: true,
  4615. configurable: true
  4616. });
  4617. Object.defineProperty(AppActivatedUsageData.prototype,"AppSizeHeight",{
  4618. get: function()
  4619. {
  4620. return this.Fields["AppSizeHeight"]
  4621. },
  4622. set: function(value)
  4623. {
  4624. this.Fields["AppSizeHeight"]=value
  4625. },
  4626. enumerable: true,
  4627. configurable: true
  4628. });
  4629. AppActivatedUsageData.prototype.SerializeFields=function()
  4630. {
  4631. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4632. this.SetSerializedField("SessionId",this.SessionId);
  4633. this.SetSerializedField("AppId",this.AppId);
  4634. this.SetSerializedField("AppInstanceId",this.AppInstanceId);
  4635. this.SetSerializedField("AppURL",this.AppURL);
  4636. this.SetSerializedField("AssetId",this.AssetId);
  4637. this.SetSerializedField("Browser",this.Browser);
  4638. this.SetSerializedField("UserId",this.UserId);
  4639. this.SetSerializedField("Host",this.Host);
  4640. this.SetSerializedField("HostVersion",this.HostVersion);
  4641. this.SetSerializedField("ClientId",this.ClientId);
  4642. this.SetSerializedField("AppSizeWidth",this.AppSizeWidth);
  4643. this.SetSerializedField("AppSizeHeight",this.AppSizeHeight)
  4644. };
  4645. return AppActivatedUsageData
  4646. }(BaseUsageData);
  4647. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  4648. var ScriptLoadUsageData=function(_super)
  4649. {
  4650. __extends(ScriptLoadUsageData,_super);
  4651. function ScriptLoadUsageData()
  4652. {
  4653. _super.call(this,"ScriptLoad")
  4654. }
  4655. Object.defineProperty(ScriptLoadUsageData.prototype,"CorrelationId",{
  4656. get: function()
  4657. {
  4658. return this.Fields["CorrelationId"]
  4659. },
  4660. set: function(value)
  4661. {
  4662. this.Fields["CorrelationId"]=value
  4663. },
  4664. enumerable: true,
  4665. configurable: true
  4666. });
  4667. Object.defineProperty(ScriptLoadUsageData.prototype,"SessionId",{
  4668. get: function()
  4669. {
  4670. return this.Fields["SessionId"]
  4671. },
  4672. set: function(value)
  4673. {
  4674. this.Fields["SessionId"]=value
  4675. },
  4676. enumerable: true,
  4677. configurable: true
  4678. });
  4679. Object.defineProperty(ScriptLoadUsageData.prototype,"ScriptId",{
  4680. get: function()
  4681. {
  4682. return this.Fields["ScriptId"]
  4683. },
  4684. set: function(value)
  4685. {
  4686. this.Fields["ScriptId"]=value
  4687. },
  4688. enumerable: true,
  4689. configurable: true
  4690. });
  4691. Object.defineProperty(ScriptLoadUsageData.prototype,"StartTime",{
  4692. get: function()
  4693. {
  4694. return this.Fields["StartTime"]
  4695. },
  4696. set: function(value)
  4697. {
  4698. this.Fields["StartTime"]=value
  4699. },
  4700. enumerable: true,
  4701. configurable: true
  4702. });
  4703. Object.defineProperty(ScriptLoadUsageData.prototype,"ResponseTime",{
  4704. get: function()
  4705. {
  4706. return this.Fields["ResponseTime"]
  4707. },
  4708. set: function(value)
  4709. {
  4710. this.Fields["ResponseTime"]=value
  4711. },
  4712. enumerable: true,
  4713. configurable: true
  4714. });
  4715. ScriptLoadUsageData.prototype.SerializeFields=function()
  4716. {
  4717. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4718. this.SetSerializedField("SessionId",this.SessionId);
  4719. this.SetSerializedField("ScriptId",this.ScriptId);
  4720. this.SetSerializedField("StartTime",this.StartTime);
  4721. this.SetSerializedField("ResponseTime",this.ResponseTime)
  4722. };
  4723. return ScriptLoadUsageData
  4724. }(BaseUsageData);
  4725. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  4726. var AppClosedUsageData=function(_super)
  4727. {
  4728. __extends(AppClosedUsageData,_super);
  4729. function AppClosedUsageData()
  4730. {
  4731. _super.call(this,"AppClosed")
  4732. }
  4733. Object.defineProperty(AppClosedUsageData.prototype,"CorrelationId",{
  4734. get: function()
  4735. {
  4736. return this.Fields["CorrelationId"]
  4737. },
  4738. set: function(value)
  4739. {
  4740. this.Fields["CorrelationId"]=value
  4741. },
  4742. enumerable: true,
  4743. configurable: true
  4744. });
  4745. Object.defineProperty(AppClosedUsageData.prototype,"SessionId",{
  4746. get: function()
  4747. {
  4748. return this.Fields["SessionId"]
  4749. },
  4750. set: function(value)
  4751. {
  4752. this.Fields["SessionId"]=value
  4753. },
  4754. enumerable: true,
  4755. configurable: true
  4756. });
  4757. Object.defineProperty(AppClosedUsageData.prototype,"FocusTime",{
  4758. get: function()
  4759. {
  4760. return this.Fields["FocusTime"]
  4761. },
  4762. set: function(value)
  4763. {
  4764. this.Fields["FocusTime"]=value
  4765. },
  4766. enumerable: true,
  4767. configurable: true
  4768. });
  4769. Object.defineProperty(AppClosedUsageData.prototype,"AppSizeFinalWidth",{
  4770. get: function()
  4771. {
  4772. return this.Fields["AppSizeFinalWidth"]
  4773. },
  4774. set: function(value)
  4775. {
  4776. this.Fields["AppSizeFinalWidth"]=value
  4777. },
  4778. enumerable: true,
  4779. configurable: true
  4780. });
  4781. Object.defineProperty(AppClosedUsageData.prototype,"AppSizeFinalHeight",{
  4782. get: function()
  4783. {
  4784. return this.Fields["AppSizeFinalHeight"]
  4785. },
  4786. set: function(value)
  4787. {
  4788. this.Fields["AppSizeFinalHeight"]=value
  4789. },
  4790. enumerable: true,
  4791. configurable: true
  4792. });
  4793. Object.defineProperty(AppClosedUsageData.prototype,"OpenTime",{
  4794. get: function()
  4795. {
  4796. return this.Fields["OpenTime"]
  4797. },
  4798. set: function(value)
  4799. {
  4800. this.Fields["OpenTime"]=value
  4801. },
  4802. enumerable: true,
  4803. configurable: true
  4804. });
  4805. Object.defineProperty(AppClosedUsageData.prototype,"CloseMethod",{
  4806. get: function()
  4807. {
  4808. return this.Fields["CloseMethod"]
  4809. },
  4810. set: function(value)
  4811. {
  4812. this.Fields["CloseMethod"]=value
  4813. },
  4814. enumerable: true,
  4815. configurable: true
  4816. });
  4817. AppClosedUsageData.prototype.SerializeFields=function()
  4818. {
  4819. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4820. this.SetSerializedField("SessionId",this.SessionId);
  4821. this.SetSerializedField("FocusTime",this.FocusTime);
  4822. this.SetSerializedField("AppSizeFinalWidth",this.AppSizeFinalWidth);
  4823. this.SetSerializedField("AppSizeFinalHeight",this.AppSizeFinalHeight);
  4824. this.SetSerializedField("OpenTime",this.OpenTime);
  4825. this.SetSerializedField("CloseMethod",this.CloseMethod)
  4826. };
  4827. return AppClosedUsageData
  4828. }(BaseUsageData);
  4829. OSFLog.AppClosedUsageData=AppClosedUsageData;
  4830. var APIUsageUsageData=function(_super)
  4831. {
  4832. __extends(APIUsageUsageData,_super);
  4833. function APIUsageUsageData()
  4834. {
  4835. _super.call(this,"APIUsage")
  4836. }
  4837. Object.defineProperty(APIUsageUsageData.prototype,"CorrelationId",{
  4838. get: function()
  4839. {
  4840. return this.Fields["CorrelationId"]
  4841. },
  4842. set: function(value)
  4843. {
  4844. this.Fields["CorrelationId"]=value
  4845. },
  4846. enumerable: true,
  4847. configurable: true
  4848. });
  4849. Object.defineProperty(APIUsageUsageData.prototype,"SessionId",{
  4850. get: function()
  4851. {
  4852. return this.Fields["SessionId"]
  4853. },
  4854. set: function(value)
  4855. {
  4856. this.Fields["SessionId"]=value
  4857. },
  4858. enumerable: true,
  4859. configurable: true
  4860. });
  4861. Object.defineProperty(APIUsageUsageData.prototype,"APIType",{
  4862. get: function()
  4863. {
  4864. return this.Fields["APIType"]
  4865. },
  4866. set: function(value)
  4867. {
  4868. this.Fields["APIType"]=value
  4869. },
  4870. enumerable: true,
  4871. configurable: true
  4872. });
  4873. Object.defineProperty(APIUsageUsageData.prototype,"APIID",{
  4874. get: function()
  4875. {
  4876. return this.Fields["APIID"]
  4877. },
  4878. set: function(value)
  4879. {
  4880. this.Fields["APIID"]=value
  4881. },
  4882. enumerable: true,
  4883. configurable: true
  4884. });
  4885. Object.defineProperty(APIUsageUsageData.prototype,"Parameters",{
  4886. get: function()
  4887. {
  4888. return this.Fields["Parameters"]
  4889. },
  4890. set: function(value)
  4891. {
  4892. this.Fields["Parameters"]=value
  4893. },
  4894. enumerable: true,
  4895. configurable: true
  4896. });
  4897. Object.defineProperty(APIUsageUsageData.prototype,"ResponseTime",{
  4898. get: function()
  4899. {
  4900. return this.Fields["ResponseTime"]
  4901. },
  4902. set: function(value)
  4903. {
  4904. this.Fields["ResponseTime"]=value
  4905. },
  4906. enumerable: true,
  4907. configurable: true
  4908. });
  4909. Object.defineProperty(APIUsageUsageData.prototype,"ErrorType",{
  4910. get: function()
  4911. {
  4912. return this.Fields["ErrorType"]
  4913. },
  4914. set: function(value)
  4915. {
  4916. this.Fields["ErrorType"]=value
  4917. },
  4918. enumerable: true,
  4919. configurable: true
  4920. });
  4921. APIUsageUsageData.prototype.SerializeFields=function()
  4922. {
  4923. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4924. this.SetSerializedField("SessionId",this.SessionId);
  4925. this.SetSerializedField("APIType",this.APIType);
  4926. this.SetSerializedField("APIID",this.APIID);
  4927. this.SetSerializedField("Parameters",this.Parameters);
  4928. this.SetSerializedField("ResponseTime",this.ResponseTime);
  4929. this.SetSerializedField("ErrorType",this.ErrorType)
  4930. };
  4931. return APIUsageUsageData
  4932. }(BaseUsageData);
  4933. OSFLog.APIUsageUsageData=APIUsageUsageData;
  4934. var AppInitializationUsageData=function(_super)
  4935. {
  4936. __extends(AppInitializationUsageData,_super);
  4937. function AppInitializationUsageData()
  4938. {
  4939. _super.call(this,"AppInitialization")
  4940. }
  4941. Object.defineProperty(AppInitializationUsageData.prototype,"CorrelationId",{
  4942. get: function()
  4943. {
  4944. return this.Fields["CorrelationId"]
  4945. },
  4946. set: function(value)
  4947. {
  4948. this.Fields["CorrelationId"]=value
  4949. },
  4950. enumerable: true,
  4951. configurable: true
  4952. });
  4953. Object.defineProperty(AppInitializationUsageData.prototype,"SessionId",{
  4954. get: function()
  4955. {
  4956. return this.Fields["SessionId"]
  4957. },
  4958. set: function(value)
  4959. {
  4960. this.Fields["SessionId"]=value
  4961. },
  4962. enumerable: true,
  4963. configurable: true
  4964. });
  4965. Object.defineProperty(AppInitializationUsageData.prototype,"SuccessCode",{
  4966. get: function()
  4967. {
  4968. return this.Fields["SuccessCode"]
  4969. },
  4970. set: function(value)
  4971. {
  4972. this.Fields["SuccessCode"]=value
  4973. },
  4974. enumerable: true,
  4975. configurable: true
  4976. });
  4977. Object.defineProperty(AppInitializationUsageData.prototype,"Message",{
  4978. get: function()
  4979. {
  4980. return this.Fields["Message"]
  4981. },
  4982. set: function(value)
  4983. {
  4984. this.Fields["Message"]=value
  4985. },
  4986. enumerable: true,
  4987. configurable: true
  4988. });
  4989. AppInitializationUsageData.prototype.SerializeFields=function()
  4990. {
  4991. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4992. this.SetSerializedField("SessionId",this.SessionId);
  4993. this.SetSerializedField("SuccessCode",this.SuccessCode);
  4994. this.SetSerializedField("Message",this.Message)
  4995. };
  4996. return AppInitializationUsageData
  4997. }(BaseUsageData);
  4998. OSFLog.AppInitializationUsageData=AppInitializationUsageData
  4999. })(OSFLog || (OSFLog={}));
  5000. var Logger;
  5001. (function(Logger)
  5002. {
  5003. "use strict";
  5004. (function(TraceLevel)
  5005. {
  5006. TraceLevel[TraceLevel["info"]=0]="info";
  5007. TraceLevel[TraceLevel["warning"]=1]="warning";
  5008. TraceLevel[TraceLevel["error"]=2]="error"
  5009. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  5010. var TraceLevel=Logger.TraceLevel;
  5011. (function(SendFlag)
  5012. {
  5013. SendFlag[SendFlag["none"]=0]="none";
  5014. SendFlag[SendFlag["flush"]=1]="flush"
  5015. })(Logger.SendFlag || (Logger.SendFlag={}));
  5016. var SendFlag=Logger.SendFlag;
  5017. function allowUploadingData()
  5018. {
  5019. if(OSF.Logger && OSF.Logger.ulsEndpoint)
  5020. OSF.Logger.ulsEndpoint.loadProxyFrame()
  5021. }
  5022. Logger.allowUploadingData=allowUploadingData;
  5023. function sendLog(traceLevel, message, flag)
  5024. {
  5025. if(OSF.Logger && OSF.Logger.ulsEndpoint)
  5026. {
  5027. var jsonObj={
  5028. traceLevel: traceLevel,
  5029. message: message,
  5030. flag: flag,
  5031. internalLog: true
  5032. };
  5033. var logs=JSON.stringify(jsonObj);
  5034. OSF.Logger.ulsEndpoint.writeLog(logs)
  5035. }
  5036. }
  5037. Logger.sendLog=sendLog;
  5038. function creatULSEndpoint()
  5039. {
  5040. try
  5041. {
  5042. return new ULSEndpointProxy
  5043. }
  5044. catch(e)
  5045. {
  5046. return null
  5047. }
  5048. }
  5049. var ULSEndpointProxy=function()
  5050. {
  5051. function ULSEndpointProxy()
  5052. {
  5053. var _this=this;
  5054. this.proxyFrame=null;
  5055. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  5056. this.buffer=[];
  5057. this.proxyFrameReady=false;
  5058. OSF.OUtil.addEventListener(window,"message",function(e)
  5059. {
  5060. return _this.tellProxyFrameReady(e)
  5061. });
  5062. setTimeout(function()
  5063. {
  5064. _this.loadProxyFrame()
  5065. },3e3)
  5066. }
  5067. ULSEndpointProxy.prototype.writeLog=function(log)
  5068. {
  5069. if(this.proxyFrameReady===true)
  5070. this.proxyFrame.contentWindow.postMessage(log,"*");
  5071. else if(this.buffer.length < 128)
  5072. this.buffer.push(log)
  5073. };
  5074. ULSEndpointProxy.prototype.loadProxyFrame=function()
  5075. {
  5076. if(this.proxyFrame==null)
  5077. {
  5078. this.proxyFrame=document.createElement("iframe");
  5079. this.proxyFrame.setAttribute("style","display:none");
  5080. this.proxyFrame.setAttribute("src",this.telemetryEndPoint);
  5081. document.head.appendChild(this.proxyFrame)
  5082. }
  5083. };
  5084. ULSEndpointProxy.prototype.tellProxyFrameReady=function(e)
  5085. {
  5086. var _this=this;
  5087. if(e.data==="ProxyFrameReadyToLog")
  5088. {
  5089. this.proxyFrameReady=true;
  5090. for(var i=0; i < this.buffer.length; i++)
  5091. this.writeLog(this.buffer[i]);
  5092. this.buffer.length=0;
  5093. OSF.OUtil.removeEventListener(window,"message",function(e)
  5094. {
  5095. return _this.tellProxyFrameReady(e)
  5096. })
  5097. }
  5098. else if(e.data==="ProxyFrameReadyToInit")
  5099. {
  5100. var initJson={
  5101. appName: "Office APPs",
  5102. sessionId: OSF.OUtil.Guid.generateNewGuid()
  5103. };
  5104. var initStr=JSON.stringify(initJson);
  5105. this.proxyFrame.contentWindow.postMessage(initStr,"*")
  5106. }
  5107. };
  5108. return ULSEndpointProxy
  5109. }();
  5110. if(!OSF.Logger)
  5111. OSF.Logger=Logger;
  5112. Logger.ulsEndpoint=creatULSEndpoint()
  5113. })(Logger || (Logger={}));
  5114. var OSFAppTelemetry;
  5115. (function(OSFAppTelemetry)
  5116. {
  5117. "use strict";
  5118. var appInfo;
  5119. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  5120. var osfControlAppCorrelationId="";
  5121. var AppInfo=function()
  5122. {
  5123. function AppInfo(){}
  5124. return AppInfo
  5125. }();
  5126. var Event=function()
  5127. {
  5128. function Event(name, handler)
  5129. {
  5130. this.name=name;
  5131. this.handler=handler
  5132. }
  5133. return Event
  5134. }();
  5135. var AppStorage=function()
  5136. {
  5137. function AppStorage()
  5138. {
  5139. this.clientIDKey="Office API client";
  5140. this.logIdSetKey="Office App Log Id Set"
  5141. }
  5142. AppStorage.prototype.getClientId=function()
  5143. {
  5144. var clientId=this.getValue(this.clientIDKey);
  5145. if(!clientId || clientId.length <=0 || clientId.length > 40)
  5146. {
  5147. clientId=OSF.OUtil.Guid.generateNewGuid();
  5148. this.setValue(this.clientIDKey,clientId)
  5149. }
  5150. return clientId
  5151. };
  5152. AppStorage.prototype.saveLog=function(logId, log)
  5153. {
  5154. var logIdSet=this.getValue(this.logIdSetKey);
  5155. logIdSet=(logIdSet && logIdSet.length > 0 ? logIdSet+";" : "")+logId;
  5156. this.setValue(this.logIdSetKey,logIdSet);
  5157. this.setValue(logId,log)
  5158. };
  5159. AppStorage.prototype.enumerateLog=function(callback, clean)
  5160. {
  5161. var logIdSet=this.getValue(this.logIdSetKey);
  5162. if(logIdSet)
  5163. {
  5164. var ids=logIdSet.split(";");
  5165. for(var id in ids)
  5166. {
  5167. var logId=ids[id];
  5168. var log=this.getValue(logId);
  5169. if(log)
  5170. {
  5171. if(callback)
  5172. callback(logId,log);
  5173. if(clean)
  5174. this.remove(logId)
  5175. }
  5176. }
  5177. if(clean)
  5178. this.remove(this.logIdSetKey)
  5179. }
  5180. };
  5181. AppStorage.prototype.getValue=function(key)
  5182. {
  5183. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5184. var value="";
  5185. if(osfLocalStorage)
  5186. value=osfLocalStorage.getItem(key);
  5187. return value
  5188. };
  5189. AppStorage.prototype.setValue=function(key, value)
  5190. {
  5191. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5192. if(osfLocalStorage)
  5193. osfLocalStorage.setItem(key,value)
  5194. };
  5195. AppStorage.prototype.remove=function(key)
  5196. {
  5197. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5198. if(osfLocalStorage)
  5199. try
  5200. {
  5201. osfLocalStorage.removeItem(key)
  5202. }
  5203. catch(ex){}
  5204. };
  5205. return AppStorage
  5206. }();
  5207. var AppLogger=function()
  5208. {
  5209. function AppLogger(){}
  5210. AppLogger.prototype.LogData=function(data)
  5211. {
  5212. if(!OSF.Logger)
  5213. return;
  5214. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,data.SerializeRow(),OSF.Logger.SendFlag.none)
  5215. };
  5216. AppLogger.prototype.LogRawData=function(log)
  5217. {
  5218. if(!OSF.Logger)
  5219. return;
  5220. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,log,OSF.Logger.SendFlag.none)
  5221. };
  5222. return AppLogger
  5223. }();
  5224. function initialize(context)
  5225. {
  5226. if(!OSF.Logger)
  5227. return;
  5228. if(appInfo)
  5229. return;
  5230. appInfo=new AppInfo;
  5231. appInfo.hostVersion=context.get_appVersion();
  5232. appInfo.appId=context.get_id();
  5233. appInfo.host=context.get_appName();
  5234. appInfo.browser=window.navigator.userAgent;
  5235. appInfo.correlationId=context.get_correlationId();
  5236. appInfo.clientId=(new AppStorage).getClientId();
  5237. appInfo.appInstanceId=context.get_appInstanceId();
  5238. if(appInfo.appInstanceId)
  5239. appInfo.appInstanceId=appInfo.appInstanceId.replace(/[{}]/g,"").toLowerCase();
  5240. var index=location.href.indexOf("?");
  5241. appInfo.appURL=index==-1 ? location.href : location.href.substring(0,index);
  5242. (function getUserIdAndAssetIdFromToken(token, appInfo)
  5243. {
  5244. var xmlContent;
  5245. var parser;
  5246. var xmlDoc;
  5247. appInfo.assetId="";
  5248. appInfo.userId="";
  5249. try
  5250. {
  5251. xmlContent=decodeURIComponent(token);
  5252. parser=new DOMParser;
  5253. xmlDoc=parser.parseFromString(xmlContent,"text/xml");
  5254. appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;
  5255. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue
  5256. }
  5257. catch(e){}
  5258. finally
  5259. {
  5260. xmlContent=null;
  5261. xmlDoc=null;
  5262. parser=null
  5263. }
  5264. })(context.get_eToken(),appInfo);
  5265. (function handleLifecycle()
  5266. {
  5267. var startTime=new Date;
  5268. var lastFocus=null;
  5269. var focusTime=0;
  5270. var finished=false;
  5271. var adjustFocusTime=function()
  5272. {
  5273. if(document.hasFocus())
  5274. {
  5275. if(lastFocus==null)
  5276. lastFocus=new Date
  5277. }
  5278. else if(lastFocus)
  5279. {
  5280. focusTime+=Math.abs((new Date).getTime() - lastFocus.getTime());
  5281. lastFocus=null
  5282. }
  5283. };
  5284. var eventList=[];
  5285. eventList.push(new Event("focus",adjustFocusTime));
  5286. eventList.push(new Event("blur",adjustFocusTime));
  5287. eventList.push(new Event("focusout",adjustFocusTime));
  5288. eventList.push(new Event("focusin",adjustFocusTime));
  5289. var exitFunction=function()
  5290. {
  5291. for(var i=0; i < eventList.length; i++)
  5292. OSF.OUtil.removeEventListener(window,eventList[i].name,eventList[i].handler);
  5293. eventList.length=0;
  5294. if(!finished)
  5295. {
  5296. if(document.hasFocus() && lastFocus)
  5297. {
  5298. focusTime+=Math.abs((new Date).getTime() - lastFocus.getTime());
  5299. lastFocus=null
  5300. }
  5301. OSFAppTelemetry.onAppClosed(Math.abs((new Date).getTime() - startTime.getTime()),focusTime);
  5302. finished=true
  5303. }
  5304. };
  5305. eventList.push(new Event("beforeunload",exitFunction));
  5306. eventList.push(new Event("unload",exitFunction));
  5307. for(var i=0; i < eventList.length; i++)
  5308. OSF.OUtil.addEventListener(window,eventList[i].name,eventList[i].handler);
  5309. adjustFocusTime()
  5310. })();
  5311. OSFAppTelemetry.onAppActivated()
  5312. }
  5313. OSFAppTelemetry.initialize=initialize;
  5314. function onAppActivated()
  5315. {
  5316. if(!appInfo)
  5317. return;
  5318. (new AppStorage).enumerateLog(function(id, log)
  5319. {
  5320. return(new AppLogger).LogRawData(log)
  5321. },true);
  5322. var data=new OSFLog.AppActivatedUsageData;
  5323. data.SessionId=sessionId;
  5324. data.AppId=appInfo.appId;
  5325. data.AssetId=appInfo.assetId;
  5326. data.AppURL=appInfo.appURL;
  5327. data.UserId=appInfo.userId;
  5328. data.ClientId=appInfo.clientId;
  5329. data.Browser=appInfo.browser;
  5330. data.Host=appInfo.host;
  5331. data.HostVersion=appInfo.hostVersion;
  5332. data.CorrelationId=appInfo.correlationId;
  5333. data.AppSizeWidth=window.innerWidth;
  5334. data.AppSizeHeight=window.innerHeight;
  5335. data.AppInstanceId=appInfo.appInstanceId;
  5336. (new AppLogger).LogData(data);
  5337. setTimeout(function()
  5338. {
  5339. if(!OSF.Logger)
  5340. return;
  5341. OSF.Logger.allowUploadingData()
  5342. },100)
  5343. }
  5344. OSFAppTelemetry.onAppActivated=onAppActivated;
  5345. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId)
  5346. {
  5347. var data=new OSFLog.ScriptLoadUsageData;
  5348. data.CorrelationId=appCorrelationId;
  5349. data.SessionId=sessionId;
  5350. data.ScriptId=scriptId;
  5351. data.StartTime=msStartTime;
  5352. data.ResponseTime=msResponseTime;
  5353. (new AppLogger).LogData(data)
  5354. }
  5355. OSFAppTelemetry.onScriptDone=onScriptDone;
  5356. function onCallDone(apiType, id, parameters, msResponseTime, errorType)
  5357. {
  5358. if(!appInfo)
  5359. return;
  5360. var data=new OSFLog.APIUsageUsageData;
  5361. data.CorrelationId=osfControlAppCorrelationId;
  5362. data.SessionId=sessionId;
  5363. data.APIType=apiType;
  5364. data.APIID=id;
  5365. data.Parameters=parameters;
  5366. data.ResponseTime=msResponseTime;
  5367. data.ErrorType=errorType;
  5368. (new AppLogger).LogData(data)
  5369. }
  5370. OSFAppTelemetry.onCallDone=onCallDone;
  5371. function onMethodDone(id, args, msResponseTime, errorType)
  5372. {
  5373. var parameters=null;
  5374. if(args)
  5375. if(typeof args=="number")
  5376. parameters=String(args);
  5377. else if(typeof args==="object")
  5378. for(var index in args)
  5379. {
  5380. if(parameters !==null)
  5381. parameters+=",";
  5382. else
  5383. parameters="";
  5384. if(typeof args[index]=="number")
  5385. parameters+=String(args[index])
  5386. }
  5387. else
  5388. parameters="";
  5389. OSF.AppTelemetry.onCallDone("method",id,parameters,msResponseTime,errorType)
  5390. }
  5391. OSFAppTelemetry.onMethodDone=onMethodDone;
  5392. function onPropertyDone(propertyName, msResponseTime)
  5393. {
  5394. OSF.AppTelemetry.onCallDone("property",-1,propertyName,msResponseTime)
  5395. }
  5396. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  5397. function onEventDone(id, errorType)
  5398. {
  5399. OSF.AppTelemetry.onCallDone("event",id,null,0,errorType)
  5400. }
  5401. OSFAppTelemetry.onEventDone=onEventDone;
  5402. function onRegisterDone(register, id, msResponseTime, errorType)
  5403. {
  5404. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent",id,null,msResponseTime,errorType)
  5405. }
  5406. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  5407. function onAppClosed(openTime, focusTime)
  5408. {
  5409. if(!appInfo)
  5410. return;
  5411. var data=new OSFLog.AppClosedUsageData;
  5412. data.CorrelationId=osfControlAppCorrelationId;
  5413. data.SessionId=sessionId;
  5414. data.FocusTime=focusTime;
  5415. data.OpenTime=openTime;
  5416. data.AppSizeFinalWidth=window.innerWidth;
  5417. data.AppSizeFinalHeight=window.innerHeight;
  5418. (new AppStorage).saveLog(sessionId,data.SerializeRow())
  5419. }
  5420. OSFAppTelemetry.onAppClosed=onAppClosed;
  5421. function setOsfControlAppCorrelationId(correlationId)
  5422. {
  5423. osfControlAppCorrelationId=correlationId
  5424. }
  5425. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  5426. function doAppInitializationLogging(isException, message)
  5427. {
  5428. var data=new OSFLog.AppInitializationUsageData;
  5429. data.CorrelationId=osfControlAppCorrelationId;
  5430. data.SessionId=sessionId;
  5431. data.SuccessCode=isException ? 1 : 0;
  5432. data.Message=message;
  5433. (new AppLogger).LogData(data)
  5434. }
  5435. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  5436. function logAppCommonMessage(message)
  5437. {
  5438. doAppInitializationLogging(false,message)
  5439. }
  5440. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  5441. function logAppException(errorMessage)
  5442. {
  5443. doAppInitializationLogging(true,errorMessage)
  5444. }
  5445. OSFAppTelemetry.logAppException=logAppException;
  5446. OSF.AppTelemetry=OSFAppTelemetry
  5447. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  5448. var OfficeExt;
  5449. (function(OfficeExt)
  5450. {
  5451. var AppCommand;
  5452. (function(AppCommand)
  5453. {
  5454. var AppCommandManager=function()
  5455. {
  5456. function AppCommandManager()
  5457. {
  5458. var _this=this;
  5459. this._pseudoDocument=null;
  5460. this._eventDispatch=null;
  5461. this._processAppCommandInvocation=function(args)
  5462. {
  5463. var verifyResult=_this._verifyManifestCallback(args.callbackName);
  5464. if(verifyResult.errorCode !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  5465. {
  5466. _this._invokeAppCommandCompletedMethod(args.appCommandId,verifyResult.errorCode,"");
  5467. return
  5468. }
  5469. var eventObj=_this._constructEventObjectForCallback(args);
  5470. if(eventObj)
  5471. window.setTimeout(function()
  5472. {
  5473. verifyResult.callback(eventObj)
  5474. },0);
  5475. else
  5476. _this._invokeAppCommandCompletedMethod(args.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,"")
  5477. }
  5478. }
  5479. AppCommandManager.initializeOsfDda=function()
  5480. {
  5481. OSF.DDA.AsyncMethodNames.addNames({AppCommandInvocationCompletedAsync: "appCommandInvocationCompletedAsync"});
  5482. OSF.DDA.AsyncMethodCalls.define({
  5483. method: OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,
  5484. requiredArguments: [{
  5485. name: Microsoft.Office.WebExtension.Parameters.Id,
  5486. types: ["string"]
  5487. },{
  5488. name: Microsoft.Office.WebExtension.Parameters.Status,
  5489. types: ["number"]
  5490. },{
  5491. name: Microsoft.Office.WebExtension.Parameters.Data,
  5492. types: ["string"]
  5493. }]
  5494. });
  5495. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{AppCommandInvokedEvent: "AppCommandInvokedEvent"});
  5496. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{AppCommandInvoked: "appCommandInvoked"});
  5497. OSF.OUtil.setNamespace("AppCommand",OSF.DDA);
  5498. OSF.DDA.AppCommand.AppCommandInvokedEventArgs=OfficeExt.AppCommand.AppCommandInvokedEventArgs
  5499. };
  5500. AppCommandManager.prototype.initializeAndChangeOnce=function(callback)
  5501. {
  5502. AppCommand.registerDdaFacade();
  5503. this._pseudoDocument={};
  5504. OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument,[OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,]);
  5505. this._eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.AppCommandInvoked,]);
  5506. var onRegisterCompleted=function(result)
  5507. {
  5508. if(callback)
  5509. if(result.status=="succeeded")
  5510. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  5511. else
  5512. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError)
  5513. };
  5514. OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument,this._eventDispatch);
  5515. this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked,this._processAppCommandInvocation,onRegisterCompleted)
  5516. };
  5517. AppCommandManager.prototype._verifyManifestCallback=function(callbackName)
  5518. {
  5519. var defaultResult={
  5520. callback: null,
  5521. errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback
  5522. };
  5523. callbackName=callbackName.trim();
  5524. try
  5525. {
  5526. var callList=callbackName.split(".");
  5527. var parentObject=window;
  5528. for(var i=0; i < callList.length - 1; i++)
  5529. if(parentObject[callList[i]] && typeof parentObject[callList[i]]=="object")
  5530. parentObject=parentObject[callList[i]];
  5531. else
  5532. return defaultResult;
  5533. var callbackFunc=parentObject[callList[callList.length - 1]];
  5534. if(typeof callbackFunc !="function")
  5535. return defaultResult
  5536. }
  5537. catch(e)
  5538. {
  5539. return defaultResult
  5540. }
  5541. return{
  5542. callback: callbackFunc,
  5543. errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess
  5544. }
  5545. };
  5546. AppCommandManager.prototype._invokeAppCommandCompletedMethod=function(appCommandId, resultCode, data)
  5547. {
  5548. this._pseudoDocument.appCommandInvocationCompletedAsync(appCommandId,resultCode,data)
  5549. };
  5550. AppCommandManager.prototype._constructEventObjectForCallback=function(args)
  5551. {
  5552. var _this=this;
  5553. var eventObj=new AppCommandCallbackEventArgs;
  5554. try
  5555. {
  5556. var jsonData=JSON.parse(args.eventObjStr);
  5557. this._translateEventObjectInternal(jsonData,eventObj);
  5558. Object.defineProperty(eventObj,"completed",{
  5559. value: function()
  5560. {
  5561. var jsonString=JSON.stringify(eventObj);
  5562. _this._invokeAppCommandCompletedMethod(args.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,jsonString)
  5563. },
  5564. enumerable: true
  5565. })
  5566. }
  5567. catch(e)
  5568. {
  5569. eventObj=null
  5570. }
  5571. return eventObj
  5572. };
  5573. AppCommandManager.prototype._translateEventObjectInternal=function(input, output)
  5574. {
  5575. for(var key in input)
  5576. {
  5577. if(!input.hasOwnProperty(key))
  5578. continue;
  5579. var inputChild=input[key];
  5580. if(typeof inputChild=="object" && inputChild !=null)
  5581. {
  5582. OSF.OUtil.defineEnumerableProperty(output,key,{value: {}});
  5583. this._translateEventObjectInternal(inputChild,output[key])
  5584. }
  5585. else
  5586. Object.defineProperty(output,key,{
  5587. value: inputChild,
  5588. enumerable: true,
  5589. writable: true
  5590. })
  5591. }
  5592. };
  5593. AppCommandManager.prototype._constructObjectByTemplate=function(template, input)
  5594. {
  5595. var output={};
  5596. if(!template || !input)
  5597. return output;
  5598. for(var key in template)
  5599. if(template.hasOwnProperty(key))
  5600. {
  5601. output[key]=null;
  5602. if(input[key] !=null)
  5603. {
  5604. var templateChild=template[key];
  5605. var inputChild=input[key];
  5606. var inputChildType=typeof inputChild;
  5607. if(typeof templateChild=="object" && templateChild !=null)
  5608. output[key]=this._constructObjectByTemplate(templateChild,inputChild);
  5609. else if(inputChildType=="number" || inputChildType=="string" || inputChildType=="boolean")
  5610. output[key]=inputChild
  5611. }
  5612. }
  5613. return output
  5614. };
  5615. AppCommandManager.instance=function()
  5616. {
  5617. if(AppCommandManager._instance==null)
  5618. AppCommandManager._instance=new AppCommandManager;
  5619. return AppCommandManager._instance
  5620. };
  5621. AppCommandManager._instance=null;
  5622. return AppCommandManager
  5623. }();
  5624. AppCommand.AppCommandManager=AppCommandManager;
  5625. var AppCommandInvokedEventArgs=function()
  5626. {
  5627. function AppCommandInvokedEventArgs(appCommandId, callbackName, eventObjStr)
  5628. {
  5629. this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked;
  5630. this.appCommandId=appCommandId;
  5631. this.callbackName=callbackName;
  5632. this.eventObjStr=eventObjStr
  5633. }
  5634. AppCommandInvokedEventArgs.create=function(eventProperties)
  5635. {
  5636. return new AppCommandInvokedEventArgs(eventProperties[AppCommand.AppCommandInvokedEventEnums.AppCommandId],eventProperties[AppCommand.AppCommandInvokedEventEnums.CallbackName],eventProperties[AppCommand.AppCommandInvokedEventEnums.EventObjStr])
  5637. };
  5638. return AppCommandInvokedEventArgs
  5639. }();
  5640. AppCommand.AppCommandInvokedEventArgs=AppCommandInvokedEventArgs;
  5641. var AppCommandCallbackEventArgs=function()
  5642. {
  5643. function AppCommandCallbackEventArgs(){}
  5644. return AppCommandCallbackEventArgs
  5645. }();
  5646. AppCommand.AppCommandCallbackEventArgs=AppCommandCallbackEventArgs;
  5647. AppCommand.AppCommandInvokedEventEnums={
  5648. AppCommandId: "appCommandId",
  5649. CallbackName: "callbackName",
  5650. EventObjStr: "eventObjStr"
  5651. }
  5652. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}))
  5653. })(OfficeExt || (OfficeExt={}));
  5654. OfficeExt.AppCommand.AppCommandManager.initializeOsfDda();
  5655. var OfficeExt;
  5656. (function(OfficeExt)
  5657. {
  5658. var AppCommand;
  5659. (function(AppCommand)
  5660. {
  5661. function registerDdaFacade()
  5662. {
  5663. if(OSF.DDA.SafeArray)
  5664. {
  5665. var parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  5666. parameterMap.define({
  5667. type: OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod,
  5668. toHost: [{
  5669. name: Microsoft.Office.WebExtension.Parameters.Id,
  5670. value: 0
  5671. },{
  5672. name: Microsoft.Office.WebExtension.Parameters.Status,
  5673. value: 1
  5674. },{
  5675. name: Microsoft.Office.WebExtension.Parameters.Data,
  5676. value: 2
  5677. }]
  5678. });
  5679. parameterMap.define({
  5680. type: OSF.DDA.EventDispId.dispidAppCommandInvokedEvent,
  5681. fromHost: [{
  5682. name: OSF.DDA.EventDescriptors.AppCommandInvokedEvent,
  5683. value: parameterMap.self
  5684. }],
  5685. isComplexType: true
  5686. });
  5687. parameterMap.define({
  5688. type: OSF.DDA.EventDescriptors.AppCommandInvokedEvent,
  5689. fromHost: [{
  5690. name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.AppCommandId,
  5691. value: 0
  5692. },{
  5693. name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.CallbackName,
  5694. value: 1
  5695. },{
  5696. name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.EventObjStr,
  5697. value: 2
  5698. },],
  5699. isComplexType: true
  5700. })
  5701. }
  5702. }
  5703. AppCommand.registerDdaFacade=registerDdaFacade
  5704. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}))
  5705. })(OfficeExt || (OfficeExt={}));
  5706. var OfficeJsClient_OutlookWin32;
  5707. (function(OfficeJsClient_OutlookWin32)
  5708. {
  5709. function prepareApiSurface(appContext)
  5710. {
  5711. if(appContext.get_isDialog())
  5712. appContext.ui=new OSF.DDA.UI.ChildUI;
  5713. else
  5714. appContext.ui=new OSF.DDA.UI.ParentUI
  5715. }
  5716. OfficeJsClient_OutlookWin32.prepareApiSurface=prepareApiSurface;
  5717. function prepareRightAfterWebExtensionInitialize()
  5718. {
  5719. var appCommandHandler=OfficeExt.AppCommand.AppCommandManager.instance();
  5720. appCommandHandler.initializeAndChangeOnce()
  5721. }
  5722. OfficeJsClient_OutlookWin32.prepareRightAfterWebExtensionInitialize=prepareRightAfterWebExtensionInitialize
  5723. })(OfficeJsClient_OutlookWin32 || (OfficeJsClient_OutlookWin32={}));
  5724. OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function OSF_InitializationHelper$prepareRightAfterWebExtensionInitialize()
  5725. {
  5726. OfficeJsClient_OutlookWin32.prepareRightAfterWebExtensionInitialize()
  5727. };
  5728. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurface(appContext)
  5729. {
  5730. var license=new OSF.DDA.License(appContext.get_eToken());
  5731. if(appContext.get_appName()==OSF.AppName.OutlookWebApp)
  5732. {
  5733. OSF.WebApp._UpdateLinksForHostAndXdmInfo();
  5734. OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext,this._settings,license,appContext.appOM))
  5735. }
  5736. else
  5737. {
  5738. OfficeJsClient_OutlookWin32.prepareApiSurface(appContext);
  5739. OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext,this._settings,license,appContext.appOM,OSF.DDA.Theming ? OSF.DDA.Theming.getOfficeTheme : null,appContext.ui));
  5740. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.DispIdHost.getClientDelegateMethods,OSF.DDA.SafeArray.Delegate.ParameterMap))
  5741. }
  5742. };
  5743. OSF.DDA.SettingsManager={
  5744. SerializedSettings: "serializedSettings",
  5745. DateJSONPrefix: "Date(",
  5746. DataJSONSuffix: ")",
  5747. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection)
  5748. {
  5749. var ret={};
  5750. for(var key in settingsCollection)
  5751. {
  5752. var value=settingsCollection[key];
  5753. try
  5754. {
  5755. if(JSON)
  5756. value=JSON.stringify(value,function dateReplacer(k, v)
  5757. {
  5758. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v
  5759. });
  5760. else
  5761. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  5762. ret[key]=value
  5763. }
  5764. catch(ex){}
  5765. }
  5766. return ret
  5767. },
  5768. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings)
  5769. {
  5770. var ret={};
  5771. serializedSettings=serializedSettings || {};
  5772. for(var key in serializedSettings)
  5773. {
  5774. var value=serializedSettings[key];
  5775. try
  5776. {
  5777. if(JSON)
  5778. value=JSON.parse(value,function dateReviver(k, v)
  5779. {
  5780. var d;
  5781. if(typeof v==="string" && v && v.length > 6 && v.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix)
  5782. {
  5783. d=new Date(parseInt(v.slice(5,-1)));
  5784. if(d)
  5785. return d
  5786. }
  5787. return v
  5788. });
  5789. else
  5790. value=Sys.Serialization.JavaScriptSerializer.deserialize(value,true);
  5791. ret[key]=value
  5792. }
  5793. catch(ex){}
  5794. }
  5795. return ret
  5796. }
  5797. };
  5798. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath)
  5799. {
  5800. Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");
  5801. Microsoft.Office.WebExtension.MailboxEnums.EntityType={
  5802. MeetingSuggestion: "meetingSuggestion",
  5803. TaskSuggestion: "taskSuggestion",
  5804. Address: "address",
  5805. EmailAddress: "emailAddress",
  5806. Url: "url",
  5807. PhoneNumber: "phoneNumber",
  5808. Contact: "contact",
  5809. FlightReservations: "flightReservations",
  5810. ParcelDeliveries: "parcelDeliveries"
  5811. };
  5812. Microsoft.Office.WebExtension.MailboxEnums.ItemType={
  5813. Message: "message",
  5814. Appointment: "appointment"
  5815. };
  5816. Microsoft.Office.WebExtension.MailboxEnums.ResponseType={
  5817. None: "none",
  5818. Organizer: "organizer",
  5819. Tentative: "tentative",
  5820. Accepted: "accepted",
  5821. Declined: "declined"
  5822. };
  5823. Microsoft.Office.WebExtension.MailboxEnums.RecipientType={
  5824. Other: "other",
  5825. DistributionList: "distributionList",
  5826. User: "user",
  5827. ExternalUser: "externalUser"
  5828. };
  5829. Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={
  5830. File: "file",
  5831. Item: "item",
  5832. Cloud: "cloud"
  5833. };
  5834. Microsoft.Office.WebExtension.MailboxEnums.BodyType={
  5835. Text: "text",
  5836. Html: "html"
  5837. };
  5838. Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType={
  5839. ProgressIndicator: "progressIndicator",
  5840. InformationalMessage: "informationalMessage",
  5841. ErrorMessage: "errorMessage"
  5842. };
  5843. Microsoft.Office.WebExtension.CoercionType={
  5844. Text: "text",
  5845. Html: "html"
  5846. };
  5847. Microsoft.Office.WebExtension.MailboxEnums.UserProfileType={
  5848. Office365: "office365",
  5849. OutlookCom: "outlookCom",
  5850. Enterprise: "enterprise"
  5851. };
  5852. Microsoft.Office.WebExtension.MailboxEnums.RestVersion={
  5853. v1_0: "v1.0",
  5854. v2_0: "v2.0",
  5855. Beta: "beta"
  5856. };
  5857. Type.registerNamespace("OSF.DDA");
  5858. var OSF=window.OSF || {};
  5859. OSF.DDA=OSF.DDA || {};
  5860. window["OSF"]["DDA"]["OutlookAppOm"]=OSF.DDA.OutlookAppOm=function(officeAppContext, targetWindow, appReadyCallback)
  5861. {
  5862. this.$$d_displayContactCardAsync=Function.createDelegate(this,this.displayContactCardAsync);
  5863. this.$$d_displayNewMessageFormApi=Function.createDelegate(this,this.displayNewMessageFormApi);
  5864. this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this,this._displayNewAppointmentFormApi$p$0);
  5865. this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);
  5866. this.$$d__getEwsUrl$p$0=Function.createDelegate(this,this._getEwsUrl$p$0);
  5867. this.$$d__getDiagnostics$p$0=Function.createDelegate(this,this._getDiagnostics$p$0);
  5868. this.$$d__getUserProfile$p$0=Function.createDelegate(this,this._getUserProfile$p$0);
  5869. this.$$d__getItem$p$0=Function.createDelegate(this,this._getItem$p$0);
  5870. this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this,this._callAppReadyCallback$p$0);
  5871. this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this,this._getInitialDataResponseHandler$p$0);
  5872. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p=this;
  5873. this._officeAppContext$p$0=officeAppContext;
  5874. this._appReadyCallback$p$0=appReadyCallback;
  5875. var $$t_4=this;
  5876. var stringLoadedCallback=function()
  5877. {
  5878. if(appReadyCallback)
  5879. if(!officeAppContext["get_isDialog"]())
  5880. $$t_4.invokeHostMethod(1,null,$$t_4.$$d__getInitialDataResponseHandler$p$0);
  5881. else
  5882. window.setTimeout($$t_4.$$d__callAppReadyCallback$p$0,0)
  5883. };
  5884. if(this._areStringsLoaded$p$0())
  5885. stringLoadedCallback();
  5886. else
  5887. this._loadLocalizedScript$p$0(stringLoadedCallback)
  5888. };
  5889. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i=function(currentPermissionLevel)
  5890. {
  5891. if(!currentPermissionLevel)
  5892. throw Error.create(window["_u"]["ExtensibilityStrings"]["l_ElevatedPermissionNeeded_Text"]);
  5893. };
  5894. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i=function(value, minValue, maxValue, argumentName)
  5895. {
  5896. if(value < minValue || value > maxValue)
  5897. throw Error.argumentOutOfRange(argumentName);
  5898. };
  5899. window["OSF"]["DDA"]["OutlookAppOm"]._getHtmlBody$p=function(data)
  5900. {
  5901. var htmlBody="";
  5902. if("htmlBody" in data)
  5903. {
  5904. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidHtmlBody$p(data["htmlBody"]);
  5905. htmlBody=data["htmlBody"]
  5906. }
  5907. return htmlBody
  5908. };
  5909. window["OSF"]["DDA"]["OutlookAppOm"]._getAttachments$p=function(data)
  5910. {
  5911. var attachments=[];
  5912. if("attachments" in data)
  5913. {
  5914. attachments=data["attachments"];
  5915. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentsArray$p(attachments)
  5916. }
  5917. return attachments
  5918. };
  5919. window["OSF"]["DDA"]["OutlookAppOm"]._getOptionsAndCallback$p=function(data)
  5920. {
  5921. var args=[];
  5922. if("options" in data)
  5923. args[0]=data["options"];
  5924. if("callback" in data)
  5925. args[args["length"]]=data["callback"];
  5926. return args
  5927. };
  5928. window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentsDataForHost$p=function(attachments)
  5929. {
  5930. var attachmentsData=new Array(0);
  5931. if(Array.isInstanceOfType(attachments))
  5932. for(var i=0; i < attachments["length"]; i++)
  5933. if(Object.isInstanceOfType(attachments[i]))
  5934. {
  5935. var attachment=attachments[i];
  5936. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachment$p(attachment);
  5937. attachmentsData[i]=window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentData$p(attachment)
  5938. }
  5939. else
  5940. throw Error.argument("attachments");
  5941. return attachmentsData
  5942. };
  5943. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidHtmlBody$p=function(htmlBody)
  5944. {
  5945. if(!String.isInstanceOfType(htmlBody))
  5946. throw Error.argument("htmlBody");
  5947. if($h.ScriptHelpers.isNullOrUndefined(htmlBody))
  5948. throw Error.argument("htmlBody");
  5949. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(htmlBody["length"],0,window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength,"htmlBody")
  5950. };
  5951. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentsArray$p=function(attachments)
  5952. {
  5953. if(!Array.isInstanceOfType(attachments))
  5954. throw Error.argument("attachments");
  5955. };
  5956. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachment$p=function(attachment)
  5957. {
  5958. if(!Object.isInstanceOfType(attachment))
  5959. throw Error.argument("attachments");
  5960. if(!("type" in attachment) || !("name" in attachment))
  5961. throw Error.argument("attachments");
  5962. if(!("url" in attachment || "itemId" in attachment))
  5963. throw Error.argument("attachments");
  5964. };
  5965. window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentData$p=function(attachment)
  5966. {
  5967. var attachmentData=null;
  5968. if(attachment["type"]==="file")
  5969. {
  5970. var url=attachment["url"];
  5971. var name=attachment["name"];
  5972. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentUrlOrName$p(url,name);
  5973. attachmentData=window["OSF"]["DDA"]["OutlookAppOm"]._createFileAttachmentData$p(url,name)
  5974. }
  5975. else if(attachment["type"]==="item")
  5976. {
  5977. var itemId=window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost(attachment["itemId"]);
  5978. var name=attachment["name"];
  5979. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentItemIdOrName$p(itemId,name);
  5980. attachmentData=window["OSF"]["DDA"]["OutlookAppOm"]._createItemAttachmentData$p(itemId,name)
  5981. }
  5982. else
  5983. throw Error.argument("attachments");
  5984. return attachmentData
  5985. };
  5986. window["OSF"]["DDA"]["OutlookAppOm"]._createFileAttachmentData$p=function(url, name)
  5987. {
  5988. return["file",name,url]
  5989. };
  5990. window["OSF"]["DDA"]["OutlookAppOm"]._createItemAttachmentData$p=function(itemId, name)
  5991. {
  5992. return["item",name,itemId]
  5993. };
  5994. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentUrlOrName$p=function(url, name)
  5995. {
  5996. if(!String.isInstanceOfType(url) || !String.isInstanceOfType(name))
  5997. throw Error.argument("attachments");
  5998. if(url["length"] > 2048)
  5999. throw Error.argumentOutOfRange("attachments",url["length"],window["_u"]["ExtensibilityStrings"]["l_AttachmentUrlTooLong_Text"]);
  6000. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentName$p(name)
  6001. };
  6002. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentItemIdOrName$p=function(itemId, name)
  6003. {
  6004. if(!String.isInstanceOfType(itemId) || !String.isInstanceOfType(name))
  6005. throw Error.argument("attachments");
  6006. if(itemId["length"] > 200)
  6007. throw Error.argumentOutOfRange("attachments",itemId["length"],window["_u"]["ExtensibilityStrings"]["l_AttachmentItemIdTooLong_Text"]);
  6008. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentName$p(name)
  6009. };
  6010. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentName$p=function(name)
  6011. {
  6012. if(name["length"] > 255)
  6013. throw Error.argumentOutOfRange("attachments",name["length"],window["_u"]["ExtensibilityStrings"]["l_AttachmentNameTooLong_Text"]);
  6014. };
  6015. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidRestVersion$p=function(restVersion)
  6016. {
  6017. if(!restVersion)
  6018. throw Error.argumentNull("restVersion");
  6019. if(restVersion !==window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["v1_0"] && restVersion !==window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["v2_0"] && restVersion !==window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["Beta"])
  6020. throw Error.argument("restVersion");
  6021. };
  6022. window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost=function(itemId)
  6023. {
  6024. if(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._initialData$p$0 && window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._initialData$p$0.get__isRestIdSupported$i$0())
  6025. return window["OSF"]["DDA"]["OutlookAppOm"]._instance$p["convertToRestId"](itemId,window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["v1_0"]);
  6026. return window["OSF"]["DDA"]["OutlookAppOm"]._instance$p["convertToEwsId"](itemId,window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["v1_0"])
  6027. };
  6028. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p=function(value, expectedType, argumentName)
  6029. {
  6030. if(Object["getType"](value) !==expectedType)
  6031. throw Error.argumentType(argumentName);
  6032. };
  6033. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p=function(value, minLength, maxLength, name)
  6034. {
  6035. if($h.ScriptHelpers.isNullOrUndefined(value))
  6036. return;
  6037. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(value,String,name);
  6038. var stringValue=value;
  6039. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(stringValue["length"],minLength,maxLength,name)
  6040. };
  6041. window["OSF"]["DDA"]["OutlookAppOm"]._convertToOutlookParameters$p=function(dispid, data)
  6042. {
  6043. var executeParameters=null;
  6044. switch(dispid)
  6045. {
  6046. case 1:
  6047. case 2:
  6048. case 12:
  6049. case 3:
  6050. case 14:
  6051. case 18:
  6052. case 26:
  6053. case 32:
  6054. case 41:
  6055. case 34:
  6056. break;
  6057. case 4:
  6058. var jsonProperty=window["JSON"]["stringify"](data["customProperties"]);
  6059. executeParameters=[jsonProperty];
  6060. break;
  6061. case 5:
  6062. executeParameters=[data["body"]];
  6063. break;
  6064. case 8:
  6065. case 9:
  6066. executeParameters=[data["itemId"]];
  6067. break;
  6068. case 7:
  6069. executeParameters=[window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["requiredAttendees"]),window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["optionalAttendees"]),data["start"],data["end"],data["location"],window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["resources"]),data["subject"],data["body"]];
  6070. break;
  6071. case 44:
  6072. executeParameters=[window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["toRecipients"]),window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["ccRecipients"]),window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["bccRecipients"]),data["subject"],data["htmlBody"],data["attachments"]];
  6073. break;
  6074. case 43:
  6075. executeParameters=[data["ewsIdOrEmail"]];
  6076. break;
  6077. case 40:
  6078. executeParameters=[data["extensionId"],data["consentState"]];
  6079. break;
  6080. case 11:
  6081. case 10:
  6082. executeParameters=[data["htmlBody"]];
  6083. break;
  6084. case 31:
  6085. case 30:
  6086. executeParameters=[data["htmlBody"],data["attachments"]];
  6087. break;
  6088. case 23:
  6089. case 13:
  6090. case 38:
  6091. case 29:
  6092. executeParameters=[data["data"],data["coercionType"]];
  6093. break;
  6094. case 37:
  6095. case 28:
  6096. executeParameters=[data["coercionType"]];
  6097. break;
  6098. case 17:
  6099. executeParameters=[data["subject"]];
  6100. break;
  6101. case 15:
  6102. executeParameters=[data["recipientField"]];
  6103. break;
  6104. case 22:
  6105. case 21:
  6106. executeParameters=[data["recipientField"],window["OSF"]["DDA"]["OutlookAppOm"]._convertComposeEmailDictionaryParameterForSetApi$p(data["recipientArray"])];
  6107. break;
  6108. case 19:
  6109. executeParameters=[data["itemId"],data["name"]];
  6110. break;
  6111. case 16:
  6112. executeParameters=[data["uri"],data["name"]];
  6113. break;
  6114. case 20:
  6115. executeParameters=[data["attachmentIndex"]];
  6116. break;
  6117. case 25:
  6118. executeParameters=[data["TimeProperty"],data["time"]];
  6119. break;
  6120. case 24:
  6121. executeParameters=[data["TimeProperty"]];
  6122. break;
  6123. case 27:
  6124. executeParameters=[data["location"]];
  6125. break;
  6126. case 33:
  6127. case 35:
  6128. executeParameters=[data["key"],data["type"],data["persistent"],data["message"],data["icon"]];
  6129. break;
  6130. case 36:
  6131. executeParameters=[data["key"]];
  6132. break;
  6133. default:
  6134. Sys.Debug.fail("Unexpected method dispid");
  6135. break
  6136. }
  6137. return executeParameters
  6138. };
  6139. window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p=function(array)
  6140. {
  6141. return array ? array["join"](";") : null
  6142. };
  6143. window["OSF"]["DDA"]["OutlookAppOm"]._convertComposeEmailDictionaryParameterForSetApi$p=function(recipients)
  6144. {
  6145. if(!recipients)
  6146. return null;
  6147. var results=new Array(recipients["length"]);
  6148. for(var i=0; i < recipients["length"]; i++)
  6149. results[i]=[recipients[i]["address"],recipients[i]["name"]];
  6150. return results
  6151. };
  6152. window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p=function(emailset, name)
  6153. {
  6154. if($h.ScriptHelpers.isNullOrUndefined(emailset))
  6155. return null;
  6156. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(emailset,Array,name);
  6157. var originalAttendees=emailset;
  6158. var updatedAttendees=null;
  6159. var normalizationNeeded=false;
  6160. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(originalAttendees["length"],0,window["OSF"]["DDA"]["OutlookAppOm"]._maxRecipients$p,String.format("{0}.length",name));
  6161. for(var i=0; i < originalAttendees["length"]; i++)
  6162. if($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]))
  6163. {
  6164. normalizationNeeded=true;
  6165. break
  6166. }
  6167. if(normalizationNeeded)
  6168. updatedAttendees=[];
  6169. for(var i=0; i < originalAttendees["length"]; i++)
  6170. if(normalizationNeeded)
  6171. {
  6172. updatedAttendees[i]=$h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]) ? originalAttendees[i]["emailAddress"] : originalAttendees[i];
  6173. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(updatedAttendees[i],String,String.format("{0}[{1}]",name,i))
  6174. }
  6175. else
  6176. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(originalAttendees[i],String,String.format("{0}[{1}]",name,i));
  6177. return updatedAttendees
  6178. };
  6179. OSF.DDA.OutlookAppOm.prototype={
  6180. _initialData$p$0: null,
  6181. _item$p$0: null,
  6182. _userProfile$p$0: null,
  6183. _diagnostics$p$0: null,
  6184. _officeAppContext$p$0: null,
  6185. _appReadyCallback$p$0: null,
  6186. _clientEndPoint$p$0: null,
  6187. _hostItemType$p$0: 0,
  6188. get_clientEndPoint: function()
  6189. {
  6190. if(!this._clientEndPoint$p$0)
  6191. this._clientEndPoint$p$0=OSF._OfficeAppFactory["getClientEndPoint"]();
  6192. return this._clientEndPoint$p$0
  6193. },
  6194. set_clientEndPoint: function(value)
  6195. {
  6196. this._clientEndPoint$p$0=value;
  6197. return value
  6198. },
  6199. get_initialData: function()
  6200. {
  6201. return this._initialData$p$0
  6202. },
  6203. get__appName$i$0: function()
  6204. {
  6205. return this._officeAppContext$p$0["get_appName"]()
  6206. },
  6207. initialize: function(initialData)
  6208. {
  6209. var ItemTypeKey="itemType";
  6210. this._initialData$p$0=new $h.InitialData(initialData);
  6211. this._hostItemType$p$0=initialData[ItemTypeKey];
  6212. if(1===initialData[ItemTypeKey])
  6213. this._item$p$0=new $h.Message(this._initialData$p$0);
  6214. else if(3===initialData[ItemTypeKey])
  6215. this._item$p$0=new $h.MeetingRequest(this._initialData$p$0);
  6216. else if(2===initialData[ItemTypeKey])
  6217. this._item$p$0=new $h.Appointment(this._initialData$p$0);
  6218. else if(4===initialData[ItemTypeKey])
  6219. this._item$p$0=new $h.MessageCompose(this._initialData$p$0);
  6220. else if(5===initialData[ItemTypeKey])
  6221. this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0);
  6222. else if(6===initialData[ItemTypeKey]);
  6223. else
  6224. Sys.Debug.trace("Unexpected item type was received from the host.");
  6225. this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0);
  6226. this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0,this._officeAppContext$p$0["get_appName"]());
  6227. this._initializeMethods$p$0();
  6228. $h.InitialData._defineReadOnlyProperty$i(this,"item",this.$$d__getItem$p$0);
  6229. $h.InitialData._defineReadOnlyProperty$i(this,"userProfile",this.$$d__getUserProfile$p$0);
  6230. $h.InitialData._defineReadOnlyProperty$i(this,"diagnostics",this.$$d__getDiagnostics$p$0);
  6231. $h.InitialData._defineReadOnlyProperty$i(this,"ewsUrl",this.$$d__getEwsUrl$p$0);
  6232. if(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.get__appName$i$0()===64)
  6233. if(this._initialData$p$0.get__overrideWindowOpen$i$0())
  6234. window.open=this.$$d_windowOpenOverrideHandler
  6235. },
  6236. windowOpenOverrideHandler: function(url, targetName, features, replace)
  6237. {
  6238. this.invokeHostMethod(403,{launchUrl: url},null)
  6239. },
  6240. createAsyncResult: function(value, errorCode, detailedErrorCode, userContext, errorMessage)
  6241. {
  6242. var initArgs={};
  6243. var errorArgs=null;
  6244. initArgs[OSF.DDA.AsyncResultEnum.Properties["Value"]]=value;
  6245. initArgs[OSF.DDA.AsyncResultEnum.Properties["Context"]]=userContext;
  6246. if(0 !==errorCode)
  6247. {
  6248. errorArgs={};
  6249. var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode);
  6250. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties["Name"]]=errorProperties["name"];
  6251. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties["Message"]]=!errorMessage ? errorProperties["message"] : errorMessage;
  6252. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties["Code"]]=detailedErrorCode
  6253. }
  6254. return new OSF.DDA.AsyncResult(initArgs,errorArgs)
  6255. },
  6256. _throwOnMethodCallForInsufficientPermission$i$0: function(requiredPermissionLevel, methodName)
  6257. {
  6258. if(this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel)
  6259. throw Error.create(String.format(window["_u"]["ExtensibilityStrings"]["l_ElevatedPermissionNeededForMethod_Text"],methodName));
  6260. },
  6261. _displayReplyForm$i$0: function(obj)
  6262. {
  6263. this._displayReplyFormHelper$p$0(obj,false)
  6264. },
  6265. _displayReplyAllForm$i$0: function(obj)
  6266. {
  6267. this._displayReplyFormHelper$p$0(obj,true)
  6268. },
  6269. _displayReplyFormHelper$p$0: function(obj, isReplyAll)
  6270. {
  6271. if(String.isInstanceOfType(obj))
  6272. this._doDisplayReplyForm$p$0(obj,isReplyAll);
  6273. else if(Object.isInstanceOfType(obj) && Object.getTypeName(obj)==="Object")
  6274. this._doDisplayReplyFormWithAttachments$p$0(obj,isReplyAll);
  6275. else
  6276. throw Error.argumentType();
  6277. },
  6278. _doDisplayReplyForm$p$0: function(htmlBody, isReplyAll)
  6279. {
  6280. if(!$h.ScriptHelpers.isNullOrUndefined(htmlBody))
  6281. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(htmlBody["length"],0,window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength,"htmlBody");
  6282. this.invokeHostMethod(isReplyAll ? 11 : 10,{htmlBody: htmlBody},null)
  6283. },
  6284. _doDisplayReplyFormWithAttachments$p$0: function(data, isReplyAll)
  6285. {
  6286. var htmlBody=window["OSF"]["DDA"]["OutlookAppOm"]._getHtmlBody$p(data);
  6287. var attachments=window["OSF"]["DDA"]["OutlookAppOm"]._getAttachments$p(data);
  6288. var parameters=$h.CommonParameters.parse(window["OSF"]["DDA"]["OutlookAppOm"]._getOptionsAndCallback$p(data),false);
  6289. var $$t_6=this;
  6290. this._standardInvokeHostMethod$i$0(isReplyAll ? 31 : 30,{
  6291. htmlBody: htmlBody,
  6292. attachments: window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentsDataForHost$p(attachments)
  6293. },function(rawInput)
  6294. {
  6295. return rawInput
  6296. },parameters._asyncContext$p$0,parameters._callback$p$0)
  6297. },
  6298. _standardInvokeHostMethod$i$0: function(dispid, data, format, userContext, callback)
  6299. {
  6300. var $$t_B=this;
  6301. this.invokeHostMethod(dispid,data,function(resultCode, response)
  6302. {
  6303. if(callback)
  6304. {
  6305. var asyncResult=null;
  6306. if(Object.isInstanceOfType(response))
  6307. {
  6308. var responseDictionary=response;
  6309. if("error" in responseDictionary || "data" in responseDictionary || "errorCode" in responseDictionary)
  6310. if(!responseDictionary["error"])
  6311. {
  6312. var formattedData=format ? format(responseDictionary["data"]) : responseDictionary["data"];
  6313. asyncResult=$$t_B.createAsyncResult(formattedData,0,0,userContext,null)
  6314. }
  6315. else
  6316. {
  6317. var errorCode=responseDictionary["errorCode"];
  6318. asyncResult=$$t_B.createAsyncResult(null,1,errorCode,userContext,null)
  6319. }
  6320. }
  6321. if(!asyncResult && resultCode)
  6322. asyncResult=$$t_B.createAsyncResult(null,1,9002,userContext,null);
  6323. callback(asyncResult)
  6324. }
  6325. })
  6326. },
  6327. invokeHostMethod: function(dispid, data, responseCallback)
  6328. {
  6329. if(64===this._officeAppContext$p$0["get_appName"]())
  6330. {
  6331. var args={ApiParams: data};
  6332. args["MethodData"]={
  6333. ControlId: OSF._OfficeAppFactory["getId"](),
  6334. DispatchId: dispid
  6335. };
  6336. if(dispid===1)
  6337. this.get_clientEndPoint()["invoke"]("GetInitialData",responseCallback,args);
  6338. else
  6339. this.get_clientEndPoint()["invoke"]("ExecuteMethod",responseCallback,args)
  6340. }
  6341. else if(!this._isOwaOnlyMethod$p$0(dispid))
  6342. {
  6343. var executeParameters=window["OSF"]["DDA"]["OutlookAppOm"]._convertToOutlookParameters$p(dispid,data);
  6344. var $$t_B=this;
  6345. OSF.ClientHostController["execute"](dispid,executeParameters,function(nativeData, resultCode)
  6346. {
  6347. if(responseCallback)
  6348. {
  6349. var responseData=nativeData.toArray();
  6350. var rawData=window["JSON"]["parse"](responseData[0]);
  6351. if(Object.isInstanceOfType(rawData))
  6352. {
  6353. var deserializedData=rawData;
  6354. if(responseData["length"] > 1 && responseData[1])
  6355. {
  6356. deserializedData["error"]=true;
  6357. deserializedData["errorCode"]=responseData[1]
  6358. }
  6359. else
  6360. deserializedData["error"]=false;
  6361. responseCallback(resultCode,deserializedData)
  6362. }
  6363. else if(Number.isInstanceOfType(rawData))
  6364. {
  6365. var returnDict={};
  6366. returnDict["error"]=true;
  6367. returnDict["errorCode"]=rawData;
  6368. responseCallback(resultCode,returnDict)
  6369. }
  6370. else
  6371. throw Error.notImplemented("Return data type from host must be Dictionary or int");
  6372. }
  6373. })
  6374. }
  6375. else if(responseCallback)
  6376. responseCallback(-2,null)
  6377. },
  6378. _dictionaryToDate$i$0: function(input)
  6379. {
  6380. var retValue=new Date(input["year"],input["month"],input["date"],input["hours"],input["minutes"],input["seconds"],!input["milliseconds"] ? 0 : input["milliseconds"]);
  6381. if(window["isNaN"](retValue["getTime"]()))
  6382. throw Error.format(window["_u"]["ExtensibilityStrings"]["l_InvalidDate_Text"]);
  6383. return retValue
  6384. },
  6385. _dateToDictionary$i$0: function(input)
  6386. {
  6387. var retValue={};
  6388. retValue["month"]=input["getMonth"]();
  6389. retValue["date"]=input["getDate"]();
  6390. retValue["year"]=input["getFullYear"]();
  6391. retValue["hours"]=input["getHours"]();
  6392. retValue["minutes"]=input["getMinutes"]();
  6393. retValue["seconds"]=input["getSeconds"]();
  6394. retValue["milliseconds"]=input["getMilliseconds"]();
  6395. return retValue
  6396. },
  6397. _isOwaOnlyMethod$p$0: function(dispId)
  6398. {
  6399. switch(dispId)
  6400. {
  6401. case 402:
  6402. case 401:
  6403. case 400:
  6404. case 403:
  6405. return true;
  6406. default:
  6407. return false
  6408. }
  6409. },
  6410. _displayNewAppointmentFormApi$p$0: function(parameters)
  6411. {
  6412. var normalizedRequiredAttendees=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["requiredAttendees"],"requiredAttendees");
  6413. var normalizedOptionalAttendees=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["optionalAttendees"],"optionalAttendees");
  6414. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["location"],0,window["OSF"]["DDA"]["OutlookAppOm"]._maxLocationLength$p,"location");
  6415. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["body"],0,window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength,"body");
  6416. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["subject"],0,window["OSF"]["DDA"]["OutlookAppOm"]._maxSubjectLength$p,"subject");
  6417. if(!$h.ScriptHelpers.isNullOrUndefined(parameters["start"]))
  6418. {
  6419. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(parameters["start"],Date,"start");
  6420. var startDateTime=parameters["start"];
  6421. parameters["start"]=startDateTime["getTime"]();
  6422. if(!$h.ScriptHelpers.isNullOrUndefined(parameters["end"]))
  6423. {
  6424. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(parameters["end"],Date,"end");
  6425. var endDateTime=parameters["end"];
  6426. if(endDateTime < startDateTime)
  6427. throw Error.argumentOutOfRange("end",endDateTime,window["_u"]["ExtensibilityStrings"]["l_InvalidEventDates_Text"]);
  6428. parameters["end"]=endDateTime["getTime"]()
  6429. }
  6430. }
  6431. var updatedParameters=null;
  6432. if(normalizedRequiredAttendees || normalizedOptionalAttendees)
  6433. {
  6434. updatedParameters={};
  6435. var $$dict_7=parameters;
  6436. for(var $$key_8 in $$dict_7)
  6437. {
  6438. var entry={
  6439. key: $$key_8,
  6440. value: $$dict_7[$$key_8]
  6441. };
  6442. updatedParameters[entry["key"]]=entry["value"]
  6443. }
  6444. if(normalizedRequiredAttendees)
  6445. updatedParameters["requiredAttendees"]=normalizedRequiredAttendees;
  6446. if(normalizedOptionalAttendees)
  6447. updatedParameters["optionalAttendees"]=normalizedOptionalAttendees
  6448. }
  6449. this.invokeHostMethod(7,updatedParameters || parameters,null)
  6450. },
  6451. displayNewMessageFormApi: function(parameters)
  6452. {
  6453. var updatedParameters={};
  6454. if(parameters)
  6455. {
  6456. var normalizedToRecipients=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["toRecipients"],"toRecipients");
  6457. var normalizedCcRecipients=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["ccRecipients"],"ccRecipients");
  6458. var normalizedBccRecipients=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["bccRecipients"],"bccRecipients");
  6459. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["htmlBody"],0,window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength,"htmlBody");
  6460. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["subject"],0,window["OSF"]["DDA"]["OutlookAppOm"]._maxSubjectLength$p,"subject");
  6461. var attachments=window["OSF"]["DDA"]["OutlookAppOm"]._getAttachments$p(parameters);
  6462. var $$dict_7=parameters;
  6463. for(var $$key_8 in $$dict_7)
  6464. {
  6465. var entry={
  6466. key: $$key_8,
  6467. value: $$dict_7[$$key_8]
  6468. };
  6469. updatedParameters[entry["key"]]=entry["value"]
  6470. }
  6471. if(normalizedToRecipients)
  6472. updatedParameters["toRecipients"]=normalizedToRecipients;
  6473. if(normalizedCcRecipients)
  6474. updatedParameters["ccRecipients"]=normalizedCcRecipients;
  6475. if(normalizedBccRecipients)
  6476. updatedParameters["bccRecipients"]=normalizedBccRecipients;
  6477. if(attachments)
  6478. updatedParameters["attachments"]=window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentsDataForHost$p(attachments)
  6479. }
  6480. this.invokeHostMethod(44,updatedParameters || parameters,null)
  6481. },
  6482. displayContactCardAsync: function(ewsIdOrEmail, callback)
  6483. {
  6484. if($h.ScriptHelpers.isNullOrUndefined(ewsIdOrEmail))
  6485. throw Error.argumentNull("ewsIdOrEmail");
  6486. var asyncContext=null;
  6487. var asyncFunctionCallback=null;
  6488. if(callback)
  6489. {
  6490. var commonParameters=$h.CommonParameters.parse([callback],false);
  6491. asyncContext=commonParameters._asyncContext$p$0;
  6492. asyncFunctionCallback=commonParameters._callback$p$0
  6493. }
  6494. this._standardInvokeHostMethod$i$0(43,{ewsIdOrEmail: ewsIdOrEmail.trim()},null,asyncContext,asyncFunctionCallback)
  6495. },
  6496. _initializeMethods$p$0: function()
  6497. {
  6498. var currentInstance=this;
  6499. if($h.Item.isInstanceOfType(this._item$p$0) || this._hostItemType$p$0===6)
  6500. {
  6501. currentInstance["displayNewAppointmentForm"]=this.$$d__displayNewAppointmentFormApi$p$0;
  6502. currentInstance["displayNewMessageForm"]=this.$$d_displayNewMessageFormApi;
  6503. currentInstance["displayContactCardAsync"]=this.$$d_displayContactCardAsync
  6504. }
  6505. },
  6506. _getInitialDataResponseHandler$p$0: function(resultCode, data)
  6507. {
  6508. if(resultCode)
  6509. return;
  6510. this.initialize(data);
  6511. this["displayName"]="mailbox";
  6512. window.setTimeout(this.$$d__callAppReadyCallback$p$0,0)
  6513. },
  6514. _callAppReadyCallback$p$0: function()
  6515. {
  6516. this._appReadyCallback$p$0()
  6517. },
  6518. _invokeGetTokenMethodAsync$p$0: function(outlookDispid, methodName, callback, userContext)
  6519. {
  6520. if($h.ScriptHelpers.isNullOrUndefined(callback))
  6521. throw Error.argumentNull("callback");
  6522. var $$t_8=this;
  6523. this.invokeHostMethod(outlookDispid,null,function(resultCode, response)
  6524. {
  6525. var asyncResult;
  6526. if(resultCode)
  6527. asyncResult=$$t_8.createAsyncResult(null,1,9017,userContext,String.format(window["_u"]["ExtensibilityStrings"]["l_InternalProtocolError_Text"],resultCode));
  6528. else
  6529. {
  6530. var responseDictionary=response;
  6531. if(responseDictionary["wasSuccessful"])
  6532. asyncResult=$$t_8.createAsyncResult(responseDictionary["token"],0,0,userContext,null);
  6533. else
  6534. asyncResult=$$t_8.createAsyncResult(null,1,responseDictionary["errorCode"],userContext,responseDictionary["errorMessage"])
  6535. }
  6536. callback(asyncResult)
  6537. })
  6538. },
  6539. _getItem$p$0: function()
  6540. {
  6541. return this._item$p$0
  6542. },
  6543. _getUserProfile$p$0: function()
  6544. {
  6545. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);
  6546. return this._userProfile$p$0
  6547. },
  6548. _getDiagnostics$p$0: function()
  6549. {
  6550. return this._diagnostics$p$0
  6551. },
  6552. _getEwsUrl$p$0: function()
  6553. {
  6554. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);
  6555. return this._initialData$p$0.get__ewsUrl$i$0()
  6556. },
  6557. _findOffset$p$0: function(value)
  6558. {
  6559. var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0();
  6560. for(var r=0; r < ranges["length"]; r++)
  6561. {
  6562. var range=ranges[r];
  6563. var start=window["parseInt"](range["start"]);
  6564. var end=window["parseInt"](range["end"]);
  6565. if(value["getTime"]() - start >=0 && value["getTime"]() - end < 0)
  6566. return window["parseInt"](range["offset"])
  6567. }
  6568. throw Error.format(window["_u"]["ExtensibilityStrings"]["l_InvalidDate_Text"]);
  6569. },
  6570. _areStringsLoaded$p$0: function()
  6571. {
  6572. var stringsLoaded=false;
  6573. try
  6574. {
  6575. stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(window["_u"]["ExtensibilityStrings"]["l_EwsRequestOversized_Text"])
  6576. }
  6577. catch($$e_1){}
  6578. return stringsLoaded
  6579. },
  6580. _loadLocalizedScript$p$0: function(stringLoadedCallback)
  6581. {
  6582. var url=null;
  6583. var baseUrl="";
  6584. var scripts=document.getElementsByTagName("script");
  6585. for(var i=scripts.length - 1; i >=0; i--)
  6586. {
  6587. var filename=null;
  6588. var attributes=scripts[i].attributes;
  6589. if(attributes)
  6590. {
  6591. var attribute=attributes.getNamedItem("src");
  6592. if(attribute)
  6593. filename=attribute.value;
  6594. if(filename)
  6595. {
  6596. var debug=false;
  6597. filename=filename["toLowerCase"]();
  6598. var officeIndex=filename["indexOf"]("office_strings.js");
  6599. if(officeIndex < 0)
  6600. {
  6601. officeIndex=filename["indexOf"]("office_strings.debug.js");
  6602. debug=true
  6603. }
  6604. if(officeIndex > 0 && officeIndex < filename["length"])
  6605. {
  6606. url=filename["replace"](debug ? "office_strings.debug.js" : "office_strings.js","outlook_strings.js");
  6607. var languageUrl=filename["substring"](0,officeIndex);
  6608. var lastIndexOfSlash=languageUrl["lastIndexOf"]("/",languageUrl["length"] - 2);
  6609. if(lastIndexOfSlash===-1)
  6610. lastIndexOfSlash=languageUrl["lastIndexOf"]("\\",languageUrl["length"] - 2);
  6611. if(lastIndexOfSlash !==-1 && languageUrl["length"] > lastIndexOfSlash+1)
  6612. baseUrl=languageUrl["substring"](0,lastIndexOfSlash+1);
  6613. break
  6614. }
  6615. }
  6616. }
  6617. }
  6618. if(url)
  6619. {
  6620. var head=document.getElementsByTagName("head")[0];
  6621. var scriptElement=null;
  6622. var $$t_H=this;
  6623. var scriptElementCallback=function()
  6624. {
  6625. if(stringLoadedCallback && (!scriptElement.readyState || scriptElement.readyState && (scriptElement.readyState==="loaded" || scriptElement.readyState==="complete")))
  6626. {
  6627. scriptElement.onload=null;
  6628. scriptElement.onreadystatechange=null;
  6629. stringLoadedCallback()
  6630. }
  6631. };
  6632. var $$t_I=this;
  6633. var failureCallback=function()
  6634. {
  6635. if(!$$t_I._areStringsLoaded$p$0())
  6636. {
  6637. var fallbackUrl=baseUrl+"en-us/"+"outlook_strings.js";
  6638. scriptElement.onload=null;
  6639. scriptElement.onreadystatechange=null;
  6640. scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl);
  6641. scriptElement.onload=scriptElementCallback;
  6642. scriptElement.onreadystatechange=scriptElementCallback;
  6643. head.appendChild(scriptElement)
  6644. }
  6645. };
  6646. scriptElement=this._createScriptElement$p$0(url);
  6647. scriptElement.onload=scriptElementCallback;
  6648. scriptElement.onreadystatechange=scriptElementCallback;
  6649. window.setTimeout(failureCallback,2e3);
  6650. head.appendChild(scriptElement)
  6651. }
  6652. },
  6653. _createScriptElement$p$0: function(url)
  6654. {
  6655. var scriptElement=document.createElement("script");
  6656. scriptElement.type="text/javascript";
  6657. scriptElement.src=url;
  6658. return scriptElement
  6659. }
  6660. };
  6661. OSF.DDA.OutlookAppOm.prototype.makeEwsRequestAsync=function(data)
  6662. {
  6663. var args=[];
  6664. for(var $$pai_5=1; $$pai_5 < arguments["length"];++$$pai_5)
  6665. args[$$pai_5 - 1]=arguments[$$pai_5];
  6666. if($h.ScriptHelpers.isNullOrUndefined(data))
  6667. throw Error.argumentNull("data");
  6668. if(data["length"] > window["OSF"]["DDA"]["OutlookAppOm"]._maxEwsRequestSize$p)
  6669. throw Error.argument("data",window["_u"]["ExtensibilityStrings"]["l_EwsRequestOversized_Text"]);
  6670. this._throwOnMethodCallForInsufficientPermission$i$0(3,"makeEwsRequestAsync");
  6671. var parameters=$h.CommonParameters.parse(args,true,true);
  6672. var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0);
  6673. var $$t_4=this;
  6674. ewsRequest.onreadystatechange=function()
  6675. {
  6676. if(4===ewsRequest.get__requestState$i$1())
  6677. parameters._callback$p$0(ewsRequest._asyncResult$p$0)
  6678. };
  6679. ewsRequest.send(data)
  6680. };
  6681. OSF.DDA.OutlookAppOm.prototype.recordDataPoint=function(data)
  6682. {
  6683. if($h.ScriptHelpers.isNullOrUndefined(data))
  6684. throw Error.argumentNull("data");
  6685. this.invokeHostMethod(402,data,null)
  6686. };
  6687. OSF.DDA.OutlookAppOm.prototype.recordTrace=function(data)
  6688. {
  6689. if($h.ScriptHelpers.isNullOrUndefined(data))
  6690. throw Error.argumentNull("data");
  6691. this.invokeHostMethod(401,data,null)
  6692. };
  6693. OSF.DDA.OutlookAppOm.prototype.trackCtq=function(data)
  6694. {
  6695. if($h.ScriptHelpers.isNullOrUndefined(data))
  6696. throw Error.argumentNull("data");
  6697. this.invokeHostMethod(400,data,null)
  6698. };
  6699. OSF.DDA.OutlookAppOm.prototype.convertToLocalClientTime=function(timeValue)
  6700. {
  6701. var date=new Date(timeValue["getTime"]());
  6702. var offset=date["getTimezoneOffset"]() * -1;
  6703. if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0())
  6704. {
  6705. date["setUTCMinutes"](date["getUTCMinutes"]() - offset);
  6706. offset=this._findOffset$p$0(date);
  6707. date["setUTCMinutes"](date["getUTCMinutes"]()+offset)
  6708. }
  6709. var retValue=this._dateToDictionary$i$0(date);
  6710. retValue["timezoneOffset"]=offset;
  6711. return retValue
  6712. };
  6713. OSF.DDA.OutlookAppOm.prototype.convertToUtcClientTime=function(input)
  6714. {
  6715. var retValue=this._dictionaryToDate$i$0(input);
  6716. if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0())
  6717. {
  6718. var offset=this._findOffset$p$0(retValue);
  6719. retValue["setUTCMinutes"](retValue["getUTCMinutes"]() - offset);
  6720. offset=!input["timezoneOffset"] ? retValue["getTimezoneOffset"]() * -1 : input["timezoneOffset"];
  6721. retValue["setUTCMinutes"](retValue["getUTCMinutes"]()+offset)
  6722. }
  6723. return retValue
  6724. };
  6725. OSF.DDA.OutlookAppOm.prototype.convertToRestId=function(itemId, restVersion)
  6726. {
  6727. if(!itemId)
  6728. throw Error.argumentNull("itemId");
  6729. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidRestVersion$p(restVersion);
  6730. return itemId["replace"](new RegExp("[/]","g"),"-")["replace"](new RegExp("[+]","g"),"_")
  6731. };
  6732. OSF.DDA.OutlookAppOm.prototype.convertToEwsId=function(itemId, restVersion)
  6733. {
  6734. if(!itemId)
  6735. throw Error.argumentNull("itemId");
  6736. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidRestVersion$p(restVersion);
  6737. return itemId["replace"](new RegExp("[-]","g"),"/")["replace"](new RegExp("[_]","g"),"+")
  6738. };
  6739. OSF.DDA.OutlookAppOm.prototype.getUserIdentityTokenAsync=function()
  6740. {
  6741. var args=[];
  6742. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  6743. args[$$pai_2]=arguments[$$pai_2];
  6744. this._throwOnMethodCallForInsufficientPermission$i$0(1,"getUserIdentityTokenAsync");
  6745. var parameters=$h.CommonParameters.parse(args,true,true);
  6746. this._invokeGetTokenMethodAsync$p$0(2,"GetUserIdentityToken",parameters._callback$p$0,parameters._asyncContext$p$0)
  6747. };
  6748. OSF.DDA.OutlookAppOm.prototype.getCallbackTokenAsync=function()
  6749. {
  6750. var args=[];
  6751. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  6752. args[$$pai_2]=arguments[$$pai_2];
  6753. this._throwOnMethodCallForInsufficientPermission$i$0(1,"getCallbackTokenAsync");
  6754. var parameters=$h.CommonParameters.parse(args,true,true);
  6755. this._invokeGetTokenMethodAsync$p$0(12,"GetCallbackToken",parameters._callback$p$0,parameters._asyncContext$p$0)
  6756. };
  6757. OSF.DDA.OutlookAppOm.prototype.displayMessageForm=function(itemId)
  6758. {
  6759. if($h.ScriptHelpers.isNullOrUndefined(itemId))
  6760. throw Error.argumentNull("itemId");
  6761. this.invokeHostMethod(8,{itemId: window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost(itemId)},null)
  6762. };
  6763. OSF.DDA.OutlookAppOm.prototype.displayAppointmentForm=function(itemId)
  6764. {
  6765. if($h.ScriptHelpers.isNullOrUndefined(itemId))
  6766. throw Error.argumentNull("itemId");
  6767. this.invokeHostMethod(9,{itemId: window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost(itemId)},null)
  6768. };
  6769. OSF.DDA.OutlookAppOm.prototype.RegisterConsentAsync=function(consentState)
  6770. {
  6771. if(consentState !==2 && consentState !==1 && consentState)
  6772. throw Error.argumentOutOfRange("consentState");
  6773. var parameters={};
  6774. parameters["consentState"]=consentState["toString"]();
  6775. parameters["extensionId"]=this["GetExtensionId"]();
  6776. this.invokeHostMethod(40,parameters,null)
  6777. };
  6778. OSF.DDA.OutlookAppOm.prototype.CloseApp=function()
  6779. {
  6780. this.invokeHostMethod(42,null,null)
  6781. };
  6782. OSF.DDA.OutlookAppOm.prototype.GetIsRead=function()
  6783. {
  6784. return this._initialData$p$0.get__isRead$i$0()
  6785. };
  6786. OSF.DDA.OutlookAppOm.prototype.GetEndNodeUrl=function()
  6787. {
  6788. return this._initialData$p$0.get__endNodeUrl$i$0()
  6789. };
  6790. OSF.DDA.OutlookAppOm.prototype.GetConsentMetadata=function()
  6791. {
  6792. return this._initialData$p$0.get__consentMetadata$i$0()
  6793. };
  6794. OSF.DDA.OutlookAppOm.prototype.GetEntryPointUrl=function()
  6795. {
  6796. return this._initialData$p$0.get__entryPointUrl$i$0()
  6797. };
  6798. OSF.DDA.OutlookAppOm.prototype.GetMarketplaceContentMarket=function()
  6799. {
  6800. return this._initialData$p$0.get__marketplaceContentMarket$i$0()
  6801. };
  6802. OSF.DDA.OutlookAppOm.prototype.GetMarketplaceAssetId=function()
  6803. {
  6804. return this._initialData$p$0.get__marketplaceAssetId$i$0()
  6805. };
  6806. OSF.DDA.OutlookAppOm.prototype.GetExtensionId=function()
  6807. {
  6808. return this._initialData$p$0.get__extensionId$i$0()
  6809. };
  6810. window["OSF"]["DDA"]["Settings"]=OSF.DDA.Settings=function(data)
  6811. {
  6812. this._rawData$p$0=data
  6813. };
  6814. window["OSF"]["DDA"]["Settings"]._convertFromRawSettings$p=function(rawSettings)
  6815. {
  6816. if(!rawSettings)
  6817. return{};
  6818. if(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.get__appName$i$0()===8)
  6819. {
  6820. var outlookSettings=rawSettings["SettingsKey"];
  6821. if(outlookSettings)
  6822. return OSF.DDA.SettingsManager["deserializeSettings"](outlookSettings)
  6823. }
  6824. return rawSettings
  6825. };
  6826. OSF.DDA.Settings.prototype={
  6827. _rawData$p$0: null,
  6828. _settingsData$p$0: null,
  6829. get__data$p$0: function()
  6830. {
  6831. if(!this._settingsData$p$0)
  6832. {
  6833. this._settingsData$p$0=window["OSF"]["DDA"]["Settings"]._convertFromRawSettings$p(this._rawData$p$0);
  6834. this._rawData$p$0=null
  6835. }
  6836. return this._settingsData$p$0
  6837. },
  6838. _saveSettingsForOutlook$p$0: function(callback, userContext)
  6839. {
  6840. var storedException=null;
  6841. try
  6842. {
  6843. var serializedSettings=OSF.DDA.SettingsManager["serializeSettings"](this.get__data$p$0());
  6844. var jsonSettings=window["JSON"]["stringify"](serializedSettings);
  6845. var settingsObjectToSave={SettingsKey: jsonSettings};
  6846. OSF.DDA.ClientSettingsManager["write"](settingsObjectToSave)
  6847. }
  6848. catch(ex)
  6849. {
  6850. storedException=ex
  6851. }
  6852. if(callback)
  6853. {
  6854. var asyncResult;
  6855. if(storedException)
  6856. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,9019,userContext,storedException["message"]);
  6857. else
  6858. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,0,0,userContext,null);
  6859. callback(asyncResult)
  6860. }
  6861. },
  6862. _saveSettingsForOwa$p$0: function(callback, userContext)
  6863. {
  6864. var serializedSettings=OSF.DDA.SettingsManager["serializeSettings"](this.get__data$p$0());
  6865. var $$t_7=this;
  6866. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.invokeHostMethod(404,[serializedSettings],function(resultCode, response)
  6867. {
  6868. if(callback)
  6869. {
  6870. var asyncResult;
  6871. if(resultCode)
  6872. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,9017,userContext,String.format(window["_u"]["ExtensibilityStrings"]["l_InternalProtocolError_Text"],resultCode));
  6873. else
  6874. {
  6875. var responseDictionary=response;
  6876. if(!responseDictionary["error"])
  6877. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,0,0,userContext,null);
  6878. else
  6879. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,9019,userContext,responseDictionary["errorMessage"])
  6880. }
  6881. callback(asyncResult)
  6882. }
  6883. })
  6884. }
  6885. };
  6886. OSF.DDA.Settings.prototype.get=function(name)
  6887. {
  6888. return this.get__data$p$0()[name]
  6889. };
  6890. OSF.DDA.Settings.prototype.set=function(name, value)
  6891. {
  6892. this.get__data$p$0()[name]=value
  6893. };
  6894. OSF.DDA.Settings.prototype.remove=function(name)
  6895. {
  6896. delete this.get__data$p$0()[name]
  6897. };
  6898. OSF.DDA.Settings.prototype.saveAsync=function()
  6899. {
  6900. var args=[];
  6901. for(var $$pai_4=0; $$pai_4 < arguments["length"];++$$pai_4)
  6902. args[$$pai_4]=arguments[$$pai_4];
  6903. var commonParameters=$h.CommonParameters.parse(args,false);
  6904. if(window["JSON"]["stringify"](OSF.DDA.SettingsManager["serializeSettings"](this.get__data$p$0()))["length"] > 32768)
  6905. {
  6906. var asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,9019,commonParameters._asyncContext$p$0,"");
  6907. var $$t_3=this;
  6908. window.setTimeout(function()
  6909. {
  6910. commonParameters._callback$p$0(asyncResult)
  6911. },0);
  6912. return
  6913. }
  6914. if(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.get__appName$i$0()===64)
  6915. this._saveSettingsForOwa$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0);
  6916. else
  6917. this._saveSettingsForOutlook$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0)
  6918. };
  6919. Type.registerNamespace("$h");
  6920. var $h=window.$h || {};
  6921. Type.registerNamespace("Office.cast");
  6922. var Office=window.Office || {};
  6923. Office.cast=Office.cast || {};
  6924. $h.Appointment=function(dataDictionary)
  6925. {
  6926. this.$$d__getOrganizer$p$2=Function.createDelegate(this,this._getOrganizer$p$2);
  6927. this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2);
  6928. this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2);
  6929. this.$$d__getResources$p$2=Function.createDelegate(this,this._getResources$p$2);
  6930. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2);
  6931. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2);
  6932. this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2);
  6933. this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2);
  6934. this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2);
  6935. $h.Appointment.initializeBase(this,[dataDictionary]);
  6936. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2);
  6937. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2);
  6938. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2);
  6939. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2);
  6940. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2);
  6941. $h.InitialData._defineReadOnlyProperty$i(this,"resources",this.$$d__getResources$p$2);
  6942. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2);
  6943. $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2);
  6944. $h.InitialData._defineReadOnlyProperty$i(this,"organizer",this.$$d__getOrganizer$p$2)
  6945. };
  6946. $h.Appointment.prototype={
  6947. getItemType: function()
  6948. {
  6949. return window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemType"]["Appointment"]
  6950. },
  6951. _getStart$p$2: function()
  6952. {
  6953. return this._data$p$0.get__start$i$0()
  6954. },
  6955. _getEnd$p$2: function()
  6956. {
  6957. return this._data$p$0.get__end$i$0()
  6958. },
  6959. _getLocation$p$2: function()
  6960. {
  6961. return this._data$p$0.get__location$i$0()
  6962. },
  6963. _getOptionalAttendees$p$2: function()
  6964. {
  6965. return this._data$p$0.get__cc$i$0()
  6966. },
  6967. _getRequiredAttendees$p$2: function()
  6968. {
  6969. return this._data$p$0.get__to$i$0()
  6970. },
  6971. _getResources$p$2: function()
  6972. {
  6973. return this._data$p$0.get__resources$i$0()
  6974. },
  6975. _getSubject$p$2: function()
  6976. {
  6977. return this._data$p$0.get__subject$i$0()
  6978. },
  6979. _getNormalizedSubject$p$2: function()
  6980. {
  6981. return this._data$p$0.get__normalizedSubject$i$0()
  6982. },
  6983. _getOrganizer$p$2: function()
  6984. {
  6985. return this._data$p$0.get__organizer$i$0()
  6986. }
  6987. };
  6988. $h.Appointment.prototype.getEntities=function()
  6989. {
  6990. return this._data$p$0._getEntities$i$0()
  6991. };
  6992. $h.Appointment.prototype.getEntitiesByType=function(entityType)
  6993. {
  6994. return this._data$p$0._getEntitiesByType$i$0(entityType)
  6995. };
  6996. $h.Appointment.prototype.getRegExMatches=function()
  6997. {
  6998. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches");
  6999. return this._data$p$0._getRegExMatches$i$0()
  7000. };
  7001. $h.Appointment.prototype.getFilteredEntitiesByName=function(name)
  7002. {
  7003. return this._data$p$0._getFilteredEntitiesByName$i$0(name)
  7004. };
  7005. $h.Appointment.prototype.getRegExMatchesByName=function(name)
  7006. {
  7007. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName");
  7008. return this._data$p$0._getRegExMatchesByName$i$0(name)
  7009. };
  7010. $h.Appointment.prototype.displayReplyForm=function(obj)
  7011. {
  7012. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._displayReplyForm$i$0(obj)
  7013. };
  7014. $h.Appointment.prototype.displayReplyAllForm=function(obj)
  7015. {
  7016. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._displayReplyAllForm$i$0(obj)
  7017. };
  7018. $h.AppointmentCompose=function(data)
  7019. {
  7020. this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2);
  7021. this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2);
  7022. this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2);
  7023. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2);
  7024. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2);
  7025. $h.AppointmentCompose.initializeBase(this,[data]);
  7026. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2);
  7027. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2);
  7028. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2);
  7029. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2);
  7030. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2)
  7031. };
  7032. $h.AppointmentCompose.prototype={
  7033. _requiredAttendees$p$2: null,
  7034. _optionalAttendees$p$2: null,
  7035. _start$p$2: null,
  7036. _end$p$2: null,
  7037. _location$p$2: null,
  7038. getItemType: function()
  7039. {
  7040. return window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemType"]["Appointment"]
  7041. },
  7042. _getRequiredAttendees$p$2: function()
  7043. {
  7044. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7045. if(!this._requiredAttendees$p$2)
  7046. this._requiredAttendees$p$2=new $h.ComposeRecipient(0,"requiredAttendees");
  7047. return this._requiredAttendees$p$2
  7048. },
  7049. _getOptionalAttendees$p$2: function()
  7050. {
  7051. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7052. if(!this._optionalAttendees$p$2)
  7053. this._optionalAttendees$p$2=new $h.ComposeRecipient(1,"optionalAttendees");
  7054. return this._optionalAttendees$p$2
  7055. },
  7056. _getStart$p$2: function()
  7057. {
  7058. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7059. if(!this._start$p$2)
  7060. this._start$p$2=new $h.ComposeTime(1);
  7061. return this._start$p$2
  7062. },
  7063. _getEnd$p$2: function()
  7064. {
  7065. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7066. if(!this._end$p$2)
  7067. this._end$p$2=new $h.ComposeTime(2);
  7068. return this._end$p$2
  7069. },
  7070. _getLocation$p$2: function()
  7071. {
  7072. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7073. if(!this._location$p$2)
  7074. this._location$p$2=new $h.ComposeLocation;
  7075. return this._location$p$2
  7076. }
  7077. };
  7078. $h.AttachmentConstants=function(){};
  7079. $h.AttachmentDetails=function(data)
  7080. {
  7081. this.$$d__getIsInline$p$0=Function.createDelegate(this,this._getIsInline$p$0);
  7082. this.$$d__getAttachmentType$p$0=Function.createDelegate(this,this._getAttachmentType$p$0);
  7083. this.$$d__getSize$p$0=Function.createDelegate(this,this._getSize$p$0);
  7084. this.$$d__getContentType$p$0=Function.createDelegate(this,this._getContentType$p$0);
  7085. this.$$d__getName$p$0=Function.createDelegate(this,this._getName$p$0);
  7086. this.$$d__getId$p$0=Function.createDelegate(this,this._getId$p$0);
  7087. this._data$p$0=data;
  7088. $h.InitialData._defineReadOnlyProperty$i(this,"id",this.$$d__getId$p$0);
  7089. $h.InitialData._defineReadOnlyProperty$i(this,"name",this.$$d__getName$p$0);
  7090. $h.InitialData._defineReadOnlyProperty$i(this,"contentType",this.$$d__getContentType$p$0);
  7091. $h.InitialData._defineReadOnlyProperty$i(this,"size",this.$$d__getSize$p$0);
  7092. $h.InitialData._defineReadOnlyProperty$i(this,"attachmentType",this.$$d__getAttachmentType$p$0);
  7093. $h.InitialData._defineReadOnlyProperty$i(this,"isInline",this.$$d__getIsInline$p$0)
  7094. };
  7095. $h.AttachmentDetails.prototype={
  7096. _data$p$0: null,
  7097. _getId$p$0: function()
  7098. {
  7099. return this._data$p$0["id"]
  7100. },
  7101. _getName$p$0: function()
  7102. {
  7103. return this._data$p$0["name"]
  7104. },
  7105. _getContentType$p$0: function()
  7106. {
  7107. return this._data$p$0["contentType"]
  7108. },
  7109. _getSize$p$0: function()
  7110. {
  7111. return this._data$p$0["size"]
  7112. },
  7113. _getAttachmentType$p$0: function()
  7114. {
  7115. var response=this._data$p$0["attachmentType"];
  7116. return response < $h.AttachmentDetails._attachmentTypeMap$p["length"] ? $h.AttachmentDetails._attachmentTypeMap$p[response] : window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["AttachmentType"]["File"]
  7117. },
  7118. _getIsInline$p$0: function()
  7119. {
  7120. return this._data$p$0["isInline"]
  7121. }
  7122. };
  7123. $h.Body=function(){};
  7124. $h.Body._tryMapToHostCoercionType$i=function(coercionType, hostCoercionType)
  7125. {
  7126. hostCoercionType.val=undefined;
  7127. if(coercionType===window["Microsoft"]["Office"]["WebExtension"]["CoercionType"]["Html"])
  7128. hostCoercionType.val=3;
  7129. else if(coercionType===window["Microsoft"]["Office"]["WebExtension"]["CoercionType"]["Text"])
  7130. hostCoercionType.val=0;
  7131. else
  7132. return false;
  7133. return true
  7134. };
  7135. $h.Body.prototype.getAsync=function(coercionType)
  7136. {
  7137. var args=[];
  7138. for(var $$pai_7=1; $$pai_7 < arguments["length"];++$$pai_7)
  7139. args[$$pai_7 - 1]=arguments[$$pai_7];
  7140. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getAsync");
  7141. var commonParameters=$h.CommonParameters.parse(args,true);
  7142. var hostCoercionType;
  7143. var $$t_5,
  7144. $$t_6;
  7145. if(!($$t_6=$h.Body._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5["val"],$$t_6))
  7146. throw Error.argument("coercionType");
  7147. var dataToHost={coercionType: hostCoercionType};
  7148. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(37,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7149. };
  7150. $h.ComposeBody=function()
  7151. {
  7152. $h.ComposeBody.initializeBase(this)
  7153. };
  7154. $h.ComposeBody._createParameterDictionaryToHost$i=function(data, parameters)
  7155. {
  7156. var dataToHost={data: data};
  7157. if(parameters._options$p$0 && !$h.ScriptHelpers.isNull(parameters._options$p$0["coercionType"]))
  7158. {
  7159. var hostCoercionType;
  7160. var $$t_4,
  7161. $$t_5;
  7162. if(!($$t_5=$h.Body._tryMapToHostCoercionType$i(parameters._options$p$0["coercionType"],$$t_4={val: hostCoercionType}),hostCoercionType=$$t_4["val"],$$t_5))
  7163. {
  7164. if(parameters._callback$p$0)
  7165. parameters._callback$p$0(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,1e3,parameters._asyncContext$p$0,null));
  7166. return null
  7167. }
  7168. dataToHost["coercionType"]=hostCoercionType
  7169. }
  7170. else
  7171. dataToHost["coercionType"]=0;
  7172. return dataToHost
  7173. };
  7174. $h.ComposeBody.prototype.getTypeAsync=function()
  7175. {
  7176. var args=[];
  7177. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7178. args[$$pai_2]=arguments[$$pai_2];
  7179. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getTypeAsync");
  7180. var parameters=$h.CommonParameters.parse(args,true);
  7181. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(14,null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7182. };
  7183. $h.ComposeBody.prototype.setSelectedDataAsync=function(data)
  7184. {
  7185. var args=[];
  7186. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  7187. args[$$pai_4 - 1]=arguments[$$pai_4];
  7188. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setSelectedDataAsync");
  7189. var parameters=$h.CommonParameters.parse(args,false);
  7190. if(!String.isInstanceOfType(data))
  7191. throw Error.argumentType("data",Object["getType"](data),String);
  7192. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,1e6,"data");
  7193. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  7194. if(!dataToHost)
  7195. return;
  7196. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(13,dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7197. };
  7198. $h.ComposeBody.prototype.prependAsync=function(data)
  7199. {
  7200. var args=[];
  7201. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  7202. args[$$pai_4 - 1]=arguments[$$pai_4];
  7203. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.prependAsync");
  7204. var parameters=$h.CommonParameters.parse(args,false);
  7205. if(!String.isInstanceOfType(data))
  7206. throw Error.argumentType("data",Object["getType"](data),String);
  7207. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,1e6,"data");
  7208. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  7209. if(!dataToHost)
  7210. return;
  7211. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(23,dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7212. };
  7213. $h.ComposeBody.prototype.setAsync=function(data)
  7214. {
  7215. var args=[];
  7216. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  7217. args[$$pai_4 - 1]=arguments[$$pai_4];
  7218. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setAsync");
  7219. var parameters=$h.CommonParameters.parse(args,false);
  7220. if(!String.isInstanceOfType(data))
  7221. throw Error.argumentType("data",Object["getType"](data),String);
  7222. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,1e6,"data");
  7223. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  7224. if(!dataToHost)
  7225. return;
  7226. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(38,dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7227. };
  7228. $h.ComposeItem=function(data)
  7229. {
  7230. this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1);
  7231. this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1);
  7232. $h.ComposeItem.initializeBase(this,[data]);
  7233. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1);
  7234. $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1)
  7235. };
  7236. $h.ComposeItem.prototype={
  7237. _subject$p$1: null,
  7238. _body$p$1: null,
  7239. _getBody$p$1: function()
  7240. {
  7241. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7242. if(!this._body$p$1)
  7243. this._body$p$1=new $h.ComposeBody;
  7244. return this._body$p$1
  7245. },
  7246. _getSubject$p$1: function()
  7247. {
  7248. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7249. if(!this._subject$p$1)
  7250. this._subject$p$1=new $h.ComposeSubject;
  7251. return this._subject$p$1
  7252. }
  7253. };
  7254. $h.ComposeItem.prototype.addFileAttachmentAsync=function(uri, attachmentName)
  7255. {
  7256. var args=[];
  7257. for(var $$pai_5=2; $$pai_5 < arguments["length"];++$$pai_5)
  7258. args[$$pai_5 - 2]=arguments[$$pai_5];
  7259. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addFileAttachmentAsync");
  7260. if(!$h.ScriptHelpers.isNonEmptyString(uri))
  7261. throw Error.argument("uri");
  7262. if(!$h.ScriptHelpers.isNonEmptyString(attachmentName))
  7263. throw Error.argument("attachmentName");
  7264. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(uri["length"],0,2048,"uri");
  7265. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(attachmentName["length"],0,255,"attachmentName");
  7266. var commonParameters=$h.CommonParameters.parse(args,false);
  7267. var parameters={
  7268. uri: uri,
  7269. name: attachmentName,
  7270. __timeout__: 6e5
  7271. };
  7272. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(16,parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7273. };
  7274. $h.ComposeItem.prototype.addItemAttachmentAsync=function(itemId, attachmentName)
  7275. {
  7276. var args=[];
  7277. for(var $$pai_5=2; $$pai_5 < arguments["length"];++$$pai_5)
  7278. args[$$pai_5 - 2]=arguments[$$pai_5];
  7279. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addItemAttachmentAsync");
  7280. if(!$h.ScriptHelpers.isNonEmptyString(itemId))
  7281. throw Error.argument("itemId");
  7282. if(!$h.ScriptHelpers.isNonEmptyString(attachmentName))
  7283. throw Error.argument("attachmentName");
  7284. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(itemId["length"],0,200,"itemId");
  7285. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(attachmentName["length"],0,255,"attachmentName");
  7286. var commonParameters=$h.CommonParameters.parse(args,false);
  7287. var parameters={
  7288. itemId: window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost(itemId),
  7289. name: attachmentName,
  7290. __timeout__: 6e5
  7291. };
  7292. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(19,parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7293. };
  7294. $h.ComposeItem.prototype.removeAttachmentAsync=function(attachmentId)
  7295. {
  7296. var args=[];
  7297. for(var $$pai_3=1; $$pai_3 < arguments["length"];++$$pai_3)
  7298. args[$$pai_3 - 1]=arguments[$$pai_3];
  7299. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"removeAttachmentAsync");
  7300. if(!$h.ScriptHelpers.isNonEmptyString(attachmentId))
  7301. throw Error.argument("attachmentId");
  7302. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(attachmentId["length"],0,200,"attachmentId");
  7303. var commonParameters=$h.CommonParameters.parse(args,false);
  7304. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(20,{attachmentIndex: attachmentId},null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7305. };
  7306. $h.ComposeItem.prototype.getSelectedDataAsync=function(coercionType)
  7307. {
  7308. var args=[];
  7309. for(var $$pai_7=1; $$pai_7 < arguments["length"];++$$pai_7)
  7310. args[$$pai_7 - 1]=arguments[$$pai_7];
  7311. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getSelectedDataAsync");
  7312. var commonParameters=$h.CommonParameters.parse(args,true);
  7313. var hostCoercionType;
  7314. var $$t_5,
  7315. $$t_6;
  7316. if(coercionType !==window["Microsoft"]["Office"]["WebExtension"]["CoercionType"]["Html"] && coercionType !==window["Microsoft"]["Office"]["WebExtension"]["CoercionType"]["Text"] || !($$t_6=$h.Body._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5["val"],$$t_6))
  7317. throw Error.argument("coercionType");
  7318. var dataToHost={coercionType: hostCoercionType};
  7319. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(28,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7320. };
  7321. $h.ComposeItem.prototype.setSelectedDataAsync=function(data)
  7322. {
  7323. var args=[];
  7324. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  7325. args[$$pai_4 - 1]=arguments[$$pai_4];
  7326. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"setSelectedDataAsync");
  7327. var parameters=$h.CommonParameters.parse(args,false);
  7328. if(!String.isInstanceOfType(data))
  7329. throw Error.argumentType("data",Object["getType"](data),String);
  7330. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,1e6,"data");
  7331. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  7332. if(!dataToHost)
  7333. return;
  7334. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(29,dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7335. };
  7336. $h.ComposeItem.prototype.close=function()
  7337. {
  7338. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(41,null,null,null,null)
  7339. };
  7340. $h.ComposeItem.prototype.saveAsync=function()
  7341. {
  7342. var args=[];
  7343. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7344. args[$$pai_2]=arguments[$$pai_2];
  7345. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"saveAsync");
  7346. var parameters=$h.CommonParameters.parse(args,false);
  7347. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(32,null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7348. };
  7349. $h.ComposeRecipient=function(type, propertyName)
  7350. {
  7351. this._type$p$0=type;
  7352. this._propertyName$p$0=propertyName
  7353. };
  7354. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function(displayName, emailAddress)
  7355. {
  7356. if(!displayName && !emailAddress)
  7357. throw Error.argument("recipients");
  7358. if(displayName && displayName["length"] > 255)
  7359. throw Error.argumentOutOfRange("recipients",displayName["length"],window["_u"]["ExtensibilityStrings"]["l_DisplayNameTooLong_Text"]);
  7360. if(emailAddress && emailAddress["length"] > 571)
  7361. throw Error.argumentOutOfRange("recipients",emailAddress["length"],window["_u"]["ExtensibilityStrings"]["l_EmailAddressTooLong_Text"]);
  7362. };
  7363. $h.ComposeRecipient._getAsyncFormatter$p=function(rawInput)
  7364. {
  7365. var input=rawInput;
  7366. var output=[];
  7367. for(var i=0; i < input["length"]; i++)
  7368. {
  7369. var email=new $h.EmailAddressDetails(input[i]);
  7370. output[i]=email
  7371. }
  7372. return output
  7373. };
  7374. $h.ComposeRecipient._createEmailDictionaryForHost$p=function(address, name)
  7375. {
  7376. return{
  7377. address: address,
  7378. name: name
  7379. }
  7380. };
  7381. $h.ComposeRecipient.prototype={
  7382. _propertyName$p$0: null,
  7383. _type$p$0: 0,
  7384. setAddHelper: function(recipients, args, isSet)
  7385. {
  7386. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(recipients["length"],0,100,"recipients");
  7387. var parameters=$h.CommonParameters.parse(args,false);
  7388. var recipientData=[];
  7389. if(Array.isInstanceOfType(recipients))
  7390. for(var i=0; i < recipients["length"]; i++)
  7391. if(String.isInstanceOfType(recipients[i]))
  7392. {
  7393. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i],recipients[i]);
  7394. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i],recipients[i])
  7395. }
  7396. else if($h.EmailAddressDetails.isInstanceOfType(recipients[i]))
  7397. {
  7398. var address=recipients[i];
  7399. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address["displayName"],address["emailAddress"]);
  7400. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address["emailAddress"],address["displayName"])
  7401. }
  7402. else if(Object.isInstanceOfType(recipients[i]))
  7403. {
  7404. var input=recipients[i];
  7405. var emailAddress=input["emailAddress"];
  7406. var displayName=input["displayName"];
  7407. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName,emailAddress);
  7408. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress,displayName)
  7409. }
  7410. else
  7411. throw Error.argument("recipients");
  7412. else
  7413. throw Error.argument("recipients");
  7414. var $$t_B=this;
  7415. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(isSet ? 21 : 22,{
  7416. recipientField: this._type$p$0,
  7417. recipientArray: recipientData
  7418. },function(rawInput)
  7419. {
  7420. return rawInput
  7421. },parameters._asyncContext$p$0,parameters._callback$p$0)
  7422. }
  7423. };
  7424. $h.ComposeRecipient.prototype.getAsync=function()
  7425. {
  7426. var args=[];
  7427. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7428. args[$$pai_2]=arguments[$$pai_2];
  7429. var parameters=$h.CommonParameters.parse(args,true);
  7430. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._propertyName$p$0+".getAsync");
  7431. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(15,{recipientField: this._type$p$0},$h.ComposeRecipient._getAsyncFormatter$p,parameters._asyncContext$p$0,parameters._callback$p$0)
  7432. };
  7433. $h.ComposeRecipient.prototype.setAsync=function(recipients)
  7434. {
  7435. var args=[];
  7436. for(var $$pai_2=1; $$pai_2 < arguments["length"];++$$pai_2)
  7437. args[$$pai_2 - 1]=arguments[$$pai_2];
  7438. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".setAsync");
  7439. this.setAddHelper(recipients,args,true)
  7440. };
  7441. $h.ComposeRecipient.prototype.addAsync=function(recipients)
  7442. {
  7443. var args=[];
  7444. for(var $$pai_2=1; $$pai_2 < arguments["length"];++$$pai_2)
  7445. args[$$pai_2 - 1]=arguments[$$pai_2];
  7446. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".addAsync");
  7447. this.setAddHelper(recipients,args,false)
  7448. };
  7449. $h.ComposeRecipient.RecipientField=function(){};
  7450. $h.ComposeRecipient.RecipientField.prototype={
  7451. to: 0,
  7452. cc: 1,
  7453. bcc: 2,
  7454. requiredAttendees: 0,
  7455. optionalAttendees: 1
  7456. };
  7457. $h.ComposeRecipient.RecipientField.registerEnum("$h.ComposeRecipient.RecipientField",false);
  7458. $h.ComposeLocation=function(){};
  7459. $h.ComposeLocation.prototype.getAsync=function()
  7460. {
  7461. var args=[];
  7462. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7463. args[$$pai_2]=arguments[$$pai_2];
  7464. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"location.getAsync");
  7465. var parameters=$h.CommonParameters.parse(args,true);
  7466. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(26,null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7467. };
  7468. $h.ComposeLocation.prototype.setAsync=function(location)
  7469. {
  7470. var args=[];
  7471. for(var $$pai_3=1; $$pai_3 < arguments["length"];++$$pai_3)
  7472. args[$$pai_3 - 1]=arguments[$$pai_3];
  7473. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"location.setAsync");
  7474. var parameters=$h.CommonParameters.parse(args,false);
  7475. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(location["length"],0,255,"location");
  7476. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(27,{location: location},null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7477. };
  7478. $h.ComposeSubject=function(){};
  7479. $h.ComposeSubject.prototype.getAsync=function()
  7480. {
  7481. var args=[];
  7482. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7483. args[$$pai_2]=arguments[$$pai_2];
  7484. var parameters=$h.CommonParameters.parse(args,true);
  7485. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"subject.getAsync");
  7486. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(18,null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7487. };
  7488. $h.ComposeSubject.prototype.setAsync=function(data)
  7489. {
  7490. var args=[];
  7491. for(var $$pai_3=1; $$pai_3 < arguments["length"];++$$pai_3)
  7492. args[$$pai_3 - 1]=arguments[$$pai_3];
  7493. var parameters=$h.CommonParameters.parse(args,false);
  7494. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"subject.setAsync");
  7495. if(!String.isInstanceOfType(data))
  7496. throw Error.argument("data");
  7497. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,255,"data");
  7498. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(17,{subject: data},null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7499. };
  7500. $h.ComposeTime=function(type)
  7501. {
  7502. this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this,this._ticksToDateFormatter$p$0);
  7503. this._timeType$p$0=type
  7504. };
  7505. $h.ComposeTime.prototype={
  7506. _timeType$p$0: 0,
  7507. _ticksToDateFormatter$p$0: function(rawInput)
  7508. {
  7509. var ticks=rawInput;
  7510. return new Date(ticks)
  7511. },
  7512. _getPropertyName$p$0: function()
  7513. {
  7514. return this._timeType$p$0===1 ? "start" : "end"
  7515. }
  7516. };
  7517. $h.ComposeTime.prototype.getAsync=function()
  7518. {
  7519. var args=[];
  7520. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7521. args[$$pai_2]=arguments[$$pai_2];
  7522. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._getPropertyName$p$0()+".getAsync");
  7523. var parameters=$h.CommonParameters.parse(args,true);
  7524. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(24,{TimeProperty: this._timeType$p$0},this.$$d__ticksToDateFormatter$p$0,parameters._asyncContext$p$0,parameters._callback$p$0)
  7525. };
  7526. $h.ComposeTime.prototype.setAsync=function(dateTime)
  7527. {
  7528. var args=[];
  7529. for(var $$pai_3=1; $$pai_3 < arguments["length"];++$$pai_3)
  7530. args[$$pai_3 - 1]=arguments[$$pai_3];
  7531. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._getPropertyName$p$0()+".setAsync");
  7532. if(!Date.isInstanceOfType(dateTime))
  7533. throw Error.argumentType("dateTime",Object["getType"](dateTime),Date);
  7534. if(window["isNaN"](dateTime["getTime"]()))
  7535. throw Error.argument("dateTime");
  7536. if(dateTime["getTime"]() < -864e13 || dateTime["getTime"]() > 864e13)
  7537. throw Error.argumentOutOfRange("dateTime");
  7538. var parameters=$h.CommonParameters.parse(args,false);
  7539. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(25,{
  7540. TimeProperty: this._timeType$p$0,
  7541. time: dateTime["getTime"]()
  7542. },null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7543. };
  7544. $h.ComposeTime.TimeType=function(){};
  7545. $h.ComposeTime.TimeType.prototype={
  7546. start: 1,
  7547. end: 2
  7548. };
  7549. $h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",false);
  7550. $h.Contact=function(data)
  7551. {
  7552. this.$$d__getContactString$p$0=Function.createDelegate(this,this._getContactString$p$0);
  7553. this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0);
  7554. this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0);
  7555. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0);
  7556. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0);
  7557. this.$$d__getBusinessName$p$0=Function.createDelegate(this,this._getBusinessName$p$0);
  7558. this.$$d__getPersonName$p$0=Function.createDelegate(this,this._getPersonName$p$0);
  7559. this._data$p$0=data;
  7560. $h.InitialData._defineReadOnlyProperty$i(this,"personName",this.$$d__getPersonName$p$0);
  7561. $h.InitialData._defineReadOnlyProperty$i(this,"businessName",this.$$d__getBusinessName$p$0);
  7562. $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0);
  7563. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0);
  7564. $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0);
  7565. $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0);
  7566. $h.InitialData._defineReadOnlyProperty$i(this,"contactString",this.$$d__getContactString$p$0)
  7567. };
  7568. $h.Contact.prototype={
  7569. _data$p$0: null,
  7570. _phoneNumbers$p$0: null,
  7571. _getPersonName$p$0: function()
  7572. {
  7573. return this._data$p$0["PersonName"]
  7574. },
  7575. _getBusinessName$p$0: function()
  7576. {
  7577. return this._data$p$0["BusinessName"]
  7578. },
  7579. _getAddresses$p$0: function()
  7580. {
  7581. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses")
  7582. },
  7583. _getEmailAddresses$p$0: function()
  7584. {
  7585. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses")
  7586. },
  7587. _getUrls$p$0: function()
  7588. {
  7589. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls")
  7590. },
  7591. _getPhoneNumbers$p$0: function()
  7592. {
  7593. if(!this._phoneNumbers$p$0)
  7594. {
  7595. var $$t_1=this;
  7596. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",function(data)
  7597. {
  7598. return new $h.PhoneNumber(data)
  7599. })
  7600. }
  7601. return this._phoneNumbers$p$0
  7602. },
  7603. _getContactString$p$0: function()
  7604. {
  7605. return this._data$p$0["ContactString"]
  7606. }
  7607. };
  7608. $h.CustomProperties=function(data)
  7609. {
  7610. if($h.ScriptHelpers.isNullOrUndefined(data))
  7611. throw Error.argumentNull("data");
  7612. if(Array.isInstanceOfType(data))
  7613. {
  7614. var customPropertiesArray=data;
  7615. if(customPropertiesArray["length"] > 0)
  7616. this._data$p$0=customPropertiesArray[0];
  7617. else
  7618. throw Error.argument("data");
  7619. }
  7620. else
  7621. this._data$p$0=data
  7622. };
  7623. $h.CustomProperties.prototype={_data$p$0: null};
  7624. $h.CustomProperties.prototype.get=function(name)
  7625. {
  7626. var value=this._data$p$0[name];
  7627. if(typeof value==="string")
  7628. {
  7629. var valueString=value;
  7630. if(valueString["length"] > 6 && valueString.startsWith("Date(") && valueString.endsWith(")"))
  7631. {
  7632. var ticksString=valueString["substring"](5,valueString["length"] - 1);
  7633. var ticks=window["parseInt"](ticksString);
  7634. if(!window["isNaN"](ticks))
  7635. {
  7636. var dateTimeValue=new Date(ticks);
  7637. if(dateTimeValue)
  7638. value=dateTimeValue
  7639. }
  7640. }
  7641. }
  7642. return value
  7643. };
  7644. $h.CustomProperties.prototype.set=function(name, value)
  7645. {
  7646. if(window["OSF"]["OUtil"]["isDate"](value))
  7647. value="Date("+value["getTime"]()+")";
  7648. this._data$p$0[name]=value
  7649. };
  7650. $h.CustomProperties.prototype.remove=function(name)
  7651. {
  7652. delete this._data$p$0[name]
  7653. };
  7654. $h.CustomProperties.prototype.saveAsync=function()
  7655. {
  7656. var args=[];
  7657. for(var $$pai_4=0; $$pai_4 < arguments["length"];++$$pai_4)
  7658. args[$$pai_4]=arguments[$$pai_4];
  7659. var MaxCustomPropertiesLength=2500;
  7660. if(window["JSON"]["stringify"](this._data$p$0)["length"] > MaxCustomPropertiesLength)
  7661. throw Error.argument();
  7662. var parameters=$h.CommonParameters.parse(args,false,true);
  7663. var saveCustomProperties=new $h.SaveDictionaryRequest(parameters._callback$p$0,parameters._asyncContext$p$0);
  7664. saveCustomProperties._sendRequest$i$0(4,"SaveCustomProperties",{customProperties: this._data$p$0})
  7665. };
  7666. $h.Diagnostics=function(data, appName)
  7667. {
  7668. this.$$d__getOwaView$p$0=Function.createDelegate(this,this._getOwaView$p$0);
  7669. this.$$d__getHostVersion$p$0=Function.createDelegate(this,this._getHostVersion$p$0);
  7670. this.$$d__getHostName$p$0=Function.createDelegate(this,this._getHostName$p$0);
  7671. this._data$p$0=data;
  7672. this._appName$p$0=appName;
  7673. $h.InitialData._defineReadOnlyProperty$i(this,"hostName",this.$$d__getHostName$p$0);
  7674. $h.InitialData._defineReadOnlyProperty$i(this,"hostVersion",this.$$d__getHostVersion$p$0);
  7675. if(64===this._appName$p$0)
  7676. $h.InitialData._defineReadOnlyProperty$i(this,"OWAView",this.$$d__getOwaView$p$0)
  7677. };
  7678. $h.Diagnostics.prototype={
  7679. _data$p$0: null,
  7680. _appName$p$0: 0,
  7681. _getHostName$p$0: function()
  7682. {
  7683. if(8===this._appName$p$0)
  7684. return"Outlook";
  7685. else if(64===this._appName$p$0)
  7686. return"OutlookWebApp";
  7687. return null
  7688. },
  7689. _getHostVersion$p$0: function()
  7690. {
  7691. return this._data$p$0.get__hostVersion$i$0()
  7692. },
  7693. _getOwaView$p$0: function()
  7694. {
  7695. return this._data$p$0.get__owaView$i$0()
  7696. }
  7697. };
  7698. $h.EmailAddressDetails=function(data)
  7699. {
  7700. this.$$d__getRecipientType$p$0=Function.createDelegate(this,this._getRecipientType$p$0);
  7701. this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this,this._getAppointmentResponse$p$0);
  7702. this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0);
  7703. this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0);
  7704. this._data$p$0=data;
  7705. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0);
  7706. $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0);
  7707. if($h.ScriptHelpers.dictionaryContainsKey(data,"appointmentResponse"))
  7708. $h.InitialData._defineReadOnlyProperty$i(this,"appointmentResponse",this.$$d__getAppointmentResponse$p$0);
  7709. if($h.ScriptHelpers.dictionaryContainsKey(data,"recipientType"))
  7710. $h.InitialData._defineReadOnlyProperty$i(this,"recipientType",this.$$d__getRecipientType$p$0)
  7711. };
  7712. $h.EmailAddressDetails._createFromEmailUserDictionary$i=function(data)
  7713. {
  7714. var emailAddressDetailsDictionary={};
  7715. var displayName=data["Name"];
  7716. var emailAddress=data["UserId"];
  7717. emailAddressDetailsDictionary["name"]=displayName || $h.EmailAddressDetails._emptyString$p;
  7718. emailAddressDetailsDictionary["address"]=emailAddress || $h.EmailAddressDetails._emptyString$p;
  7719. return new $h.EmailAddressDetails(emailAddressDetailsDictionary)
  7720. };
  7721. $h.EmailAddressDetails.prototype={
  7722. _data$p$0: null,
  7723. _getEmailAddress$p$0: function()
  7724. {
  7725. return this._data$p$0["address"]
  7726. },
  7727. _getDisplayName$p$0: function()
  7728. {
  7729. return this._data$p$0["name"]
  7730. },
  7731. _getAppointmentResponse$p$0: function()
  7732. {
  7733. var response=this._data$p$0["appointmentResponse"];
  7734. return response < $h.EmailAddressDetails._responseTypeMap$p["length"] ? $h.EmailAddressDetails._responseTypeMap$p[response] : window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["None"]
  7735. },
  7736. _getRecipientType$p$0: function()
  7737. {
  7738. var response=this._data$p$0["recipientType"];
  7739. return response < $h.EmailAddressDetails._recipientTypeMap$p["length"] ? $h.EmailAddressDetails._recipientTypeMap$p[response] : window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["Other"]
  7740. }
  7741. };
  7742. $h.EmailAddressDetails.prototype.toJSON=function()
  7743. {
  7744. var result={};
  7745. result["emailAddress"]=this._getEmailAddress$p$0();
  7746. result["displayName"]=this._getDisplayName$p$0();
  7747. if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"appointmentResponse"))
  7748. result["appointmentResponse"]=this._getAppointmentResponse$p$0();
  7749. if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"recipientType"))
  7750. result["recipientType"]=this._getRecipientType$p$0();
  7751. return result
  7752. };
  7753. $h.Entities=function(data, filteredEntitiesData, timeSent, permissionLevel)
  7754. {
  7755. this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this,this._createMeetingSuggestion$p$0);
  7756. this.$$d__getParcelDeliveries$p$0=Function.createDelegate(this,this._getParcelDeliveries$p$0);
  7757. this.$$d__getFlightReservations$p$0=Function.createDelegate(this,this._getFlightReservations$p$0);
  7758. this.$$d__getContacts$p$0=Function.createDelegate(this,this._getContacts$p$0);
  7759. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0);
  7760. this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0);
  7761. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0);
  7762. this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this,this._getMeetingSuggestions$p$0);
  7763. this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this,this._getTaskSuggestions$p$0);
  7764. this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0);
  7765. this._data$p$0=data || {};
  7766. this._filteredData$p$0=filteredEntitiesData || {};
  7767. this._dateTimeSent$p$0=timeSent;
  7768. $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0);
  7769. $h.InitialData._defineReadOnlyProperty$i(this,"taskSuggestions",this.$$d__getTaskSuggestions$p$0);
  7770. $h.InitialData._defineReadOnlyProperty$i(this,"meetingSuggestions",this.$$d__getMeetingSuggestions$p$0);
  7771. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0);
  7772. $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0);
  7773. $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0);
  7774. $h.InitialData._defineReadOnlyProperty$i(this,"contacts",this.$$d__getContacts$p$0);
  7775. $h.InitialData._defineReadOnlyProperty$i(this,"flightReservations",this.$$d__getFlightReservations$p$0);
  7776. $h.InitialData._defineReadOnlyProperty$i(this,"parcelDeliveries",this.$$d__getParcelDeliveries$p$0);
  7777. this._permissionLevel$p$0=permissionLevel
  7778. };
  7779. $h.Entities._getExtractedObjects$i=function(T, data, name, creator, removeDuplicates, stringPropertyName)
  7780. {
  7781. var results=null;
  7782. var extractedObjects=data[name];
  7783. if(!extractedObjects)
  7784. return new Array(0);
  7785. if(removeDuplicates)
  7786. extractedObjects=$h.Entities._removeDuplicate$p(Object,extractedObjects,$h.Entities._entityDictionaryEquals$p,stringPropertyName);
  7787. results=new Array(extractedObjects["length"]);
  7788. var count=0;
  7789. for(var $$arr_9=extractedObjects, $$len_A=$$arr_9["length"], $$idx_B=0; $$idx_B < $$len_A;++$$idx_B)
  7790. {
  7791. var extractedObject=$$arr_9[$$idx_B];
  7792. if(creator)
  7793. results[count++]=creator(extractedObject);
  7794. else
  7795. results[count++]=extractedObject
  7796. }
  7797. return results
  7798. };
  7799. $h.Entities._getExtractedStringProperty$i=function(data, name, removeDuplicate)
  7800. {
  7801. var extractedProperties=data[name];
  7802. if(!extractedProperties)
  7803. return new Array(0);
  7804. if(removeDuplicate)
  7805. extractedProperties=$h.Entities._removeDuplicate$p(String,extractedProperties,$h.Entities._stringEquals$p,null);
  7806. return extractedProperties
  7807. };
  7808. $h.Entities._createContact$p=function(data)
  7809. {
  7810. return new $h.Contact(data)
  7811. };
  7812. $h.Entities._createTaskSuggestion$p=function(data)
  7813. {
  7814. return new $h.TaskSuggestion(data)
  7815. };
  7816. $h.Entities._createPhoneNumber$p=function(data)
  7817. {
  7818. return new $h.PhoneNumber(data)
  7819. };
  7820. $h.Entities._entityDictionaryEquals$p=function(dictionary1, dictionary2, entityPropertyIdentifier)
  7821. {
  7822. if(dictionary1===dictionary2)
  7823. return true;
  7824. if(!dictionary1 || !dictionary2)
  7825. return false;
  7826. if(dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier])
  7827. return true;
  7828. return false
  7829. };
  7830. $h.Entities._stringEquals$p=function(string1, string2, entityProperty)
  7831. {
  7832. return string1===string2
  7833. };
  7834. $h.Entities._removeDuplicate$p=function(T, array, entityEquals, entityPropertyIdentifier)
  7835. {
  7836. for(var matchIndex1=array["length"] - 1; matchIndex1 >=0; matchIndex1--)
  7837. {
  7838. var removeMatch=false;
  7839. for(var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--)
  7840. if(entityEquals(array[matchIndex1],array[matchIndex2],entityPropertyIdentifier))
  7841. {
  7842. removeMatch=true;
  7843. break
  7844. }
  7845. if(removeMatch)
  7846. Array.removeAt(array,matchIndex1)
  7847. }
  7848. return array
  7849. };
  7850. $h.Entities.prototype={
  7851. _dateTimeSent$p$0: null,
  7852. _data$p$0: null,
  7853. _filteredData$p$0: null,
  7854. _filteredEntitiesCache$p$0: null,
  7855. _permissionLevel$p$0: 0,
  7856. _taskSuggestions$p$0: null,
  7857. _meetingSuggestions$p$0: null,
  7858. _phoneNumbers$p$0: null,
  7859. _contacts$p$0: null,
  7860. _addresses$p$0: null,
  7861. _emailAddresses$p$0: null,
  7862. _urls$p$0: null,
  7863. _flightReservations$p$0: null,
  7864. _parcelDeliveries$p$0: null,
  7865. _getByType$i$0: function(entityType)
  7866. {
  7867. if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["MeetingSuggestion"])
  7868. return this._getMeetingSuggestions$p$0();
  7869. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["TaskSuggestion"])
  7870. return this._getTaskSuggestions$p$0();
  7871. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["Address"])
  7872. return this._getAddresses$p$0();
  7873. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["PhoneNumber"])
  7874. return this._getPhoneNumbers$p$0();
  7875. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["EmailAddress"])
  7876. return this._getEmailAddresses$p$0();
  7877. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["Url"])
  7878. return this._getUrls$p$0();
  7879. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["Contact"])
  7880. return this._getContacts$p$0();
  7881. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["FlightReservations"])
  7882. return this._getFlightReservations$p$0();
  7883. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["ParcelDeliveries"])
  7884. return this._getParcelDeliveries$p$0();
  7885. return null
  7886. },
  7887. _getFilteredEntitiesByName$i$0: function(name)
  7888. {
  7889. if(!this._filteredEntitiesCache$p$0)
  7890. this._filteredEntitiesCache$p$0={};
  7891. if(!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0,name))
  7892. {
  7893. var found=false;
  7894. for(var i=0; i < $h.Entities._allEntityKeys$p["length"]; i++)
  7895. {
  7896. var entityTypeKey=$h.Entities._allEntityKeys$p[i];
  7897. var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey];
  7898. if(!perEntityTypeDictionary)
  7899. continue;
  7900. if($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary,name))
  7901. {
  7902. switch(entityTypeKey)
  7903. {
  7904. case"EmailAddresses":
  7905. case"Urls":
  7906. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name);
  7907. break;
  7908. case"Addresses":
  7909. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name,true);
  7910. break;
  7911. case"PhoneNumbers":
  7912. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber,perEntityTypeDictionary,name,$h.Entities._createPhoneNumber$p,false,null);
  7913. break;
  7914. case"TaskSuggestions":
  7915. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,perEntityTypeDictionary,name,$h.Entities._createTaskSuggestion$p,true,"TaskString");
  7916. break;
  7917. case"MeetingSuggestions":
  7918. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,perEntityTypeDictionary,name,this.$$d__createMeetingSuggestion$p$0,true,"MeetingString");
  7919. break;
  7920. case"Contacts":
  7921. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact,perEntityTypeDictionary,name,$h.Entities._createContact$p,true,"ContactString");
  7922. break
  7923. }
  7924. found=true;
  7925. break
  7926. }
  7927. }
  7928. if(!found)
  7929. this._filteredEntitiesCache$p$0[name]=null
  7930. }
  7931. return this._filteredEntitiesCache$p$0[name]
  7932. },
  7933. _createMeetingSuggestion$p$0: function(data)
  7934. {
  7935. return new $h.MeetingSuggestion(data,this._dateTimeSent$p$0)
  7936. },
  7937. _getAddresses$p$0: function()
  7938. {
  7939. if(!this._addresses$p$0)
  7940. this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses",true);
  7941. return this._addresses$p$0
  7942. },
  7943. _getEmailAddresses$p$0: function()
  7944. {
  7945. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7946. if(!this._emailAddresses$p$0)
  7947. this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses",false);
  7948. return this._emailAddresses$p$0
  7949. },
  7950. _getUrls$p$0: function()
  7951. {
  7952. if(!this._urls$p$0)
  7953. this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls",false);
  7954. return this._urls$p$0
  7955. },
  7956. _getPhoneNumbers$p$0: function()
  7957. {
  7958. if(!this._phoneNumbers$p$0)
  7959. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",$h.Entities._createPhoneNumber$p);
  7960. return this._phoneNumbers$p$0
  7961. },
  7962. _getTaskSuggestions$p$0: function()
  7963. {
  7964. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7965. if(!this._taskSuggestions$p$0)
  7966. this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,this._data$p$0,"TaskSuggestions",$h.Entities._createTaskSuggestion$p,true,"TaskString");
  7967. return this._taskSuggestions$p$0
  7968. },
  7969. _getMeetingSuggestions$p$0: function()
  7970. {
  7971. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7972. if(!this._meetingSuggestions$p$0)
  7973. this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,this._data$p$0,"MeetingSuggestions",this.$$d__createMeetingSuggestion$p$0,true,"MeetingString");
  7974. return this._meetingSuggestions$p$0
  7975. },
  7976. _getContacts$p$0: function()
  7977. {
  7978. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7979. if(!this._contacts$p$0)
  7980. this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact,this._data$p$0,"Contacts",$h.Entities._createContact$p,true,"ContactString");
  7981. return this._contacts$p$0
  7982. },
  7983. _getParcelDeliveries$p$0: function()
  7984. {
  7985. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7986. if(!this._parcelDeliveries$p$0)
  7987. this._parcelDeliveries$p$0=$h.Entities._getExtractedObjects$i(Object,this._data$p$0,"ParcelDeliveries",null);
  7988. return this._parcelDeliveries$p$0
  7989. },
  7990. _getFlightReservations$p$0: function()
  7991. {
  7992. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7993. if(!this._flightReservations$p$0)
  7994. this._flightReservations$p$0=$h.Entities._getExtractedObjects$i(Object,this._data$p$0,"FlightReservations",null);
  7995. return this._flightReservations$p$0
  7996. }
  7997. };
  7998. $h.ReplyConstants=function(){};
  7999. $h.AsyncConstants=function(){};
  8000. window["Office"]["cast"]["item"]=Office.cast.item=function(){};
  8001. window["Office"]["cast"]["item"]["toItemRead"]=function(item)
  8002. {
  8003. if($h.Item.isInstanceOfType(item))
  8004. return item;
  8005. throw Error.argumentType();
  8006. };
  8007. window["Office"]["cast"]["item"]["toItemCompose"]=function(item)
  8008. {
  8009. if($h.ComposeItem.isInstanceOfType(item))
  8010. return item;
  8011. throw Error.argumentType();
  8012. };
  8013. window["Office"]["cast"]["item"]["toMessage"]=function(item)
  8014. {
  8015. return window["Office"]["cast"]["item"]["toMessageRead"](item)
  8016. };
  8017. window["Office"]["cast"]["item"]["toMessageRead"]=function(item)
  8018. {
  8019. if($h.Message.isInstanceOfType(item))
  8020. return item;
  8021. throw Error.argumentType();
  8022. };
  8023. window["Office"]["cast"]["item"]["toMessageCompose"]=function(item)
  8024. {
  8025. if($h.MessageCompose.isInstanceOfType(item))
  8026. return item;
  8027. throw Error.argumentType();
  8028. };
  8029. window["Office"]["cast"]["item"]["toMeetingRequest"]=function(item)
  8030. {
  8031. if($h.MeetingRequest.isInstanceOfType(item))
  8032. return item;
  8033. throw Error.argumentType();
  8034. };
  8035. window["Office"]["cast"]["item"]["toAppointment"]=function(item)
  8036. {
  8037. return window["Office"]["cast"]["item"]["toAppointmentRead"](item)
  8038. };
  8039. window["Office"]["cast"]["item"]["toAppointmentRead"]=function(item)
  8040. {
  8041. if($h.Appointment.isInstanceOfType(item))
  8042. return item;
  8043. throw Error.argumentType();
  8044. };
  8045. window["Office"]["cast"]["item"]["toAppointmentCompose"]=function(item)
  8046. {
  8047. if($h.AppointmentCompose.isInstanceOfType(item))
  8048. return item;
  8049. throw Error.argumentType();
  8050. };
  8051. $h.Item=function(data)
  8052. {
  8053. this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1);
  8054. this.$$d__getAttachments$p$1=Function.createDelegate(this,this._getAttachments$p$1);
  8055. this.$$d__getItemClass$p$1=Function.createDelegate(this,this._getItemClass$p$1);
  8056. this.$$d__getItemId$p$1=Function.createDelegate(this,this._getItemId$p$1);
  8057. this.$$d__getDateTimeModified$p$1=Function.createDelegate(this,this._getDateTimeModified$p$1);
  8058. this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this,this._getDateTimeCreated$p$1);
  8059. $h.Item.initializeBase(this,[data]);
  8060. $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeCreated",this.$$d__getDateTimeCreated$p$1);
  8061. $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeModified",this.$$d__getDateTimeModified$p$1);
  8062. $h.InitialData._defineReadOnlyProperty$i(this,"itemId",this.$$d__getItemId$p$1);
  8063. $h.InitialData._defineReadOnlyProperty$i(this,"itemClass",this.$$d__getItemClass$p$1);
  8064. $h.InitialData._defineReadOnlyProperty$i(this,"attachments",this.$$d__getAttachments$p$1);
  8065. $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1)
  8066. };
  8067. $h.Item.prototype={
  8068. _body$p$1: null,
  8069. _getItemId$p$1: function()
  8070. {
  8071. return this._data$p$0.get__itemId$i$0()
  8072. },
  8073. _getItemClass$p$1: function()
  8074. {
  8075. return this._data$p$0.get__itemClass$i$0()
  8076. },
  8077. _getDateTimeCreated$p$1: function()
  8078. {
  8079. return this._data$p$0.get__dateTimeCreated$i$0()
  8080. },
  8081. _getDateTimeModified$p$1: function()
  8082. {
  8083. return this._data$p$0.get__dateTimeModified$i$0()
  8084. },
  8085. _getAttachments$p$1: function()
  8086. {
  8087. return this._data$p$0.get__attachments$i$0()
  8088. },
  8089. _getBody$p$1: function()
  8090. {
  8091. if(!this._body$p$1)
  8092. this._body$p$1=new $h.Body;
  8093. return this._body$p$1
  8094. }
  8095. };
  8096. $h.ItemBase=function(data)
  8097. {
  8098. this.$$d__createCustomProperties$i$0=Function.createDelegate(this,this._createCustomProperties$i$0);
  8099. this.$$d__getNotificationMessages$p$0=Function.createDelegate(this,this._getNotificationMessages$p$0);
  8100. this.$$d_getItemType=Function.createDelegate(this,this.getItemType);
  8101. this._data$p$0=data;
  8102. $h.InitialData._defineReadOnlyProperty$i(this,"itemType",this.$$d_getItemType);
  8103. $h.InitialData._defineReadOnlyProperty$i(this,"notificationMessages",this.$$d__getNotificationMessages$p$0)
  8104. };
  8105. $h.ItemBase.prototype={
  8106. _data$p$0: null,
  8107. _notificationMessages$p$0: null,
  8108. get_data: function()
  8109. {
  8110. return this._data$p$0
  8111. },
  8112. _createCustomProperties$i$0: function(data)
  8113. {
  8114. return new $h.CustomProperties(data)
  8115. },
  8116. _getNotificationMessages$p$0: function()
  8117. {
  8118. if(!this._notificationMessages$p$0)
  8119. this._notificationMessages$p$0=new $h.NotificationMessages;
  8120. return this._notificationMessages$p$0
  8121. }
  8122. };
  8123. $h.ItemBase.prototype.loadCustomPropertiesAsync=function()
  8124. {
  8125. var args=[];
  8126. for(var $$pai_3=0; $$pai_3 < arguments["length"];++$$pai_3)
  8127. args[$$pai_3]=arguments[$$pai_3];
  8128. var parameters=$h.CommonParameters.parse(args,true,true);
  8129. var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0,"customProperties",parameters._callback$p$0,parameters._asyncContext$p$0);
  8130. loadCustomProperties._sendRequest$i$0(3,"LoadCustomProperties",{})
  8131. };
  8132. $h.MeetingRequest=function(data)
  8133. {
  8134. this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this,this._getRequiredAttendees$p$3);
  8135. this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this,this._getOptionalAttendees$p$3);
  8136. this.$$d__getLocation$p$3=Function.createDelegate(this,this._getLocation$p$3);
  8137. this.$$d__getEnd$p$3=Function.createDelegate(this,this._getEnd$p$3);
  8138. this.$$d__getStart$p$3=Function.createDelegate(this,this._getStart$p$3);
  8139. $h.MeetingRequest.initializeBase(this,[data]);
  8140. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$3);
  8141. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$3);
  8142. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$3);
  8143. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$3);
  8144. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$3)
  8145. };
  8146. $h.MeetingRequest.prototype={
  8147. _getStart$p$3: function()
  8148. {
  8149. return this._data$p$0.get__start$i$0()
  8150. },
  8151. _getEnd$p$3: function()
  8152. {
  8153. return this._data$p$0.get__end$i$0()
  8154. },
  8155. _getLocation$p$3: function()
  8156. {
  8157. return this._data$p$0.get__location$i$0()
  8158. },
  8159. _getOptionalAttendees$p$3: function()
  8160. {
  8161. return this._data$p$0.get__cc$i$0()
  8162. },
  8163. _getRequiredAttendees$p$3: function()
  8164. {
  8165. return this._data$p$0.get__to$i$0()
  8166. }
  8167. };
  8168. $h.MeetingSuggestion=function(data, dateTimeSent)
  8169. {
  8170. this.$$d__getEndTime$p$0=Function.createDelegate(this,this._getEndTime$p$0);
  8171. this.$$d__getStartTime$p$0=Function.createDelegate(this,this._getStartTime$p$0);
  8172. this.$$d__getSubject$p$0=Function.createDelegate(this,this._getSubject$p$0);
  8173. this.$$d__getLocation$p$0=Function.createDelegate(this,this._getLocation$p$0);
  8174. this.$$d__getAttendees$p$0=Function.createDelegate(this,this._getAttendees$p$0);
  8175. this.$$d__getMeetingString$p$0=Function.createDelegate(this,this._getMeetingString$p$0);
  8176. this._data$p$0=data;
  8177. this._dateTimeSent$p$0=dateTimeSent;
  8178. $h.InitialData._defineReadOnlyProperty$i(this,"meetingString",this.$$d__getMeetingString$p$0);
  8179. $h.InitialData._defineReadOnlyProperty$i(this,"attendees",this.$$d__getAttendees$p$0);
  8180. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$0);
  8181. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$0);
  8182. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStartTime$p$0);
  8183. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEndTime$p$0)
  8184. };
  8185. $h.MeetingSuggestion.prototype={
  8186. _dateTimeSent$p$0: null,
  8187. _data$p$0: null,
  8188. _attendees$p$0: null,
  8189. _getMeetingString$p$0: function()
  8190. {
  8191. return this._data$p$0["MeetingString"]
  8192. },
  8193. _getLocation$p$0: function()
  8194. {
  8195. return this._data$p$0["Location"]
  8196. },
  8197. _getSubject$p$0: function()
  8198. {
  8199. return this._data$p$0["Subject"]
  8200. },
  8201. _getStartTime$p$0: function()
  8202. {
  8203. var time=this._createDateTimeFromParameter$p$0("StartTime");
  8204. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0);
  8205. if(resolvedTime["getTime"]() !==time["getTime"]())
  8206. return window["OSF"]["DDA"]["OutlookAppOm"]._instance$p["convertToUtcClientTime"](window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._dateToDictionary$i$0(resolvedTime));
  8207. return time
  8208. },
  8209. _getEndTime$p$0: function()
  8210. {
  8211. var time=this._createDateTimeFromParameter$p$0("EndTime");
  8212. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0);
  8213. if(resolvedTime["getTime"]() !==time["getTime"]())
  8214. return window["OSF"]["DDA"]["OutlookAppOm"]._instance$p["convertToUtcClientTime"](window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._dateToDictionary$i$0(resolvedTime));
  8215. return time
  8216. },
  8217. _createDateTimeFromParameter$p$0: function(keyName)
  8218. {
  8219. var dateTimeString=this._data$p$0[keyName];
  8220. if(!dateTimeString)
  8221. return null;
  8222. return new Date(dateTimeString)
  8223. },
  8224. _getAttendees$p$0: function()
  8225. {
  8226. if(!this._attendees$p$0)
  8227. {
  8228. var $$t_1=this;
  8229. this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Attendees",function(data)
  8230. {
  8231. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data)
  8232. })
  8233. }
  8234. return this._attendees$p$0
  8235. }
  8236. };
  8237. $h.MeetingSuggestionTimeDecoder=function(){};
  8238. $h.MeetingSuggestionTimeDecoder.resolve=function(inTime, sentTime)
  8239. {
  8240. if(!sentTime)
  8241. return inTime;
  8242. try
  8243. {
  8244. var tod;
  8245. var outDate;
  8246. var extractedDate;
  8247. var sentDate=new Date(sentTime["getFullYear"](),sentTime["getMonth"](),sentTime["getDate"](),0,0,0,0);
  8248. var $$t_7,
  8249. $$t_8,
  8250. $$t_9;
  8251. 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))
  8252. return inTime;
  8253. else
  8254. {
  8255. if($h._preciseDate.isInstanceOfType(extractedDate))
  8256. outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate,extractedDate);
  8257. else if($h._relativeDate.isInstanceOfType(extractedDate))
  8258. outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate,extractedDate);
  8259. else
  8260. outDate=sentDate;
  8261. if(window["isNaN"](outDate["getTime"]()))
  8262. return sentTime;
  8263. outDate["setMilliseconds"](outDate["getMilliseconds"]()+tod);
  8264. return outDate
  8265. }
  8266. }
  8267. catch($$e_6)
  8268. {
  8269. return sentTime
  8270. }
  8271. };
  8272. $h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function(value)
  8273. {
  8274. return null===value || value===undefined
  8275. };
  8276. $h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function(sentDate, precise)
  8277. {
  8278. var year=precise._year$i$1;
  8279. var month=!precise._month$i$1 ? sentDate["getMonth"]() : precise._month$i$1 - 1;
  8280. var day=precise._day$i$1;
  8281. if(!day)
  8282. return sentDate;
  8283. var candidate;
  8284. if($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year))
  8285. {
  8286. candidate=new Date(sentDate["getFullYear"](),month,day);
  8287. if(candidate["getTime"]() < sentDate["getTime"]())
  8288. candidate=new Date(sentDate["getFullYear"]()+1,month,day)
  8289. }
  8290. else
  8291. candidate=new Date(year < 50 ? 2e3+year : 1900+year,month,day);
  8292. if(candidate["getMonth"]() !==month)
  8293. return sentDate;
  8294. return candidate
  8295. };
  8296. $h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function(sentDate, relative)
  8297. {
  8298. var date;
  8299. switch(relative._unit$i$1)
  8300. {
  8301. case 0:
  8302. date=new Date(sentDate["getFullYear"](),sentDate["getMonth"](),sentDate["getDate"]());
  8303. date["setDate"](date["getDate"]()+relative._offset$i$1);
  8304. return date;
  8305. case 5:
  8306. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate,relative._offset$i$1,relative._tag$i$1);
  8307. case 2:
  8308. var days=1;
  8309. switch(relative._modifier$i$1)
  8310. {
  8311. case 1:
  8312. break;
  8313. case 2:
  8314. days=16;
  8315. break;
  8316. default:
  8317. if(!relative._offset$i$1)
  8318. days=sentDate["getDate"]();
  8319. break
  8320. }
  8321. date=new Date(sentDate["getFullYear"](),sentDate["getMonth"](),days);
  8322. date["setMonth"](date["getMonth"]()+relative._offset$i$1);
  8323. if(date["getTime"]() < sentDate["getTime"]())
  8324. date["setDate"](date["getDate"]()+sentDate["getDate"]() - 1);
  8325. return date;
  8326. case 1:
  8327. date=new Date(sentDate["getFullYear"](),sentDate["getMonth"](),sentDate["getDate"]());
  8328. date["setDate"](sentDate["getDate"]()+7 * relative._offset$i$1);
  8329. if(relative._modifier$i$1===1 || !relative._modifier$i$1)
  8330. {
  8331. date["setDate"](date["getDate"]()+1 - date["getDay"]());
  8332. if(date["getTime"]() < sentDate["getTime"]())
  8333. return sentDate;
  8334. return date
  8335. }
  8336. else if(relative._modifier$i$1===2)
  8337. {
  8338. date["setDate"](date["getDate"]()+5 - date["getDay"]());
  8339. return date
  8340. }
  8341. break;
  8342. case 4:
  8343. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate,relative);
  8344. case 3:
  8345. if(relative._offset$i$1 > 0)
  8346. return new Date(sentDate["getFullYear"]()+relative._offset$i$1,0,1);
  8347. break;
  8348. default:
  8349. break
  8350. }
  8351. return sentDate
  8352. };
  8353. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function(sentDate, offset, tag)
  8354. {
  8355. if(offset > -5 && offset < 5)
  8356. {
  8357. var dayOfWeek;
  8358. var days;
  8359. dayOfWeek=(tag+6) % 7+1;
  8360. days=7 * offset+(dayOfWeek - sentDate["getDay"]());
  8361. sentDate["setDate"](sentDate["getDate"]()+days);
  8362. return sentDate
  8363. }
  8364. else
  8365. {
  8366. var days=(tag - sentDate["getDay"]()) % 7;
  8367. if(days < 0)
  8368. days+=7;
  8369. sentDate["setDate"](sentDate["getDate"]()+days);
  8370. return sentDate
  8371. }
  8372. };
  8373. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function(sentDate, relative)
  8374. {
  8375. var date;
  8376. var firstDay;
  8377. var newDate;
  8378. date=sentDate;
  8379. if(relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5)
  8380. return sentDate;
  8381. var monthOffset=(12+relative._tag$i$1 - date["getMonth"]() - 1) % 12;
  8382. firstDay=new Date(date["getFullYear"](),date["getMonth"]()+monthOffset,1);
  8383. if(relative._modifier$i$1===1)
  8384. if(relative._offset$i$1===1 && firstDay["getDay"]() !==6 && firstDay["getDay"]())
  8385. return firstDay;
  8386. else
  8387. {
  8388. newDate=new Date(firstDay["getFullYear"](),firstDay["getMonth"](),firstDay["getDate"]());
  8389. newDate["setDate"](newDate["getDate"]()+(7+(1 - firstDay["getDay"]())) % 7);
  8390. if(firstDay["getDay"]() !==6 && firstDay["getDay"]() && firstDay["getDay"]() !==1)
  8391. newDate["setDate"](newDate["getDate"]() - 7);
  8392. newDate["setDate"](newDate["getDate"]()+7 * (relative._offset$i$1 - 1));
  8393. if(newDate["getMonth"]()+1 !==relative._tag$i$1)
  8394. return sentDate;
  8395. return newDate
  8396. }
  8397. else
  8398. {
  8399. newDate=new Date(firstDay["getFullYear"](),firstDay["getMonth"](),$h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay["getMonth"](),firstDay["getFullYear"]()));
  8400. var offset=1 - newDate["getDay"]();
  8401. if(offset > 0)
  8402. offset=offset - 7;
  8403. newDate["setDate"](newDate["getDate"]()+offset);
  8404. newDate["setDate"](newDate["getDate"]()+7 * (1 - relative._offset$i$1));
  8405. if(newDate["getMonth"]()+1 !==relative._tag$i$1)
  8406. if(firstDay["getDay"]() !==6 && firstDay["getDay"]())
  8407. return firstDay;
  8408. else
  8409. return sentDate;
  8410. else
  8411. return newDate
  8412. }
  8413. };
  8414. $h.MeetingSuggestionTimeDecoder._decode$p=function(inDate, date, time)
  8415. {
  8416. var DateValueMask=32767;
  8417. date.val=null;
  8418. time.val=0;
  8419. if(!inDate)
  8420. return false;
  8421. time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate);
  8422. var inDateAtMidnight=inDate["getTime"]() - time.val;
  8423. var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p["getTime"]()) / 864e5;
  8424. if(value < 0)
  8425. return false;
  8426. else if(value >=262144)
  8427. return false;
  8428. else
  8429. {
  8430. var type=value >> 15;
  8431. value=value & DateValueMask;
  8432. switch(type)
  8433. {
  8434. case 0:
  8435. return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value,date);
  8436. case 1:
  8437. return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value,date);
  8438. default:
  8439. return false
  8440. }
  8441. }
  8442. };
  8443. $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function(value, date)
  8444. {
  8445. var c_SubTypeMask=7;
  8446. var c_MonthMask=15;
  8447. var c_DayMask=31;
  8448. var c_YearMask=127;
  8449. var year=null;
  8450. var month=0;
  8451. var day=0;
  8452. date.val=null;
  8453. var subType=value >> 12 & c_SubTypeMask;
  8454. if((subType & 4)===4)
  8455. {
  8456. year=value >> 5 & c_YearMask;
  8457. if((subType & 2)===2)
  8458. {
  8459. if((subType & 1)===1)
  8460. return false;
  8461. month=value >> 1 & c_MonthMask
  8462. }
  8463. }
  8464. else
  8465. {
  8466. if((subType & 2)===2)
  8467. month=value >> 8 & c_MonthMask;
  8468. if((subType & 1)===1)
  8469. day=value >> 3 & c_DayMask
  8470. }
  8471. date.val=new $h._preciseDate(day,month,year);
  8472. return true
  8473. };
  8474. $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function(value, date)
  8475. {
  8476. var TagMask=15;
  8477. var OffsetMask=63;
  8478. var UnitMask=7;
  8479. var ModifierMask=3;
  8480. var tag=value & TagMask;
  8481. value >>=4;
  8482. var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask,6);
  8483. value >>=6;
  8484. var unit=value & UnitMask;
  8485. value >>=3;
  8486. var modifier=value & ModifierMask;
  8487. try
  8488. {
  8489. date.val=new $h._relativeDate(modifier,offset,unit,tag);
  8490. return true
  8491. }
  8492. catch($$e_A)
  8493. {
  8494. date.val=null;
  8495. return false
  8496. }
  8497. };
  8498. $h.MeetingSuggestionTimeDecoder._fromComplement$p=function(value, n)
  8499. {
  8500. var signed=1 << n - 1;
  8501. var mask=(1 << n) - 1;
  8502. if((value & signed)===signed)
  8503. return-((value ^ mask)+1);
  8504. else
  8505. return value
  8506. };
  8507. $h.MeetingSuggestionTimeDecoder._daysInMonth$p=function(month, year)
  8508. {
  8509. return 32 - new Date(year,month,32)["getDate"]()
  8510. };
  8511. $h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function(inputTime)
  8512. {
  8513. var timeOfDay=0;
  8514. timeOfDay+=inputTime["getUTCHours"]() * 3600;
  8515. timeOfDay+=inputTime["getUTCMinutes"]() * 60;
  8516. timeOfDay+=inputTime["getUTCSeconds"]();
  8517. timeOfDay *=1e3;
  8518. timeOfDay+=inputTime["getUTCMilliseconds"]();
  8519. return timeOfDay
  8520. };
  8521. $h._extractedDate=function(){};
  8522. $h._preciseDate=function(day, month, year)
  8523. {
  8524. $h._preciseDate.initializeBase(this);
  8525. if(day < 0 || day > 31)
  8526. throw Error.argumentOutOfRange("day");
  8527. if(month < 0 || month > 12)
  8528. throw Error.argumentOutOfRange("month");
  8529. this._day$i$1=day;
  8530. this._month$i$1=month;
  8531. if(!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year))
  8532. {
  8533. if(!month && day)
  8534. throw Error.argument("Invalid arguments");
  8535. if(year < 0 || year > 2099)
  8536. throw Error.argumentOutOfRange("year");
  8537. this._year$i$1=year % 100
  8538. }
  8539. else if(!this._month$i$1 && !this._day$i$1)
  8540. throw Error.argument("Invalid datetime");
  8541. };
  8542. $h._preciseDate.prototype={
  8543. _day$i$1: 0,
  8544. _month$i$1: 0,
  8545. _year$i$1: null
  8546. };
  8547. $h._relativeDate=function(modifier, offset, unit, tag)
  8548. {
  8549. $h._relativeDate.initializeBase(this);
  8550. if(offset < -32 || offset > 31)
  8551. throw Error.argumentOutOfRange("offset");
  8552. if(tag < 0 || tag > 15)
  8553. throw Error.argumentOutOfRange("tag");
  8554. if(!unit && offset < 0)
  8555. throw Error.argument("unit & offset do not form a valid date");
  8556. this._modifier$i$1=modifier;
  8557. this._offset$i$1=offset;
  8558. this._unit$i$1=unit;
  8559. this._tag$i$1=tag
  8560. };
  8561. $h._relativeDate.prototype={
  8562. _modifier$i$1: 0,
  8563. _offset$i$1: 0,
  8564. _unit$i$1: 0,
  8565. _tag$i$1: 0
  8566. };
  8567. $h.Message=function(dataDictionary)
  8568. {
  8569. this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2);
  8570. this.$$d__getInternetMessageId$p$2=Function.createDelegate(this,this._getInternetMessageId$p$2);
  8571. this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2);
  8572. this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2);
  8573. this.$$d__getFrom$p$2=Function.createDelegate(this,this._getFrom$p$2);
  8574. this.$$d__getSender$p$2=Function.createDelegate(this,this._getSender$p$2);
  8575. this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2);
  8576. this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2);
  8577. $h.Message.initializeBase(this,[dataDictionary]);
  8578. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2);
  8579. $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2);
  8580. $h.InitialData._defineReadOnlyProperty$i(this,"sender",this.$$d__getSender$p$2);
  8581. $h.InitialData._defineReadOnlyProperty$i(this,"from",this.$$d__getFrom$p$2);
  8582. $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2);
  8583. $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2);
  8584. $h.InitialData._defineReadOnlyProperty$i(this,"internetMessageId",this.$$d__getInternetMessageId$p$2);
  8585. $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2)
  8586. };
  8587. $h.Message.prototype={
  8588. getItemType: function()
  8589. {
  8590. return window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemType"]["Message"]
  8591. },
  8592. _getSubject$p$2: function()
  8593. {
  8594. return this._data$p$0.get__subject$i$0()
  8595. },
  8596. _getNormalizedSubject$p$2: function()
  8597. {
  8598. return this._data$p$0.get__normalizedSubject$i$0()
  8599. },
  8600. _getSender$p$2: function()
  8601. {
  8602. return this._data$p$0.get__sender$i$0()
  8603. },
  8604. _getFrom$p$2: function()
  8605. {
  8606. return this._data$p$0.get__from$i$0()
  8607. },
  8608. _getTo$p$2: function()
  8609. {
  8610. return this._data$p$0.get__to$i$0()
  8611. },
  8612. _getCc$p$2: function()
  8613. {
  8614. return this._data$p$0.get__cc$i$0()
  8615. },
  8616. _getInternetMessageId$p$2: function()
  8617. {
  8618. return this._data$p$0.get__internetMessageId$i$0()
  8619. },
  8620. _getConversationId$p$2: function()
  8621. {
  8622. return this._data$p$0.get__conversationId$i$0()
  8623. }
  8624. };
  8625. $h.Message.prototype.getEntities=function()
  8626. {
  8627. return this._data$p$0._getEntities$i$0()
  8628. };
  8629. $h.Message.prototype.getEntitiesByType=function(entityType)
  8630. {
  8631. return this._data$p$0._getEntitiesByType$i$0(entityType)
  8632. };
  8633. $h.Message.prototype.getFilteredEntitiesByName=function(name)
  8634. {
  8635. return this._data$p$0._getFilteredEntitiesByName$i$0(name)
  8636. };
  8637. $h.Message.prototype.getRegExMatches=function()
  8638. {
  8639. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches");
  8640. return this._data$p$0._getRegExMatches$i$0()
  8641. };
  8642. $h.Message.prototype.getRegExMatchesByName=function(name)
  8643. {
  8644. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName");
  8645. return this._data$p$0._getRegExMatchesByName$i$0(name)
  8646. };
  8647. $h.Message.prototype.displayReplyForm=function(obj)
  8648. {
  8649. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._displayReplyForm$i$0(obj)
  8650. };
  8651. $h.Message.prototype.displayReplyAllForm=function(obj)
  8652. {
  8653. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._displayReplyAllForm$i$0(obj)
  8654. };
  8655. $h.MessageCompose=function(data)
  8656. {
  8657. this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2);
  8658. this.$$d__getBcc$p$2=Function.createDelegate(this,this._getBcc$p$2);
  8659. this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2);
  8660. this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2);
  8661. $h.MessageCompose.initializeBase(this,[data]);
  8662. $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2);
  8663. $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2);
  8664. $h.InitialData._defineReadOnlyProperty$i(this,"bcc",this.$$d__getBcc$p$2);
  8665. $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2)
  8666. };
  8667. $h.MessageCompose.prototype={
  8668. _to$p$2: null,
  8669. _cc$p$2: null,
  8670. _bcc$p$2: null,
  8671. getItemType: function()
  8672. {
  8673. return window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemType"]["Message"]
  8674. },
  8675. _getTo$p$2: function()
  8676. {
  8677. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  8678. if(!this._to$p$2)
  8679. this._to$p$2=new $h.ComposeRecipient(0,"to");
  8680. return this._to$p$2
  8681. },
  8682. _getCc$p$2: function()
  8683. {
  8684. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  8685. if(!this._cc$p$2)
  8686. this._cc$p$2=new $h.ComposeRecipient(1,"cc");
  8687. return this._cc$p$2
  8688. },
  8689. _getBcc$p$2: function()
  8690. {
  8691. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  8692. if(!this._bcc$p$2)
  8693. this._bcc$p$2=new $h.ComposeRecipient(2,"bcc");
  8694. return this._bcc$p$2
  8695. },
  8696. _getConversationId$p$2: function()
  8697. {
  8698. return this._data$p$0.get__conversationId$i$0()
  8699. }
  8700. };
  8701. $h.NotificationMessages=function(){};
  8702. $h.NotificationMessages._mapToHostItemNotificationMessageType$p=function(dataToHost)
  8703. {
  8704. var notificationType;
  8705. var hostItemNotificationMessageType;
  8706. notificationType=dataToHost["type"];
  8707. if(notificationType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemNotificationMessageType"]["ProgressIndicator"])
  8708. hostItemNotificationMessageType=1;
  8709. else if(notificationType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemNotificationMessageType"]["InformationalMessage"])
  8710. hostItemNotificationMessageType=0;
  8711. else if(notificationType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemNotificationMessageType"]["ErrorMessage"])
  8712. hostItemNotificationMessageType=2;
  8713. else
  8714. throw Error.argument("type");
  8715. dataToHost["type"]=hostItemNotificationMessageType
  8716. };
  8717. $h.NotificationMessages._validateKey$p=function(key)
  8718. {
  8719. if(!$h.ScriptHelpers.isNonEmptyString(key))
  8720. throw Error.argument("key");
  8721. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(key["length"],0,32,"key")
  8722. };
  8723. $h.NotificationMessages._validateDictionary$p=function(dictionary)
  8724. {
  8725. if(!$h.ScriptHelpers.isNonEmptyString(dictionary["type"]))
  8726. throw Error.argument("type");
  8727. if(dictionary["type"]===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemNotificationMessageType"]["InformationalMessage"])
  8728. {
  8729. if(!$h.ScriptHelpers.isNonEmptyString(dictionary["icon"]))
  8730. throw Error.argument("icon");
  8731. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(dictionary["icon"]["length"],0,32,"icon");
  8732. if($h.ScriptHelpers.isUndefined(dictionary["persistent"]))
  8733. throw Error.argument("persistent");
  8734. if(!Boolean.isInstanceOfType(dictionary["persistent"]))
  8735. throw Error.argumentType("persistent",Object["getType"](dictionary["persistent"]),Boolean);
  8736. }
  8737. else
  8738. {
  8739. if(!$h.ScriptHelpers.isUndefined(dictionary["icon"]))
  8740. throw Error.argument("icon");
  8741. if(!$h.ScriptHelpers.isUndefined(dictionary["persistent"]))
  8742. throw Error.argument("persistent");
  8743. }
  8744. if(!$h.ScriptHelpers.isNonEmptyString(dictionary["message"]))
  8745. throw Error.argument("message");
  8746. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(dictionary["message"]["length"],0,150,"message")
  8747. };
  8748. $h.NotificationMessages.prototype.addAsync=function(key, dictionary)
  8749. {
  8750. var args=[];
  8751. for(var $$pai_5=2; $$pai_5 < arguments["length"];++$$pai_5)
  8752. args[$$pai_5 - 2]=arguments[$$pai_5];
  8753. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.addAsync");
  8754. var commonParameters=$h.CommonParameters.parse(args,false);
  8755. $h.NotificationMessages._validateKey$p(key);
  8756. $h.NotificationMessages._validateDictionary$p(dictionary);
  8757. var dataToHost={};
  8758. dataToHost=$h.ScriptHelpers.deepClone(dictionary);
  8759. dataToHost["key"]=key;
  8760. $h.NotificationMessages._mapToHostItemNotificationMessageType$p(dataToHost);
  8761. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(33,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  8762. };
  8763. $h.NotificationMessages.prototype.getAllAsync=function()
  8764. {
  8765. var args=[];
  8766. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  8767. args[$$pai_2]=arguments[$$pai_2];
  8768. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.getAllAsync");
  8769. var commonParameters=$h.CommonParameters.parse(args,true);
  8770. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(34,null,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  8771. };
  8772. $h.NotificationMessages.prototype.replaceAsync=function(key, dictionary)
  8773. {
  8774. var args=[];
  8775. for(var $$pai_5=2; $$pai_5 < arguments["length"];++$$pai_5)
  8776. args[$$pai_5 - 2]=arguments[$$pai_5];
  8777. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.replaceAsync");
  8778. var commonParameters=$h.CommonParameters.parse(args,false);
  8779. $h.NotificationMessages._validateKey$p(key);
  8780. $h.NotificationMessages._validateDictionary$p(dictionary);
  8781. var dataToHost={};
  8782. dataToHost=$h.ScriptHelpers.deepClone(dictionary);
  8783. dataToHost["key"]=key;
  8784. $h.NotificationMessages._mapToHostItemNotificationMessageType$p(dataToHost);
  8785. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(35,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  8786. };
  8787. $h.NotificationMessages.prototype.removeAsync=function(key)
  8788. {
  8789. var args=[];
  8790. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  8791. args[$$pai_4 - 1]=arguments[$$pai_4];
  8792. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.removeAsync");
  8793. var commonParameters=$h.CommonParameters.parse(args,false);
  8794. $h.NotificationMessages._validateKey$p(key);
  8795. var dataToHost={key: key};
  8796. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(36,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  8797. };
  8798. $h.OutlookErrorManager=function(){};
  8799. $h.OutlookErrorManager.getErrorArgs=function(errorCode)
  8800. {
  8801. if(!$h.OutlookErrorManager._isInitialized$p)
  8802. $h.OutlookErrorManager._initialize$p();
  8803. return OSF.DDA.ErrorCodeManager["getErrorArgs"](errorCode)
  8804. };
  8805. $h.OutlookErrorManager._initialize$p=function()
  8806. {
  8807. $h.OutlookErrorManager._addErrorMessage$p(9e3,"AttachmentSizeExceeded",window["_u"]["ExtensibilityStrings"]["l_AttachmentExceededSize_Text"]);
  8808. $h.OutlookErrorManager._addErrorMessage$p(9001,"NumberOfAttachmentsExceeded",window["_u"]["ExtensibilityStrings"]["l_ExceededMaxNumberOfAttachments_Text"]);
  8809. $h.OutlookErrorManager._addErrorMessage$p(9002,"InternalFormatError",window["_u"]["ExtensibilityStrings"]["l_InternalFormatError_Text"]);
  8810. $h.OutlookErrorManager._addErrorMessage$p(9003,"InvalidAttachmentId",window["_u"]["ExtensibilityStrings"]["l_InvalidAttachmentId_Text"]);
  8811. $h.OutlookErrorManager._addErrorMessage$p(9004,"InvalidAttachmentPath",window["_u"]["ExtensibilityStrings"]["l_InvalidAttachmentPath_Text"]);
  8812. $h.OutlookErrorManager._addErrorMessage$p(9005,"CannotAddAttachmentBeforeUpgrade",window["_u"]["ExtensibilityStrings"]["l_CannotAddAttachmentBeforeUpgrade_Text"]);
  8813. $h.OutlookErrorManager._addErrorMessage$p(9006,"AttachmentDeletedBeforeUploadCompletes",window["_u"]["ExtensibilityStrings"]["l_AttachmentDeletedBeforeUploadCompletes_Text"]);
  8814. $h.OutlookErrorManager._addErrorMessage$p(9007,"AttachmentUploadGeneralFailure",window["_u"]["ExtensibilityStrings"]["l_AttachmentUploadGeneralFailure_Text"]);
  8815. $h.OutlookErrorManager._addErrorMessage$p(9008,"AttachmentToDeleteDoesNotExist",window["_u"]["ExtensibilityStrings"]["l_DeleteAttachmentDoesNotExist_Text"]);
  8816. $h.OutlookErrorManager._addErrorMessage$p(9009,"AttachmentDeleteGeneralFailure",window["_u"]["ExtensibilityStrings"]["l_AttachmentDeleteGeneralFailure_Text"]);
  8817. $h.OutlookErrorManager._addErrorMessage$p(9010,"InvalidEndTime",window["_u"]["ExtensibilityStrings"]["l_InvalidEndTime_Text"]);
  8818. $h.OutlookErrorManager._addErrorMessage$p(9011,"HtmlSanitizationFailure",window["_u"]["ExtensibilityStrings"]["l_HtmlSanitizationFailure_Text"]);
  8819. $h.OutlookErrorManager._addErrorMessage$p(9012,"NumberOfRecipientsExceeded",String.format(window["_u"]["ExtensibilityStrings"]["l_NumberOfRecipientsExceeded_Text"],500));
  8820. $h.OutlookErrorManager._addErrorMessage$p(9013,"NoValidRecipientsProvided",window["_u"]["ExtensibilityStrings"]["l_NoValidRecipientsProvided_Text"]);
  8821. $h.OutlookErrorManager._addErrorMessage$p(9014,"CursorPositionChanged",window["_u"]["ExtensibilityStrings"]["l_CursorPositionChanged_Text"]);
  8822. $h.OutlookErrorManager._addErrorMessage$p(9016,"InvalidSelection",window["_u"]["ExtensibilityStrings"]["l_InvalidSelection_Text"]);
  8823. $h.OutlookErrorManager._addErrorMessage$p(9017,"AccessRestricted","");
  8824. $h.OutlookErrorManager._addErrorMessage$p(9018,"GenericTokenError","");
  8825. $h.OutlookErrorManager._addErrorMessage$p(9019,"GenericSettingsError","");
  8826. $h.OutlookErrorManager._addErrorMessage$p(9020,"GenericResponseError","");
  8827. $h.OutlookErrorManager._addErrorMessage$p(9021,"SaveError",window["_u"]["ExtensibilityStrings"]["l_SaveError_Text"]);
  8828. $h.OutlookErrorManager._addErrorMessage$p(9022,"MessageInDifferentStoreError",window["_u"]["ExtensibilityStrings"]["l_MessageInDifferentStoreError_Text"]);
  8829. $h.OutlookErrorManager._addErrorMessage$p(9023,"DuplicateNotificationKey",window["_u"]["ExtensibilityStrings"]["l_DuplicateNotificationKey_Text"]);
  8830. $h.OutlookErrorManager._addErrorMessage$p(9024,"NotificationKeyNotFound",window["_u"]["ExtensibilityStrings"]["l_NotificationKeyNotFound_Text"]);
  8831. $h.OutlookErrorManager._addErrorMessage$p(9025,"NumberOfNotificationsExceeded",window["_u"]["ExtensibilityStrings"]["l_NumberOfNotificationsExceeded_Text"]);
  8832. $h.OutlookErrorManager._addErrorMessage$p(9026,"PersistedNotificationArrayReadError",window["_u"]["ExtensibilityStrings"]["l_PersistedNotificationArrayReadError_Text"]);
  8833. $h.OutlookErrorManager._addErrorMessage$p(9027,"PersistedNotificationArraySaveError",window["_u"]["ExtensibilityStrings"]["l_PersistedNotificationArraySaveError_Text"]);
  8834. $h.OutlookErrorManager._addErrorMessage$p(9028,"CannotPersistPropertyInUnsavedDraftError",window["_u"]["ExtensibilityStrings"]["l_CannotPersistPropertyInUnsavedDraftError_Text"]);
  8835. $h.OutlookErrorManager._isInitialized$p=true
  8836. };
  8837. $h.OutlookErrorManager._addErrorMessage$p=function(errorCode, errorName, errorMessage)
  8838. {
  8839. OSF.DDA.ErrorCodeManager["addErrorMessage"](errorCode,{
  8840. name: errorName,
  8841. message: errorMessage
  8842. })
  8843. };
  8844. $h.OutlookErrorManager.OutlookErrorCodes=function(){};
  8845. $h.OutlookErrorManager.OsfDdaErrorCodes=function(){};
  8846. $h.PhoneNumber=function(data)
  8847. {
  8848. this.$$d__getPhoneType$p$0=Function.createDelegate(this,this._getPhoneType$p$0);
  8849. this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this,this._getOriginalPhoneString$p$0);
  8850. this.$$d__getPhoneString$p$0=Function.createDelegate(this,this._getPhoneString$p$0);
  8851. this._data$p$0=data;
  8852. $h.InitialData._defineReadOnlyProperty$i(this,"phoneString",this.$$d__getPhoneString$p$0);
  8853. $h.InitialData._defineReadOnlyProperty$i(this,"originalPhoneString",this.$$d__getOriginalPhoneString$p$0);
  8854. $h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getPhoneType$p$0)
  8855. };
  8856. $h.PhoneNumber.prototype={
  8857. _data$p$0: null,
  8858. _getPhoneString$p$0: function()
  8859. {
  8860. return this._data$p$0["PhoneString"]
  8861. },
  8862. _getOriginalPhoneString$p$0: function()
  8863. {
  8864. return this._data$p$0["OriginalPhoneString"]
  8865. },
  8866. _getPhoneType$p$0: function()
  8867. {
  8868. return this._data$p$0["Type"]
  8869. }
  8870. };
  8871. $h.TaskSuggestion=function(data)
  8872. {
  8873. this.$$d__getAssignees$p$0=Function.createDelegate(this,this._getAssignees$p$0);
  8874. this.$$d__getTaskString$p$0=Function.createDelegate(this,this._getTaskString$p$0);
  8875. this._data$p$0=data;
  8876. $h.InitialData._defineReadOnlyProperty$i(this,"taskString",this.$$d__getTaskString$p$0);
  8877. $h.InitialData._defineReadOnlyProperty$i(this,"assignees",this.$$d__getAssignees$p$0)
  8878. };
  8879. $h.TaskSuggestion.prototype={
  8880. _data$p$0: null,
  8881. _assignees$p$0: null,
  8882. _getTaskString$p$0: function()
  8883. {
  8884. return this._data$p$0["TaskString"]
  8885. },
  8886. _getAssignees$p$0: function()
  8887. {
  8888. if(!this._assignees$p$0)
  8889. {
  8890. var $$t_1=this;
  8891. this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Assignees",function(data)
  8892. {
  8893. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data)
  8894. })
  8895. }
  8896. return this._assignees$p$0
  8897. }
  8898. };
  8899. $h.UserProfile=function(data)
  8900. {
  8901. this.$$d__getUserProfileType$p$0=Function.createDelegate(this,this._getUserProfileType$p$0);
  8902. this.$$d__getTimeZone$p$0=Function.createDelegate(this,this._getTimeZone$p$0);
  8903. this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0);
  8904. this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0);
  8905. this._data$p$0=data;
  8906. $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0);
  8907. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0);
  8908. $h.InitialData._defineReadOnlyProperty$i(this,"timeZone",this.$$d__getTimeZone$p$0);
  8909. $h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getUserProfileType$p$0)
  8910. };
  8911. $h.UserProfile.prototype={
  8912. _data$p$0: null,
  8913. _getUserProfileType$p$0: function()
  8914. {
  8915. return this._data$p$0.get__userProfileType$i$0()
  8916. },
  8917. _getDisplayName$p$0: function()
  8918. {
  8919. return this._data$p$0.get__userDisplayName$i$0()
  8920. },
  8921. _getEmailAddress$p$0: function()
  8922. {
  8923. return this._data$p$0.get__userEmailAddress$i$0()
  8924. },
  8925. _getTimeZone$p$0: function()
  8926. {
  8927. return this._data$p$0.get__userTimeZone$i$0()
  8928. }
  8929. };
  8930. $h.OutlookDispid=function(){};
  8931. $h.OutlookDispid.prototype={
  8932. owaOnlyMethod: 0,
  8933. getInitialData: 1,
  8934. getUserIdentityToken: 2,
  8935. loadCustomProperties: 3,
  8936. saveCustomProperties: 4,
  8937. ewsRequest: 5,
  8938. displayNewAppointmentForm: 7,
  8939. displayMessageForm: 8,
  8940. displayAppointmentForm: 9,
  8941. displayReplyForm: 10,
  8942. displayReplyAllForm: 11,
  8943. getCallbackToken: 12,
  8944. bodySetSelectedDataAsync: 13,
  8945. getBodyTypeAsync: 14,
  8946. getRecipientsAsync: 15,
  8947. addFileAttachmentAsync: 16,
  8948. setSubjectAsync: 17,
  8949. getSubjectAsync: 18,
  8950. addItemAttachmentAsync: 19,
  8951. removeAttachmentAsync: 20,
  8952. setRecipientsAsync: 21,
  8953. addRecipientsAsync: 22,
  8954. bodyPrependAsync: 23,
  8955. getTimeAsync: 24,
  8956. setTimeAsync: 25,
  8957. getLocationAsync: 26,
  8958. setLocationAsync: 27,
  8959. getSelectedDataAsync: 28,
  8960. setSelectedDataAsync: 29,
  8961. displayReplyFormWithAttachments: 30,
  8962. displayReplyAllFormWithAttachments: 31,
  8963. saveAsync: 32,
  8964. addNotficationMessageAsync: 33,
  8965. getAllNotficationMessagesAsync: 34,
  8966. replaceNotficationMessageAsync: 35,
  8967. removeNotficationMessageAsync: 36,
  8968. getBodyAsync: 37,
  8969. setBodyAsync: 38,
  8970. appCommands1: 39,
  8971. registerConsentAsync: 40,
  8972. close: 41,
  8973. closeApp: 42,
  8974. displayContactCardAsync: 43,
  8975. displayNewMessageForm: 44,
  8976. appCommands2: 94,
  8977. trackCtq: 400,
  8978. recordTrace: 401,
  8979. recordDataPoint: 402,
  8980. windowOpenOverrideHandler: 403,
  8981. saveSettingsRequest: 404
  8982. };
  8983. $h.OutlookDispid.registerEnum("$h.OutlookDispid",false);
  8984. $h.RequestState=function(){};
  8985. $h.RequestState.prototype={
  8986. unsent: 0,
  8987. opened: 1,
  8988. headersReceived: 2,
  8989. loading: 3,
  8990. done: 4
  8991. };
  8992. $h.RequestState.registerEnum("$h.RequestState",false);
  8993. $h.CommonParameters=function(options, callback, asyncContext)
  8994. {
  8995. this._options$p$0=options;
  8996. this._callback$p$0=callback;
  8997. this._asyncContext$p$0=asyncContext
  8998. };
  8999. $h.CommonParameters.parse=function(args, isCallbackRequired, tryLegacy)
  9000. {
  9001. var legacyParameters;
  9002. var $$t_8,
  9003. $$t_9;
  9004. if(tryLegacy && ($$t_9=$h.CommonParameters._tryParseLegacy$p(args,$$t_8={val: legacyParameters}),legacyParameters=$$t_8["val"],$$t_9))
  9005. return legacyParameters;
  9006. var argsLength=args["length"];
  9007. var options=null;
  9008. var callback=null;
  9009. var asyncContext=null;
  9010. if(argsLength===1)
  9011. if(Function.isInstanceOfType(args[0]))
  9012. callback=args[0];
  9013. else if(Object.isInstanceOfType(args[0]))
  9014. options=args[0];
  9015. else
  9016. throw Error.argumentType();
  9017. else if(argsLength===2)
  9018. {
  9019. if(!Object.isInstanceOfType(args[0]))
  9020. throw Error.argument("options");
  9021. if(!Function.isInstanceOfType(args[1]))
  9022. throw Error.argument("callback");
  9023. options=args[0];
  9024. callback=args[1]
  9025. }
  9026. else if(argsLength)
  9027. throw Error.parameterCount(window["_u"]["ExtensibilityStrings"]["l_ParametersNotAsExpected_Text"]);
  9028. if(isCallbackRequired && !callback)
  9029. throw Error.argumentNull("callback");
  9030. if(options && !$h.ScriptHelpers.isNullOrUndefined(options["asyncContext"]))
  9031. asyncContext=options["asyncContext"];
  9032. return new $h.CommonParameters(options,callback,asyncContext)
  9033. };
  9034. $h.CommonParameters._tryParseLegacy$p=function(args, commonParameters)
  9035. {
  9036. commonParameters.val=null;
  9037. var argsLength=args["length"];
  9038. var callback=null;
  9039. var userContext=null;
  9040. if(!argsLength || argsLength > 2)
  9041. return false;
  9042. if(!Function.isInstanceOfType(args[0]))
  9043. return false;
  9044. callback=args[0];
  9045. if(argsLength > 1)
  9046. userContext=args[1];
  9047. commonParameters.val=new $h.CommonParameters(null,callback,userContext);
  9048. return true
  9049. };
  9050. $h.CommonParameters.prototype={
  9051. _options$p$0: null,
  9052. _callback$p$0: null,
  9053. _asyncContext$p$0: null,
  9054. get_options: function()
  9055. {
  9056. return this._options$p$0
  9057. },
  9058. get_callback: function()
  9059. {
  9060. return this._callback$p$0
  9061. },
  9062. get_asyncContext: function()
  9063. {
  9064. return this._asyncContext$p$0
  9065. }
  9066. };
  9067. $h.EwsRequest=function(userContext)
  9068. {
  9069. $h.EwsRequest.initializeBase(this,[userContext])
  9070. };
  9071. $h.EwsRequest.prototype={
  9072. readyState: 1,
  9073. status: 0,
  9074. statusText: null,
  9075. onreadystatechange: null,
  9076. responseText: null,
  9077. get__statusCode$i$1: function()
  9078. {
  9079. return this.status
  9080. },
  9081. set__statusCode$i$1: function(value)
  9082. {
  9083. this.status=value;
  9084. return value
  9085. },
  9086. get__statusDescription$i$1: function()
  9087. {
  9088. return this.statusText
  9089. },
  9090. set__statusDescription$i$1: function(value)
  9091. {
  9092. this.statusText=value;
  9093. return value
  9094. },
  9095. get__requestState$i$1: function()
  9096. {
  9097. return this.readyState
  9098. },
  9099. set__requestState$i$1: function(value)
  9100. {
  9101. this.readyState=value;
  9102. return value
  9103. },
  9104. get_hasOnReadyStateChangeCallback: function()
  9105. {
  9106. return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)
  9107. },
  9108. get__response$i$1: function()
  9109. {
  9110. return this.responseText
  9111. },
  9112. set__response$i$1: function(value)
  9113. {
  9114. this.responseText=value;
  9115. return value
  9116. },
  9117. send: function(data)
  9118. {
  9119. this._checkSendConditions$i$1();
  9120. if($h.ScriptHelpers.isNullOrUndefined(data))
  9121. this._throwInvalidStateException$i$1();
  9122. this._sendRequest$i$0(5,"EwsRequest",{body: data})
  9123. },
  9124. _callOnReadyStateChangeCallback$i$1: function()
  9125. {
  9126. if(!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange))
  9127. this.onreadystatechange()
  9128. },
  9129. _parseExtraResponseData$i$1: function(response){},
  9130. executeExtraFailedResponseSteps: function(){}
  9131. };
  9132. $h.InitialData=function(data)
  9133. {
  9134. this._data$p$0=data;
  9135. this._permissionLevel$p$0=this._calculatePermissionLevel$p$0()
  9136. };
  9137. $h.InitialData._defineReadOnlyProperty$i=function(o, methodName, getter)
  9138. {
  9139. var propertyDescriptor={
  9140. get: getter,
  9141. configurable: false
  9142. };
  9143. Object.defineProperty(o,methodName,propertyDescriptor)
  9144. };
  9145. $h.InitialData.prototype={
  9146. _toRecipients$p$0: null,
  9147. _ccRecipients$p$0: null,
  9148. _attachments$p$0: null,
  9149. _resources$p$0: null,
  9150. _entities$p$0: null,
  9151. _data$p$0: null,
  9152. _permissionLevel$p$0: 0,
  9153. get__isRestIdSupported$i$0: function()
  9154. {
  9155. return this._data$p$0["isRestIdSupported"]
  9156. },
  9157. get__itemId$i$0: function()
  9158. {
  9159. return this._data$p$0["id"]
  9160. },
  9161. get__itemClass$i$0: function()
  9162. {
  9163. return this._data$p$0["itemClass"]
  9164. },
  9165. get__dateTimeCreated$i$0: function()
  9166. {
  9167. return new Date(this._data$p$0["dateTimeCreated"])
  9168. },
  9169. get__dateTimeModified$i$0: function()
  9170. {
  9171. return new Date(this._data$p$0["dateTimeModified"])
  9172. },
  9173. get__dateTimeSent$i$0: function()
  9174. {
  9175. return new Date(this._data$p$0["dateTimeSent"])
  9176. },
  9177. get__subject$i$0: function()
  9178. {
  9179. this._throwOnRestrictedPermissionLevel$i$0();
  9180. return this._data$p$0["subject"]
  9181. },
  9182. get__normalizedSubject$i$0: function()
  9183. {
  9184. this._throwOnRestrictedPermissionLevel$i$0();
  9185. return this._data$p$0["normalizedSubject"]
  9186. },
  9187. get__internetMessageId$i$0: function()
  9188. {
  9189. return this._data$p$0["internetMessageId"]
  9190. },
  9191. get__conversationId$i$0: function()
  9192. {
  9193. return this._data$p$0["conversationId"]
  9194. },
  9195. get__sender$i$0: function()
  9196. {
  9197. this._throwOnRestrictedPermissionLevel$i$0();
  9198. var sender=this._data$p$0["sender"];
  9199. return $h.ScriptHelpers.isNullOrUndefined(sender) ? null : new $h.EmailAddressDetails(sender)
  9200. },
  9201. get__from$i$0: function()
  9202. {
  9203. this._throwOnRestrictedPermissionLevel$i$0();
  9204. var from=this._data$p$0["from"];
  9205. return $h.ScriptHelpers.isNullOrUndefined(from) ? null : new $h.EmailAddressDetails(from)
  9206. },
  9207. get__to$i$0: function()
  9208. {
  9209. this._throwOnRestrictedPermissionLevel$i$0();
  9210. if(null===this._toRecipients$p$0)
  9211. this._toRecipients$p$0=this._createEmailAddressDetails$p$0("to");
  9212. return this._toRecipients$p$0
  9213. },
  9214. get__cc$i$0: function()
  9215. {
  9216. this._throwOnRestrictedPermissionLevel$i$0();
  9217. if(null===this._ccRecipients$p$0)
  9218. this._ccRecipients$p$0=this._createEmailAddressDetails$p$0("cc");
  9219. return this._ccRecipients$p$0
  9220. },
  9221. get__attachments$i$0: function()
  9222. {
  9223. this._throwOnRestrictedPermissionLevel$i$0();
  9224. if(null===this._attachments$p$0)
  9225. this._attachments$p$0=this._createAttachmentDetails$p$0();
  9226. return this._attachments$p$0
  9227. },
  9228. get__ewsUrl$i$0: function()
  9229. {
  9230. return this._data$p$0["ewsUrl"]
  9231. },
  9232. get__marketplaceAssetId$i$0: function()
  9233. {
  9234. return this._data$p$0["marketplaceAssetId"]
  9235. },
  9236. get__extensionId$i$0: function()
  9237. {
  9238. return this._data$p$0["extensionId"]
  9239. },
  9240. get__marketplaceContentMarket$i$0: function()
  9241. {
  9242. return this._data$p$0["marketplaceContentMarket"]
  9243. },
  9244. get__consentMetadata$i$0: function()
  9245. {
  9246. return this._data$p$0["consentMetadata"]
  9247. },
  9248. get__isRead$i$0: function()
  9249. {
  9250. return this._data$p$0["isRead"]
  9251. },
  9252. get__endNodeUrl$i$0: function()
  9253. {
  9254. return this._data$p$0["endNodeUrl"]
  9255. },
  9256. get__entryPointUrl$i$0: function()
  9257. {
  9258. return this._data$p$0["entryPointUrl"]
  9259. },
  9260. get__start$i$0: function()
  9261. {
  9262. return new Date(this._data$p$0["start"])
  9263. },
  9264. get__end$i$0: function()
  9265. {
  9266. return new Date(this._data$p$0["end"])
  9267. },
  9268. get__location$i$0: function()
  9269. {
  9270. return this._data$p$0["location"]
  9271. },
  9272. get__userProfileType$i$0: function()
  9273. {
  9274. return this._data$p$0["userProfileType"]
  9275. },
  9276. get__resources$i$0: function()
  9277. {
  9278. this._throwOnRestrictedPermissionLevel$i$0();
  9279. if(null===this._resources$p$0)
  9280. this._resources$p$0=this._createEmailAddressDetails$p$0("resources");
  9281. return this._resources$p$0
  9282. },
  9283. get__organizer$i$0: function()
  9284. {
  9285. this._throwOnRestrictedPermissionLevel$i$0();
  9286. var organizer=this._data$p$0["organizer"];
  9287. return $h.ScriptHelpers.isNullOrUndefined(organizer) ? null : new $h.EmailAddressDetails(organizer)
  9288. },
  9289. get__userDisplayName$i$0: function()
  9290. {
  9291. return this._data$p$0["userDisplayName"]
  9292. },
  9293. get__userEmailAddress$i$0: function()
  9294. {
  9295. return this._data$p$0["userEmailAddress"]
  9296. },
  9297. get__userTimeZone$i$0: function()
  9298. {
  9299. return this._data$p$0["userTimeZone"]
  9300. },
  9301. get__timeZoneOffsets$i$0: function()
  9302. {
  9303. return this._data$p$0["timeZoneOffsets"]
  9304. },
  9305. get__hostVersion$i$0: function()
  9306. {
  9307. return this._data$p$0["hostVersion"]
  9308. },
  9309. get__owaView$i$0: function()
  9310. {
  9311. return this._data$p$0["owaView"]
  9312. },
  9313. get__overrideWindowOpen$i$0: function()
  9314. {
  9315. return this._data$p$0["overrideWindowOpen"]
  9316. },
  9317. _getEntities$i$0: function()
  9318. {
  9319. if(!this._entities$p$0)
  9320. 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);
  9321. return this._entities$p$0
  9322. },
  9323. _getEntitiesByType$i$0: function(entityType)
  9324. {
  9325. var entites=this._getEntities$i$0();
  9326. return entites._getByType$i$0(entityType)
  9327. },
  9328. _getFilteredEntitiesByName$i$0: function(name)
  9329. {
  9330. var entities=this._getEntities$i$0();
  9331. return entities._getFilteredEntitiesByName$i$0(name)
  9332. },
  9333. _getRegExMatches$i$0: function()
  9334. {
  9335. if(!this._data$p$0["regExMatches"])
  9336. return null;
  9337. return this._data$p$0["regExMatches"]
  9338. },
  9339. _getRegExMatchesByName$i$0: function(regexName)
  9340. {
  9341. var regexMatches=this._getRegExMatches$i$0();
  9342. if(!regexMatches || !regexMatches[regexName])
  9343. return null;
  9344. return regexMatches[regexName]
  9345. },
  9346. _throwOnRestrictedPermissionLevel$i$0: function()
  9347. {
  9348. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0)
  9349. },
  9350. _createEmailAddressDetails$p$0: function(key)
  9351. {
  9352. var to=this._data$p$0[key];
  9353. if($h.ScriptHelpers.isNullOrUndefined(to))
  9354. return[];
  9355. var recipients=[];
  9356. for(var i=0; i < to["length"]; i++)
  9357. if(!$h.ScriptHelpers.isNullOrUndefined(to[i]))
  9358. recipients[i]=new $h.EmailAddressDetails(to[i]);
  9359. return recipients
  9360. },
  9361. _createAttachmentDetails$p$0: function()
  9362. {
  9363. var attachments=this._data$p$0["attachments"];
  9364. if($h.ScriptHelpers.isNullOrUndefined(attachments))
  9365. return[];
  9366. var attachmentDetails=[];
  9367. for(var i=0; i < attachments["length"]; i++)
  9368. if(!$h.ScriptHelpers.isNullOrUndefined(attachments[i]))
  9369. attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]);
  9370. return attachmentDetails
  9371. },
  9372. _calculatePermissionLevel$p$0: function()
  9373. {
  9374. var HostReadItem=1;
  9375. var HostReadWriteMailbox=2;
  9376. var HostReadWriteItem=3;
  9377. var permissionLevelFromHost=this._data$p$0["permissionLevel"];
  9378. if($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0))
  9379. return 0;
  9380. switch(permissionLevelFromHost)
  9381. {
  9382. case HostReadItem:
  9383. return 1;
  9384. case HostReadWriteItem:
  9385. return 2;
  9386. case HostReadWriteMailbox:
  9387. return 3;
  9388. default:
  9389. return 0
  9390. }
  9391. }
  9392. };
  9393. $h._loadDictionaryRequest=function(createResultObject, dictionaryName, callback, userContext)
  9394. {
  9395. $h._loadDictionaryRequest.initializeBase(this,[userContext]);
  9396. this._createResultObject$p$1=createResultObject;
  9397. this._dictionaryName$p$1=dictionaryName;
  9398. this._callback$p$1=callback
  9399. };
  9400. $h._loadDictionaryRequest.prototype={
  9401. _dictionaryName$p$1: null,
  9402. _createResultObject$p$1: null,
  9403. _callback$p$1: null,
  9404. handleResponse: function(response)
  9405. {
  9406. if(response["wasSuccessful"])
  9407. {
  9408. var value=response[this._dictionaryName$p$1];
  9409. var responseData=window["JSON"]["parse"](value);
  9410. this.createAsyncResult(this._createResultObject$p$1(responseData),0,0,null)
  9411. }
  9412. else
  9413. this.createAsyncResult(null,1,9020,response["errorMessage"]);
  9414. this._callback$p$1(this._asyncResult$p$0)
  9415. }
  9416. };
  9417. $h.ProxyRequestBase=function(userContext)
  9418. {
  9419. $h.ProxyRequestBase.initializeBase(this,[userContext])
  9420. };
  9421. $h.ProxyRequestBase.prototype={
  9422. handleResponse: function(response)
  9423. {
  9424. if(!response["wasProxySuccessful"])
  9425. {
  9426. this.set__statusCode$i$1(500);
  9427. this.set__statusDescription$i$1("Error");
  9428. var errorMessage=response["errorMessage"];
  9429. this.set__response$i$1(errorMessage);
  9430. this.createAsyncResult(null,1,9020,errorMessage)
  9431. }
  9432. else
  9433. {
  9434. this.set__statusCode$i$1(response["statusCode"]);
  9435. this.set__statusDescription$i$1(response["statusDescription"]);
  9436. this.set__response$i$1(response["body"]);
  9437. this.createAsyncResult(this.get__response$i$1(),0,0,null)
  9438. }
  9439. this._parseExtraResponseData$i$1(response);
  9440. this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1()
  9441. },
  9442. _throwInvalidStateException$i$1: function()
  9443. {
  9444. throw Error.create("DOMException",{
  9445. code: 11,
  9446. message: "INVALID_STATE_ERR"
  9447. });
  9448. },
  9449. _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function()
  9450. {
  9451. var $$t_0=this;
  9452. this._changeReadyState$i$1(2,function()
  9453. {
  9454. $$t_0._changeReadyState$i$1(3,function()
  9455. {
  9456. $$t_0._changeReadyState$i$1(4,null)
  9457. })
  9458. })
  9459. },
  9460. _changeReadyState$i$1: function(state, nextStep)
  9461. {
  9462. this.set__requestState$i$1(state);
  9463. var $$t_2=this;
  9464. window.setTimeout(function()
  9465. {
  9466. try
  9467. {
  9468. $$t_2._callOnReadyStateChangeCallback$i$1()
  9469. }
  9470. finally
  9471. {
  9472. if(!$h.ScriptHelpers.isNullOrUndefined(nextStep))
  9473. nextStep()
  9474. }
  9475. },0)
  9476. },
  9477. _checkSendConditions$i$1: function()
  9478. {
  9479. if(this.get__requestState$i$1() !==1)
  9480. this._throwInvalidStateException$i$1();
  9481. if(this._isSent$p$0)
  9482. this._throwInvalidStateException$i$1()
  9483. }
  9484. };
  9485. $h.RequestBase=function(userContext)
  9486. {
  9487. this._userContext$p$0=userContext
  9488. };
  9489. $h.RequestBase.prototype={
  9490. _isSent$p$0: false,
  9491. _asyncResult$p$0: null,
  9492. _userContext$p$0: null,
  9493. get_asyncResult: function()
  9494. {
  9495. return this._asyncResult$p$0
  9496. },
  9497. _sendRequest$i$0: function(dispid, methodName, dataToSend)
  9498. {
  9499. this._isSent$p$0=true;
  9500. var $$t_5=this;
  9501. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.invokeHostMethod(dispid,dataToSend,function(resultCode, response)
  9502. {
  9503. if(resultCode)
  9504. $$t_5.createAsyncResult(null,1,9017,String.format(window["_u"]["ExtensibilityStrings"]["l_InternalProtocolError_Text"],resultCode));
  9505. else
  9506. $$t_5.handleResponse(response)
  9507. })
  9508. },
  9509. createAsyncResult: function(value, errorCode, detailedErrorCode, errorDescription)
  9510. {
  9511. this._asyncResult$p$0=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(value,errorCode,detailedErrorCode,this._userContext$p$0,errorDescription)
  9512. }
  9513. };
  9514. $h.SaveDictionaryRequest=function(callback, userContext)
  9515. {
  9516. $h.SaveDictionaryRequest.initializeBase(this,[userContext]);
  9517. if(!$h.ScriptHelpers.isNullOrUndefined(callback))
  9518. this._callback$p$1=callback
  9519. };
  9520. $h.SaveDictionaryRequest.prototype={
  9521. _callback$p$1: null,
  9522. handleResponse: function(response)
  9523. {
  9524. if(response["wasSuccessful"])
  9525. this.createAsyncResult(null,0,0,null);
  9526. else
  9527. this.createAsyncResult(null,1,9020,response["errorMessage"]);
  9528. if(!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1))
  9529. this._callback$p$1(this._asyncResult$p$0)
  9530. }
  9531. };
  9532. $h.ScriptHelpers=function(){};
  9533. $h.ScriptHelpers.isNull=function(value)
  9534. {
  9535. return null===value
  9536. };
  9537. $h.ScriptHelpers.isNullOrUndefined=function(value)
  9538. {
  9539. return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value)
  9540. };
  9541. $h.ScriptHelpers.isUndefined=function(value)
  9542. {
  9543. return value===undefined
  9544. };
  9545. $h.ScriptHelpers.dictionaryContainsKey=function(obj, keyName)
  9546. {
  9547. return Object.isInstanceOfType(obj) ? keyName in obj : false
  9548. };
  9549. $h.ScriptHelpers.isNonEmptyString=function(value)
  9550. {
  9551. if(!value)
  9552. return false;
  9553. return String.isInstanceOfType(value)
  9554. };
  9555. $h.ScriptHelpers.deepClone=function(obj)
  9556. {
  9557. return window["JSON"]["parse"](window["JSON"]["stringify"](obj))
  9558. };
  9559. window["OSF"]["DDA"]["OutlookAppOm"].registerClass("OSF.DDA.OutlookAppOm");
  9560. window["OSF"]["DDA"]["Settings"].registerClass("OSF.DDA.Settings");
  9561. $h.ItemBase.registerClass("$h.ItemBase");
  9562. $h.Item.registerClass("$h.Item",$h.ItemBase);
  9563. $h.Appointment.registerClass("$h.Appointment",$h.Item);
  9564. $h.ComposeItem.registerClass("$h.ComposeItem",$h.ItemBase);
  9565. $h.AppointmentCompose.registerClass("$h.AppointmentCompose",$h.ComposeItem);
  9566. $h.AttachmentConstants.registerClass("$h.AttachmentConstants");
  9567. $h.AttachmentDetails.registerClass("$h.AttachmentDetails");
  9568. $h.Body.registerClass("$h.Body");
  9569. $h.ComposeBody.registerClass("$h.ComposeBody",$h.Body);
  9570. $h.ComposeRecipient.registerClass("$h.ComposeRecipient");
  9571. $h.ComposeLocation.registerClass("$h.ComposeLocation");
  9572. $h.ComposeSubject.registerClass("$h.ComposeSubject");
  9573. $h.ComposeTime.registerClass("$h.ComposeTime");
  9574. $h.Contact.registerClass("$h.Contact");
  9575. $h.CustomProperties.registerClass("$h.CustomProperties");
  9576. $h.Diagnostics.registerClass("$h.Diagnostics");
  9577. $h.EmailAddressDetails.registerClass("$h.EmailAddressDetails");
  9578. $h.Entities.registerClass("$h.Entities");
  9579. $h.ReplyConstants.registerClass("$h.ReplyConstants");
  9580. $h.AsyncConstants.registerClass("$h.AsyncConstants");
  9581. window["Office"]["cast"]["item"].registerClass("Office.cast.item");
  9582. $h.Message.registerClass("$h.Message",$h.Item);
  9583. $h.MeetingRequest.registerClass("$h.MeetingRequest",$h.Message);
  9584. $h.MeetingSuggestion.registerClass("$h.MeetingSuggestion");
  9585. $h.MeetingSuggestionTimeDecoder.registerClass("$h.MeetingSuggestionTimeDecoder");
  9586. $h._extractedDate.registerClass("$h._extractedDate");
  9587. $h._preciseDate.registerClass("$h._preciseDate",$h._extractedDate);
  9588. $h._relativeDate.registerClass("$h._relativeDate",$h._extractedDate);
  9589. $h.MessageCompose.registerClass("$h.MessageCompose",$h.ComposeItem);
  9590. $h.NotificationMessages.registerClass("$h.NotificationMessages");
  9591. $h.OutlookErrorManager.registerClass("$h.OutlookErrorManager");
  9592. $h.OutlookErrorManager.OutlookErrorCodes.registerClass("$h.OutlookErrorManager.OutlookErrorCodes");
  9593. $h.OutlookErrorManager.OsfDdaErrorCodes.registerClass("$h.OutlookErrorManager.OsfDdaErrorCodes");
  9594. $h.PhoneNumber.registerClass("$h.PhoneNumber");
  9595. $h.TaskSuggestion.registerClass("$h.TaskSuggestion");
  9596. $h.UserProfile.registerClass("$h.UserProfile");
  9597. $h.CommonParameters.registerClass("$h.CommonParameters");
  9598. $h.RequestBase.registerClass("$h.RequestBase");
  9599. $h.ProxyRequestBase.registerClass("$h.ProxyRequestBase",$h.RequestBase);
  9600. $h.EwsRequest.registerClass("$h.EwsRequest",$h.ProxyRequestBase);
  9601. $h.InitialData.registerClass("$h.InitialData");
  9602. $h._loadDictionaryRequest.registerClass("$h._loadDictionaryRequest",$h.RequestBase);
  9603. $h.SaveDictionaryRequest.registerClass("$h.SaveDictionaryRequest",$h.RequestBase);
  9604. $h.ScriptHelpers.registerClass("$h.ScriptHelpers");
  9605. window["OSF"]["DDA"]["OutlookAppOm"].asyncMethodTimeoutKeyName="__timeout__";
  9606. window["OSF"]["DDA"]["OutlookAppOm"].ewsIdOrEmailParamName="ewsIdOrEmail";
  9607. window["OSF"]["DDA"]["OutlookAppOm"]._maxRecipients$p=100;
  9608. window["OSF"]["DDA"]["OutlookAppOm"]._maxSubjectLength$p=255;
  9609. window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength=32768;
  9610. window["OSF"]["DDA"]["OutlookAppOm"]._maxLocationLength$p=255;
  9611. window["OSF"]["DDA"]["OutlookAppOm"]._maxEwsRequestSize$p=1e6;
  9612. window["OSF"]["DDA"]["OutlookAppOm"].executeMethodName="ExecuteMethod";
  9613. window["OSF"]["DDA"]["OutlookAppOm"].getInitialDataMethodName="GetInitialData";
  9614. window["OSF"]["DDA"]["OutlookAppOm"].itemIdParameterName="itemId";
  9615. window["OSF"]["DDA"]["OutlookAppOm"].restVersionParameterName="restVersion";
  9616. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p=null;
  9617. $h.AttachmentConstants.maxAttachmentNameLength=255;
  9618. $h.AttachmentConstants.maxUrlLength=2048;
  9619. $h.AttachmentConstants.maxItemIdLength=200;
  9620. $h.AttachmentConstants.maxRemoveIdLength=200;
  9621. $h.AttachmentConstants.attachmentParameterName="attachments";
  9622. $h.AttachmentConstants.attachmentTypeParameterName="type";
  9623. $h.AttachmentConstants.attachmentUrlParameterName="url";
  9624. $h.AttachmentConstants.attachmentItemIdParameterName="itemId";
  9625. $h.AttachmentConstants.attachmentNameParameterName="name";
  9626. $h.AttachmentConstants.attachmentTypeFileName="file";
  9627. $h.AttachmentConstants.attachmentTypeItemName="item";
  9628. $h.AttachmentDetails._attachmentTypeMap$p=[window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["AttachmentType"]["File"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["AttachmentType"]["Item"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["AttachmentType"]["Cloud"]];
  9629. $h.Body.coercionTypeParameterName="coercionType";
  9630. $h.ComposeRecipient.displayNameLengthLimit=255;
  9631. $h.ComposeRecipient.maxSmtpLength=571;
  9632. $h.ComposeRecipient.recipientsLimit=100;
  9633. $h.ComposeRecipient.totalRecipientsLimit=500;
  9634. $h.ComposeRecipient.addressParameterName="address";
  9635. $h.ComposeRecipient.nameParameterName="name";
  9636. $h.ComposeLocation.locationKey="location";
  9637. $h.ComposeLocation.maximumLocationLength=255;
  9638. $h.ComposeSubject.maximumSubjectLength=255;
  9639. $h.ComposeTime.timeTypeName="TimeProperty";
  9640. $h.ComposeTime.timeDataName="time";
  9641. $h.Diagnostics.outlookAppName="Outlook";
  9642. $h.Diagnostics.outlookWebAppName="OutlookWebApp";
  9643. $h.EmailAddressDetails._emptyString$p="";
  9644. $h.EmailAddressDetails._responseTypeMap$p=[window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["None"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["Organizer"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["Tentative"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["Accepted"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["Declined"]];
  9645. $h.EmailAddressDetails._recipientTypeMap$p=[window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["Other"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["DistributionList"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["User"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["ExternalUser"]];
  9646. $h.Entities._allEntityKeys$p=["Addresses","EmailAddresses","Urls","PhoneNumbers","TaskSuggestions","MeetingSuggestions","Contacts","FlightReservations","ParcelDeliveries"];
  9647. $h.ReplyConstants.htmlBodyKeyName="htmlBody";
  9648. $h.AsyncConstants.optionsKeyName="options";
  9649. $h.AsyncConstants.callbackKeyName="callback";
  9650. $h.AsyncConstants.asyncResultKeyName="asyncResult";
  9651. $h.MeetingSuggestionTimeDecoder._baseDate$p=new Date("0001-01-01T00:00:00Z");
  9652. $h.NotificationMessages.maximumKeyLength=32;
  9653. $h.NotificationMessages.maximumIconLength=32;
  9654. $h.NotificationMessages.maximumMessageLength=150;
  9655. $h.NotificationMessages.notificationsKeyParameterName="key";
  9656. $h.NotificationMessages.notificationsTypeParameterName="type";
  9657. $h.NotificationMessages.notificationsIconParameterName="icon";
  9658. $h.NotificationMessages.notificationsMessageParameterName="message";
  9659. $h.NotificationMessages.notificationsPersistentParameterName="persistent";
  9660. $h.OutlookErrorManager.errorNameKey="name";
  9661. $h.OutlookErrorManager.errorMessageKey="message";
  9662. $h.OutlookErrorManager._isInitialized$p=false;
  9663. $h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9e3;
  9664. $h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001;
  9665. $h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002;
  9666. $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003;
  9667. $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004;
  9668. $h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005;
  9669. $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006;
  9670. $h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007;
  9671. $h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008;
  9672. $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009;
  9673. $h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010;
  9674. $h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011;
  9675. $h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012;
  9676. $h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013;
  9677. $h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014;
  9678. $h.OutlookErrorManager.OutlookErrorCodes.invalidSelection=9016;
  9679. $h.OutlookErrorManager.OutlookErrorCodes.accessRestricted=9017;
  9680. $h.OutlookErrorManager.OutlookErrorCodes.genericTokenError=9018;
  9681. $h.OutlookErrorManager.OutlookErrorCodes.genericSettingsError=9019;
  9682. $h.OutlookErrorManager.OutlookErrorCodes.genericResponseError=9020;
  9683. $h.OutlookErrorManager.OutlookErrorCodes.saveError=9021;
  9684. $h.OutlookErrorManager.OutlookErrorCodes.messageInDifferentStoreError=9022;
  9685. $h.OutlookErrorManager.OutlookErrorCodes.duplicateNotificationKey=9023;
  9686. $h.OutlookErrorManager.OutlookErrorCodes.notificationKeyNotFound=9024;
  9687. $h.OutlookErrorManager.OutlookErrorCodes.numberOfNotificationsExceeded=9025;
  9688. $h.OutlookErrorManager.OutlookErrorCodes.persistedNotificationArrayReadError=9026;
  9689. $h.OutlookErrorManager.OutlookErrorCodes.persistedNotificationArraySaveError=9027;
  9690. $h.OutlookErrorManager.OutlookErrorCodes.cannotPersistPropertyInUnsavedDraftError=9028;
  9691. $h.OutlookErrorManager.OutlookErrorCodes.ooeInvalidDataFormat=2006;
  9692. $h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1e3;
  9693. $h.CommonParameters.asyncContextKeyName="asyncContext";
  9694. $h.InitialData.userProfileTypeKey="userProfileType";
  9695. $h.ScriptHelpers.emptyString="";
  9696. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  9697. if(appContext.get_appName()==OSF.AppName.OutlookWebApp || appContext.get_appName()==OSF.AppName.OutlookIOS)
  9698. this._settings=this._initializeSettings(appContext,false);
  9699. else
  9700. this._settings=this._initializeSettings(false);
  9701. appContext.appOM=new OSF.DDA.OutlookAppOm(appContext,this._webAppState.wnd,appReady)
  9702. }