Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

excel-win32-16.01.debug.js 651KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195
  1. /* Excel Desktop-specific API library */
  2. /* Version: 16.0.7524.3000 */
  3. /* Office.js Version: 16.0.7526.1000 */
  4. /*
  5. Copyright (c) Microsoft Corporation. All rights reserved.
  6. */
  7. /*
  8. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  9. */
  10. /*
  11. * @overview es6-promise - a tiny implementation of Promises/A+.
  12. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  13. * @license Licensed under MIT license
  14. * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
  15. * @version 2.3.0
  16. */
  17. var __extends=(this && this.__extends) || function (d, b) {
  18. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  19. function __() { this.constructor=d; }
  20. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  21. };
  22. var OfficeExt;
  23. (function (OfficeExt) {
  24. var MicrosoftAjaxFactory=(function () {
  25. function MicrosoftAjaxFactory() {
  26. }
  27. MicrosoftAjaxFactory.prototype.isMsAjaxLoaded=function () {
  28. if (typeof (Sys) !=='undefined' && typeof (Type) !=='undefined' &&
  29. Sys.StringBuilder && typeof (Sys.StringBuilder)==="function" &&
  30. Type.registerNamespace && typeof (Type.registerNamespace)==="function" &&
  31. Type.registerClass && typeof (Type.registerClass)==="function" &&
  32. typeof (Function._validateParams)==="function" &&
  33. Sys.Serialization && Sys.Serialization.JavaScriptSerializer && typeof (Sys.Serialization.JavaScriptSerializer.serialize)==="function") {
  34. return true;
  35. }
  36. else {
  37. return false;
  38. }
  39. };
  40. MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function (callback) {
  41. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js';
  42. OSF.OUtil.loadScript(msAjaxCDNPath, callback);
  43. };
  44. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", {
  45. get: function () {
  46. if (this._msAjaxError==null && this.isMsAjaxLoaded()) {
  47. this._msAjaxError=Error;
  48. }
  49. return this._msAjaxError;
  50. },
  51. set: function (errorClass) {
  52. this._msAjaxError=errorClass;
  53. },
  54. enumerable: true,
  55. configurable: true
  56. });
  57. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", {
  58. get: function () {
  59. if (this._msAjaxString==null && this.isMsAjaxLoaded()) {
  60. this._msAjaxString=String;
  61. }
  62. return this._msAjaxString;
  63. },
  64. set: function (stringClass) {
  65. this._msAjaxString=stringClass;
  66. },
  67. enumerable: true,
  68. configurable: true
  69. });
  70. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", {
  71. get: function () {
  72. if (this._msAjaxDebug==null && this.isMsAjaxLoaded()) {
  73. this._msAjaxDebug=Sys.Debug;
  74. }
  75. return this._msAjaxDebug;
  76. },
  77. set: function (debugClass) {
  78. this._msAjaxDebug=debugClass;
  79. },
  80. enumerable: true,
  81. configurable: true
  82. });
  83. return MicrosoftAjaxFactory;
  84. })();
  85. OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory;
  86. })(OfficeExt || (OfficeExt={}));
  87. var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory();
  88. var OSF=OSF || {};
  89. var OfficeExt;
  90. (function (OfficeExt) {
  91. var SafeStorage=(function () {
  92. function SafeStorage(_internalStorage) {
  93. this._internalStorage=_internalStorage;
  94. }
  95. SafeStorage.prototype.getItem=function (key) {
  96. try {
  97. return this._internalStorage && this._internalStorage.getItem(key);
  98. }
  99. catch (e) {
  100. return null;
  101. }
  102. };
  103. SafeStorage.prototype.setItem=function (key, data) {
  104. try {
  105. this._internalStorage && this._internalStorage.setItem(key, data);
  106. }
  107. catch (e) {
  108. }
  109. };
  110. SafeStorage.prototype.clear=function () {
  111. try {
  112. this._internalStorage && this._internalStorage.clear();
  113. }
  114. catch (e) {
  115. }
  116. };
  117. SafeStorage.prototype.removeItem=function (key) {
  118. try {
  119. this._internalStorage && this._internalStorage.removeItem(key);
  120. }
  121. catch (e) {
  122. }
  123. };
  124. SafeStorage.prototype.getKeysWithPrefix=function (keyPrefix) {
  125. var keyList=[];
  126. try {
  127. var len=this._internalStorage && this._internalStorage.length || 0;
  128. for (var i=0; i < len; i++) {
  129. var key=this._internalStorage.key(i);
  130. if (key.indexOf(keyPrefix)===0) {
  131. keyList.push(key);
  132. }
  133. }
  134. }
  135. catch (e) {
  136. }
  137. return keyList;
  138. };
  139. return SafeStorage;
  140. })();
  141. OfficeExt.SafeStorage=SafeStorage;
  142. })(OfficeExt || (OfficeExt={}));
  143. OSF.XdmFieldName={
  144. ConversationUrl: "ConversationUrl",
  145. AppId: "AppId"
  146. };
  147. OSF.WindowNameItemKeys={
  148. BaseFrameName: "baseFrameName",
  149. HostInfo: "hostInfo",
  150. XdmInfo: "xdmInfo",
  151. SerializerVersion: "serializerVersion",
  152. AppContext: "appContext"
  153. };
  154. OSF.OUtil=(function () {
  155. var _uniqueId=-1;
  156. var _xdmInfoKey='&_xdm_Info=';
  157. var _serializerVersionKey='&_serializer_version=';
  158. var _xdmSessionKeyPrefix='_xdm_';
  159. var _serializerVersionKeyPrefix='_serializer_version=';
  160. var _fragmentSeparator='#';
  161. var _fragmentInfoDelimiter='&';
  162. var _classN="class";
  163. var _loadedScripts={};
  164. var _defaultScriptLoadingTimeout=30000;
  165. var _safeSessionStorage=null;
  166. var _safeLocalStorage=null;
  167. var _rndentropy=new Date().getTime();
  168. function _random() {
  169. var nextrand=0x7fffffff * (Math.random());
  170. nextrand ^=_rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10)));
  171. return nextrand.toString(16);
  172. }
  173. ;
  174. function _getSessionStorage() {
  175. if (!_safeSessionStorage) {
  176. try {
  177. var sessionStorage=window.sessionStorage;
  178. }
  179. catch (ex) {
  180. sessionStorage=null;
  181. }
  182. _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage);
  183. }
  184. return _safeSessionStorage;
  185. }
  186. ;
  187. function _reOrderTabbableElements(elements) {
  188. var bucket0=[];
  189. var bucketPositive=[];
  190. var i;
  191. var len=elements.length;
  192. var ele;
  193. for (i=0; i < len; i++) {
  194. ele=elements[i];
  195. if (ele.tabIndex) {
  196. if (ele.tabIndex > 0) {
  197. bucketPositive.push(ele);
  198. }
  199. else if (ele.tabIndex===0) {
  200. bucket0.push(ele);
  201. }
  202. }
  203. else {
  204. bucket0.push(ele);
  205. }
  206. }
  207. bucketPositive=bucketPositive.sort(function (left, right) {
  208. var diff=left.tabIndex - right.tabIndex;
  209. if (diff===0) {
  210. diff=bucketPositive.indexOf(left) - bucketPositive.indexOf(right);
  211. }
  212. return diff;
  213. });
  214. return [].concat(bucketPositive, bucket0);
  215. }
  216. ;
  217. return {
  218. set_entropy: function OSF_OUtil$set_entropy(entropy) {
  219. if (typeof entropy=="string") {
  220. for (var i=0; i < entropy.length; i+=4) {
  221. var temp=0;
  222. for (var j=0; j < 4 && i+j < entropy.length; j++) {
  223. temp=(temp << 8)+entropy.charCodeAt(i+j);
  224. }
  225. _rndentropy ^=temp;
  226. }
  227. }
  228. else if (typeof entropy=="number") {
  229. _rndentropy ^=entropy;
  230. }
  231. else {
  232. _rndentropy ^=0x7fffffff * Math.random();
  233. }
  234. _rndentropy &=0x7fffffff;
  235. },
  236. extend: function OSF_OUtil$extend(child, parent) {
  237. var F=function () { };
  238. F.prototype=parent.prototype;
  239. child.prototype=new F();
  240. child.prototype.constructor=child;
  241. child.uber=parent.prototype;
  242. if (parent.prototype.constructor===Object.prototype.constructor) {
  243. parent.prototype.constructor=parent;
  244. }
  245. },
  246. setNamespace: function OSF_OUtil$setNamespace(name, parent) {
  247. if (parent && name && !parent[name]) {
  248. parent[name]={};
  249. }
  250. },
  251. unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) {
  252. if (parent && name && parent[name]) {
  253. delete parent[name];
  254. }
  255. },
  256. loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) {
  257. if (url && callback) {
  258. var doc=window.document;
  259. var _loadedScriptEntry=_loadedScripts[url];
  260. if (!_loadedScriptEntry) {
  261. var script=doc.createElement("script");
  262. script.type="text/javascript";
  263. _loadedScriptEntry={ loaded: false, pendingCallbacks: [callback], timer: null };
  264. _loadedScripts[url]=_loadedScriptEntry;
  265. var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback() {
  266. if (_loadedScriptEntry.timer !=null) {
  267. clearTimeout(_loadedScriptEntry.timer);
  268. delete _loadedScriptEntry.timer;
  269. }
  270. _loadedScriptEntry.loaded=true;
  271. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  272. for (var i=0; i < pendingCallbackCount; i++) {
  273. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  274. currentCallback();
  275. }
  276. };
  277. var onLoadError=function OSF_OUtil_loadScript$onLoadError() {
  278. delete _loadedScripts[url];
  279. if (_loadedScriptEntry.timer !=null) {
  280. clearTimeout(_loadedScriptEntry.timer);
  281. delete _loadedScriptEntry.timer;
  282. }
  283. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  284. for (var i=0; i < pendingCallbackCount; i++) {
  285. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  286. currentCallback();
  287. }
  288. };
  289. if (script.readyState) {
  290. script.onreadystatechange=function () {
  291. if (script.readyState=="loaded" || script.readyState=="complete") {
  292. script.onreadystatechange=null;
  293. onLoadCallback();
  294. }
  295. };
  296. }
  297. else {
  298. script.onload=onLoadCallback;
  299. }
  300. script.onerror=onLoadError;
  301. timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout;
  302. _loadedScriptEntry.timer=setTimeout(onLoadError, timeoutInMs);
  303. script.src=url;
  304. doc.getElementsByTagName("head")[0].appendChild(script);
  305. }
  306. else if (_loadedScriptEntry.loaded) {
  307. callback();
  308. }
  309. else {
  310. _loadedScriptEntry.pendingCallbacks.push(callback);
  311. }
  312. }
  313. },
  314. loadCSS: function OSF_OUtil$loadCSS(url) {
  315. if (url) {
  316. var doc=window.document;
  317. var link=doc.createElement("link");
  318. link.type="text/css";
  319. link.rel="stylesheet";
  320. link.href=url;
  321. doc.getElementsByTagName("head")[0].appendChild(link);
  322. }
  323. },
  324. parseEnum: function OSF_OUtil$parseEnum(str, enumObject) {
  325. var parsed=enumObject[str.trim()];
  326. if (typeof (parsed)=='undefined') {
  327. OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str);
  328. throw OsfMsAjaxFactory.msAjaxError.argument("str");
  329. }
  330. return parsed;
  331. },
  332. delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() {
  333. var obj={ calc: arguments[0] };
  334. return function () {
  335. if (obj.calc) {
  336. obj.val=obj.calc.apply(this, arguments);
  337. delete obj.calc;
  338. }
  339. return obj.val;
  340. };
  341. },
  342. getUniqueId: function OSF_OUtil$getUniqueId() {
  343. _uniqueId=_uniqueId+1;
  344. return _uniqueId.toString();
  345. },
  346. formatString: function OSF_OUtil$formatString() {
  347. var args=arguments;
  348. var source=args[0];
  349. return source.replace(/{(\d+)}/gm, function (match, number) {
  350. var index=parseInt(number, 10)+1;
  351. return args[index]===undefined ? '{'+number+'}' : args[index];
  352. });
  353. },
  354. generateConversationId: function OSF_OUtil$generateConversationId() {
  355. return [_random(), _random(), (new Date()).getTime().toString()].join('_');
  356. },
  357. getFrameName: function OSF_OUtil$getFrameName(cacheKey) {
  358. return _xdmSessionKeyPrefix+cacheKey+this.generateConversationId();
  359. },
  360. addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) {
  361. return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue, false);
  362. },
  363. addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) {
  364. return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion, true);
  365. },
  366. addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue, encodeInfo) {
  367. url=url.trim() || '';
  368. var urlParts=url.split(_fragmentSeparator);
  369. var urlWithoutFragment=urlParts.shift();
  370. var fragment=urlParts.join(_fragmentSeparator);
  371. var newFragment;
  372. if (encodeInfo) {
  373. newFragment=[keyName, encodeURIComponent(infoValue), fragment].join('');
  374. }
  375. else {
  376. newFragment=[fragment, keyName, infoValue].join('');
  377. }
  378. return [urlWithoutFragment, _fragmentSeparator, newFragment].join('');
  379. },
  380. parseHostInfoFromWindowName: function OSF_OUtil$parseHostInfoFromWindowName(skipSessionStorage, windowName) {
  381. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.HostInfo);
  382. },
  383. parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) {
  384. var xdmInfoValue=OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash);
  385. if (!xdmInfoValue) {
  386. xdmInfoValue=OSF.OUtil.parseXdmInfoFromWindowName(skipSessionStorage, window.name);
  387. }
  388. return xdmInfoValue;
  389. },
  390. parseXdmInfoFromWindowName: function OSF_OUtil$parseXdmInfoFromWindowName(skipSessionStorage, windowName) {
  391. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.XdmInfo);
  392. },
  393. parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) {
  394. return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, false, skipSessionStorage, fragment);
  395. },
  396. parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) {
  397. var serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash);
  398. if (isNaN(serializerVersion)) {
  399. serializerVersion=OSF.OUtil.parseSerializerVersionFromWindowName(skipSessionStorage, window.name);
  400. }
  401. return serializerVersion;
  402. },
  403. parseSerializerVersionFromWindowName: function OSF_OUtil$parseSerializerVersionFromWindowName(skipSessionStorage, windowName) {
  404. return parseInt(OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.SerializerVersion));
  405. },
  406. parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) {
  407. return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, true, skipSessionStorage, fragment));
  408. },
  409. parseInfoFromWindowName: function OSF_OUtil$parseInfoFromWindowName(skipSessionStorage, windowName, infoKey) {
  410. try {
  411. var windowNameObj=JSON.parse(windowName);
  412. var infoValue=windowNameObj !=null ? windowNameObj[infoKey] : null;
  413. var osfSessionStorage=_getSessionStorage();
  414. if (!skipSessionStorage && osfSessionStorage && windowNameObj !=null) {
  415. var sessionKey=windowNameObj[OSF.WindowNameItemKeys.BaseFrameName]+infoKey;
  416. if (infoValue) {
  417. osfSessionStorage.setItem(sessionKey, infoValue);
  418. }
  419. else {
  420. infoValue=osfSessionStorage.getItem(sessionKey);
  421. }
  422. }
  423. return infoValue;
  424. }
  425. catch (Exception) {
  426. return null;
  427. }
  428. },
  429. parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, decodeInfo, skipSessionStorage, fragment) {
  430. var fragmentParts=fragment.split(infoKey);
  431. var infoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null;
  432. if (decodeInfo && infoValue !=null) {
  433. if (infoValue.indexOf(_fragmentInfoDelimiter) >=0) {
  434. infoValue=infoValue.split(_fragmentInfoDelimiter)[0];
  435. }
  436. infoValue=decodeURIComponent(infoValue);
  437. }
  438. var osfSessionStorage=_getSessionStorage();
  439. if (!skipSessionStorage && osfSessionStorage) {
  440. var sessionKeyStart=window.name.indexOf(infoKeyPrefix);
  441. if (sessionKeyStart > -1) {
  442. var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart);
  443. if (sessionKeyEnd==-1) {
  444. sessionKeyEnd=window.name.length;
  445. }
  446. var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd);
  447. if (infoValue) {
  448. osfSessionStorage.setItem(sessionKey, infoValue);
  449. }
  450. else {
  451. infoValue=osfSessionStorage.getItem(sessionKey);
  452. }
  453. }
  454. }
  455. return infoValue;
  456. },
  457. getConversationId: function OSF_OUtil$getConversationId() {
  458. var searchString=window.location.search;
  459. var conversationId=null;
  460. if (searchString) {
  461. var index=searchString.indexOf("&");
  462. conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1);
  463. if (conversationId && conversationId.charAt(conversationId.length - 1)==='=') {
  464. conversationId=conversationId.substring(0, conversationId.length - 1);
  465. if (conversationId) {
  466. conversationId=decodeURIComponent(conversationId);
  467. }
  468. }
  469. }
  470. return conversationId;
  471. },
  472. getInfoItems: function OSF_OUtil$getInfoItems(strInfo) {
  473. var items=strInfo.split("$");
  474. if (typeof items[1]=="undefined") {
  475. items=strInfo.split("|");
  476. }
  477. if (typeof items[1]=="undefined") {
  478. items=strInfo.split("%7C");
  479. }
  480. return items;
  481. },
  482. getXdmFieldValue: function OSF_OUtil$getXdmFieldValue(xdmFieldName, skipSessionStorage) {
  483. var fieldValue='';
  484. var xdmInfoValue=OSF.OUtil.parseXdmInfo(skipSessionStorage);
  485. if (xdmInfoValue) {
  486. var items=OSF.OUtil.getInfoItems(xdmInfoValue);
  487. if (items !=undefined && items.length >=3) {
  488. switch (xdmFieldName) {
  489. case OSF.XdmFieldName.ConversationUrl:
  490. fieldValue=items[2];
  491. break;
  492. case OSF.XdmFieldName.AppId:
  493. fieldValue=items[1];
  494. break;
  495. }
  496. }
  497. }
  498. return fieldValue;
  499. },
  500. validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) {
  501. var e=Function._validateParams(arguments, [{ name: "params", type: Object, mayBeNull: false },
  502. { name: "expectedProperties", type: Object, mayBeNull: false },
  503. { name: "callback", type: Function, mayBeNull: true }
  504. ]);
  505. if (e)
  506. throw e;
  507. for (var p in expectedProperties) {
  508. e=Function._validateParameter(params[p], expectedProperties[p], p);
  509. if (e)
  510. throw e;
  511. }
  512. },
  513. writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) {
  514. if (window.msWriteProfilerMark) {
  515. window.msWriteProfilerMark(text);
  516. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  517. }
  518. },
  519. outputDebug: function OSF_OUtil$outputDebug(text) {
  520. if (typeof (OsfMsAjaxFactory) !=='undefined' && OsfMsAjaxFactory.msAjaxDebug && OsfMsAjaxFactory.msAjaxDebug.trace) {
  521. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  522. }
  523. },
  524. defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) {
  525. descriptor=descriptor || {};
  526. for (var nd in attributes) {
  527. var attribute=attributes[nd];
  528. if (descriptor[attribute]==undefined) {
  529. descriptor[attribute]=true;
  530. }
  531. }
  532. Object.defineProperty(obj, prop, descriptor);
  533. return obj;
  534. },
  535. defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) {
  536. descriptors=descriptors || {};
  537. for (var prop in descriptors) {
  538. OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes);
  539. }
  540. return obj;
  541. },
  542. defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) {
  543. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]);
  544. },
  545. defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) {
  546. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]);
  547. },
  548. defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) {
  549. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]);
  550. },
  551. defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) {
  552. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]);
  553. },
  554. finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) {
  555. descriptor=descriptor || {};
  556. var props=Object.getOwnPropertyNames(obj);
  557. var propsLength=props.length;
  558. for (var i=0; i < propsLength; i++) {
  559. var prop=props[i];
  560. var desc=Object.getOwnPropertyDescriptor(obj, prop);
  561. if (!desc.get && !desc.set) {
  562. desc.writable=descriptor.writable || false;
  563. }
  564. desc.configurable=descriptor.configurable || false;
  565. desc.enumerable=descriptor.enumerable || true;
  566. Object.defineProperty(obj, prop, desc);
  567. }
  568. return obj;
  569. },
  570. mapList: function OSF_OUtil$MapList(list, mapFunction) {
  571. var ret=[];
  572. if (list) {
  573. for (var item in list) {
  574. ret.push(mapFunction(list[item]));
  575. }
  576. }
  577. return ret;
  578. },
  579. listContainsKey: function OSF_OUtil$listContainsKey(list, key) {
  580. for (var item in list) {
  581. if (key==item) {
  582. return true;
  583. }
  584. }
  585. return false;
  586. },
  587. listContainsValue: function OSF_OUtil$listContainsElement(list, value) {
  588. for (var item in list) {
  589. if (value==list[item]) {
  590. return true;
  591. }
  592. }
  593. return false;
  594. },
  595. augmentList: function OSF_OUtil$augmentList(list, addenda) {
  596. var add=list.push ? function (key, value) { list.push(value); } : function (key, value) { list[key]=value; };
  597. for (var key in addenda) {
  598. add(key, addenda[key]);
  599. }
  600. },
  601. redefineList: function OSF_Outil$redefineList(oldList, newList) {
  602. for (var key1 in oldList) {
  603. delete oldList[key1];
  604. }
  605. for (var key2 in newList) {
  606. oldList[key2]=newList[key2];
  607. }
  608. },
  609. isArray: function OSF_OUtil$isArray(obj) {
  610. return Object.prototype.toString.apply(obj)==="[object Array]";
  611. },
  612. isFunction: function OSF_OUtil$isFunction(obj) {
  613. return Object.prototype.toString.apply(obj)==="[object Function]";
  614. },
  615. isDate: function OSF_OUtil$isDate(obj) {
  616. return Object.prototype.toString.apply(obj)==="[object Date]";
  617. },
  618. addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) {
  619. if (element.addEventListener) {
  620. element.addEventListener(eventName, listener, false);
  621. }
  622. else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.attachEvent) {
  623. element.attachEvent("on"+eventName, listener);
  624. }
  625. else {
  626. element["on"+eventName]=listener;
  627. }
  628. },
  629. removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) {
  630. if (element.removeEventListener) {
  631. element.removeEventListener(eventName, listener, false);
  632. }
  633. else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.detachEvent) {
  634. element.detachEvent("on"+eventName, listener);
  635. }
  636. else {
  637. element["on"+eventName]=null;
  638. }
  639. },
  640. getCookieValue: function OSF_OUtil$getCookieValue(cookieName) {
  641. var tmpCookieString=RegExp(cookieName+"[^;]+").exec(document.cookie);
  642. return tmpCookieString.toString().replace(/^[^=]+./, "");
  643. },
  644. xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) {
  645. var xmlhttp;
  646. try {
  647. xmlhttp=new XMLHttpRequest();
  648. xmlhttp.onreadystatechange=function () {
  649. if (xmlhttp.readyState==4) {
  650. if (xmlhttp.status==200) {
  651. onSuccess(xmlhttp.responseText);
  652. }
  653. else {
  654. onError(xmlhttp.status);
  655. }
  656. }
  657. };
  658. xmlhttp.open("GET", url, true);
  659. xmlhttp.send();
  660. }
  661. catch (ex) {
  662. onError(ex);
  663. }
  664. },
  665. xhrGetFull: function OSF_OUtil$xhrGetFull(url, oneDriveFileName, onSuccess, onError) {
  666. var xmlhttp;
  667. var requestedFileName=oneDriveFileName;
  668. try {
  669. xmlhttp=new XMLHttpRequest();
  670. xmlhttp.onreadystatechange=function () {
  671. if (xmlhttp.readyState==4) {
  672. if (xmlhttp.status==200) {
  673. onSuccess(xmlhttp, requestedFileName);
  674. }
  675. else {
  676. onError(xmlhttp.status);
  677. }
  678. }
  679. };
  680. xmlhttp.open("GET", url, true);
  681. xmlhttp.send();
  682. }
  683. catch (ex) {
  684. onError(ex);
  685. }
  686. },
  687. encodeBase64: function OSF_Outil$encodeBase64(input) {
  688. if (!input)
  689. return input;
  690. var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/=";
  691. var output=[];
  692. var temp=[];
  693. var index=0;
  694. var c1, c2, c3, a, b, c;
  695. var i;
  696. var length=input.length;
  697. do {
  698. c1=input.charCodeAt(index++);
  699. c2=input.charCodeAt(index++);
  700. c3=input.charCodeAt(index++);
  701. i=0;
  702. a=c1 & 255;
  703. b=c1 >> 8;
  704. c=c2 & 255;
  705. temp[i++]=a >> 2;
  706. temp[i++]=((a & 3) << 4) | (b >> 4);
  707. temp[i++]=((b & 15) << 2) | (c >> 6);
  708. temp[i++]=c & 63;
  709. if (!isNaN(c2)) {
  710. a=c2 >> 8;
  711. b=c3 & 255;
  712. c=c3 >> 8;
  713. temp[i++]=a >> 2;
  714. temp[i++]=((a & 3) << 4) | (b >> 4);
  715. temp[i++]=((b & 15) << 2) | (c >> 6);
  716. temp[i++]=c & 63;
  717. }
  718. if (isNaN(c2)) {
  719. temp[i - 1]=64;
  720. }
  721. else if (isNaN(c3)) {
  722. temp[i - 2]=64;
  723. temp[i - 1]=64;
  724. }
  725. for (var t=0; t < i; t++) {
  726. output.push(codex.charAt(temp[t]));
  727. }
  728. } while (index < length);
  729. return output.join("");
  730. },
  731. getSessionStorage: function OSF_Outil$getSessionStorage() {
  732. return _getSessionStorage();
  733. },
  734. getLocalStorage: function OSF_Outil$getLocalStorage() {
  735. if (!_safeLocalStorage) {
  736. try {
  737. var localStorage=window.localStorage;
  738. }
  739. catch (ex) {
  740. localStorage=null;
  741. }
  742. _safeLocalStorage=new OfficeExt.SafeStorage(localStorage);
  743. }
  744. return _safeLocalStorage;
  745. },
  746. convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) {
  747. var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6);
  748. return hex;
  749. },
  750. attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) {
  751. element.onclick=function (e) {
  752. handler();
  753. };
  754. element.ontouchend=function (e) {
  755. handler();
  756. e.preventDefault();
  757. };
  758. },
  759. getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) {
  760. var e=Function._validateParams(arguments, [{ name: "queryString", type: String, mayBeNull: false },
  761. { name: "paramName", type: String, mayBeNull: false }
  762. ]);
  763. if (e) {
  764. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null.");
  765. return "";
  766. }
  767. var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)", "i");
  768. if (!queryExp.test(queryString)) {
  769. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found.");
  770. return "";
  771. }
  772. return queryExp.exec(queryString)[1];
  773. },
  774. isiOS: function OSF_Outil$isiOS() {
  775. return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
  776. },
  777. isChrome: function OSF_Outil$isChrome() {
  778. return (window.navigator.userAgent.indexOf("Chrome") > 0) && !OSF.OUtil.isEdge();
  779. },
  780. isEdge: function OSF_Outil$isEdge() {
  781. return window.navigator.userAgent.indexOf("Edge") > 0;
  782. },
  783. isIE: function OSF_Outil$isIE() {
  784. return window.navigator.userAgent.indexOf("Trident") > 0;
  785. },
  786. isFirefox: function OSF_Outil$isFirefox() {
  787. return window.navigator.userAgent.indexOf("Firefox") > 0;
  788. },
  789. shallowCopy: function OSF_Outil$shallowCopy(sourceObj) {
  790. var copyObj=sourceObj.constructor();
  791. for (var property in sourceObj) {
  792. if (sourceObj.hasOwnProperty(property)) {
  793. copyObj[property]=sourceObj[property];
  794. }
  795. }
  796. return copyObj;
  797. },
  798. createObject: function OSF_Outil$createObject(properties) {
  799. var obj=null;
  800. if (properties) {
  801. obj={};
  802. var len=properties.length;
  803. for (var i=0; i < len; i++) {
  804. obj[properties[i].name]=properties[i].value;
  805. }
  806. }
  807. return obj;
  808. },
  809. addClass: function OSF_OUtil$addClass(elmt, val) {
  810. if (!OSF.OUtil.hasClass(elmt, val)) {
  811. var className=elmt.getAttribute(_classN);
  812. if (className) {
  813. elmt.setAttribute(_classN, className+" "+val);
  814. }
  815. else {
  816. elmt.setAttribute(_classN, val);
  817. }
  818. }
  819. },
  820. hasClass: function OSF_OUtil$hasClass(elmt, clsName) {
  821. var className=elmt.getAttribute(_classN);
  822. return className && className.match(new RegExp('(\\s|^)'+clsName+'(\\s|$)'));
  823. },
  824. focusToFirstTabbable: function OSF_OUtil$focusToFirstTabbable(all, backward) {
  825. var next;
  826. var focused=false;
  827. var candidate;
  828. var setFlag=function (e) {
  829. focused=true;
  830. };
  831. var findNextPos=function (allLen, currPos, backward) {
  832. if (currPos < 0 || currPos > allLen) {
  833. return -1;
  834. }
  835. else if (currPos===0 && backward) {
  836. return -1;
  837. }
  838. else if (currPos===allLen - 1 && !backward) {
  839. return -1;
  840. }
  841. if (backward) {
  842. return currPos - 1;
  843. }
  844. else {
  845. return currPos+1;
  846. }
  847. };
  848. all=_reOrderTabbableElements(all);
  849. next=backward ? all.length - 1 : 0;
  850. if (all.length===0) {
  851. return null;
  852. }
  853. while (!focused && next >=0 && next < all.length) {
  854. candidate=all[next];
  855. window.focus();
  856. candidate.addEventListener('focus', setFlag);
  857. candidate.focus();
  858. candidate.removeEventListener('focus', setFlag);
  859. next=findNextPos(all.length, next, backward);
  860. if (!focused && candidate===document.activeElement) {
  861. focused=true;
  862. }
  863. }
  864. if (focused) {
  865. return candidate;
  866. }
  867. else {
  868. return null;
  869. }
  870. },
  871. focusToNextTabbable: function OSF_OUtil$focusToNextTabbable(all, curr, shift) {
  872. var currPos;
  873. var next;
  874. var focused=false;
  875. var candidate;
  876. var setFlag=function (e) {
  877. focused=true;
  878. };
  879. var findCurrPos=function (all, curr) {
  880. var i=0;
  881. for (; i < all.length; i++) {
  882. if (all[i]===curr) {
  883. return i;
  884. }
  885. }
  886. return -1;
  887. };
  888. var findNextPos=function (allLen, currPos, shift) {
  889. if (currPos < 0 || currPos > allLen) {
  890. return -1;
  891. }
  892. else if (currPos===0 && shift) {
  893. return -1;
  894. }
  895. else if (currPos===allLen - 1 && !shift) {
  896. return -1;
  897. }
  898. if (shift) {
  899. return currPos - 1;
  900. }
  901. else {
  902. return currPos+1;
  903. }
  904. };
  905. all=_reOrderTabbableElements(all);
  906. currPos=findCurrPos(all, curr);
  907. next=findNextPos(all.length, currPos, shift);
  908. if (next < 0) {
  909. return null;
  910. }
  911. while (!focused && next >=0 && next < all.length) {
  912. candidate=all[next];
  913. candidate.addEventListener('focus', setFlag);
  914. candidate.focus();
  915. candidate.removeEventListener('focus', setFlag);
  916. next=findNextPos(all.length, next, shift);
  917. if (!focused && candidate===document.activeElement) {
  918. focused=true;
  919. }
  920. }
  921. if (focused) {
  922. return candidate;
  923. }
  924. else {
  925. return null;
  926. }
  927. }
  928. };
  929. })();
  930. OSF.OUtil.Guid=(function () {
  931. var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
  932. return {
  933. generateNewGuid: function OSF_Outil_Guid$generateNewGuid() {
  934. var result="";
  935. var tick=(new Date()).getTime();
  936. var index=0;
  937. for (; index < 32 && tick > 0; index++) {
  938. if (index==8 || index==12 || index==16 || index==20) {
  939. result+="-";
  940. }
  941. result+=hexCode[tick % 16];
  942. tick=Math.floor(tick / 16);
  943. }
  944. for (; index < 32; index++) {
  945. if (index==8 || index==12 || index==16 || index==20) {
  946. result+="-";
  947. }
  948. result+=hexCode[Math.floor(Math.random() * 16)];
  949. }
  950. return result;
  951. }
  952. };
  953. })();
  954. window.OSF=OSF;
  955. OSF.OUtil.setNamespace("OSF", window);
  956. OSF.AppName={
  957. Unsupported: 0,
  958. Excel: 1,
  959. Word: 2,
  960. PowerPoint: 4,
  961. Outlook: 8,
  962. ExcelWebApp: 16,
  963. WordWebApp: 32,
  964. OutlookWebApp: 64,
  965. Project: 128,
  966. AccessWebApp: 256,
  967. PowerpointWebApp: 512,
  968. ExcelIOS: 1024,
  969. Sway: 2048,
  970. WordIOS: 4096,
  971. PowerPointIOS: 8192,
  972. Access: 16384,
  973. Lync: 32768,
  974. OutlookIOS: 65536,
  975. OneNoteWebApp: 131072,
  976. OneNote: 262144,
  977. ExcelWinRT: 524288,
  978. WordWinRT: 1048576,
  979. PowerpointWinRT: 2097152,
  980. OutlookAndroid: 4194304,
  981. OneNoteWinRT: 8388608,
  982. ExcelAndroid: 8388609,
  983. VisioWebApp: 8388610
  984. };
  985. OSF.InternalPerfMarker={
  986. DataCoercionBegin: "Agave.HostCall.CoerceDataStart",
  987. DataCoercionEnd: "Agave.HostCall.CoerceDataEnd"
  988. };
  989. OSF.HostCallPerfMarker={
  990. IssueCall: "Agave.HostCall.IssueCall",
  991. ReceiveResponse: "Agave.HostCall.ReceiveResponse",
  992. RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised"
  993. };
  994. OSF.AgaveHostAction={
  995. "Select": 0,
  996. "UnSelect": 1,
  997. "CancelDialog": 2,
  998. "InsertAgave": 3,
  999. "CtrlF6In": 4,
  1000. "CtrlF6Exit": 5,
  1001. "CtrlF6ExitShift": 6,
  1002. "SelectWithError": 7,
  1003. "NotifyHostError": 8,
  1004. "RefreshAddinCommands": 9,
  1005. "PageIsReady": 10,
  1006. "TabIn": 11,
  1007. "TabInShift": 12,
  1008. "TabExit": 13,
  1009. "TabExitShift": 14,
  1010. "EscExit": 15,
  1011. "F2Exit": 16,
  1012. "ExitNoFocusable": 17,
  1013. "ExitNoFocusableShift": 18
  1014. };
  1015. OSF.SharedConstants={
  1016. "NotificationConversationIdSuffix": '_ntf'
  1017. };
  1018. OSF.DialogMessageType={
  1019. DialogMessageReceived: 0,
  1020. DialogParentMessageReceived: 1,
  1021. DialogClosed: 12006
  1022. };
  1023. OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix, hostCustomMessage, hostFullVersion, clientWindowHeight, clientWindowWidth, addinName, appDomains, dialogRequirementMatrix) {
  1024. this._id=id;
  1025. this._appName=appName;
  1026. this._appVersion=appVersion;
  1027. this._appUILocale=appUILocale;
  1028. this._dataLocale=dataLocale;
  1029. this._docUrl=docUrl;
  1030. this._clientMode=clientMode;
  1031. this._settings=settings;
  1032. this._reason=reason;
  1033. this._osfControlType=osfControlType;
  1034. this._eToken=eToken;
  1035. this._correlationId=correlationId;
  1036. this._appInstanceId=appInstanceId;
  1037. this._touchEnabled=touchEnabled;
  1038. this._commerceAllowed=commerceAllowed;
  1039. this._appMinorVersion=appMinorVersion;
  1040. this._requirementMatrix=requirementMatrix;
  1041. this._hostCustomMessage=hostCustomMessage;
  1042. this._hostFullVersion=hostFullVersion;
  1043. this._isDialog=false;
  1044. this._clientWindowHeight=clientWindowHeight;
  1045. this._clientWindowWidth=clientWindowWidth;
  1046. this._addinName=addinName;
  1047. this._appDomains=appDomains;
  1048. this._dialogRequirementMatrix=dialogRequirementMatrix;
  1049. this.get_id=function get_id() { return this._id; };
  1050. this.get_appName=function get_appName() { return this._appName; };
  1051. this.get_appVersion=function get_appVersion() { return this._appVersion; };
  1052. this.get_appUILocale=function get_appUILocale() { return this._appUILocale; };
  1053. this.get_dataLocale=function get_dataLocale() { return this._dataLocale; };
  1054. this.get_docUrl=function get_docUrl() { return this._docUrl; };
  1055. this.get_clientMode=function get_clientMode() { return this._clientMode; };
  1056. this.get_bindings=function get_bindings() { return this._bindings; };
  1057. this.get_settings=function get_settings() { return this._settings; };
  1058. this.get_reason=function get_reason() { return this._reason; };
  1059. this.get_osfControlType=function get_osfControlType() { return this._osfControlType; };
  1060. this.get_eToken=function get_eToken() { return this._eToken; };
  1061. this.get_correlationId=function get_correlationId() { return this._correlationId; };
  1062. this.get_appInstanceId=function get_appInstanceId() { return this._appInstanceId; };
  1063. this.get_touchEnabled=function get_touchEnabled() { return this._touchEnabled; };
  1064. this.get_commerceAllowed=function get_commerceAllowed() { return this._commerceAllowed; };
  1065. this.get_appMinorVersion=function get_appMinorVersion() { return this._appMinorVersion; };
  1066. this.get_requirementMatrix=function get_requirementMatrix() { return this._requirementMatrix; };
  1067. this.get_dialogRequirementMatrix=function get_dialogRequirementMatrix() { return this._dialogRequirementMatrix; };
  1068. this.get_hostCustomMessage=function get_hostCustomMessage() { return this._hostCustomMessage; };
  1069. this.get_hostFullVersion=function get_hostFullVersion() { return this._hostFullVersion; };
  1070. this.get_isDialog=function get_isDialog() { return this._isDialog; };
  1071. this.get_clientWindowHeight=function get_clientWindowHeight() { return this._clientWindowHeight; };
  1072. this.get_clientWindowWidth=function get_clientWindowWidth() { return this._clientWindowWidth; };
  1073. this.get_addinName=function get_addinName() { return this._addinName; };
  1074. this.get_appDomains=function get_appDomains() { return this._appDomains; };
  1075. };
  1076. OSF.OsfControlType={
  1077. DocumentLevel: 0,
  1078. ContainerLevel: 1
  1079. };
  1080. OSF.ClientMode={
  1081. ReadOnly: 0,
  1082. ReadWrite: 1
  1083. };
  1084. OSF.OUtil.setNamespace("Microsoft", window);
  1085. OSF.OUtil.setNamespace("Office", Microsoft);
  1086. OSF.OUtil.setNamespace("Client", Microsoft.Office);
  1087. OSF.OUtil.setNamespace("WebExtension", Microsoft.Office);
  1088. Microsoft.Office.WebExtension.InitializationReason={
  1089. Inserted: "inserted",
  1090. DocumentOpened: "documentOpened"
  1091. };
  1092. Microsoft.Office.WebExtension.ValueFormat={
  1093. Unformatted: "unformatted",
  1094. Formatted: "formatted"
  1095. };
  1096. Microsoft.Office.WebExtension.FilterType={
  1097. All: "all"
  1098. };
  1099. Microsoft.Office.WebExtension.Parameters={
  1100. BindingType: "bindingType",
  1101. CoercionType: "coercionType",
  1102. ValueFormat: "valueFormat",
  1103. FilterType: "filterType",
  1104. Columns: "columns",
  1105. SampleData: "sampleData",
  1106. GoToType: "goToType",
  1107. SelectionMode: "selectionMode",
  1108. Id: "id",
  1109. PromptText: "promptText",
  1110. ItemName: "itemName",
  1111. FailOnCollision: "failOnCollision",
  1112. StartRow: "startRow",
  1113. StartColumn: "startColumn",
  1114. RowCount: "rowCount",
  1115. ColumnCount: "columnCount",
  1116. Callback: "callback",
  1117. AsyncContext: "asyncContext",
  1118. Data: "data",
  1119. Rows: "rows",
  1120. OverwriteIfStale: "overwriteIfStale",
  1121. FileType: "fileType",
  1122. EventType: "eventType",
  1123. Handler: "handler",
  1124. SliceSize: "sliceSize",
  1125. SliceIndex: "sliceIndex",
  1126. ActiveView: "activeView",
  1127. Status: "status",
  1128. Xml: "xml",
  1129. Namespace: "namespace",
  1130. Prefix: "prefix",
  1131. XPath: "xPath",
  1132. Text: "text",
  1133. ImageLeft: "imageLeft",
  1134. ImageTop: "imageTop",
  1135. ImageWidth: "imageWidth",
  1136. ImageHeight: "imageHeight",
  1137. TaskId: "taskId",
  1138. FieldId: "fieldId",
  1139. FieldValue: "fieldValue",
  1140. ServerUrl: "serverUrl",
  1141. ListName: "listName",
  1142. ResourceId: "resourceId",
  1143. ViewType: "viewType",
  1144. ViewName: "viewName",
  1145. GetRawValue: "getRawValue",
  1146. CellFormat: "cellFormat",
  1147. TableOptions: "tableOptions",
  1148. TaskIndex: "taskIndex",
  1149. ResourceIndex: "resourceIndex",
  1150. CustomFieldId: "customFieldId",
  1151. Url: "url",
  1152. MessageHandler: "messageHandler",
  1153. Width: "width",
  1154. Height: "height",
  1155. RequireHTTPs: "requireHTTPS",
  1156. MessageToParent: "messageToParent",
  1157. DisplayInIframe: "displayInIframe",
  1158. MessageContent: "messageContent"
  1159. };
  1160. OSF.OUtil.setNamespace("DDA", OSF);
  1161. OSF.DDA.DocumentMode={
  1162. ReadOnly: 1,
  1163. ReadWrite: 0
  1164. };
  1165. OSF.DDA.PropertyDescriptors={
  1166. AsyncResultStatus: "AsyncResultStatus"
  1167. };
  1168. OSF.DDA.EventDescriptors={};
  1169. OSF.DDA.ListDescriptors={};
  1170. OSF.DDA.UI={};
  1171. OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(id, eventType) {
  1172. if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged ||
  1173. eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged ||
  1174. eventType==Microsoft.Office.WebExtension.EventType.DataNodeDeleted ||
  1175. eventType==Microsoft.Office.WebExtension.EventType.DataNodeInserted ||
  1176. eventType==Microsoft.Office.WebExtension.EventType.DataNodeReplaced) {
  1177. return id+"_"+eventType;
  1178. }
  1179. else {
  1180. return eventType;
  1181. }
  1182. };
  1183. OSF.DDA.MethodDispId={
  1184. dispidMethodMin: 64,
  1185. dispidGetSelectedDataMethod: 64,
  1186. dispidSetSelectedDataMethod: 65,
  1187. dispidAddBindingFromSelectionMethod: 66,
  1188. dispidAddBindingFromPromptMethod: 67,
  1189. dispidGetBindingMethod: 68,
  1190. dispidReleaseBindingMethod: 69,
  1191. dispidGetBindingDataMethod: 70,
  1192. dispidSetBindingDataMethod: 71,
  1193. dispidAddRowsMethod: 72,
  1194. dispidClearAllRowsMethod: 73,
  1195. dispidGetAllBindingsMethod: 74,
  1196. dispidLoadSettingsMethod: 75,
  1197. dispidSaveSettingsMethod: 76,
  1198. dispidGetDocumentCopyMethod: 77,
  1199. dispidAddBindingFromNamedItemMethod: 78,
  1200. dispidAddColumnsMethod: 79,
  1201. dispidGetDocumentCopyChunkMethod: 80,
  1202. dispidReleaseDocumentCopyMethod: 81,
  1203. dispidNavigateToMethod: 82,
  1204. dispidGetActiveViewMethod: 83,
  1205. dispidGetDocumentThemeMethod: 84,
  1206. dispidGetOfficeThemeMethod: 85,
  1207. dispidGetFilePropertiesMethod: 86,
  1208. dispidClearFormatsMethod: 87,
  1209. dispidSetTableOptionsMethod: 88,
  1210. dispidSetFormatsMethod: 89,
  1211. dispidExecuteRichApiRequestMethod: 93,
  1212. dispidAppCommandInvocationCompletedMethod: 94,
  1213. dispidCloseContainerMethod: 97,
  1214. dispidGetSelectedTaskMethod: 110,
  1215. dispidGetSelectedResourceMethod: 111,
  1216. dispidGetTaskMethod: 112,
  1217. dispidGetResourceFieldMethod: 113,
  1218. dispidGetWSSUrlMethod: 114,
  1219. dispidGetTaskFieldMethod: 115,
  1220. dispidGetProjectFieldMethod: 116,
  1221. dispidGetSelectedViewMethod: 117,
  1222. dispidGetTaskByIndexMethod: 118,
  1223. dispidGetResourceByIndexMethod: 119,
  1224. dispidSetTaskFieldMethod: 120,
  1225. dispidSetResourceFieldMethod: 121,
  1226. dispidGetMaxTaskIndexMethod: 122,
  1227. dispidGetMaxResourceIndexMethod: 123,
  1228. dispidCreateTaskMethod: 124,
  1229. dispidAddDataPartMethod: 128,
  1230. dispidGetDataPartByIdMethod: 129,
  1231. dispidGetDataPartsByNamespaceMethod: 130,
  1232. dispidGetDataPartXmlMethod: 131,
  1233. dispidGetDataPartNodesMethod: 132,
  1234. dispidDeleteDataPartMethod: 133,
  1235. dispidGetDataNodeValueMethod: 134,
  1236. dispidGetDataNodeXmlMethod: 135,
  1237. dispidGetDataNodesMethod: 136,
  1238. dispidSetDataNodeValueMethod: 137,
  1239. dispidSetDataNodeXmlMethod: 138,
  1240. dispidAddDataNamespaceMethod: 139,
  1241. dispidGetDataUriByPrefixMethod: 140,
  1242. dispidGetDataPrefixByUriMethod: 141,
  1243. dispidGetDataNodeTextMethod: 142,
  1244. dispidSetDataNodeTextMethod: 143,
  1245. dispidMessageParentMethod: 144,
  1246. dispidSendMessageMethod: 145,
  1247. dispidMethodMax: 145
  1248. };
  1249. OSF.DDA.EventDispId={
  1250. dispidEventMin: 0,
  1251. dispidInitializeEvent: 0,
  1252. dispidSettingsChangedEvent: 1,
  1253. dispidDocumentSelectionChangedEvent: 2,
  1254. dispidBindingSelectionChangedEvent: 3,
  1255. dispidBindingDataChangedEvent: 4,
  1256. dispidDocumentOpenEvent: 5,
  1257. dispidDocumentCloseEvent: 6,
  1258. dispidActiveViewChangedEvent: 7,
  1259. dispidDocumentThemeChangedEvent: 8,
  1260. dispidOfficeThemeChangedEvent: 9,
  1261. dispidDialogMessageReceivedEvent: 10,
  1262. dispidDialogNotificationShownInAddinEvent: 11,
  1263. dispidDialogParentMessageReceivedEvent: 12,
  1264. dispidActivationStatusChangedEvent: 32,
  1265. dispidAppCommandInvokedEvent: 39,
  1266. dispidOlkItemSelectedChangedEvent: 46,
  1267. dispidTaskSelectionChangedEvent: 56,
  1268. dispidResourceSelectionChangedEvent: 57,
  1269. dispidViewSelectionChangedEvent: 58,
  1270. dispidDataNodeAddedEvent: 60,
  1271. dispidDataNodeReplacedEvent: 61,
  1272. dispidDataNodeDeletedEvent: 62,
  1273. dispidEventMax: 63
  1274. };
  1275. OSF.DDA.ErrorCodeManager=(function () {
  1276. var _errorMappings={};
  1277. return {
  1278. getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) {
  1279. var errorArgs=_errorMappings[errorCode];
  1280. if (!errorArgs) {
  1281. errorArgs=_errorMappings[this.errorCodes.ooeInternalError];
  1282. }
  1283. else {
  1284. if (!errorArgs.name) {
  1285. errorArgs.name=_errorMappings[this.errorCodes.ooeInternalError].name;
  1286. }
  1287. if (!errorArgs.message) {
  1288. errorArgs.message=_errorMappings[this.errorCodes.ooeInternalError].message;
  1289. }
  1290. }
  1291. return errorArgs;
  1292. },
  1293. addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) {
  1294. _errorMappings[errorCode]=errorNameMessage;
  1295. },
  1296. errorCodes: {
  1297. ooeSuccess: 0,
  1298. ooeChunkResult: 1,
  1299. ooeCoercionTypeNotSupported: 1000,
  1300. ooeGetSelectionNotMatchDataType: 1001,
  1301. ooeCoercionTypeNotMatchBinding: 1002,
  1302. ooeInvalidGetRowColumnCounts: 1003,
  1303. ooeSelectionNotSupportCoercionType: 1004,
  1304. ooeInvalidGetStartRowColumn: 1005,
  1305. ooeNonUniformPartialGetNotSupported: 1006,
  1306. ooeGetDataIsTooLarge: 1008,
  1307. ooeFileTypeNotSupported: 1009,
  1308. ooeGetDataParametersConflict: 1010,
  1309. ooeInvalidGetColumns: 1011,
  1310. ooeInvalidGetRows: 1012,
  1311. ooeInvalidReadForBlankRow: 1013,
  1312. ooeUnsupportedDataObject: 2000,
  1313. ooeCannotWriteToSelection: 2001,
  1314. ooeDataNotMatchSelection: 2002,
  1315. ooeOverwriteWorksheetData: 2003,
  1316. ooeDataNotMatchBindingSize: 2004,
  1317. ooeInvalidSetStartRowColumn: 2005,
  1318. ooeInvalidDataFormat: 2006,
  1319. ooeDataNotMatchCoercionType: 2007,
  1320. ooeDataNotMatchBindingType: 2008,
  1321. ooeSetDataIsTooLarge: 2009,
  1322. ooeNonUniformPartialSetNotSupported: 2010,
  1323. ooeInvalidSetColumns: 2011,
  1324. ooeInvalidSetRows: 2012,
  1325. ooeSetDataParametersConflict: 2013,
  1326. ooeCellDataAmountBeyondLimits: 2014,
  1327. ooeSelectionCannotBound: 3000,
  1328. ooeBindingNotExist: 3002,
  1329. ooeBindingToMultipleSelection: 3003,
  1330. ooeInvalidSelectionForBindingType: 3004,
  1331. ooeOperationNotSupportedOnThisBindingType: 3005,
  1332. ooeNamedItemNotFound: 3006,
  1333. ooeMultipleNamedItemFound: 3007,
  1334. ooeInvalidNamedItemForBindingType: 3008,
  1335. ooeUnknownBindingType: 3009,
  1336. ooeOperationNotSupportedOnMatrixData: 3010,
  1337. ooeInvalidColumnsForBinding: 3011,
  1338. ooeSettingNameNotExist: 4000,
  1339. ooeSettingsCannotSave: 4001,
  1340. ooeSettingsAreStale: 4002,
  1341. ooeOperationNotSupported: 5000,
  1342. ooeInternalError: 5001,
  1343. ooeDocumentReadOnly: 5002,
  1344. ooeEventHandlerNotExist: 5003,
  1345. ooeInvalidApiCallInContext: 5004,
  1346. ooeShuttingDown: 5005,
  1347. ooeUnsupportedEnumeration: 5007,
  1348. ooeIndexOutOfRange: 5008,
  1349. ooeBrowserAPINotSupported: 5009,
  1350. ooeInvalidParam: 5010,
  1351. ooeRequestTimeout: 5011,
  1352. ooeTooManyIncompleteRequests: 5100,
  1353. ooeRequestTokenUnavailable: 5101,
  1354. ooeActivityLimitReached: 5102,
  1355. ooeCustomXmlNodeNotFound: 6000,
  1356. ooeCustomXmlError: 6100,
  1357. ooeCustomXmlExceedQuota: 6101,
  1358. ooeCustomXmlOutOfDate: 6102,
  1359. ooeNoCapability: 7000,
  1360. ooeCannotNavTo: 7001,
  1361. ooeSpecifiedIdNotExist: 7002,
  1362. ooeNavOutOfBound: 7004,
  1363. ooeElementMissing: 8000,
  1364. ooeProtectedError: 8001,
  1365. ooeInvalidCellsValue: 8010,
  1366. ooeInvalidTableOptionValue: 8011,
  1367. ooeInvalidFormatValue: 8012,
  1368. ooeRowIndexOutOfRange: 8020,
  1369. ooeColIndexOutOfRange: 8021,
  1370. ooeFormatValueOutOfRange: 8022,
  1371. ooeCellFormatAmountBeyondLimits: 8023,
  1372. ooeMemoryFileLimit: 11000,
  1373. ooeNetworkProblemRetrieveFile: 11001,
  1374. ooeInvalidSliceSize: 11002,
  1375. ooeInvalidCallback: 11101,
  1376. ooeInvalidWidth: 12000,
  1377. ooeInvalidHeight: 12001,
  1378. ooeNavigationError: 12002,
  1379. ooeInvalidScheme: 12003,
  1380. ooeAppDomains: 12004,
  1381. ooeRequireHTTPS: 12005,
  1382. ooeWebDialogClosed: 12006,
  1383. ooeDialogAlreadyOpened: 12007,
  1384. ooeEndUserAllow: 12008,
  1385. ooeEndUserIgnore: 12009,
  1386. ooeNotUILessDialog: 12010,
  1387. ooeCrossZone: 12011
  1388. },
  1389. initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) {
  1390. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported };
  1391. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported };
  1392. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding };
  1393. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts };
  1394. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType };
  1395. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn };
  1396. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported };
  1397. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge };
  1398. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported };
  1399. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict };
  1400. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns };
  1401. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows };
  1402. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow };
  1403. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject };
  1404. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection };
  1405. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection };
  1406. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData };
  1407. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize };
  1408. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn };
  1409. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat };
  1410. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType };
  1411. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType };
  1412. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge };
  1413. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported };
  1414. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns };
  1415. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows };
  1416. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict };
  1417. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound };
  1418. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist };
  1419. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection };
  1420. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType };
  1421. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType };
  1422. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound };
  1423. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound };
  1424. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType };
  1425. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType };
  1426. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData };
  1427. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding };
  1428. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist };
  1429. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave };
  1430. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale };
  1431. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported };
  1432. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription };
  1433. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly };
  1434. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist };
  1435. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext };
  1436. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown };
  1437. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage };
  1438. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1439. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported };
  1440. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout };
  1441. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests };
  1442. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable };
  1443. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={ name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached };
  1444. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound };
  1445. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1446. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ name: stringNS.L_CustomXmlExceedQuotaName, message: stringNS.L_CustomXmlExceedQuotaMessage };
  1447. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ name: stringNS.L_CustomXmlOutOfDateName, message: stringNS.L_CustomXmlOutOfDateMessage };
  1448. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1449. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo };
  1450. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist };
  1451. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound };
  1452. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits };
  1453. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing };
  1454. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1455. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue };
  1456. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue };
  1457. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue };
  1458. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange };
  1459. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange };
  1460. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange };
  1461. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits };
  1462. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve };
  1463. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile };
  1464. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported };
  1465. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAlreadyOpened };
  1466. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1467. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1468. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_NetworkProblem };
  1469. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme]={ name: stringNS.L_DialogNavigateError, message: stringNS.L_DialogAddressNotTrusted };
  1470. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAddressNotTrusted };
  1471. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAddressNotTrusted };
  1472. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_UserClickIgnore };
  1473. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_NewWindowCrossZoneErrorString };
  1474. }
  1475. };
  1476. })();
  1477. var OfficeExt;
  1478. (function (OfficeExt) {
  1479. var Requirement;
  1480. (function (Requirement) {
  1481. var RequirementMatrix=(function () {
  1482. function RequirementMatrix(_setMap) {
  1483. this.isSetSupported=function _isSetSupported(name, minVersion) {
  1484. if (name==undefined) {
  1485. return false;
  1486. }
  1487. if (minVersion==undefined) {
  1488. minVersion=0;
  1489. }
  1490. var setSupportArray=this._setMap;
  1491. var sets=setSupportArray._sets;
  1492. if (sets.hasOwnProperty(name.toLowerCase())) {
  1493. var setMaxVersion=sets[name.toLowerCase()];
  1494. return setMaxVersion > 0 && setMaxVersion >=minVersion;
  1495. }
  1496. else {
  1497. return false;
  1498. }
  1499. };
  1500. this._setMap=_setMap;
  1501. this.isSetSupported=this.isSetSupported.bind(this);
  1502. }
  1503. return RequirementMatrix;
  1504. })();
  1505. Requirement.RequirementMatrix=RequirementMatrix;
  1506. var DefaultSetRequirement=(function () {
  1507. function DefaultSetRequirement(setMap) {
  1508. this._addSetMap=function DefaultSetRequirement_addSetMap(addedSet) {
  1509. for (var name in addedSet) {
  1510. this._sets[name]=addedSet[name];
  1511. }
  1512. };
  1513. this._sets=setMap;
  1514. }
  1515. return DefaultSetRequirement;
  1516. })();
  1517. Requirement.DefaultSetRequirement=DefaultSetRequirement;
  1518. var DefaultDialogSetRequirement=(function (_super) {
  1519. __extends(DefaultDialogSetRequirement, _super);
  1520. function DefaultDialogSetRequirement() {
  1521. _super.call(this, {
  1522. "dialogapi": 1.1
  1523. });
  1524. }
  1525. return DefaultDialogSetRequirement;
  1526. })(DefaultSetRequirement);
  1527. Requirement.DefaultDialogSetRequirement=DefaultDialogSetRequirement;
  1528. var ExcelClientDefaultSetRequirement=(function (_super) {
  1529. __extends(ExcelClientDefaultSetRequirement, _super);
  1530. function ExcelClientDefaultSetRequirement() {
  1531. _super.call(this, {
  1532. "bindingevents": 1.1,
  1533. "documentevents": 1.1,
  1534. "excelapi": 1.1,
  1535. "matrixbindings": 1.1,
  1536. "matrixcoercion": 1.1,
  1537. "selection": 1.1,
  1538. "settings": 1.1,
  1539. "tablebindings": 1.1,
  1540. "tablecoercion": 1.1,
  1541. "textbindings": 1.1,
  1542. "textcoercion": 1.1
  1543. });
  1544. }
  1545. return ExcelClientDefaultSetRequirement;
  1546. })(DefaultSetRequirement);
  1547. Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement;
  1548. var ExcelClientV1DefaultSetRequirement=(function (_super) {
  1549. __extends(ExcelClientV1DefaultSetRequirement, _super);
  1550. function ExcelClientV1DefaultSetRequirement() {
  1551. _super.call(this);
  1552. this._addSetMap({
  1553. "imagecoercion": 1.1
  1554. });
  1555. }
  1556. return ExcelClientV1DefaultSetRequirement;
  1557. })(ExcelClientDefaultSetRequirement);
  1558. Requirement.ExcelClientV1DefaultSetRequirement=ExcelClientV1DefaultSetRequirement;
  1559. var OutlookClientDefaultSetRequirement=(function (_super) {
  1560. __extends(OutlookClientDefaultSetRequirement, _super);
  1561. function OutlookClientDefaultSetRequirement() {
  1562. _super.call(this, {
  1563. "mailbox": 1.3
  1564. });
  1565. }
  1566. return OutlookClientDefaultSetRequirement;
  1567. })(DefaultSetRequirement);
  1568. Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement;
  1569. var WordClientDefaultSetRequirement=(function (_super) {
  1570. __extends(WordClientDefaultSetRequirement, _super);
  1571. function WordClientDefaultSetRequirement() {
  1572. _super.call(this, {
  1573. "bindingevents": 1.1,
  1574. "compressedfile": 1.1,
  1575. "customxmlparts": 1.1,
  1576. "documentevents": 1.1,
  1577. "file": 1.1,
  1578. "htmlcoercion": 1.1,
  1579. "matrixbindings": 1.1,
  1580. "matrixcoercion": 1.1,
  1581. "ooxmlcoercion": 1.1,
  1582. "pdffile": 1.1,
  1583. "selection": 1.1,
  1584. "settings": 1.1,
  1585. "tablebindings": 1.1,
  1586. "tablecoercion": 1.1,
  1587. "textbindings": 1.1,
  1588. "textcoercion": 1.1,
  1589. "textfile": 1.1,
  1590. "wordapi": 1.1
  1591. });
  1592. }
  1593. return WordClientDefaultSetRequirement;
  1594. })(DefaultSetRequirement);
  1595. Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement;
  1596. var WordClientV1DefaultSetRequirement=(function (_super) {
  1597. __extends(WordClientV1DefaultSetRequirement, _super);
  1598. function WordClientV1DefaultSetRequirement() {
  1599. _super.call(this);
  1600. this._addSetMap({
  1601. "customxmlparts": 1.2,
  1602. "wordapi": 1.2,
  1603. "imagecoercion": 1.1
  1604. });
  1605. }
  1606. return WordClientV1DefaultSetRequirement;
  1607. })(WordClientDefaultSetRequirement);
  1608. Requirement.WordClientV1DefaultSetRequirement=WordClientV1DefaultSetRequirement;
  1609. var PowerpointClientDefaultSetRequirement=(function (_super) {
  1610. __extends(PowerpointClientDefaultSetRequirement, _super);
  1611. function PowerpointClientDefaultSetRequirement() {
  1612. _super.call(this, {
  1613. "activeview": 1.1,
  1614. "compressedfile": 1.1,
  1615. "documentevents": 1.1,
  1616. "file": 1.1,
  1617. "pdffile": 1.1,
  1618. "selection": 1.1,
  1619. "settings": 1.1,
  1620. "textcoercion": 1.1
  1621. });
  1622. }
  1623. return PowerpointClientDefaultSetRequirement;
  1624. })(DefaultSetRequirement);
  1625. Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement;
  1626. var PowerpointClientV1DefaultSetRequirement=(function (_super) {
  1627. __extends(PowerpointClientV1DefaultSetRequirement, _super);
  1628. function PowerpointClientV1DefaultSetRequirement() {
  1629. _super.call(this);
  1630. this._addSetMap({
  1631. "imagecoercion": 1.1
  1632. });
  1633. }
  1634. return PowerpointClientV1DefaultSetRequirement;
  1635. })(PowerpointClientDefaultSetRequirement);
  1636. Requirement.PowerpointClientV1DefaultSetRequirement=PowerpointClientV1DefaultSetRequirement;
  1637. var ProjectClientDefaultSetRequirement=(function (_super) {
  1638. __extends(ProjectClientDefaultSetRequirement, _super);
  1639. function ProjectClientDefaultSetRequirement() {
  1640. _super.call(this, {
  1641. "selection": 1.1,
  1642. "textcoercion": 1.1
  1643. });
  1644. }
  1645. return ProjectClientDefaultSetRequirement;
  1646. })(DefaultSetRequirement);
  1647. Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement;
  1648. var ExcelWebDefaultSetRequirement=(function (_super) {
  1649. __extends(ExcelWebDefaultSetRequirement, _super);
  1650. function ExcelWebDefaultSetRequirement() {
  1651. _super.call(this, {
  1652. "bindingevents": 1.1,
  1653. "documentevents": 1.1,
  1654. "matrixbindings": 1.1,
  1655. "matrixcoercion": 1.1,
  1656. "selection": 1.1,
  1657. "settings": 1.1,
  1658. "tablebindings": 1.1,
  1659. "tablecoercion": 1.1,
  1660. "textbindings": 1.1,
  1661. "textcoercion": 1.1,
  1662. "file": 1.1
  1663. });
  1664. }
  1665. return ExcelWebDefaultSetRequirement;
  1666. })(DefaultSetRequirement);
  1667. Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement;
  1668. var WordWebDefaultSetRequirement=(function (_super) {
  1669. __extends(WordWebDefaultSetRequirement, _super);
  1670. function WordWebDefaultSetRequirement() {
  1671. _super.call(this, {
  1672. "compressedfile": 1.1,
  1673. "documentevents": 1.1,
  1674. "file": 1.1,
  1675. "imagecoercion": 1.1,
  1676. "matrixcoercion": 1.1,
  1677. "ooxmlcoercion": 1.1,
  1678. "pdffile": 1.1,
  1679. "selection": 1.1,
  1680. "settings": 1.1,
  1681. "tablecoercion": 1.1,
  1682. "textcoercion": 1.1,
  1683. "textfile": 1.1
  1684. });
  1685. }
  1686. return WordWebDefaultSetRequirement;
  1687. })(DefaultSetRequirement);
  1688. Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement;
  1689. var PowerpointWebDefaultSetRequirement=(function (_super) {
  1690. __extends(PowerpointWebDefaultSetRequirement, _super);
  1691. function PowerpointWebDefaultSetRequirement() {
  1692. _super.call(this, {
  1693. "activeview": 1.1,
  1694. "settings": 1.1
  1695. });
  1696. }
  1697. return PowerpointWebDefaultSetRequirement;
  1698. })(DefaultSetRequirement);
  1699. Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement;
  1700. var OutlookWebDefaultSetRequirement=(function (_super) {
  1701. __extends(OutlookWebDefaultSetRequirement, _super);
  1702. function OutlookWebDefaultSetRequirement() {
  1703. _super.call(this, {
  1704. "mailbox": 1.3
  1705. });
  1706. }
  1707. return OutlookWebDefaultSetRequirement;
  1708. })(DefaultSetRequirement);
  1709. Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement;
  1710. var SwayWebDefaultSetRequirement=(function (_super) {
  1711. __extends(SwayWebDefaultSetRequirement, _super);
  1712. function SwayWebDefaultSetRequirement() {
  1713. _super.call(this, {
  1714. "activeview": 1.1,
  1715. "documentevents": 1.1,
  1716. "selection": 1.1,
  1717. "settings": 1.1,
  1718. "textcoercion": 1.1
  1719. });
  1720. }
  1721. return SwayWebDefaultSetRequirement;
  1722. })(DefaultSetRequirement);
  1723. Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement;
  1724. var AccessWebDefaultSetRequirement=(function (_super) {
  1725. __extends(AccessWebDefaultSetRequirement, _super);
  1726. function AccessWebDefaultSetRequirement() {
  1727. _super.call(this, {
  1728. "bindingevents": 1.1,
  1729. "partialtablebindings": 1.1,
  1730. "settings": 1.1,
  1731. "tablebindings": 1.1,
  1732. "tablecoercion": 1.1
  1733. });
  1734. }
  1735. return AccessWebDefaultSetRequirement;
  1736. })(DefaultSetRequirement);
  1737. Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement;
  1738. var ExcelIOSDefaultSetRequirement=(function (_super) {
  1739. __extends(ExcelIOSDefaultSetRequirement, _super);
  1740. function ExcelIOSDefaultSetRequirement() {
  1741. _super.call(this, {
  1742. "bindingevents": 1.1,
  1743. "documentevents": 1.1,
  1744. "matrixbindings": 1.1,
  1745. "matrixcoercion": 1.1,
  1746. "selection": 1.1,
  1747. "settings": 1.1,
  1748. "tablebindings": 1.1,
  1749. "tablecoercion": 1.1,
  1750. "textbindings": 1.1,
  1751. "textcoercion": 1.1
  1752. });
  1753. }
  1754. return ExcelIOSDefaultSetRequirement;
  1755. })(DefaultSetRequirement);
  1756. Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement;
  1757. var WordIOSDefaultSetRequirement=(function (_super) {
  1758. __extends(WordIOSDefaultSetRequirement, _super);
  1759. function WordIOSDefaultSetRequirement() {
  1760. _super.call(this, {
  1761. "bindingevents": 1.1,
  1762. "compressedfile": 1.1,
  1763. "customxmlparts": 1.1,
  1764. "documentevents": 1.1,
  1765. "file": 1.1,
  1766. "htmlcoercion": 1.1,
  1767. "matrixbindings": 1.1,
  1768. "matrixcoercion": 1.1,
  1769. "ooxmlcoercion": 1.1,
  1770. "pdffile": 1.1,
  1771. "selection": 1.1,
  1772. "settings": 1.1,
  1773. "tablebindings": 1.1,
  1774. "tablecoercion": 1.1,
  1775. "textbindings": 1.1,
  1776. "textcoercion": 1.1,
  1777. "textfile": 1.1
  1778. });
  1779. }
  1780. return WordIOSDefaultSetRequirement;
  1781. })(DefaultSetRequirement);
  1782. Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement;
  1783. var WordIOSV1DefaultSetRequirement=(function (_super) {
  1784. __extends(WordIOSV1DefaultSetRequirement, _super);
  1785. function WordIOSV1DefaultSetRequirement() {
  1786. _super.call(this);
  1787. this._addSetMap({
  1788. "customxmlparts": 1.2,
  1789. "wordapi": 1.2
  1790. });
  1791. }
  1792. return WordIOSV1DefaultSetRequirement;
  1793. })(WordIOSDefaultSetRequirement);
  1794. Requirement.WordIOSV1DefaultSetRequirement=WordIOSV1DefaultSetRequirement;
  1795. var PowerpointIOSDefaultSetRequirement=(function (_super) {
  1796. __extends(PowerpointIOSDefaultSetRequirement, _super);
  1797. function PowerpointIOSDefaultSetRequirement() {
  1798. _super.call(this, {
  1799. "activeview": 1.1,
  1800. "compressedfile": 1.1,
  1801. "documentevents": 1.1,
  1802. "file": 1.1,
  1803. "pdffile": 1.1,
  1804. "selection": 1.1,
  1805. "settings": 1.1,
  1806. "textcoercion": 1.1
  1807. });
  1808. }
  1809. return PowerpointIOSDefaultSetRequirement;
  1810. })(DefaultSetRequirement);
  1811. Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement;
  1812. var OutlookIOSDefaultSetRequirement=(function (_super) {
  1813. __extends(OutlookIOSDefaultSetRequirement, _super);
  1814. function OutlookIOSDefaultSetRequirement() {
  1815. _super.call(this, {
  1816. "mailbox": 1.1
  1817. });
  1818. }
  1819. return OutlookIOSDefaultSetRequirement;
  1820. })(DefaultSetRequirement);
  1821. Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement;
  1822. var RequirementsMatrixFactory=(function () {
  1823. function RequirementsMatrixFactory() {
  1824. }
  1825. RequirementsMatrixFactory.initializeOsfDda=function () {
  1826. OSF.OUtil.setNamespace("Requirement", OSF.DDA);
  1827. };
  1828. RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) {
  1829. this.initializeDefaultSetMatrix();
  1830. var defaultRequirementMatrix=undefined;
  1831. var clientRequirement=appContext.get_requirementMatrix();
  1832. if (clientRequirement !=undefined && clientRequirement.length > 0 && typeof (JSON) !=="undefined") {
  1833. var matrixItem=JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1834. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1835. }
  1836. else {
  1837. var appLocator=RequirementsMatrixFactory.getClientFullVersionString(appContext);
  1838. if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) {
  1839. defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]);
  1840. }
  1841. else {
  1842. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({}));
  1843. }
  1844. }
  1845. return defaultRequirementMatrix;
  1846. };
  1847. RequirementsMatrixFactory.getDefaultDialogRequirementMatrix=function (appContext) {
  1848. var defaultRequirementMatrix=undefined;
  1849. var clientRequirement=appContext.get_dialogRequirementMatrix();
  1850. if (clientRequirement !=undefined && clientRequirement.length > 0 && typeof (JSON) !=="undefined") {
  1851. var matrixItem=JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1852. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1853. }
  1854. else {
  1855. defaultRequirementMatrix=new RequirementMatrix(new DefaultDialogSetRequirement());
  1856. }
  1857. return defaultRequirementMatrix;
  1858. };
  1859. RequirementsMatrixFactory.getClientFullVersionString=function (appContext) {
  1860. var appMinorVersion=appContext.get_appMinorVersion();
  1861. var appMinorVersionString="";
  1862. var appFullVersion="";
  1863. var appName=appContext.get_appName();
  1864. var isIOSClient=appName==1024 ||
  1865. appName==4096 ||
  1866. appName==8192 ||
  1867. appName==65536;
  1868. if (isIOSClient && appContext.get_appVersion()==1) {
  1869. if (appName==4096 && appMinorVersion >=15) {
  1870. appFullVersion="16.00.01";
  1871. }
  1872. else {
  1873. appFullVersion="16.00";
  1874. }
  1875. }
  1876. else if (appContext.get_appName()==64) {
  1877. appFullVersion=appContext.get_appVersion();
  1878. }
  1879. else {
  1880. if (appMinorVersion < 10) {
  1881. appMinorVersionString="0"+appMinorVersion;
  1882. }
  1883. else {
  1884. appMinorVersionString=""+appMinorVersion;
  1885. }
  1886. appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString;
  1887. }
  1888. return appContext.get_appName()+"-"+appFullVersion;
  1889. };
  1890. RequirementsMatrixFactory.initializeDefaultSetMatrix=function () {
  1891. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement();
  1892. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement();
  1893. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement();
  1894. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1601]=new ExcelClientV1DefaultSetRequirement();
  1895. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1601]=new WordClientV1DefaultSetRequirement();
  1896. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1601]=new PowerpointClientV1DefaultSetRequirement();
  1897. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement();
  1898. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement();
  1899. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement();
  1900. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement();
  1901. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement();
  1902. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement();
  1903. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement();
  1904. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement();
  1905. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement();
  1906. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement();
  1907. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement();
  1908. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_16001]=new WordIOSV1DefaultSetRequirement();
  1909. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement();
  1910. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement();
  1911. };
  1912. RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00";
  1913. RequirementsMatrixFactory.Excel_RCLIENT_1601="1-16.01";
  1914. RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00";
  1915. RequirementsMatrixFactory.Word_RCLIENT_1601="2-16.01";
  1916. RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00";
  1917. RequirementsMatrixFactory.PowerPoint_RCLIENT_1601="4-16.01";
  1918. RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00";
  1919. RequirementsMatrixFactory.Excel_WAC_1600="16-16.00";
  1920. RequirementsMatrixFactory.Word_WAC_1600="32-16.00";
  1921. RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00";
  1922. RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01";
  1923. RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00";
  1924. RequirementsMatrixFactory.Access_WAC_1600="256-16.00";
  1925. RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00";
  1926. RequirementsMatrixFactory.Excel_IOS_1600="1024-16.00";
  1927. RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00";
  1928. RequirementsMatrixFactory.Word_IOS_1600="4096-16.00";
  1929. RequirementsMatrixFactory.Word_IOS_16001="4096-16.00.01";
  1930. RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00";
  1931. RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00";
  1932. RequirementsMatrixFactory.DefaultSetArrayMatrix={};
  1933. return RequirementsMatrixFactory;
  1934. })();
  1935. Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory;
  1936. })(Requirement=OfficeExt.Requirement || (OfficeExt.Requirement={}));
  1937. })(OfficeExt || (OfficeExt={}));
  1938. OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();
  1939. Microsoft.Office.WebExtension.ApplicationMode={
  1940. WebEditor: "webEditor",
  1941. WebViewer: "webViewer",
  1942. Client: "client"
  1943. };
  1944. Microsoft.Office.WebExtension.DocumentMode={
  1945. ReadOnly: "readOnly",
  1946. ReadWrite: "readWrite"
  1947. };
  1948. OSF.NamespaceManager=(function OSF_NamespaceManager() {
  1949. var _userOffice;
  1950. var _useShortcut=false;
  1951. return {
  1952. enableShortcut: function OSF_NamespaceManager$enableShortcut() {
  1953. if (!_useShortcut) {
  1954. if (window.Office) {
  1955. _userOffice=window.Office;
  1956. }
  1957. else {
  1958. OSF.OUtil.setNamespace("Office", window);
  1959. }
  1960. window.Office=Microsoft.Office.WebExtension;
  1961. _useShortcut=true;
  1962. }
  1963. },
  1964. disableShortcut: function OSF_NamespaceManager$disableShortcut() {
  1965. if (_useShortcut) {
  1966. if (_userOffice) {
  1967. window.Office=_userOffice;
  1968. }
  1969. else {
  1970. OSF.OUtil.unsetNamespace("Office", window);
  1971. }
  1972. _useShortcut=false;
  1973. }
  1974. }
  1975. };
  1976. })();
  1977. OSF.NamespaceManager.enableShortcut();
  1978. Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) {
  1979. if (useShortcut) {
  1980. OSF.NamespaceManager.enableShortcut();
  1981. }
  1982. else {
  1983. OSF.NamespaceManager.disableShortcut();
  1984. }
  1985. };
  1986. Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) {
  1987. var promise;
  1988. if (str && typeof str=="string") {
  1989. var index=str.indexOf("#");
  1990. if (index !=-1) {
  1991. var op=str.substring(0, index);
  1992. var target=str.substring(index+1);
  1993. switch (op) {
  1994. case "binding":
  1995. case "bindings":
  1996. if (target) {
  1997. promise=new OSF.DDA.BindingPromise(target);
  1998. }
  1999. break;
  2000. }
  2001. }
  2002. }
  2003. if (!promise) {
  2004. if (errorCallback) {
  2005. var callbackType=typeof errorCallback;
  2006. if (callbackType=="function") {
  2007. var callArgs={};
  2008. callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback;
  2009. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));
  2010. }
  2011. else {
  2012. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType);
  2013. }
  2014. }
  2015. }
  2016. else {
  2017. promise.onFail=errorCallback;
  2018. return promise;
  2019. }
  2020. };
  2021. OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) {
  2022. OSF.OUtil.defineEnumerableProperties(this, {
  2023. "contentLanguage": {
  2024. value: officeAppContext.get_dataLocale()
  2025. },
  2026. "displayLanguage": {
  2027. value: officeAppContext.get_appUILocale()
  2028. },
  2029. "touchEnabled": {
  2030. value: officeAppContext.get_touchEnabled()
  2031. },
  2032. "commerceAllowed": {
  2033. value: officeAppContext.get_commerceAllowed()
  2034. }
  2035. });
  2036. if (license) {
  2037. OSF.OUtil.defineEnumerableProperty(this, "license", {
  2038. value: license
  2039. });
  2040. }
  2041. if (officeAppContext.ui) {
  2042. OSF.OUtil.defineEnumerableProperty(this, "ui", {
  2043. value: officeAppContext.ui
  2044. });
  2045. }
  2046. if (officeAppContext.get_isDialog()) {
  2047. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(officeAppContext);
  2048. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  2049. value: requirements
  2050. });
  2051. }
  2052. else {
  2053. if (document) {
  2054. OSF.OUtil.defineEnumerableProperty(this, "document", {
  2055. value: document
  2056. });
  2057. }
  2058. if (appOM) {
  2059. var displayName=appOM.displayName || "appOM";
  2060. delete appOM.displayName;
  2061. OSF.OUtil.defineEnumerableProperty(this, displayName, {
  2062. value: appOM
  2063. });
  2064. }
  2065. if (getOfficeTheme) {
  2066. OSF.OUtil.defineEnumerableProperty(this, "officeTheme", {
  2067. get: function () {
  2068. return getOfficeTheme();
  2069. }
  2070. });
  2071. }
  2072. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext);
  2073. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  2074. value: requirements
  2075. });
  2076. }
  2077. };
  2078. OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) {
  2079. OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme);
  2080. if (settings) {
  2081. OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", {
  2082. value: settings
  2083. });
  2084. }
  2085. };
  2086. OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context);
  2087. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) { };
  2088. OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) {
  2089. var mode;
  2090. switch (officeAppContext.get_clientMode()) {
  2091. case OSF.ClientMode.ReadOnly:
  2092. mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;
  2093. break;
  2094. case OSF.ClientMode.ReadWrite:
  2095. mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite;
  2096. break;
  2097. }
  2098. ;
  2099. if (settings) {
  2100. OSF.OUtil.defineEnumerableProperty(this, "settings", {
  2101. value: settings
  2102. });
  2103. }
  2104. ;
  2105. OSF.OUtil.defineMutableProperties(this, {
  2106. "mode": {
  2107. value: mode
  2108. },
  2109. "url": {
  2110. value: officeAppContext.get_docUrl()
  2111. }
  2112. });
  2113. };
  2114. OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) {
  2115. OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings);
  2116. if (bindingFacade) {
  2117. OSF.OUtil.defineEnumerableProperty(this, "bindings", {
  2118. get: function OSF_DDA_Document$GetBindings() { return bindingFacade; }
  2119. });
  2120. }
  2121. var am=OSF.DDA.AsyncMethodNames;
  2122. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  2123. am.GetSelectedDataAsync,
  2124. am.SetSelectedDataAsync
  2125. ]);
  2126. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]));
  2127. };
  2128. OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document);
  2129. OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", {
  2130. get: function Microsoft_Office_WebExtension$GetContext() {
  2131. var context;
  2132. if (OSF && OSF._OfficeAppFactory) {
  2133. context=OSF._OfficeAppFactory.getContext();
  2134. }
  2135. return context;
  2136. }
  2137. });
  2138. OSF.DDA.License=function OSF_DDA_License(eToken) {
  2139. OSF.OUtil.defineEnumerableProperty(this, "value", {
  2140. value: eToken
  2141. });
  2142. };
  2143. OSF.DDA.ApiMethodCall=function OSF_DDA_ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName) {
  2144. var requiredCount=requiredParameters.length;
  2145. var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function () {
  2146. return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName);
  2147. });
  2148. this.verifyArguments=function OSF_DDA_ApiMethodCall$VerifyArguments(params, args) {
  2149. for (var name in params) {
  2150. var param=params[name];
  2151. var arg=args[name];
  2152. if (param["enum"]) {
  2153. switch (typeof arg) {
  2154. case "string":
  2155. if (OSF.OUtil.listContainsValue(param["enum"], arg)) {
  2156. break;
  2157. }
  2158. case "undefined":
  2159. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;
  2160. default:
  2161. throw getInvalidParameterString();
  2162. }
  2163. }
  2164. if (param["types"]) {
  2165. if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) {
  2166. throw getInvalidParameterString();
  2167. }
  2168. }
  2169. }
  2170. };
  2171. this.extractRequiredArguments=function OSF_DDA_ApiMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) {
  2172. if (userArgs.length < requiredCount) {
  2173. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);
  2174. }
  2175. var requiredArgs=[];
  2176. var index;
  2177. for (index=0; index < requiredCount; index++) {
  2178. requiredArgs.push(userArgs[index]);
  2179. }
  2180. this.verifyArguments(requiredParameters, requiredArgs);
  2181. var ret={};
  2182. for (index=0; index < requiredCount; index++) {
  2183. var param=requiredParameters[index];
  2184. var arg=requiredArgs[index];
  2185. if (param.verify) {
  2186. var isValid=param.verify(arg, caller, stateInfo);
  2187. if (!isValid) {
  2188. throw getInvalidParameterString();
  2189. }
  2190. }
  2191. ret[param.name]=arg;
  2192. }
  2193. return ret;
  2194. },
  2195. this.fillOptions=function OSF_DDA_ApiMethodCall$FillOptions(options, requiredArgs, caller, stateInfo) {
  2196. options=options || {};
  2197. for (var optionName in supportedOptions) {
  2198. if (!OSF.OUtil.listContainsKey(options, optionName)) {
  2199. var value=undefined;
  2200. var option=supportedOptions[optionName];
  2201. if (option.calculate && requiredArgs) {
  2202. value=option.calculate(requiredArgs, caller, stateInfo);
  2203. }
  2204. if (!value && option.defaultValue !==undefined) {
  2205. value=option.defaultValue;
  2206. }
  2207. options[optionName]=value;
  2208. }
  2209. }
  2210. return options;
  2211. };
  2212. this.constructCallArgs=function OSF_DAA_ApiMethodCall$ConstructCallArgs(required, options, caller, stateInfo) {
  2213. var callArgs={};
  2214. for (var r in required) {
  2215. callArgs[r]=required[r];
  2216. }
  2217. for (var o in options) {
  2218. callArgs[o]=options[o];
  2219. }
  2220. for (var s in privateStateCallbacks) {
  2221. callArgs[s]=privateStateCallbacks[s](caller, stateInfo);
  2222. }
  2223. if (checkCallArgs) {
  2224. callArgs=checkCallArgs(callArgs, caller, stateInfo);
  2225. }
  2226. return callArgs;
  2227. };
  2228. };
  2229. OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA);
  2230. OSF.DDA.AsyncResultEnum.Properties={
  2231. Context: "Context",
  2232. Value: "Value",
  2233. Status: "Status",
  2234. Error: "Error"
  2235. };
  2236. Microsoft.Office.WebExtension.AsyncResultStatus={
  2237. Succeeded: "succeeded",
  2238. Failed: "failed"
  2239. };
  2240. OSF.DDA.AsyncResultEnum.ErrorCode={
  2241. Success: 0,
  2242. Failed: 1
  2243. };
  2244. OSF.DDA.AsyncResultEnum.ErrorProperties={
  2245. Name: "Name",
  2246. Message: "Message",
  2247. Code: "Code"
  2248. };
  2249. OSF.DDA.AsyncMethodNames={};
  2250. OSF.DDA.AsyncMethodNames.addNames=function (methodNames) {
  2251. for (var entry in methodNames) {
  2252. var am={};
  2253. OSF.OUtil.defineEnumerableProperties(am, {
  2254. "id": {
  2255. value: entry
  2256. },
  2257. "displayName": {
  2258. value: methodNames[entry]
  2259. }
  2260. });
  2261. OSF.DDA.AsyncMethodNames[entry]=am;
  2262. }
  2263. };
  2264. OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) {
  2265. var requiredCount=requiredParameters.length;
  2266. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName);
  2267. function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  2268. if (userArgs.length > requiredCount+2) {
  2269. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2270. }
  2271. var options, parameterCallback;
  2272. for (var i=userArgs.length - 1; i >=requiredCount; i--) {
  2273. var argument=userArgs[i];
  2274. switch (typeof argument) {
  2275. case "object":
  2276. if (options) {
  2277. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2278. }
  2279. else {
  2280. options=argument;
  2281. }
  2282. break;
  2283. case "function":
  2284. if (parameterCallback) {
  2285. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);
  2286. }
  2287. else {
  2288. parameterCallback=argument;
  2289. }
  2290. break;
  2291. default:
  2292. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2293. break;
  2294. }
  2295. }
  2296. options=apiMethods.fillOptions(options, requiredArgs, caller, stateInfo);
  2297. if (parameterCallback) {
  2298. if (options[Microsoft.Office.WebExtension.Parameters.Callback]) {
  2299. throw Strings.OfficeOM.L_RedundantCallbackSpecification;
  2300. }
  2301. else {
  2302. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2303. }
  2304. }
  2305. apiMethods.verifyArguments(supportedOptions, options);
  2306. return options;
  2307. }
  2308. ;
  2309. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  2310. var required=apiMethods.extractRequiredArguments(userArgs, caller, stateInfo);
  2311. var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  2312. var callArgs=apiMethods.constructCallArgs(required, options, caller, stateInfo);
  2313. return callArgs;
  2314. };
  2315. this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) {
  2316. var payload;
  2317. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2318. if (onSucceeded) {
  2319. payload=onSucceeded(response, caller, callArgs);
  2320. }
  2321. else {
  2322. payload=response;
  2323. }
  2324. }
  2325. else {
  2326. if (onFailed) {
  2327. payload=onFailed(status, response);
  2328. }
  2329. else {
  2330. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2331. }
  2332. }
  2333. return payload;
  2334. };
  2335. this.getCallArgs=function (suppliedArgs) {
  2336. var options, parameterCallback;
  2337. for (var i=suppliedArgs.length - 1; i >=requiredCount; i--) {
  2338. var argument=suppliedArgs[i];
  2339. switch (typeof argument) {
  2340. case "object":
  2341. options=argument;
  2342. break;
  2343. case "function":
  2344. parameterCallback=argument;
  2345. break;
  2346. }
  2347. }
  2348. options=options || {};
  2349. if (parameterCallback) {
  2350. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2351. }
  2352. return options;
  2353. };
  2354. };
  2355. OSF.DDA.AsyncMethodCallFactory=(function () {
  2356. return {
  2357. manufacture: function (params) {
  2358. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2359. var privateStateCallbacks=params.privateStateCallbacks ? OSF.OUtil.createObject(params.privateStateCallbacks) : [];
  2360. return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName);
  2361. }
  2362. };
  2363. })();
  2364. OSF.DDA.AsyncMethodCalls={};
  2365. OSF.DDA.AsyncMethodCalls.define=function (callDefinition) {
  2366. OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition);
  2367. };
  2368. OSF.DDA.Error=function OSF_DDA_Error(name, message, code) {
  2369. OSF.OUtil.defineEnumerableProperties(this, {
  2370. "name": {
  2371. value: name
  2372. },
  2373. "message": {
  2374. value: message
  2375. },
  2376. "code": {
  2377. value: code
  2378. }
  2379. });
  2380. };
  2381. OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) {
  2382. OSF.OUtil.defineEnumerableProperties(this, {
  2383. "value": {
  2384. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]
  2385. },
  2386. "status": {
  2387. value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded
  2388. }
  2389. });
  2390. if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) {
  2391. OSF.OUtil.defineEnumerableProperty(this, "asyncContext", {
  2392. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]
  2393. });
  2394. }
  2395. if (errorArgs) {
  2396. OSF.OUtil.defineEnumerableProperty(this, "error", {
  2397. value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])
  2398. });
  2399. }
  2400. };
  2401. OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) {
  2402. var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback];
  2403. if (callback) {
  2404. var asyncInitArgs={};
  2405. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext];
  2406. var errorArgs;
  2407. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2408. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload;
  2409. }
  2410. else {
  2411. errorArgs={};
  2412. payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  2413. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2414. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  2415. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  2416. }
  2417. callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs));
  2418. }
  2419. };
  2420. OSF.DDA.SyncMethodNames={};
  2421. OSF.DDA.SyncMethodNames.addNames=function (methodNames) {
  2422. for (var entry in methodNames) {
  2423. var am={};
  2424. OSF.OUtil.defineEnumerableProperties(am, {
  2425. "id": {
  2426. value: entry
  2427. },
  2428. "displayName": {
  2429. value: methodNames[entry]
  2430. }
  2431. });
  2432. OSF.DDA.SyncMethodNames[entry]=am;
  2433. }
  2434. };
  2435. OSF.DDA.SyncMethodCall=function OSF_DDA_SyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName) {
  2436. var requiredCount=requiredParameters.length;
  2437. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName);
  2438. function OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  2439. if (userArgs.length > requiredCount+1) {
  2440. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2441. }
  2442. var options, parameterCallback;
  2443. for (var i=userArgs.length - 1; i >=requiredCount; i--) {
  2444. var argument=userArgs[i];
  2445. switch (typeof argument) {
  2446. case "object":
  2447. if (options) {
  2448. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2449. }
  2450. else {
  2451. options=argument;
  2452. }
  2453. break;
  2454. default:
  2455. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2456. break;
  2457. }
  2458. }
  2459. options=apiMethods.fillOptions(options, requiredArgs, caller, stateInfo);
  2460. apiMethods.verifyArguments(supportedOptions, options);
  2461. return options;
  2462. }
  2463. ;
  2464. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  2465. var required=apiMethods.extractRequiredArguments(userArgs, caller, stateInfo);
  2466. var options=OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  2467. var callArgs=apiMethods.constructCallArgs(required, options, caller, stateInfo);
  2468. return callArgs;
  2469. };
  2470. };
  2471. OSF.DDA.SyncMethodCallFactory=(function () {
  2472. return {
  2473. manufacture: function (params) {
  2474. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2475. return new OSF.DDA.SyncMethodCall(params.requiredArguments || [], supportedOptions, params.privateStateCallbacks, params.checkCallArgs, params.method.displayName);
  2476. }
  2477. };
  2478. })();
  2479. OSF.DDA.SyncMethodCalls={};
  2480. OSF.DDA.SyncMethodCalls.define=function (callDefinition) {
  2481. OSF.DDA.SyncMethodCalls[callDefinition.method.id]=OSF.DDA.SyncMethodCallFactory.manufacture(callDefinition);
  2482. };
  2483. OSF.DDA.ListType=(function () {
  2484. var listTypes={};
  2485. return {
  2486. setListType: function OSF_DDA_ListType$AddListType(t, prop) { listTypes[t]=prop; },
  2487. isListType: function OSF_DDA_ListType$IsListType(t) { return OSF.OUtil.listContainsKey(listTypes, t); },
  2488. getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { return listTypes[t]; }
  2489. };
  2490. })();
  2491. OSF.DDA.HostParameterMap=function (specialProcessor, mappings) {
  2492. var toHostMap="toHost";
  2493. var fromHostMap="fromHost";
  2494. var sourceData="sourceData";
  2495. var self="self";
  2496. var dynamicTypes={};
  2497. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={
  2498. toHost: function (data) {
  2499. if (data !=null && data.rows !==undefined) {
  2500. var tableData={};
  2501. tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows;
  2502. tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers;
  2503. data=tableData;
  2504. }
  2505. return data;
  2506. },
  2507. fromHost: function (args) {
  2508. return args;
  2509. }
  2510. };
  2511. dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data];
  2512. function mapValues(preimageSet, mapping) {
  2513. var ret=preimageSet ? {} : undefined;
  2514. for (var entry in preimageSet) {
  2515. var preimage=preimageSet[entry];
  2516. var image;
  2517. if (OSF.DDA.ListType.isListType(entry)) {
  2518. image=[];
  2519. for (var subEntry in preimage) {
  2520. image.push(mapValues(preimage[subEntry], mapping));
  2521. }
  2522. }
  2523. else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) {
  2524. image=dynamicTypes[entry][mapping](preimage);
  2525. }
  2526. else if (mapping==fromHostMap && specialProcessor.preserveNesting(entry)) {
  2527. image=mapValues(preimage, mapping);
  2528. }
  2529. else {
  2530. var maps=mappings[entry];
  2531. if (maps) {
  2532. var map=maps[mapping];
  2533. if (map) {
  2534. image=map[preimage];
  2535. if (image===undefined) {
  2536. image=preimage;
  2537. }
  2538. }
  2539. }
  2540. else {
  2541. image=preimage;
  2542. }
  2543. }
  2544. ret[entry]=image;
  2545. }
  2546. return ret;
  2547. }
  2548. ;
  2549. function generateArguments(imageSet, parameters) {
  2550. var ret;
  2551. for (var param in parameters) {
  2552. var arg;
  2553. if (specialProcessor.isComplexType(param)) {
  2554. arg=generateArguments(imageSet, mappings[param][toHostMap]);
  2555. }
  2556. else {
  2557. arg=imageSet[param];
  2558. }
  2559. if (arg !=undefined) {
  2560. if (!ret) {
  2561. ret={};
  2562. }
  2563. var index=parameters[param];
  2564. if (index==self) {
  2565. index=param;
  2566. }
  2567. ret[index]=specialProcessor.pack(param, arg);
  2568. }
  2569. }
  2570. return ret;
  2571. }
  2572. ;
  2573. function extractArguments(source, parameters, extracted) {
  2574. if (!extracted) {
  2575. extracted={};
  2576. }
  2577. for (var param in parameters) {
  2578. var index=parameters[param];
  2579. var value;
  2580. if (index==self) {
  2581. value=source;
  2582. }
  2583. else if (index==sourceData) {
  2584. extracted[param]=source.toArray();
  2585. continue;
  2586. }
  2587. else {
  2588. value=source[index];
  2589. }
  2590. if (value===null || value===undefined) {
  2591. extracted[param]=undefined;
  2592. }
  2593. else {
  2594. value=specialProcessor.unpack(param, value);
  2595. var map;
  2596. if (specialProcessor.isComplexType(param)) {
  2597. map=mappings[param][fromHostMap];
  2598. if (specialProcessor.preserveNesting(param)) {
  2599. extracted[param]=extractArguments(value, map);
  2600. }
  2601. else {
  2602. extractArguments(value, map, extracted);
  2603. }
  2604. }
  2605. else {
  2606. if (OSF.DDA.ListType.isListType(param)) {
  2607. map={};
  2608. var entryDescriptor=OSF.DDA.ListType.getDescriptor(param);
  2609. map[entryDescriptor]=self;
  2610. var extractedValues=new Array(value.length);
  2611. for (var item in value) {
  2612. extractedValues[item]=extractArguments(value[item], map);
  2613. }
  2614. extracted[param]=extractedValues;
  2615. }
  2616. else {
  2617. extracted[param]=value;
  2618. }
  2619. }
  2620. }
  2621. }
  2622. return extracted;
  2623. }
  2624. ;
  2625. function applyMap(mapName, preimage, mapping) {
  2626. var parameters=mappings[mapName][mapping];
  2627. var image;
  2628. if (mapping=="toHost") {
  2629. var imageSet=mapValues(preimage, mapping);
  2630. image=generateArguments(imageSet, parameters);
  2631. }
  2632. else if (mapping=="fromHost") {
  2633. var argumentSet=extractArguments(preimage, parameters);
  2634. image=mapValues(argumentSet, mapping);
  2635. }
  2636. return image;
  2637. }
  2638. ;
  2639. if (!mappings) {
  2640. mappings={};
  2641. }
  2642. this.addMapping=function (mapName, description) {
  2643. var toHost, fromHost;
  2644. if (description.map) {
  2645. toHost=description.map;
  2646. fromHost={};
  2647. for (var preimage in toHost) {
  2648. var image=toHost[preimage];
  2649. if (image==self) {
  2650. image=preimage;
  2651. }
  2652. fromHost[image]=preimage;
  2653. }
  2654. }
  2655. else {
  2656. toHost=description.toHost;
  2657. fromHost=description.fromHost;
  2658. }
  2659. var pair=mappings[mapName];
  2660. if (pair) {
  2661. var currMap=pair[toHostMap];
  2662. for (var th in currMap)
  2663. toHost[th]=currMap[th];
  2664. currMap=pair[fromHostMap];
  2665. for (var fh in currMap)
  2666. fromHost[fh]=currMap[fh];
  2667. }
  2668. else {
  2669. pair=mappings[mapName]={};
  2670. }
  2671. pair[toHostMap]=toHost;
  2672. pair[fromHostMap]=fromHost;
  2673. };
  2674. this.toHost=function (mapName, preimage) { return applyMap(mapName, preimage, toHostMap); };
  2675. this.fromHost=function (mapName, image) { return applyMap(mapName, image, fromHostMap); };
  2676. this.self=self;
  2677. this.sourceData=sourceData;
  2678. this.addComplexType=function (ct) { specialProcessor.addComplexType(ct); };
  2679. this.getDynamicType=function (dt) { return specialProcessor.getDynamicType(dt); };
  2680. this.setDynamicType=function (dt, handler) { specialProcessor.setDynamicType(dt, handler); };
  2681. this.dynamicTypes=dynamicTypes;
  2682. this.doMapValues=function (preimageSet, mapping) { return mapValues(preimageSet, mapping); };
  2683. };
  2684. OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) {
  2685. this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) {
  2686. complexTypes.push(ct);
  2687. };
  2688. this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) {
  2689. return dynamicTypes[dt];
  2690. };
  2691. this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) {
  2692. dynamicTypes[dt]=handler;
  2693. };
  2694. this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) {
  2695. return OSF.OUtil.listContainsValue(complexTypes, t);
  2696. };
  2697. this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) {
  2698. return OSF.OUtil.listContainsKey(dynamicTypes, p);
  2699. };
  2700. this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) {
  2701. var pn=[];
  2702. if (OSF.DDA.PropertyDescriptors)
  2703. pn.push(OSF.DDA.PropertyDescriptors.Subset);
  2704. if (OSF.DDA.DataNodeEventProperties) {
  2705. pn=pn.concat([
  2706. OSF.DDA.DataNodeEventProperties.OldNode,
  2707. OSF.DDA.DataNodeEventProperties.NewNode,
  2708. OSF.DDA.DataNodeEventProperties.NextSiblingNode
  2709. ]);
  2710. }
  2711. return OSF.OUtil.listContainsValue(pn, p);
  2712. };
  2713. this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) {
  2714. var value;
  2715. if (this.isDynamicType(param)) {
  2716. value=dynamicTypes[param].toHost(arg);
  2717. }
  2718. else {
  2719. value=arg;
  2720. }
  2721. return value;
  2722. };
  2723. this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) {
  2724. var value;
  2725. if (this.isDynamicType(param)) {
  2726. value=dynamicTypes[param].fromHost(arg);
  2727. }
  2728. else {
  2729. value=arg;
  2730. }
  2731. return value;
  2732. };
  2733. };
  2734. OSF.DDA.getDecoratedParameterMap=function (specialProcessor, initialDefs) {
  2735. var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor);
  2736. var self=parameterMap.self;
  2737. function createObject(properties) {
  2738. var obj=null;
  2739. if (properties) {
  2740. obj={};
  2741. var len=properties.length;
  2742. for (var i=0; i < len; i++) {
  2743. obj[properties[i].name]=properties[i].value;
  2744. }
  2745. }
  2746. return obj;
  2747. }
  2748. parameterMap.define=function define(definition) {
  2749. var args={};
  2750. var toHost=createObject(definition.toHost);
  2751. if (definition.invertible) {
  2752. args.map=toHost;
  2753. }
  2754. else if (definition.canonical) {
  2755. args.toHost=args.fromHost=toHost;
  2756. }
  2757. else {
  2758. args.toHost=toHost;
  2759. args.fromHost=createObject(definition.fromHost);
  2760. }
  2761. parameterMap.addMapping(definition.type, args);
  2762. if (definition.isComplexType)
  2763. parameterMap.addComplexType(definition.type);
  2764. };
  2765. for (var id in initialDefs)
  2766. parameterMap.define(initialDefs[id]);
  2767. return parameterMap;
  2768. };
  2769. OSF.OUtil.setNamespace("DispIdHost", OSF.DDA);
  2770. OSF.DDA.DispIdHost.Methods={
  2771. InvokeMethod: "invokeMethod",
  2772. AddEventHandler: "addEventHandler",
  2773. RemoveEventHandler: "removeEventHandler",
  2774. OpenDialog: "openDialog",
  2775. CloseDialog: "closeDialog",
  2776. MessageParent: "messageParent",
  2777. SendMessage: "sendMessage"
  2778. };
  2779. OSF.DDA.DispIdHost.Delegates={
  2780. ExecuteAsync: "executeAsync",
  2781. RegisterEventAsync: "registerEventAsync",
  2782. UnregisterEventAsync: "unregisterEventAsync",
  2783. ParameterMap: "parameterMap",
  2784. OpenDialog: "openDialog",
  2785. CloseDialog: "closeDialog",
  2786. MessageParent: "messageParent",
  2787. SendMessage: "sendMessage"
  2788. };
  2789. OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) {
  2790. var dispIdMap={};
  2791. var jsom=OSF.DDA.AsyncMethodNames;
  2792. var did=OSF.DDA.MethodDispId;
  2793. var methodMap={
  2794. "GoToByIdAsync": did.dispidNavigateToMethod,
  2795. "GetSelectedDataAsync": did.dispidGetSelectedDataMethod,
  2796. "SetSelectedDataAsync": did.dispidSetSelectedDataMethod,
  2797. "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod,
  2798. "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod,
  2799. "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod,
  2800. "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod,
  2801. "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod,
  2802. "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod,
  2803. "GetAllAsync": did.dispidGetAllBindingsMethod,
  2804. "GetByIdAsync": did.dispidGetBindingMethod,
  2805. "ReleaseByIdAsync": did.dispidReleaseBindingMethod,
  2806. "GetDataAsync": did.dispidGetBindingDataMethod,
  2807. "SetDataAsync": did.dispidSetBindingDataMethod,
  2808. "AddRowsAsync": did.dispidAddRowsMethod,
  2809. "AddColumnsAsync": did.dispidAddColumnsMethod,
  2810. "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod,
  2811. "RefreshAsync": did.dispidLoadSettingsMethod,
  2812. "SaveAsync": did.dispidSaveSettingsMethod,
  2813. "GetActiveViewAsync": did.dispidGetActiveViewMethod,
  2814. "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod,
  2815. "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod,
  2816. "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod,
  2817. "ClearFormatsAsync": did.dispidClearFormatsMethod,
  2818. "SetTableOptionsAsync": did.dispidSetTableOptionsMethod,
  2819. "SetFormatsAsync": did.dispidSetFormatsMethod,
  2820. "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod,
  2821. "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod,
  2822. "CloseContainerAsync": did.dispidCloseContainerMethod,
  2823. "AddDataPartAsync": did.dispidAddDataPartMethod,
  2824. "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod,
  2825. "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod,
  2826. "GetPartXmlAsync": did.dispidGetDataPartXmlMethod,
  2827. "GetPartNodesAsync": did.dispidGetDataPartNodesMethod,
  2828. "DeleteDataPartAsync": did.dispidDeleteDataPartMethod,
  2829. "GetNodeValueAsync": did.dispidGetDataNodeValueMethod,
  2830. "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod,
  2831. "GetRelativeNodesAsync": did.dispidGetDataNodesMethod,
  2832. "SetNodeValueAsync": did.dispidSetDataNodeValueMethod,
  2833. "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod,
  2834. "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod,
  2835. "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod,
  2836. "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod,
  2837. "GetNodeTextAsync": did.dispidGetDataNodeTextMethod,
  2838. "SetNodeTextAsync": did.dispidSetDataNodeTextMethod,
  2839. "GetSelectedTask": did.dispidGetSelectedTaskMethod,
  2840. "GetTask": did.dispidGetTaskMethod,
  2841. "GetWSSUrl": did.dispidGetWSSUrlMethod,
  2842. "GetTaskField": did.dispidGetTaskFieldMethod,
  2843. "GetSelectedResource": did.dispidGetSelectedResourceMethod,
  2844. "GetResourceField": did.dispidGetResourceFieldMethod,
  2845. "GetProjectField": did.dispidGetProjectFieldMethod,
  2846. "GetSelectedView": did.dispidGetSelectedViewMethod,
  2847. "GetTaskByIndex": did.dispidGetTaskByIndexMethod,
  2848. "GetResourceByIndex": did.dispidGetResourceByIndexMethod,
  2849. "SetTaskField": did.dispidSetTaskFieldMethod,
  2850. "SetResourceField": did.dispidSetResourceFieldMethod,
  2851. "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod,
  2852. "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod,
  2853. "CreateTask": did.dispidCreateTaskMethod
  2854. };
  2855. for (var method in methodMap) {
  2856. if (jsom[method]) {
  2857. dispIdMap[jsom[method].id]=methodMap[method];
  2858. }
  2859. }
  2860. jsom=OSF.DDA.SyncMethodNames;
  2861. did=OSF.DDA.MethodDispId;
  2862. var asyncMethodMap={
  2863. "MessageParent": did.dispidMessageParentMethod,
  2864. "SendMessage": did.dispidSendMessageMethod
  2865. };
  2866. for (var method in asyncMethodMap) {
  2867. if (jsom[method]) {
  2868. dispIdMap[jsom[method].id]=asyncMethodMap[method];
  2869. }
  2870. }
  2871. jsom=Microsoft.Office.WebExtension.EventType;
  2872. did=OSF.DDA.EventDispId;
  2873. var eventMap={
  2874. "SettingsChanged": did.dispidSettingsChangedEvent,
  2875. "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent,
  2876. "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent,
  2877. "BindingDataChanged": did.dispidBindingDataChangedEvent,
  2878. "ActiveViewChanged": did.dispidActiveViewChangedEvent,
  2879. "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent,
  2880. "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent,
  2881. "AppCommandInvoked": did.dispidAppCommandInvokedEvent,
  2882. "DialogMessageReceived": did.dispidDialogMessageReceivedEvent,
  2883. "DialogParentMessageReceived": did.dispidDialogParentMessageReceivedEvent,
  2884. "ItemChanged": did.dispidOlkItemSelectedChangedEvent,
  2885. "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent,
  2886. "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent,
  2887. "ViewSelectionChanged": did.dispidViewSelectionChangedEvent,
  2888. "DataNodeInserted": did.dispidDataNodeAddedEvent,
  2889. "DataNodeReplaced": did.dispidDataNodeReplacedEvent,
  2890. "DataNodeDeleted": did.dispidDataNodeDeletedEvent
  2891. };
  2892. for (var event in eventMap) {
  2893. if (jsom[event]) {
  2894. dispIdMap[jsom[event]]=eventMap[event];
  2895. }
  2896. }
  2897. function onException(ex, asyncMethodCall, suppliedArgs, callArgs) {
  2898. if (typeof ex=="number") {
  2899. if (!callArgs) {
  2900. callArgs=asyncMethodCall.getCallArgs(suppliedArgs);
  2901. }
  2902. OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex));
  2903. }
  2904. else {
  2905. throw ex;
  2906. }
  2907. }
  2908. ;
  2909. this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) {
  2910. var callArgs;
  2911. try {
  2912. var methodName=method.id;
  2913. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName];
  2914. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState);
  2915. var dispId=dispIdMap[methodName];
  2916. var delegate=getDelegateMethods(methodName);
  2917. var richApiInExcelMethodSubstitution=null;
  2918. if (window.Excel && window.Office.context.requirements.isSetSupported("RedirectV1Api")) {
  2919. window.Excel._RedirectV1APIs=true;
  2920. }
  2921. if (window.Excel && window.Excel._RedirectV1APIs && (richApiInExcelMethodSubstitution=window.Excel._V1APIMap[methodName])) {
  2922. if (richApiInExcelMethodSubstitution.preprocess) {
  2923. callArgs=richApiInExcelMethodSubstitution.preprocess(callArgs);
  2924. }
  2925. var ctx=new window.Excel.RequestContext();
  2926. var result=richApiInExcelMethodSubstitution.call(ctx, callArgs);
  2927. ctx.sync()
  2928. .then(function () {
  2929. var response=result.value;
  2930. var status=response.status;
  2931. delete response["status"];
  2932. delete response["@odata.type"];
  2933. if (richApiInExcelMethodSubstitution.postprocess) {
  2934. response=richApiInExcelMethodSubstitution.postprocess(response, callArgs);
  2935. }
  2936. if (status !=0) {
  2937. response=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2938. }
  2939. OSF.DDA.issueAsyncResult(callArgs, status, response);
  2940. })["catch"](function (error) {
  2941. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeFailure, null);
  2942. });
  2943. }
  2944. else {
  2945. var hostCallArgs;
  2946. if (parameterMap.toHost) {
  2947. hostCallArgs=parameterMap.toHost(dispId, callArgs);
  2948. }
  2949. else {
  2950. hostCallArgs=callArgs;
  2951. }
  2952. delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({
  2953. "dispId": dispId,
  2954. "hostCallArgs": hostCallArgs,
  2955. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { },
  2956. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { },
  2957. "onComplete": function (status, hostResponseArgs) {
  2958. var responseArgs;
  2959. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2960. if (parameterMap.fromHost) {
  2961. responseArgs=parameterMap.fromHost(dispId, hostResponseArgs);
  2962. }
  2963. else {
  2964. responseArgs=hostResponseArgs;
  2965. }
  2966. }
  2967. else {
  2968. responseArgs=hostResponseArgs;
  2969. }
  2970. var payload=asyncMethodCall.processResponse(status, responseArgs, caller, callArgs);
  2971. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  2972. }
  2973. });
  2974. }
  2975. }
  2976. catch (ex) {
  2977. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2978. }
  2979. };
  2980. this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) {
  2981. var callArgs;
  2982. var eventType, handler;
  2983. function onEnsureRegistration(status) {
  2984. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2985. var added=eventDispatch.addEventHandler(eventType, handler);
  2986. if (!added) {
  2987. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed;
  2988. }
  2989. }
  2990. var error;
  2991. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2992. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2993. }
  2994. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2995. }
  2996. try {
  2997. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];
  2998. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2999. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3000. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3001. if (eventDispatch.getEventHandlerCount(eventType)==0) {
  3002. var dispId=dispIdMap[eventType];
  3003. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3004. invoker({
  3005. "eventType": eventType,
  3006. "dispId": dispId,
  3007. "targetId": caller.id || "",
  3008. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3009. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3010. "onComplete": onEnsureRegistration,
  3011. "onEvent": function handleEvent(hostArgs) {
  3012. var args=parameterMap.fromHost(dispId, hostArgs);
  3013. eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args));
  3014. }
  3015. });
  3016. }
  3017. else {
  3018. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  3019. }
  3020. }
  3021. catch (ex) {
  3022. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3023. }
  3024. };
  3025. this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) {
  3026. var callArgs;
  3027. var eventType, handler;
  3028. function onEnsureRegistration(status) {
  3029. var error;
  3030. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3031. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3032. }
  3033. OSF.DDA.issueAsyncResult(callArgs, status, error);
  3034. }
  3035. try {
  3036. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];
  3037. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3038. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3039. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3040. var status, removeSuccess;
  3041. if (handler===null) {
  3042. removeSuccess=eventDispatch.clearEventHandlers(eventType);
  3043. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3044. }
  3045. else {
  3046. removeSuccess=eventDispatch.removeEventHandler(eventType, handler);
  3047. status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist;
  3048. }
  3049. if (removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) {
  3050. var dispId=dispIdMap[eventType];
  3051. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3052. invoker({
  3053. "eventType": eventType,
  3054. "dispId": dispId,
  3055. "targetId": caller.id || "",
  3056. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3057. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3058. "onComplete": onEnsureRegistration
  3059. });
  3060. }
  3061. else {
  3062. onEnsureRegistration(status);
  3063. }
  3064. }
  3065. catch (ex) {
  3066. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3067. }
  3068. };
  3069. this[OSF.DDA.DispIdHost.Methods.OpenDialog]=function OSF_DDA_DispIdHost_Facade$OpenDialog(suppliedArguments, eventDispatch, caller) {
  3070. var callArgs;
  3071. var targetId;
  3072. var dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3073. var dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3074. function onEnsureRegistration(status) {
  3075. var payload;
  3076. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3077. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3078. }
  3079. else {
  3080. var onSucceedArgs={};
  3081. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Id]=targetId;
  3082. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Data]=eventDispatch;
  3083. var payload=asyncMethodCall.processResponse(status, onSucceedArgs, caller, callArgs);
  3084. OSF.DialogShownStatus.hasDialogShown=true;
  3085. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3086. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3087. }
  3088. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  3089. }
  3090. try {
  3091. if (dialogMessageEvent==undefined || dialogOtherEvent==undefined) {
  3092. onEnsureRegistration(OSF.DDA.ErrorCodeManager.ooeOperationNotSupported);
  3093. }
  3094. if (OSF.DDA.AsyncMethodNames.DisplayDialogAsync==null) {
  3095. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3096. return;
  3097. }
  3098. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.DisplayDialogAsync.id];
  3099. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3100. var dispId=dispIdMap[dialogMessageEvent];
  3101. var delegateMethods=getDelegateMethods(dialogMessageEvent);
  3102. var invoker=delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] !=undefined ?
  3103. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] :
  3104. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3105. targetId=JSON.stringify(callArgs);
  3106. invoker({
  3107. "eventType": dialogMessageEvent,
  3108. "dispId": dispId,
  3109. "targetId": targetId,
  3110. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3111. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3112. "onComplete": onEnsureRegistration,
  3113. "onEvent": function handleEvent(hostArgs) {
  3114. var args=parameterMap.fromHost(dispId, hostArgs);
  3115. var event=OSF.DDA.OMFactory.manufactureEventArgs(dialogMessageEvent, caller, args);
  3116. if (event.type==dialogOtherEvent) {
  3117. var payload=OSF.DDA.ErrorCodeManager.getErrorArgs(event.error);
  3118. var errorArgs={};
  3119. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3120. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  3121. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  3122. event.error=new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]);
  3123. }
  3124. eventDispatch.fireOrQueueEvent(event);
  3125. if (args[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogClosed) {
  3126. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3127. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3128. eventDispatch.clearEventHandlers(Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived);
  3129. OSF.DialogShownStatus.hasDialogShown=false;
  3130. }
  3131. }
  3132. });
  3133. }
  3134. catch (ex) {
  3135. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3136. }
  3137. };
  3138. this[OSF.DDA.DispIdHost.Methods.CloseDialog]=function OSF_DDA_DispIdHost_Facade$CloseDialog(suppliedArguments, targetId, eventDispatch, caller) {
  3139. var callArgs;
  3140. var dialogMessageEvent, dialogOtherEvent;
  3141. var closeStatus=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3142. function closeCallback(status) {
  3143. closeStatus=status;
  3144. OSF.DialogShownStatus.hasDialogShown=false;
  3145. }
  3146. try {
  3147. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.CloseAsync.id];
  3148. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3149. dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3150. dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3151. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3152. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3153. var dispId=dispIdMap[dialogMessageEvent];
  3154. var delegateMethods=getDelegateMethods(dialogMessageEvent);
  3155. var invoker=delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] !=undefined ?
  3156. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] :
  3157. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3158. invoker({
  3159. "eventType": dialogMessageEvent,
  3160. "dispId": dispId,
  3161. "targetId": targetId,
  3162. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3163. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3164. "onComplete": closeCallback
  3165. });
  3166. }
  3167. catch (ex) {
  3168. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3169. }
  3170. if (closeStatus !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3171. throw OSF.OUtil.formatString(Strings.OfficeOM.L_FunctionCallFailed, OSF.DDA.AsyncMethodNames.CloseAsync.displayName, closeStatus);
  3172. }
  3173. };
  3174. this[OSF.DDA.DispIdHost.Methods.MessageParent]=function OSF_DDA_DispIdHost_Facade$MessageParent(suppliedArguments, caller) {
  3175. var stateInfo={};
  3176. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.MessageParent.id];
  3177. var callArgs=syncMethodCall.verifyAndExtractCall(suppliedArguments, caller, stateInfo);
  3178. var delegate=getDelegateMethods(OSF.DDA.SyncMethodNames.MessageParent.id);
  3179. var invoker=delegate[OSF.DDA.DispIdHost.Delegates.MessageParent];
  3180. var dispId=dispIdMap[OSF.DDA.SyncMethodNames.MessageParent.id];
  3181. return invoker({
  3182. "dispId": dispId,
  3183. "hostCallArgs": callArgs,
  3184. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3185. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }
  3186. });
  3187. };
  3188. this[OSF.DDA.DispIdHost.Methods.SendMessage]=function OSF_DDA_DispIdHost_Facade$SendMessage(suppliedArguments, eventDispatch, caller) {
  3189. var stateInfo={};
  3190. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.SendMessage.id];
  3191. var callArgs=syncMethodCall.verifyAndExtractCall(suppliedArguments, caller, stateInfo);
  3192. var delegate=getDelegateMethods(OSF.DDA.SyncMethodNames.SendMessage.id);
  3193. var invoker=delegate[OSF.DDA.DispIdHost.Delegates.SendMessage];
  3194. var dispId=dispIdMap[OSF.DDA.SyncMethodNames.SendMessage.id];
  3195. return invoker({
  3196. "dispId": dispId,
  3197. "hostCallArgs": callArgs,
  3198. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3199. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }
  3200. });
  3201. };
  3202. };
  3203. OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) {
  3204. for (var entry in asyncMethodNames) {
  3205. var method=asyncMethodNames[entry];
  3206. var name=method.displayName;
  3207. if (!target[name]) {
  3208. OSF.OUtil.defineEnumerableProperty(target, name, {
  3209. value: (function (asyncMethod) {
  3210. return function () {
  3211. var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];
  3212. invokeMethod(asyncMethod, arguments, target, privateState);
  3213. };
  3214. })(method)
  3215. });
  3216. }
  3217. }
  3218. };
  3219. OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) {
  3220. var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  3221. var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;
  3222. if (!target[add]) {
  3223. OSF.OUtil.defineEnumerableProperty(target, add, {
  3224. value: function () {
  3225. var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];
  3226. addEventHandler(arguments, eventDispatch, target);
  3227. }
  3228. });
  3229. }
  3230. if (!target[remove]) {
  3231. OSF.OUtil.defineEnumerableProperty(target, remove, {
  3232. value: function () {
  3233. var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];
  3234. removeEventHandler(arguments, eventDispatch, target);
  3235. }
  3236. });
  3237. }
  3238. };
  3239. var OfficeExt;
  3240. (function (OfficeExt) {
  3241. var MsAjaxTypeHelper=(function () {
  3242. function MsAjaxTypeHelper() {
  3243. }
  3244. MsAjaxTypeHelper.isInstanceOfType=function (type, instance) {
  3245. if (typeof (instance)==="undefined" || instance===null)
  3246. return false;
  3247. if (instance instanceof type)
  3248. return true;
  3249. var instanceType=instance.constructor;
  3250. if (!instanceType || (typeof (instanceType) !=="function") || !instanceType.__typeName || instanceType.__typeName==='Object') {
  3251. instanceType=Object;
  3252. }
  3253. return !!(instanceType===type) ||
  3254. (instanceType.__typeName && type.__typeName && instanceType.__typeName===type.__typeName);
  3255. };
  3256. return MsAjaxTypeHelper;
  3257. })();
  3258. OfficeExt.MsAjaxTypeHelper=MsAjaxTypeHelper;
  3259. var MsAjaxError=(function () {
  3260. function MsAjaxError() {
  3261. }
  3262. MsAjaxError.create=function (message, errorInfo) {
  3263. var err=new Error(message);
  3264. err.message=message;
  3265. if (errorInfo) {
  3266. for (var v in errorInfo) {
  3267. err[v]=errorInfo[v];
  3268. }
  3269. }
  3270. err.popStackFrame();
  3271. return err;
  3272. };
  3273. MsAjaxError.parameterCount=function (message) {
  3274. var displayMessage="Sys.ParameterCountException: "+(message ? message : "Parameter count mismatch.");
  3275. var err=MsAjaxError.create(displayMessage, { name: 'Sys.ParameterCountException' });
  3276. err.popStackFrame();
  3277. return err;
  3278. };
  3279. MsAjaxError.argument=function (paramName, message) {
  3280. var displayMessage="Sys.ArgumentException: "+(message ? message : "Value does not fall within the expected range.");
  3281. if (paramName) {
  3282. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3283. }
  3284. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName });
  3285. err.popStackFrame();
  3286. return err;
  3287. };
  3288. MsAjaxError.argumentNull=function (paramName, message) {
  3289. var displayMessage="Sys.ArgumentNullException: "+(message ? message : "Value cannot be null.");
  3290. if (paramName) {
  3291. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3292. }
  3293. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName });
  3294. err.popStackFrame();
  3295. return err;
  3296. };
  3297. MsAjaxError.argumentOutOfRange=function (paramName, actualValue, message) {
  3298. var displayMessage="Sys.ArgumentOutOfRangeException: "+(message ? message : "Specified argument was out of the range of valid values.");
  3299. if (paramName) {
  3300. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3301. }
  3302. if (typeof (actualValue) !=="undefined" && actualValue !==null) {
  3303. displayMessage+="\n"+MsAjaxString.format("Actual value was {0}.", actualValue);
  3304. }
  3305. var err=MsAjaxError.create(displayMessage, {
  3306. name: "Sys.ArgumentOutOfRangeException",
  3307. paramName: paramName,
  3308. actualValue: actualValue
  3309. });
  3310. err.popStackFrame();
  3311. return err;
  3312. };
  3313. MsAjaxError.argumentType=function (paramName, actualType, expectedType, message) {
  3314. var displayMessage="Sys.ArgumentTypeException: ";
  3315. if (message) {
  3316. displayMessage+=message;
  3317. }
  3318. else if (actualType && expectedType) {
  3319. displayMessage+=MsAjaxString.format("Object of type '{0}' cannot be converted to type '{1}'.", actualType.getName ? actualType.getName() : actualType, expectedType.getName ? expectedType.getName() : expectedType);
  3320. }
  3321. else {
  3322. displayMessage+="Object cannot be converted to the required type.";
  3323. }
  3324. if (paramName) {
  3325. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3326. }
  3327. var err=MsAjaxError.create(displayMessage, {
  3328. name: "Sys.ArgumentTypeException",
  3329. paramName: paramName,
  3330. actualType: actualType,
  3331. expectedType: expectedType
  3332. });
  3333. err.popStackFrame();
  3334. return err;
  3335. };
  3336. MsAjaxError.argumentUndefined=function (paramName, message) {
  3337. var displayMessage="Sys.ArgumentUndefinedException: "+(message ? message : "Value cannot be undefined.");
  3338. if (paramName) {
  3339. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3340. }
  3341. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName });
  3342. err.popStackFrame();
  3343. return err;
  3344. };
  3345. MsAjaxError.invalidOperation=function (message) {
  3346. var displayMessage="Sys.InvalidOperationException: "+(message ? message : "Operation is not valid due to the current state of the object.");
  3347. var err=MsAjaxError.create(displayMessage, { name: 'Sys.InvalidOperationException' });
  3348. err.popStackFrame();
  3349. return err;
  3350. };
  3351. return MsAjaxError;
  3352. })();
  3353. OfficeExt.MsAjaxError=MsAjaxError;
  3354. var MsAjaxString=(function () {
  3355. function MsAjaxString() {
  3356. }
  3357. MsAjaxString.format=function (format) {
  3358. var args=[];
  3359. for (var _i=1; _i < arguments.length; _i++) {
  3360. args[_i - 1]=arguments[_i];
  3361. }
  3362. var source=format;
  3363. return source.replace(/{(\d+)}/gm, function (match, number) {
  3364. var index=parseInt(number, 10);
  3365. return args[index]===undefined ? '{'+number+'}' : args[index];
  3366. });
  3367. };
  3368. MsAjaxString.startsWith=function (str, prefix) {
  3369. return (str.substr(0, prefix.length)===prefix);
  3370. };
  3371. return MsAjaxString;
  3372. })();
  3373. OfficeExt.MsAjaxString=MsAjaxString;
  3374. var MsAjaxDebug=(function () {
  3375. function MsAjaxDebug() {
  3376. }
  3377. MsAjaxDebug.trace=function (text) {
  3378. if (typeof Debug !=="undefined" && Debug.writeln)
  3379. Debug.writeln(text);
  3380. if (window.console && window.console.log)
  3381. window.console.log(text);
  3382. if (window.opera && window.opera.postError)
  3383. window.opera.postError(text);
  3384. if (window.debugService && window.debugService.trace)
  3385. window.debugService.trace(text);
  3386. var a=document.getElementById("TraceConsole");
  3387. if (a && a.tagName.toUpperCase()==="TEXTAREA") {
  3388. a.innerHTML+=text+"\n";
  3389. }
  3390. };
  3391. return MsAjaxDebug;
  3392. })();
  3393. OfficeExt.MsAjaxDebug=MsAjaxDebug;
  3394. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  3395. var registerTypeInternal=function registerTypeInternal(type, name, isClass) {
  3396. if (type.__typeName===undefined) {
  3397. type.__typeName=name;
  3398. }
  3399. if (type.__class===undefined) {
  3400. type.__class=isClass;
  3401. }
  3402. };
  3403. registerTypeInternal(Function, "Function", true);
  3404. registerTypeInternal(Error, "Error", true);
  3405. registerTypeInternal(Object, "Object", true);
  3406. registerTypeInternal(String, "String", true);
  3407. registerTypeInternal(Boolean, "Boolean", true);
  3408. registerTypeInternal(Date, "Date", true);
  3409. registerTypeInternal(Number, "Number", true);
  3410. registerTypeInternal(RegExp, "RegExp", true);
  3411. registerTypeInternal(Array, "Array", true);
  3412. if (!Function.createCallback) {
  3413. Function.createCallback=function Function$createCallback(method, context) {
  3414. var e=Function._validateParams(arguments, [
  3415. { name: "method", type: Function },
  3416. { name: "context", mayBeNull: true }
  3417. ]);
  3418. if (e)
  3419. throw e;
  3420. return function () {
  3421. var l=arguments.length;
  3422. if (l > 0) {
  3423. var args=[];
  3424. for (var i=0; i < l; i++) {
  3425. args[i]=arguments[i];
  3426. }
  3427. args[l]=context;
  3428. return method.apply(this, args);
  3429. }
  3430. return method.call(this, context);
  3431. };
  3432. };
  3433. }
  3434. if (!Function.createDelegate) {
  3435. Function.createDelegate=function Function$createDelegate(instance, method) {
  3436. var e=Function._validateParams(arguments, [
  3437. { name: "instance", mayBeNull: true },
  3438. { name: "method", type: Function }
  3439. ]);
  3440. if (e)
  3441. throw e;
  3442. return function () {
  3443. return method.apply(instance, arguments);
  3444. };
  3445. };
  3446. }
  3447. if (!Function._validateParams) {
  3448. Function._validateParams=function (params, expectedParams, validateParameterCount) {
  3449. var e, expectedLength=expectedParams.length;
  3450. validateParameterCount=validateParameterCount || (typeof (validateParameterCount)==="undefined");
  3451. e=Function._validateParameterCount(params, expectedParams, validateParameterCount);
  3452. if (e) {
  3453. e.popStackFrame();
  3454. return e;
  3455. }
  3456. for (var i=0, l=params.length; i < l; i++) {
  3457. var expectedParam=expectedParams[Math.min(i, expectedLength - 1)], paramName=expectedParam.name;
  3458. if (expectedParam.parameterArray) {
  3459. paramName+="["+(i - expectedLength+1)+"]";
  3460. }
  3461. else if (!validateParameterCount && (i >=expectedLength)) {
  3462. break;
  3463. }
  3464. e=Function._validateParameter(params[i], expectedParam, paramName);
  3465. if (e) {
  3466. e.popStackFrame();
  3467. return e;
  3468. }
  3469. }
  3470. return null;
  3471. };
  3472. }
  3473. if (!Function._validateParameterCount) {
  3474. Function._validateParameterCount=function (params, expectedParams, validateParameterCount) {
  3475. var i, error, expectedLen=expectedParams.length, actualLen=params.length;
  3476. if (actualLen < expectedLen) {
  3477. var minParams=expectedLen;
  3478. for (i=0; i < expectedLen; i++) {
  3479. var param=expectedParams[i];
  3480. if (param.optional || param.parameterArray) {
  3481. minParams--;
  3482. }
  3483. }
  3484. if (actualLen < minParams) {
  3485. error=true;
  3486. }
  3487. }
  3488. else if (validateParameterCount && (actualLen > expectedLen)) {
  3489. error=true;
  3490. for (i=0; i < expectedLen; i++) {
  3491. if (expectedParams[i].parameterArray) {
  3492. error=false;
  3493. break;
  3494. }
  3495. }
  3496. }
  3497. if (error) {
  3498. var e=MsAjaxError.parameterCount();
  3499. e.popStackFrame();
  3500. return e;
  3501. }
  3502. return null;
  3503. };
  3504. }
  3505. if (!Function._validateParameter) {
  3506. Function._validateParameter=function (param, expectedParam, paramName) {
  3507. var e, expectedType=expectedParam.type, expectedInteger=!!expectedParam.integer, expectedDomElement=!!expectedParam.domElement, mayBeNull=!!expectedParam.mayBeNull;
  3508. e=Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName);
  3509. if (e) {
  3510. e.popStackFrame();
  3511. return e;
  3512. }
  3513. var expectedElementType=expectedParam.elementType, elementMayBeNull=!!expectedParam.elementMayBeNull;
  3514. if (expectedType===Array && typeof (param) !=="undefined" && param !==null &&
  3515. (expectedElementType || !elementMayBeNull)) {
  3516. var expectedElementInteger=!!expectedParam.elementInteger, expectedElementDomElement=!!expectedParam.elementDomElement;
  3517. for (var i=0; i < param.length; i++) {
  3518. var elem=param[i];
  3519. e=Function._validateParameterType(elem, expectedElementType, expectedElementInteger, expectedElementDomElement, elementMayBeNull, paramName+"["+i+"]");
  3520. if (e) {
  3521. e.popStackFrame();
  3522. return e;
  3523. }
  3524. }
  3525. }
  3526. return null;
  3527. };
  3528. }
  3529. if (!Function._validateParameterType) {
  3530. Function._validateParameterType=function (param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) {
  3531. var e, i;
  3532. if (typeof (param)==="undefined") {
  3533. if (mayBeNull) {
  3534. return null;
  3535. }
  3536. else {
  3537. e=OfficeExt.MsAjaxError.argumentUndefined(paramName);
  3538. e.popStackFrame();
  3539. return e;
  3540. }
  3541. }
  3542. if (param===null) {
  3543. if (mayBeNull) {
  3544. return null;
  3545. }
  3546. else {
  3547. e=OfficeExt.MsAjaxError.argumentNull(paramName);
  3548. e.popStackFrame();
  3549. return e;
  3550. }
  3551. }
  3552. if (expectedType && !OfficeExt.MsAjaxTypeHelper.isInstanceOfType(expectedType, param)) {
  3553. e=OfficeExt.MsAjaxError.argumentType(paramName, typeof (param), expectedType);
  3554. e.popStackFrame();
  3555. return e;
  3556. }
  3557. return null;
  3558. };
  3559. }
  3560. if (!window.Type) {
  3561. window.Type=Function;
  3562. }
  3563. if (!Type.registerNamespace) {
  3564. Type.registerNamespace=function (ns) {
  3565. var namespaceParts=ns.split('.');
  3566. var currentNamespace=window;
  3567. for (var i=0; i < namespaceParts.length; i++) {
  3568. currentNamespace[namespaceParts[i]]=currentNamespace[namespaceParts[i]] || {};
  3569. currentNamespace=currentNamespace[namespaceParts[i]];
  3570. }
  3571. };
  3572. }
  3573. if (!Type.prototype.registerClass) {
  3574. Type.prototype.registerClass=function (cls) { cls={}; };
  3575. }
  3576. if (typeof (Sys)==="undefined") {
  3577. Type.registerNamespace('Sys');
  3578. }
  3579. if (!Error.prototype.popStackFrame) {
  3580. Error.prototype.popStackFrame=function () {
  3581. if (arguments.length !==0)
  3582. throw MsAjaxError.parameterCount();
  3583. if (typeof (this.stack)==="undefined" || this.stack===null ||
  3584. typeof (this.fileName)==="undefined" || this.fileName===null ||
  3585. typeof (this.lineNumber)==="undefined" || this.lineNumber===null) {
  3586. return;
  3587. }
  3588. var stackFrames=this.stack.split("\n");
  3589. var currentFrame=stackFrames[0];
  3590. var pattern=this.fileName+":"+this.lineNumber;
  3591. while (typeof (currentFrame) !=="undefined" &&
  3592. currentFrame !==null &&
  3593. currentFrame.indexOf(pattern)===-1) {
  3594. stackFrames.shift();
  3595. currentFrame=stackFrames[0];
  3596. }
  3597. var nextFrame=stackFrames[1];
  3598. if (typeof (nextFrame)==="undefined" || nextFrame===null) {
  3599. return;
  3600. }
  3601. var nextFrameParts=nextFrame.match(/@(.*):(\d+)$/);
  3602. if (typeof (nextFrameParts)==="undefined" || nextFrameParts===null) {
  3603. return;
  3604. }
  3605. this.fileName=nextFrameParts[1];
  3606. this.lineNumber=parseInt(nextFrameParts[2]);
  3607. stackFrames.shift();
  3608. this.stack=stackFrames.join("\n");
  3609. };
  3610. }
  3611. OsfMsAjaxFactory.msAjaxError=MsAjaxError;
  3612. OsfMsAjaxFactory.msAjaxString=MsAjaxString;
  3613. OsfMsAjaxFactory.msAjaxDebug=MsAjaxDebug;
  3614. }
  3615. })(OfficeExt || (OfficeExt={}));
  3616. OSF.OUtil.setNamespace("SafeArray", OSF.DDA);
  3617. OSF.DDA.SafeArray.Response={
  3618. Status: 0,
  3619. Payload: 1
  3620. };
  3621. OSF.DDA.SafeArray.UniqueArguments={
  3622. Offset: "offset",
  3623. Run: "run",
  3624. BindingSpecificData: "bindingSpecificData",
  3625. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  3626. };
  3627. OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray);
  3628. OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) {
  3629. var status;
  3630. var statusNumber=ex.number;
  3631. if (statusNumber) {
  3632. switch (statusNumber) {
  3633. case -2146828218:
  3634. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3635. break;
  3636. case -2147467259:
  3637. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened;
  3638. break;
  3639. case -2146828283:
  3640. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3641. break;
  3642. case -2147209089:
  3643. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3644. break;
  3645. case -2146827850:
  3646. default:
  3647. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3648. break;
  3649. }
  3650. }
  3651. if (args.onComplete) {
  3652. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3653. }
  3654. };
  3655. OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod=function OSF_DDA_SafeArray_Delegate$OnExceptionSyncMethod(ex, args) {
  3656. var status;
  3657. var number=ex.number;
  3658. if (number) {
  3659. switch (number) {
  3660. case -2146828218:
  3661. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3662. break;
  3663. case -2146827850:
  3664. default:
  3665. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3666. break;
  3667. }
  3668. }
  3669. return status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3670. };
  3671. OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() {
  3672. function _2DVBArrayToJaggedArray(vbArr) {
  3673. var ret;
  3674. try {
  3675. var rows=vbArr.ubound(1);
  3676. var cols=vbArr.ubound(2);
  3677. vbArr=vbArr.toArray();
  3678. if (rows==1 && cols==1) {
  3679. ret=[vbArr];
  3680. }
  3681. else {
  3682. ret=[];
  3683. for (var row=0; row < rows; row++) {
  3684. var rowArr=[];
  3685. for (var col=0; col < cols; col++) {
  3686. var datum=vbArr[row * cols+col];
  3687. if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) {
  3688. rowArr.push(datum);
  3689. }
  3690. }
  3691. if (rowArr.length > 0) {
  3692. ret.push(rowArr);
  3693. }
  3694. }
  3695. }
  3696. }
  3697. catch (ex) {
  3698. }
  3699. return ret;
  3700. }
  3701. var complexTypes=[];
  3702. var dynamicTypes={};
  3703. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () {
  3704. var tableRows=0;
  3705. var tableHeaders=1;
  3706. return {
  3707. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) {
  3708. if (OSF.DDA.TableDataProperties && typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) {
  3709. var tableData=[];
  3710. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  3711. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  3712. data=tableData;
  3713. }
  3714. return data;
  3715. },
  3716. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  3717. var ret;
  3718. if (hostArgs.toArray) {
  3719. var dimensions=hostArgs.dimensions();
  3720. if (dimensions===2) {
  3721. ret=_2DVBArrayToJaggedArray(hostArgs);
  3722. }
  3723. else {
  3724. var array=hostArgs.toArray();
  3725. if (array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) {
  3726. ret={};
  3727. ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]);
  3728. ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]);
  3729. }
  3730. else {
  3731. ret=array;
  3732. }
  3733. }
  3734. }
  3735. else {
  3736. ret=hostArgs;
  3737. }
  3738. return ret;
  3739. }
  3740. };
  3741. })();
  3742. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  3743. this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) {
  3744. var value;
  3745. if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) {
  3746. var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray;
  3747. value=toArraySupported ? arg.toArray() : arg || {};
  3748. }
  3749. else if (this.isDynamicType(param)) {
  3750. value=dynamicTypes[param].fromHost(arg);
  3751. }
  3752. else {
  3753. value=arg;
  3754. }
  3755. return value;
  3756. };
  3757. };
  3758. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  3759. OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [
  3760. {
  3761. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  3762. toHost: [
  3763. { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 },
  3764. { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 }
  3765. ]
  3766. },
  3767. {
  3768. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  3769. toHost: [
  3770. { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 }
  3771. ]
  3772. }
  3773. ]);
  3774. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  3775. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  3776. fromHost: [
  3777. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 },
  3778. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 }
  3779. ]
  3780. });
  3781. OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) {
  3782. function toArray(args) {
  3783. var arrArgs=args;
  3784. if (OSF.OUtil.isArray(args)) {
  3785. var len=arrArgs.length;
  3786. for (var i=0; i < len; i++) {
  3787. arrArgs[i]=toArray(arrArgs[i]);
  3788. }
  3789. }
  3790. else if (OSF.OUtil.isDate(args)) {
  3791. arrArgs=args.getVarDate();
  3792. }
  3793. else if (typeof args==="object" && !OSF.OUtil.isArray(args)) {
  3794. arrArgs=[];
  3795. for (var index in args) {
  3796. if (!OSF.OUtil.isFunction(args[index])) {
  3797. arrArgs[index]=toArray(args[index]);
  3798. }
  3799. }
  3800. }
  3801. return arrArgs;
  3802. }
  3803. function fromSafeArray(value) {
  3804. var ret=value;
  3805. if (value !=null && value.toArray) {
  3806. var arrayResult=value.toArray();
  3807. ret=new Array(arrayResult.length);
  3808. for (var i=0; i < arrayResult.length; i++) {
  3809. ret[i]=fromSafeArray(arrayResult[i]);
  3810. }
  3811. }
  3812. return ret;
  3813. }
  3814. try {
  3815. if (args.onCalling) {
  3816. args.onCalling();
  3817. }
  3818. var startTime=(new Date()).getTime();
  3819. OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs, resultCode) {
  3820. var result=hostResponseArgs.toArray();
  3821. var status=result[OSF.DDA.SafeArray.Response.Status];
  3822. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) {
  3823. var payload=result[OSF.DDA.SafeArray.Response.Payload];
  3824. payload=fromSafeArray(payload);
  3825. if (payload !=null) {
  3826. if (!args._chunkResultData) {
  3827. args._chunkResultData=new Array();
  3828. }
  3829. args._chunkResultData[payload[0]]=payload[1];
  3830. }
  3831. return false;
  3832. }
  3833. if (args.onReceiving) {
  3834. args.onReceiving();
  3835. }
  3836. if (args.onComplete) {
  3837. var payload;
  3838. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3839. if (result.length > 2) {
  3840. payload=[];
  3841. for (var i=1; i < result.length; i++)
  3842. payload[i - 1]=result[i];
  3843. }
  3844. else {
  3845. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3846. }
  3847. if (args._chunkResultData) {
  3848. payload=fromSafeArray(payload);
  3849. if (payload !=null) {
  3850. var expectedChunkCount=payload[payload.length - 1];
  3851. if (args._chunkResultData.length==expectedChunkCount) {
  3852. payload[payload.length - 1]=args._chunkResultData;
  3853. }
  3854. else {
  3855. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3856. }
  3857. }
  3858. }
  3859. }
  3860. else {
  3861. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3862. }
  3863. args.onComplete(status, payload);
  3864. }
  3865. if (OSF.AppTelemetry) {
  3866. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status);
  3867. }
  3868. return true;
  3869. });
  3870. }
  3871. catch (ex) {
  3872. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3873. }
  3874. };
  3875. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) {
  3876. var startTime=(new Date()).getTime();
  3877. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) {
  3878. if (args.onReceiving) {
  3879. args.onReceiving();
  3880. }
  3881. var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  3882. if (args.onComplete) {
  3883. args.onComplete(status);
  3884. }
  3885. if (OSF.AppTelemetry) {
  3886. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  3887. }
  3888. };
  3889. };
  3890. OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) {
  3891. if (args.onCalling) {
  3892. args.onCalling();
  3893. }
  3894. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  3895. try {
  3896. OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  3897. if (args.onEvent) {
  3898. args.onEvent(payload);
  3899. }
  3900. if (OSF.AppTelemetry) {
  3901. OSF.AppTelemetry.onEventDone(args.dispId);
  3902. }
  3903. }, callback);
  3904. }
  3905. catch (ex) {
  3906. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3907. }
  3908. };
  3909. OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) {
  3910. if (args.onCalling) {
  3911. args.onCalling();
  3912. }
  3913. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  3914. try {
  3915. OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback);
  3916. }
  3917. catch (ex) {
  3918. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3919. }
  3920. };
  3921. OSF.ClientMode={
  3922. ReadWrite: 0,
  3923. ReadOnly: 1
  3924. };
  3925. OSF.DDA.RichInitializationReason={
  3926. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  3927. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  3928. };
  3929. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) {
  3930. this._hostInfo=hostInfo;
  3931. this._webAppState=webAppState;
  3932. this._context=context;
  3933. this._settings=settings;
  3934. this._hostFacade=hostFacade;
  3935. this._initializeSettings=this.initializeSettings;
  3936. };
  3937. OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) {
  3938. var settings;
  3939. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  3940. if (osfSessionStorage) {
  3941. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  3942. if (storageSettings) {
  3943. serializedSettings=JSON.parse(storageSettings);
  3944. }
  3945. else {
  3946. storageSettings=JSON.stringify(serializedSettings);
  3947. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  3948. }
  3949. }
  3950. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  3951. if (refreshSupported) {
  3952. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  3953. }
  3954. else {
  3955. settings=new OSF.DDA.Settings(deserializedSettings);
  3956. }
  3957. return settings;
  3958. };
  3959. OSF.InitializationHelper.prototype.saveAndSetDialogInfo=function OSF_InitializationHelper$saveAndSetDialogInfo(hostInfoValue) {
  3960. };
  3961. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() {
  3962. };
  3963. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) {
  3964. this.prepareApiSurface(appContext);
  3965. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext));
  3966. };
  3967. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) {
  3968. var license=new OSF.DDA.License(appContext.get_eToken());
  3969. var getOfficeThemeHandler=(OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null;
  3970. if (appContext.get_isDialog()) {
  3971. if (OSF.DDA.UI.ChildUI) {
  3972. appContext.ui=new OSF.DDA.UI.ChildUI();
  3973. }
  3974. }
  3975. else {
  3976. if (OSF.DDA.UI.ParentUI) {
  3977. appContext.ui=new OSF.DDA.UI.ParentUI();
  3978. if (OfficeExt.Container) {
  3979. OSF.DDA.DispIdHost.addAsyncMethods(appContext.ui, [OSF.DDA.AsyncMethodNames.CloseContainerAsync]);
  3980. }
  3981. }
  3982. }
  3983. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler));
  3984. var getDelegateMethods, parameterMap;
  3985. getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods;
  3986. parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  3987. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap));
  3988. };
  3989. OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) { return OSF.DDA.RichInitializationReason[appContext.get_reason()]; };
  3990. OSF.DDA.DispIdHost.getClientDelegateMethods=function (actionId) {
  3991. var delegateMethods={};
  3992. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  3993. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  3994. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  3995. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog]=OSF.DDA.SafeArray.Delegate.openDialog;
  3996. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog]=OSF.DDA.SafeArray.Delegate.closeDialog;
  3997. delegateMethods[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.SafeArray.Delegate.messageParent;
  3998. if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id) {
  3999. var readSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  4000. return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving);
  4001. };
  4002. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings);
  4003. }
  4004. if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id) {
  4005. var writeSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  4006. return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving);
  4007. };
  4008. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings);
  4009. }
  4010. return delegateMethods;
  4011. };
  4012. var OfficeExt;
  4013. (function (OfficeExt) {
  4014. var RichClientHostController=(function () {
  4015. function RichClientHostController() {
  4016. }
  4017. RichClientHostController.prototype.execute=function (id, params, callback) {
  4018. window.external.Execute(id, params, callback);
  4019. };
  4020. RichClientHostController.prototype.registerEvent=function (id, targetId, handler, callback) {
  4021. window.external.RegisterEvent(id, targetId, handler, callback);
  4022. };
  4023. RichClientHostController.prototype.unregisterEvent=function (id, targetId, callback) {
  4024. window.external.UnregisterEvent(id, targetId, callback);
  4025. };
  4026. return RichClientHostController;
  4027. })();
  4028. OfficeExt.RichClientHostController=RichClientHostController;
  4029. })(OfficeExt || (OfficeExt={}));
  4030. var OfficeExt;
  4031. (function (OfficeExt) {
  4032. var Win32RichClientHostController=(function (_super) {
  4033. __extends(Win32RichClientHostController, _super);
  4034. function Win32RichClientHostController() {
  4035. _super.apply(this, arguments);
  4036. }
  4037. Win32RichClientHostController.prototype.messageParent=function (params) {
  4038. var message=params[Microsoft.Office.WebExtension.Parameters.MessageToParent];
  4039. window.external.MessageParent(message);
  4040. };
  4041. Win32RichClientHostController.prototype.openDialog=function (id, targetId, handler, callback) {
  4042. this.registerEvent(id, targetId, handler, callback);
  4043. };
  4044. Win32RichClientHostController.prototype.closeDialog=function (id, targetId, callback) {
  4045. this.unregisterEvent(id, targetId, callback);
  4046. };
  4047. return Win32RichClientHostController;
  4048. })(OfficeExt.RichClientHostController);
  4049. OfficeExt.Win32RichClientHostController=Win32RichClientHostController;
  4050. })(OfficeExt || (OfficeExt={}));
  4051. OSF.ClientHostController=new OfficeExt.Win32RichClientHostController();
  4052. var OfficeExt;
  4053. (function (OfficeExt) {
  4054. var OfficeTheme;
  4055. (function (OfficeTheme) {
  4056. var OfficeThemeManager=(function () {
  4057. function OfficeThemeManager() {
  4058. this._osfOfficeTheme=null;
  4059. this._osfOfficeThemeTimeStamp=null;
  4060. }
  4061. OfficeThemeManager.prototype.getOfficeTheme=function () {
  4062. if (OSF.DDA._OsfControlContext) {
  4063. if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) {
  4064. if (OSF.AppTelemetry) {
  4065. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0);
  4066. }
  4067. }
  4068. else {
  4069. var startTime=(new Date()).getTime();
  4070. var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo();
  4071. var endTime=(new Date()).getTime();
  4072. if (OSF.AppTelemetry) {
  4073. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime));
  4074. }
  4075. this._osfOfficeTheme=JSON.parse(osfOfficeTheme);
  4076. for (var color in this._osfOfficeTheme) {
  4077. this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]);
  4078. }
  4079. this._osfOfficeThemeTimeStamp=endTime;
  4080. }
  4081. return this._osfOfficeTheme;
  4082. }
  4083. };
  4084. OfficeThemeManager.instance=function () {
  4085. if (OfficeThemeManager._instance==null) {
  4086. OfficeThemeManager._instance=new OfficeThemeManager();
  4087. }
  4088. return OfficeThemeManager._instance;
  4089. };
  4090. OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5000;
  4091. OfficeThemeManager._instance=null;
  4092. return OfficeThemeManager;
  4093. })();
  4094. OfficeTheme.OfficeThemeManager=OfficeThemeManager;
  4095. OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA);
  4096. OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme;
  4097. })(OfficeTheme=OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={}));
  4098. })(OfficeExt || (OfficeExt={}));
  4099. OSF.DDA.ClientSettingsManager={
  4100. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) {
  4101. return function (args) {
  4102. var status, response;
  4103. try {
  4104. response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving);
  4105. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  4106. }
  4107. catch (ex) {
  4108. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4109. response={ name: Strings.OfficeOM.L_InternalError, message: ex };
  4110. }
  4111. if (args.onComplete) {
  4112. args.onComplete(status, response);
  4113. }
  4114. };
  4115. },
  4116. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) {
  4117. var keys=[];
  4118. var values=[];
  4119. if (onCalling) {
  4120. onCalling();
  4121. }
  4122. OSF.DDA._OsfControlContext.GetSettings().Read(keys, values);
  4123. if (onReceiving) {
  4124. onReceiving();
  4125. }
  4126. var serializedSettings={};
  4127. for (var index=0; index < keys.length; index++) {
  4128. serializedSettings[keys[index]]=values[index];
  4129. }
  4130. return serializedSettings;
  4131. },
  4132. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) {
  4133. var keys=[];
  4134. var values=[];
  4135. for (var key in serializedSettings) {
  4136. keys.push(key);
  4137. values.push(serializedSettings[key]);
  4138. }
  4139. if (onCalling) {
  4140. onCalling();
  4141. }
  4142. OSF.DDA._OsfControlContext.GetSettings().Write(keys, values);
  4143. if (onReceiving) {
  4144. onReceiving();
  4145. }
  4146. }
  4147. };
  4148. OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported) {
  4149. var serializedSettings=OSF.DDA.ClientSettingsManager.read();
  4150. var settings=this.deserializeSettings(serializedSettings, refreshSupported);
  4151. return settings;
  4152. };
  4153. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
  4154. var returnedContext;
  4155. var context;
  4156. var warningText="Warning: Office.js is loaded outside of Office client";
  4157. try {
  4158. if (window.external && typeof window.external.GetContext !=='undefined') {
  4159. context=OSF.DDA._OsfControlContext=window.external.GetContext();
  4160. }
  4161. else {
  4162. OsfMsAjaxFactory.msAjaxDebug.trace(warningText);
  4163. return;
  4164. }
  4165. }
  4166. catch (e) {
  4167. OsfMsAjaxFactory.msAjaxDebug.trace(warningText);
  4168. return;
  4169. }
  4170. var appType=context.GetAppType();
  4171. var id=context.GetSolutionRef();
  4172. var version=context.GetAppVersionMajor();
  4173. var minorVersion=context.GetAppVersionMinor();
  4174. var UILocale=context.GetAppUILocale();
  4175. var dataLocale=context.GetAppDataLocale();
  4176. var docUrl=context.GetDocUrl();
  4177. var clientMode=context.GetAppCapabilities();
  4178. var reason=context.GetActivationMode();
  4179. var osfControlType=context.GetControlIntegrationLevel();
  4180. var settings=[];
  4181. var eToken;
  4182. try {
  4183. eToken=context.GetSolutionToken();
  4184. }
  4185. catch (ex) {
  4186. }
  4187. var correlationId;
  4188. if (typeof context.GetCorrelationId !=="undefined") {
  4189. correlationId=context.GetCorrelationId();
  4190. }
  4191. var appInstanceId;
  4192. if (typeof context.GetInstanceId !=="undefined") {
  4193. appInstanceId=context.GetInstanceId();
  4194. }
  4195. var touchEnabled;
  4196. if (typeof context.GetTouchEnabled !=="undefined") {
  4197. touchEnabled=context.GetTouchEnabled();
  4198. }
  4199. var commerceAllowed;
  4200. if (typeof context.GetCommerceAllowed !=="undefined") {
  4201. commerceAllowed=context.GetCommerceAllowed();
  4202. }
  4203. var requirementMatrix;
  4204. if (typeof context.GetSupportedMatrix !=="undefined") {
  4205. requirementMatrix=context.GetSupportedMatrix();
  4206. }
  4207. var hostCustomMessage;
  4208. if (typeof context.GetHostCustomMessage !=="undefined") {
  4209. hostCustomMessage=context.GetHostCustomMessage();
  4210. }
  4211. var hostFullVersion;
  4212. if (typeof context.GetHostFullVersion !=="undefined") {
  4213. hostFullVersion=context.GetHostFullVersion();
  4214. }
  4215. var dialogRequirementMatrix;
  4216. if (typeof context.GetDialogRequirementMatrix !="undefined") {
  4217. dialogRequirementMatrix=context.GetDialogRequirementMatrix();
  4218. }
  4219. eToken=eToken ? eToken.toString() : "";
  4220. returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix, hostCustomMessage, hostFullVersion, undefined, undefined, undefined, dialogRequirementMatrix);
  4221. if (OSF.AppTelemetry) {
  4222. OSF.AppTelemetry.initialize(returnedContext);
  4223. }
  4224. gotAppContext(returnedContext);
  4225. };
  4226. var OSFLog;
  4227. (function (OSFLog) {
  4228. var BaseUsageData=(function () {
  4229. function BaseUsageData(table) {
  4230. this._table=table;
  4231. this._fields={};
  4232. }
  4233. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  4234. get: function () {
  4235. return this._fields;
  4236. },
  4237. enumerable: true,
  4238. configurable: true
  4239. });
  4240. Object.defineProperty(BaseUsageData.prototype, "Table", {
  4241. get: function () {
  4242. return this._table;
  4243. },
  4244. enumerable: true,
  4245. configurable: true
  4246. });
  4247. BaseUsageData.prototype.SerializeFields=function () {
  4248. };
  4249. BaseUsageData.prototype.SetSerializedField=function (key, value) {
  4250. if (typeof (value) !=="undefined" && value !==null) {
  4251. this._serializedFields[key]=value.toString();
  4252. }
  4253. };
  4254. BaseUsageData.prototype.SerializeRow=function () {
  4255. this._serializedFields={};
  4256. this.SetSerializedField("Table", this._table);
  4257. this.SerializeFields();
  4258. return JSON.stringify(this._serializedFields);
  4259. };
  4260. return BaseUsageData;
  4261. })();
  4262. OSFLog.BaseUsageData=BaseUsageData;
  4263. var AppActivatedUsageData=(function (_super) {
  4264. __extends(AppActivatedUsageData, _super);
  4265. function AppActivatedUsageData() {
  4266. _super.call(this, "AppActivated");
  4267. }
  4268. Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", {
  4269. get: function () { return this.Fields["CorrelationId"]; },
  4270. set: function (value) { this.Fields["CorrelationId"]=value; },
  4271. enumerable: true,
  4272. configurable: true
  4273. });
  4274. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  4275. get: function () { return this.Fields["SessionId"]; },
  4276. set: function (value) { this.Fields["SessionId"]=value; },
  4277. enumerable: true,
  4278. configurable: true
  4279. });
  4280. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  4281. get: function () { return this.Fields["AppId"]; },
  4282. set: function (value) { this.Fields["AppId"]=value; },
  4283. enumerable: true,
  4284. configurable: true
  4285. });
  4286. Object.defineProperty(AppActivatedUsageData.prototype, "AppInstanceId", {
  4287. get: function () { return this.Fields["AppInstanceId"]; },
  4288. set: function (value) { this.Fields["AppInstanceId"]=value; },
  4289. enumerable: true,
  4290. configurable: true
  4291. });
  4292. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  4293. get: function () { return this.Fields["AppURL"]; },
  4294. set: function (value) { this.Fields["AppURL"]=value; },
  4295. enumerable: true,
  4296. configurable: true
  4297. });
  4298. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  4299. get: function () { return this.Fields["AssetId"]; },
  4300. set: function (value) { this.Fields["AssetId"]=value; },
  4301. enumerable: true,
  4302. configurable: true
  4303. });
  4304. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  4305. get: function () { return this.Fields["Browser"]; },
  4306. set: function (value) { this.Fields["Browser"]=value; },
  4307. enumerable: true,
  4308. configurable: true
  4309. });
  4310. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  4311. get: function () { return this.Fields["UserId"]; },
  4312. set: function (value) { this.Fields["UserId"]=value; },
  4313. enumerable: true,
  4314. configurable: true
  4315. });
  4316. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  4317. get: function () { return this.Fields["Host"]; },
  4318. set: function (value) { this.Fields["Host"]=value; },
  4319. enumerable: true,
  4320. configurable: true
  4321. });
  4322. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  4323. get: function () { return this.Fields["HostVersion"]; },
  4324. set: function (value) { this.Fields["HostVersion"]=value; },
  4325. enumerable: true,
  4326. configurable: true
  4327. });
  4328. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  4329. get: function () { return this.Fields["ClientId"]; },
  4330. set: function (value) { this.Fields["ClientId"]=value; },
  4331. enumerable: true,
  4332. configurable: true
  4333. });
  4334. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  4335. get: function () { return this.Fields["AppSizeWidth"]; },
  4336. set: function (value) { this.Fields["AppSizeWidth"]=value; },
  4337. enumerable: true,
  4338. configurable: true
  4339. });
  4340. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  4341. get: function () { return this.Fields["AppSizeHeight"]; },
  4342. set: function (value) { this.Fields["AppSizeHeight"]=value; },
  4343. enumerable: true,
  4344. configurable: true
  4345. });
  4346. Object.defineProperty(AppActivatedUsageData.prototype, "Message", {
  4347. get: function () { return this.Fields["Message"]; },
  4348. set: function (value) { this.Fields["Message"]=value; },
  4349. enumerable: true,
  4350. configurable: true
  4351. });
  4352. Object.defineProperty(AppActivatedUsageData.prototype, "DocUrl", {
  4353. get: function () { return this.Fields["DocUrl"]; },
  4354. set: function (value) { this.Fields["DocUrl"]=value; },
  4355. enumerable: true,
  4356. configurable: true
  4357. });
  4358. Object.defineProperty(AppActivatedUsageData.prototype, "OfficeJSVersion", {
  4359. get: function () { return this.Fields["OfficeJSVersion"]; },
  4360. set: function (value) { this.Fields["OfficeJSVersion"]=value; },
  4361. enumerable: true,
  4362. configurable: true
  4363. });
  4364. Object.defineProperty(AppActivatedUsageData.prototype, "HostJSVersion", {
  4365. get: function () { return this.Fields["HostJSVersion"]; },
  4366. set: function (value) { this.Fields["HostJSVersion"]=value; },
  4367. enumerable: true,
  4368. configurable: true
  4369. });
  4370. AppActivatedUsageData.prototype.SerializeFields=function () {
  4371. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4372. this.SetSerializedField("SessionId", this.SessionId);
  4373. this.SetSerializedField("AppId", this.AppId);
  4374. this.SetSerializedField("AppInstanceId", this.AppInstanceId);
  4375. this.SetSerializedField("AppURL", this.AppURL);
  4376. this.SetSerializedField("AssetId", this.AssetId);
  4377. this.SetSerializedField("Browser", this.Browser);
  4378. this.SetSerializedField("UserId", this.UserId);
  4379. this.SetSerializedField("Host", this.Host);
  4380. this.SetSerializedField("HostVersion", this.HostVersion);
  4381. this.SetSerializedField("ClientId", this.ClientId);
  4382. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);
  4383. this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  4384. this.SetSerializedField("Message", this.Message);
  4385. this.SetSerializedField("DocUrl", this.DocUrl);
  4386. this.SetSerializedField("OfficeJSVersion", this.OfficeJSVersion);
  4387. this.SetSerializedField("HostJSVersion", this.HostJSVersion);
  4388. };
  4389. return AppActivatedUsageData;
  4390. })(BaseUsageData);
  4391. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  4392. var ScriptLoadUsageData=(function (_super) {
  4393. __extends(ScriptLoadUsageData, _super);
  4394. function ScriptLoadUsageData() {
  4395. _super.call(this, "ScriptLoad");
  4396. }
  4397. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  4398. get: function () { return this.Fields["CorrelationId"]; },
  4399. set: function (value) { this.Fields["CorrelationId"]=value; },
  4400. enumerable: true,
  4401. configurable: true
  4402. });
  4403. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  4404. get: function () { return this.Fields["SessionId"]; },
  4405. set: function (value) { this.Fields["SessionId"]=value; },
  4406. enumerable: true,
  4407. configurable: true
  4408. });
  4409. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  4410. get: function () { return this.Fields["ScriptId"]; },
  4411. set: function (value) { this.Fields["ScriptId"]=value; },
  4412. enumerable: true,
  4413. configurable: true
  4414. });
  4415. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  4416. get: function () { return this.Fields["StartTime"]; },
  4417. set: function (value) { this.Fields["StartTime"]=value; },
  4418. enumerable: true,
  4419. configurable: true
  4420. });
  4421. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  4422. get: function () { return this.Fields["ResponseTime"]; },
  4423. set: function (value) { this.Fields["ResponseTime"]=value; },
  4424. enumerable: true,
  4425. configurable: true
  4426. });
  4427. ScriptLoadUsageData.prototype.SerializeFields=function () {
  4428. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4429. this.SetSerializedField("SessionId", this.SessionId);
  4430. this.SetSerializedField("ScriptId", this.ScriptId);
  4431. this.SetSerializedField("StartTime", this.StartTime);
  4432. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4433. };
  4434. return ScriptLoadUsageData;
  4435. })(BaseUsageData);
  4436. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  4437. var AppClosedUsageData=(function (_super) {
  4438. __extends(AppClosedUsageData, _super);
  4439. function AppClosedUsageData() {
  4440. _super.call(this, "AppClosed");
  4441. }
  4442. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  4443. get: function () { return this.Fields["CorrelationId"]; },
  4444. set: function (value) { this.Fields["CorrelationId"]=value; },
  4445. enumerable: true,
  4446. configurable: true
  4447. });
  4448. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  4449. get: function () { return this.Fields["SessionId"]; },
  4450. set: function (value) { this.Fields["SessionId"]=value; },
  4451. enumerable: true,
  4452. configurable: true
  4453. });
  4454. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  4455. get: function () { return this.Fields["FocusTime"]; },
  4456. set: function (value) { this.Fields["FocusTime"]=value; },
  4457. enumerable: true,
  4458. configurable: true
  4459. });
  4460. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  4461. get: function () { return this.Fields["AppSizeFinalWidth"]; },
  4462. set: function (value) { this.Fields["AppSizeFinalWidth"]=value; },
  4463. enumerable: true,
  4464. configurable: true
  4465. });
  4466. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  4467. get: function () { return this.Fields["AppSizeFinalHeight"]; },
  4468. set: function (value) { this.Fields["AppSizeFinalHeight"]=value; },
  4469. enumerable: true,
  4470. configurable: true
  4471. });
  4472. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  4473. get: function () { return this.Fields["OpenTime"]; },
  4474. set: function (value) { this.Fields["OpenTime"]=value; },
  4475. enumerable: true,
  4476. configurable: true
  4477. });
  4478. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  4479. get: function () { return this.Fields["CloseMethod"]; },
  4480. set: function (value) { this.Fields["CloseMethod"]=value; },
  4481. enumerable: true,
  4482. configurable: true
  4483. });
  4484. AppClosedUsageData.prototype.SerializeFields=function () {
  4485. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4486. this.SetSerializedField("SessionId", this.SessionId);
  4487. this.SetSerializedField("FocusTime", this.FocusTime);
  4488. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  4489. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  4490. this.SetSerializedField("OpenTime", this.OpenTime);
  4491. this.SetSerializedField("CloseMethod", this.CloseMethod);
  4492. };
  4493. return AppClosedUsageData;
  4494. })(BaseUsageData);
  4495. OSFLog.AppClosedUsageData=AppClosedUsageData;
  4496. var APIUsageUsageData=(function (_super) {
  4497. __extends(APIUsageUsageData, _super);
  4498. function APIUsageUsageData() {
  4499. _super.call(this, "APIUsage");
  4500. }
  4501. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  4502. get: function () { return this.Fields["CorrelationId"]; },
  4503. set: function (value) { this.Fields["CorrelationId"]=value; },
  4504. enumerable: true,
  4505. configurable: true
  4506. });
  4507. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  4508. get: function () { return this.Fields["SessionId"]; },
  4509. set: function (value) { this.Fields["SessionId"]=value; },
  4510. enumerable: true,
  4511. configurable: true
  4512. });
  4513. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  4514. get: function () { return this.Fields["APIType"]; },
  4515. set: function (value) { this.Fields["APIType"]=value; },
  4516. enumerable: true,
  4517. configurable: true
  4518. });
  4519. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  4520. get: function () { return this.Fields["APIID"]; },
  4521. set: function (value) { this.Fields["APIID"]=value; },
  4522. enumerable: true,
  4523. configurable: true
  4524. });
  4525. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  4526. get: function () { return this.Fields["Parameters"]; },
  4527. set: function (value) { this.Fields["Parameters"]=value; },
  4528. enumerable: true,
  4529. configurable: true
  4530. });
  4531. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  4532. get: function () { return this.Fields["ResponseTime"]; },
  4533. set: function (value) { this.Fields["ResponseTime"]=value; },
  4534. enumerable: true,
  4535. configurable: true
  4536. });
  4537. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  4538. get: function () { return this.Fields["ErrorType"]; },
  4539. set: function (value) { this.Fields["ErrorType"]=value; },
  4540. enumerable: true,
  4541. configurable: true
  4542. });
  4543. APIUsageUsageData.prototype.SerializeFields=function () {
  4544. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4545. this.SetSerializedField("SessionId", this.SessionId);
  4546. this.SetSerializedField("APIType", this.APIType);
  4547. this.SetSerializedField("APIID", this.APIID);
  4548. this.SetSerializedField("Parameters", this.Parameters);
  4549. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4550. this.SetSerializedField("ErrorType", this.ErrorType);
  4551. };
  4552. return APIUsageUsageData;
  4553. })(BaseUsageData);
  4554. OSFLog.APIUsageUsageData=APIUsageUsageData;
  4555. var AppInitializationUsageData=(function (_super) {
  4556. __extends(AppInitializationUsageData, _super);
  4557. function AppInitializationUsageData() {
  4558. _super.call(this, "AppInitialization");
  4559. }
  4560. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  4561. get: function () { return this.Fields["CorrelationId"]; },
  4562. set: function (value) { this.Fields["CorrelationId"]=value; },
  4563. enumerable: true,
  4564. configurable: true
  4565. });
  4566. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  4567. get: function () { return this.Fields["SessionId"]; },
  4568. set: function (value) { this.Fields["SessionId"]=value; },
  4569. enumerable: true,
  4570. configurable: true
  4571. });
  4572. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  4573. get: function () { return this.Fields["SuccessCode"]; },
  4574. set: function (value) { this.Fields["SuccessCode"]=value; },
  4575. enumerable: true,
  4576. configurable: true
  4577. });
  4578. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  4579. get: function () { return this.Fields["Message"]; },
  4580. set: function (value) { this.Fields["Message"]=value; },
  4581. enumerable: true,
  4582. configurable: true
  4583. });
  4584. AppInitializationUsageData.prototype.SerializeFields=function () {
  4585. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4586. this.SetSerializedField("SessionId", this.SessionId);
  4587. this.SetSerializedField("SuccessCode", this.SuccessCode);
  4588. this.SetSerializedField("Message", this.Message);
  4589. };
  4590. return AppInitializationUsageData;
  4591. })(BaseUsageData);
  4592. OSFLog.AppInitializationUsageData=AppInitializationUsageData;
  4593. })(OSFLog || (OSFLog={}));
  4594. var Logger;
  4595. (function (Logger) {
  4596. "use strict";
  4597. (function (TraceLevel) {
  4598. TraceLevel[TraceLevel["info"]=0]="info";
  4599. TraceLevel[TraceLevel["warning"]=1]="warning";
  4600. TraceLevel[TraceLevel["error"]=2]="error";
  4601. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  4602. var TraceLevel=Logger.TraceLevel;
  4603. (function (SendFlag) {
  4604. SendFlag[SendFlag["none"]=0]="none";
  4605. SendFlag[SendFlag["flush"]=1]="flush";
  4606. })(Logger.SendFlag || (Logger.SendFlag={}));
  4607. var SendFlag=Logger.SendFlag;
  4608. function allowUploadingData() {
  4609. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4610. OSF.Logger.ulsEndpoint.loadProxyFrame();
  4611. }
  4612. }
  4613. Logger.allowUploadingData=allowUploadingData;
  4614. function sendLog(traceLevel, message, flag) {
  4615. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4616. var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  4617. var logs=JSON.stringify(jsonObj);
  4618. OSF.Logger.ulsEndpoint.writeLog(logs);
  4619. }
  4620. }
  4621. Logger.sendLog=sendLog;
  4622. function creatULSEndpoint() {
  4623. try {
  4624. return new ULSEndpointProxy();
  4625. }
  4626. catch (e) {
  4627. return null;
  4628. }
  4629. }
  4630. var ULSEndpointProxy=(function () {
  4631. function ULSEndpointProxy() {
  4632. var _this=this;
  4633. this.proxyFrame=null;
  4634. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  4635. this.buffer=[];
  4636. this.proxyFrameReady=false;
  4637. OSF.OUtil.addEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4638. setTimeout(function () {
  4639. _this.loadProxyFrame();
  4640. }, 3000);
  4641. }
  4642. ULSEndpointProxy.prototype.writeLog=function (log) {
  4643. if (this.proxyFrameReady===true) {
  4644. this.proxyFrame.contentWindow.postMessage(log, ULSEndpointProxy.telemetryOrigin);
  4645. }
  4646. else {
  4647. if (this.buffer.length < 128) {
  4648. this.buffer.push(log);
  4649. }
  4650. }
  4651. };
  4652. ULSEndpointProxy.prototype.loadProxyFrame=function () {
  4653. if (this.proxyFrame==null) {
  4654. this.proxyFrame=document.createElement("iframe");
  4655. this.proxyFrame.setAttribute("style", "display:none");
  4656. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  4657. document.head.appendChild(this.proxyFrame);
  4658. }
  4659. };
  4660. ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) {
  4661. var _this=this;
  4662. if (e.data==="ProxyFrameReadyToLog") {
  4663. this.proxyFrameReady=true;
  4664. for (var i=0; i < this.buffer.length; i++) {
  4665. this.writeLog(this.buffer[i]);
  4666. }
  4667. this.buffer.length=0;
  4668. OSF.OUtil.removeEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4669. }
  4670. else if (e.data==="ProxyFrameReadyToInit") {
  4671. var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  4672. var initStr=JSON.stringify(initJson);
  4673. this.proxyFrame.contentWindow.postMessage(initStr, ULSEndpointProxy.telemetryOrigin);
  4674. }
  4675. };
  4676. ULSEndpointProxy.telemetryOrigin="https://telemetryservice.firstpartyapps.oaspapps.com";
  4677. return ULSEndpointProxy;
  4678. })();
  4679. if (!OSF.Logger) {
  4680. OSF.Logger=Logger;
  4681. }
  4682. Logger.ulsEndpoint=creatULSEndpoint();
  4683. })(Logger || (Logger={}));
  4684. var OSFAppTelemetry;
  4685. (function (OSFAppTelemetry) {
  4686. "use strict";
  4687. var appInfo;
  4688. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  4689. var osfControlAppCorrelationId="";
  4690. var omexDomainRegex=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/", "i");
  4691. ;
  4692. var AppInfo=(function () {
  4693. function AppInfo() {
  4694. }
  4695. return AppInfo;
  4696. })();
  4697. var Event=(function () {
  4698. function Event(name, handler) {
  4699. this.name=name;
  4700. this.handler=handler;
  4701. }
  4702. return Event;
  4703. })();
  4704. var AppStorage=(function () {
  4705. function AppStorage() {
  4706. this.clientIDKey="Office API client";
  4707. this.logIdSetKey="Office App Log Id Set";
  4708. }
  4709. AppStorage.prototype.getClientId=function () {
  4710. var clientId=this.getValue(this.clientIDKey);
  4711. if (!clientId || clientId.length <=0 || clientId.length > 40) {
  4712. clientId=OSF.OUtil.Guid.generateNewGuid();
  4713. this.setValue(this.clientIDKey, clientId);
  4714. }
  4715. return clientId;
  4716. };
  4717. AppStorage.prototype.saveLog=function (logId, log) {
  4718. var logIdSet=this.getValue(this.logIdSetKey);
  4719. logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId;
  4720. this.setValue(this.logIdSetKey, logIdSet);
  4721. this.setValue(logId, log);
  4722. };
  4723. AppStorage.prototype.enumerateLog=function (callback, clean) {
  4724. var logIdSet=this.getValue(this.logIdSetKey);
  4725. if (logIdSet) {
  4726. var ids=logIdSet.split(";");
  4727. for (var id in ids) {
  4728. var logId=ids[id];
  4729. var log=this.getValue(logId);
  4730. if (log) {
  4731. if (callback) {
  4732. callback(logId, log);
  4733. }
  4734. if (clean) {
  4735. this.remove(logId);
  4736. }
  4737. }
  4738. }
  4739. if (clean) {
  4740. this.remove(this.logIdSetKey);
  4741. }
  4742. }
  4743. };
  4744. AppStorage.prototype.getValue=function (key) {
  4745. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4746. var value="";
  4747. if (osfLocalStorage) {
  4748. value=osfLocalStorage.getItem(key);
  4749. }
  4750. return value;
  4751. };
  4752. AppStorage.prototype.setValue=function (key, value) {
  4753. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4754. if (osfLocalStorage) {
  4755. osfLocalStorage.setItem(key, value);
  4756. }
  4757. };
  4758. AppStorage.prototype.remove=function (key) {
  4759. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4760. if (osfLocalStorage) {
  4761. try {
  4762. osfLocalStorage.removeItem(key);
  4763. }
  4764. catch (ex) {
  4765. }
  4766. }
  4767. };
  4768. return AppStorage;
  4769. })();
  4770. var AppLogger=(function () {
  4771. function AppLogger() {
  4772. }
  4773. AppLogger.prototype.LogData=function (data) {
  4774. if (!OSF.Logger) {
  4775. return;
  4776. }
  4777. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  4778. };
  4779. AppLogger.prototype.LogRawData=function (log) {
  4780. if (!OSF.Logger) {
  4781. return;
  4782. }
  4783. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  4784. };
  4785. return AppLogger;
  4786. })();
  4787. function initialize(context) {
  4788. if (!OSF.Logger) {
  4789. return;
  4790. }
  4791. if (appInfo) {
  4792. return;
  4793. }
  4794. appInfo=new AppInfo();
  4795. if (context.get_hostFullVersion()) {
  4796. appInfo.hostVersion=context.get_hostFullVersion();
  4797. }
  4798. else {
  4799. appInfo.hostVersion=context.get_appVersion();
  4800. }
  4801. appInfo.appId=context.get_id();
  4802. appInfo.host=context.get_appName();
  4803. appInfo.browser=window.navigator.userAgent;
  4804. appInfo.correlationId=context.get_correlationId();
  4805. appInfo.clientId=(new AppStorage()).getClientId();
  4806. appInfo.appInstanceId=context.get_appInstanceId();
  4807. if (appInfo.appInstanceId) {
  4808. appInfo.appInstanceId=appInfo.appInstanceId.replace(/[{}]/g, "").toLowerCase();
  4809. }
  4810. appInfo.message=context.get_hostCustomMessage();
  4811. appInfo.officeJSVersion=OSF.ConstantNames.FileVersion;
  4812. appInfo.hostJSVersion="16.0.7526.1000";
  4813. var docUrl=context.get_docUrl();
  4814. appInfo.docUrl=omexDomainRegex.test(docUrl) ? docUrl : "";
  4815. var url=location.href;
  4816. if (url) {
  4817. url=url.split("?")[0].split("#")[0];
  4818. }
  4819. appInfo.appURL=url;
  4820. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  4821. var xmlContent;
  4822. var parser;
  4823. var xmlDoc;
  4824. appInfo.assetId="";
  4825. appInfo.userId="";
  4826. try {
  4827. xmlContent=decodeURIComponent(token);
  4828. parser=new DOMParser();
  4829. xmlDoc=parser.parseFromString(xmlContent, "text/xml");
  4830. var cidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid");
  4831. var oidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("oid");
  4832. if (cidNode && cidNode.nodeValue) {
  4833. appInfo.userId=cidNode.nodeValue;
  4834. }
  4835. else if (oidNode && oidNode.nodeValue) {
  4836. appInfo.userId=oidNode.nodeValue;
  4837. }
  4838. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  4839. }
  4840. catch (e) {
  4841. }
  4842. finally {
  4843. xmlContent=null;
  4844. xmlDoc=null;
  4845. parser=null;
  4846. }
  4847. })(context.get_eToken(), appInfo);
  4848. (function handleLifecycle() {
  4849. var startTime=new Date();
  4850. var lastFocus=null;
  4851. var focusTime=0;
  4852. var finished=false;
  4853. var adjustFocusTime=function () {
  4854. if (document.hasFocus()) {
  4855. if (lastFocus==null) {
  4856. lastFocus=new Date();
  4857. }
  4858. }
  4859. else if (lastFocus) {
  4860. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  4861. lastFocus=null;
  4862. }
  4863. };
  4864. var eventList=[];
  4865. eventList.push(new Event("focus", adjustFocusTime));
  4866. eventList.push(new Event("blur", adjustFocusTime));
  4867. eventList.push(new Event("focusout", adjustFocusTime));
  4868. eventList.push(new Event("focusin", adjustFocusTime));
  4869. var exitFunction=function () {
  4870. for (var i=0; i < eventList.length; i++) {
  4871. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  4872. }
  4873. eventList.length=0;
  4874. if (!finished) {
  4875. if (document.hasFocus() && lastFocus) {
  4876. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  4877. lastFocus=null;
  4878. }
  4879. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  4880. finished=true;
  4881. }
  4882. };
  4883. eventList.push(new Event("beforeunload", exitFunction));
  4884. eventList.push(new Event("unload", exitFunction));
  4885. for (var i=0; i < eventList.length; i++) {
  4886. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  4887. }
  4888. adjustFocusTime();
  4889. })();
  4890. OSFAppTelemetry.onAppActivated();
  4891. }
  4892. OSFAppTelemetry.initialize=initialize;
  4893. function onAppActivated() {
  4894. if (!appInfo) {
  4895. return;
  4896. }
  4897. (new AppStorage()).enumerateLog(function (id, log) { return (new AppLogger()).LogRawData(log); }, true);
  4898. var data=new OSFLog.AppActivatedUsageData();
  4899. data.SessionId=sessionId;
  4900. data.AppId=appInfo.appId;
  4901. data.AssetId=appInfo.assetId;
  4902. data.AppURL=appInfo.appURL;
  4903. data.UserId=appInfo.userId;
  4904. data.ClientId=appInfo.clientId;
  4905. data.Browser=appInfo.browser;
  4906. data.Host=appInfo.host;
  4907. data.HostVersion=appInfo.hostVersion;
  4908. data.CorrelationId=appInfo.correlationId;
  4909. data.AppSizeWidth=window.innerWidth;
  4910. data.AppSizeHeight=window.innerHeight;
  4911. data.AppInstanceId=appInfo.appInstanceId;
  4912. data.Message=appInfo.message;
  4913. data.DocUrl=appInfo.docUrl;
  4914. data.OfficeJSVersion=appInfo.officeJSVersion;
  4915. data.HostJSVersion=appInfo.hostJSVersion;
  4916. (new AppLogger()).LogData(data);
  4917. setTimeout(function () {
  4918. if (!OSF.Logger) {
  4919. return;
  4920. }
  4921. OSF.Logger.allowUploadingData();
  4922. }, 100);
  4923. }
  4924. OSFAppTelemetry.onAppActivated=onAppActivated;
  4925. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  4926. var data=new OSFLog.ScriptLoadUsageData();
  4927. data.CorrelationId=appCorrelationId;
  4928. data.SessionId=sessionId;
  4929. data.ScriptId=scriptId;
  4930. data.StartTime=msStartTime;
  4931. data.ResponseTime=msResponseTime;
  4932. (new AppLogger()).LogData(data);
  4933. }
  4934. OSFAppTelemetry.onScriptDone=onScriptDone;
  4935. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  4936. if (!appInfo) {
  4937. return;
  4938. }
  4939. var data=new OSFLog.APIUsageUsageData();
  4940. data.CorrelationId=osfControlAppCorrelationId;
  4941. data.SessionId=sessionId;
  4942. data.APIType=apiType;
  4943. data.APIID=id;
  4944. data.Parameters=parameters;
  4945. data.ResponseTime=msResponseTime;
  4946. data.ErrorType=errorType;
  4947. (new AppLogger()).LogData(data);
  4948. }
  4949. OSFAppTelemetry.onCallDone=onCallDone;
  4950. ;
  4951. function onMethodDone(id, args, msResponseTime, errorType) {
  4952. var parameters=null;
  4953. if (args) {
  4954. if (typeof args=="number") {
  4955. parameters=String(args);
  4956. }
  4957. else if (typeof args==="object") {
  4958. for (var index in args) {
  4959. if (parameters !==null) {
  4960. parameters+=",";
  4961. }
  4962. else {
  4963. parameters="";
  4964. }
  4965. if (typeof args[index]=="number") {
  4966. parameters+=String(args[index]);
  4967. }
  4968. }
  4969. }
  4970. else {
  4971. parameters="";
  4972. }
  4973. }
  4974. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  4975. }
  4976. OSFAppTelemetry.onMethodDone=onMethodDone;
  4977. function onPropertyDone(propertyName, msResponseTime) {
  4978. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  4979. }
  4980. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  4981. function onEventDone(id, errorType) {
  4982. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  4983. }
  4984. OSFAppTelemetry.onEventDone=onEventDone;
  4985. function onRegisterDone(register, id, msResponseTime, errorType) {
  4986. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  4987. }
  4988. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  4989. function onAppClosed(openTime, focusTime) {
  4990. if (!appInfo) {
  4991. return;
  4992. }
  4993. var data=new OSFLog.AppClosedUsageData();
  4994. data.CorrelationId=osfControlAppCorrelationId;
  4995. data.SessionId=sessionId;
  4996. data.FocusTime=focusTime;
  4997. data.OpenTime=openTime;
  4998. data.AppSizeFinalWidth=window.innerWidth;
  4999. data.AppSizeFinalHeight=window.innerHeight;
  5000. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  5001. }
  5002. OSFAppTelemetry.onAppClosed=onAppClosed;
  5003. function setOsfControlAppCorrelationId(correlationId) {
  5004. osfControlAppCorrelationId=correlationId;
  5005. }
  5006. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  5007. function doAppInitializationLogging(isException, message) {
  5008. var data=new OSFLog.AppInitializationUsageData();
  5009. data.CorrelationId=osfControlAppCorrelationId;
  5010. data.SessionId=sessionId;
  5011. data.SuccessCode=isException ? 1 : 0;
  5012. data.Message=message;
  5013. (new AppLogger()).LogData(data);
  5014. }
  5015. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  5016. function logAppCommonMessage(message) {
  5017. doAppInitializationLogging(false, message);
  5018. }
  5019. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  5020. function logAppException(errorMessage) {
  5021. doAppInitializationLogging(true, errorMessage);
  5022. }
  5023. OSFAppTelemetry.logAppException=logAppException;
  5024. OSF.AppTelemetry=OSFAppTelemetry;
  5025. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  5026. Microsoft.Office.WebExtension.EventType={};
  5027. OSF.EventDispatch=function OSF_EventDispatch(eventTypes) {
  5028. this._eventHandlers={};
  5029. this._queuedEventsArgs={};
  5030. for (var entry in eventTypes) {
  5031. var eventType=eventTypes[entry];
  5032. this._eventHandlers[eventType]=[];
  5033. this._queuedEventsArgs[eventType]=[];
  5034. }
  5035. };
  5036. OSF.EventDispatch.prototype={
  5037. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  5038. var events=[];
  5039. for (var eventName in this._eventHandlers)
  5040. events.push(eventName);
  5041. return events;
  5042. },
  5043. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  5044. var isSupported=false;
  5045. for (var eventName in this._eventHandlers) {
  5046. if (event==eventName) {
  5047. isSupported=true;
  5048. break;
  5049. }
  5050. }
  5051. return isSupported;
  5052. },
  5053. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  5054. var handlers=this._eventHandlers[eventType];
  5055. if (handlers && handlers.length > 0) {
  5056. for (var h in handlers) {
  5057. if (handlers[h]===handler)
  5058. return true;
  5059. }
  5060. }
  5061. return false;
  5062. },
  5063. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  5064. if (typeof handler !="function") {
  5065. return false;
  5066. }
  5067. var handlers=this._eventHandlers[eventType];
  5068. if (handlers && !this.hasEventHandler(eventType, handler)) {
  5069. handlers.push(handler);
  5070. return true;
  5071. }
  5072. else {
  5073. return false;
  5074. }
  5075. },
  5076. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler) {
  5077. var handlers=this._eventHandlers[eventType];
  5078. var isFirstHandler=handlers.length==0;
  5079. var succeed=this.addEventHandler(eventType, handler);
  5080. if (isFirstHandler && succeed) {
  5081. this.fireQueuedEvent(eventType);
  5082. }
  5083. return succeed;
  5084. },
  5085. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  5086. var handlers=this._eventHandlers[eventType];
  5087. if (handlers && handlers.length > 0) {
  5088. for (var index=0; index < handlers.length; index++) {
  5089. if (handlers[index]===handler) {
  5090. handlers.splice(index, 1);
  5091. return true;
  5092. }
  5093. }
  5094. }
  5095. return false;
  5096. },
  5097. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  5098. if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) {
  5099. this._eventHandlers[eventType]=[];
  5100. return true;
  5101. }
  5102. return false;
  5103. },
  5104. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  5105. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1;
  5106. },
  5107. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  5108. if (eventArgs.type==undefined)
  5109. return false;
  5110. var eventType=eventArgs.type;
  5111. if (eventType && this._eventHandlers[eventType]) {
  5112. var eventHandlers=this._eventHandlers[eventType];
  5113. for (var handler in eventHandlers)
  5114. eventHandlers[handler](eventArgs);
  5115. return true;
  5116. }
  5117. else {
  5118. return false;
  5119. }
  5120. },
  5121. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs) {
  5122. var eventType=eventArgs.type;
  5123. if (eventType && this._eventHandlers[eventType]) {
  5124. var eventHandlers=this._eventHandlers[eventType];
  5125. var queuedEvents=this._queuedEventsArgs[eventType];
  5126. if (eventHandlers.length==0) {
  5127. queuedEvents.push(eventArgs);
  5128. }
  5129. else {
  5130. this.fireEvent(eventArgs);
  5131. }
  5132. return true;
  5133. }
  5134. else {
  5135. return false;
  5136. }
  5137. },
  5138. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType) {
  5139. if (eventType && this._eventHandlers[eventType]) {
  5140. var eventHandlers=this._eventHandlers[eventType];
  5141. var queuedEvents=this._queuedEventsArgs[eventType];
  5142. if (eventHandlers.length > 0) {
  5143. var eventHandler=eventHandlers[0];
  5144. while (queuedEvents.length > 0) {
  5145. var eventArgs=queuedEvents.shift();
  5146. eventHandler(eventArgs);
  5147. }
  5148. return true;
  5149. }
  5150. }
  5151. return false;
  5152. }
  5153. };
  5154. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5155. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  5156. var args;
  5157. switch (eventType) {
  5158. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  5159. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  5160. break;
  5161. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  5162. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  5163. break;
  5164. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  5165. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  5166. break;
  5167. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  5168. args=new OSF.DDA.SettingsChangedEventArgs(target);
  5169. break;
  5170. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  5171. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  5172. break;
  5173. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  5174. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  5175. break;
  5176. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  5177. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  5178. break;
  5179. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  5180. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  5181. break;
  5182. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  5183. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5184. break;
  5185. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  5186. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5187. break;
  5188. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  5189. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5190. break;
  5191. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  5192. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  5193. break;
  5194. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  5195. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  5196. break;
  5197. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  5198. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  5199. break;
  5200. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  5201. args=new OSF.DDA.DialogEventArgs(eventProperties);
  5202. break;
  5203. case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:
  5204. args=new OSF.DDA.DialogParentEventArgs(eventProperties);
  5205. break;
  5206. case Microsoft.Office.WebExtension.EventType.ItemChanged:
  5207. if (OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlook" || OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlookwebapp") {
  5208. args=new OSF.DDA.OlkItemSelectedChangedEventArgs(eventProperties);
  5209. target.initialize(args["initialData"]);
  5210. target.setCurrentItemNumber(args["itemNumber"].itemNumber);
  5211. }
  5212. else {
  5213. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5214. }
  5215. break;
  5216. default:
  5217. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5218. }
  5219. return args;
  5220. };
  5221. OSF.DDA.AsyncMethodNames.addNames({
  5222. AddHandlerAsync: "addHandlerAsync",
  5223. RemoveHandlerAsync: "removeHandlerAsync"
  5224. });
  5225. OSF.DDA.AsyncMethodCalls.define({
  5226. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  5227. requiredArguments: [{
  5228. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5229. "enum": Microsoft.Office.WebExtension.EventType,
  5230. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5231. },
  5232. {
  5233. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5234. "types": ["function"]
  5235. }
  5236. ],
  5237. supportedOptions: [],
  5238. privateStateCallbacks: []
  5239. });
  5240. OSF.DDA.AsyncMethodCalls.define({
  5241. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  5242. requiredArguments: [
  5243. {
  5244. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5245. "enum": Microsoft.Office.WebExtension.EventType,
  5246. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5247. }
  5248. ],
  5249. supportedOptions: [
  5250. {
  5251. name: Microsoft.Office.WebExtension.Parameters.Handler,
  5252. value: {
  5253. "types": ["function", "object"],
  5254. "defaultValue": null
  5255. }
  5256. }
  5257. ],
  5258. privateStateCallbacks: []
  5259. });
  5260. OSF.DialogShownStatus={ hasDialogShown: false, isWindowDialog: false };
  5261. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  5262. DialogMessageReceivedEvent: "DialogMessageReceivedEvent"
  5263. });
  5264. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5265. DialogMessageReceived: "dialogMessageReceived",
  5266. DialogEventReceived: "dialogEventReceived"
  5267. });
  5268. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5269. MessageType: "messageType",
  5270. MessageContent: "messageContent"
  5271. });
  5272. OSF.DDA.DialogEventType={};
  5273. OSF.OUtil.augmentList(OSF.DDA.DialogEventType, {
  5274. DialogClosed: "dialogClosed",
  5275. NavigationFailed: "naviationFailed"
  5276. });
  5277. OSF.DDA.AsyncMethodNames.addNames({
  5278. DisplayDialogAsync: "displayDialogAsync",
  5279. CloseAsync: "close"
  5280. });
  5281. OSF.DDA.SyncMethodNames.addNames({
  5282. MessageParent: "messageParent",
  5283. AddMessageHandler: "addEventHandler",
  5284. SendMessage: "sendMessage"
  5285. });
  5286. OSF.DDA.UI.ParentUI=function OSF_DDA_ParentUI() {
  5287. var eventDispatch=new OSF.EventDispatch([
  5288. Microsoft.Office.WebExtension.EventType.DialogMessageReceived,
  5289. Microsoft.Office.WebExtension.EventType.DialogEventReceived,
  5290. Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  5291. ]);
  5292. var openDialogName=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  5293. var target=this;
  5294. if (!target[openDialogName]) {
  5295. OSF.OUtil.defineEnumerableProperty(target, openDialogName, {
  5296. value: function () {
  5297. var openDialog=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  5298. openDialog(arguments, eventDispatch, target);
  5299. }
  5300. });
  5301. }
  5302. OSF.OUtil.finalizeProperties(this);
  5303. };
  5304. OSF.DDA.UI.ChildUI=function OSF_DDA_ChildUI() {
  5305. var messageParentName=OSF.DDA.SyncMethodNames.MessageParent.displayName;
  5306. var target=this;
  5307. if (!target[messageParentName]) {
  5308. OSF.OUtil.defineEnumerableProperty(target, messageParentName, {
  5309. value: function () {
  5310. var messageParent=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  5311. return messageParent(arguments, target);
  5312. }
  5313. });
  5314. }
  5315. var addEventHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5316. if (!target[addEventHandler] && typeof OSF.DialogParentMessageEventDispatch !="undefined") {
  5317. OSF.DDA.DispIdHost.addEventSupport(target, OSF.DialogParentMessageEventDispatch);
  5318. }
  5319. OSF.OUtil.finalizeProperties(this);
  5320. };
  5321. OSF.DialogHandler=function OSF_DialogHandler() { };
  5322. OSF.DDA.DialogEventArgs=function OSF_DDA_DialogEventArgs(message) {
  5323. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived) {
  5324. OSF.OUtil.defineEnumerableProperties(this, {
  5325. "type": {
  5326. value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived
  5327. },
  5328. "message": {
  5329. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5330. }
  5331. });
  5332. }
  5333. else {
  5334. OSF.OUtil.defineEnumerableProperties(this, {
  5335. "type": {
  5336. value: Microsoft.Office.WebExtension.EventType.DialogEventReceived
  5337. },
  5338. "error": {
  5339. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5340. }
  5341. });
  5342. }
  5343. };
  5344. OSF.DDA.DialogParentEventArgs=function OSF_DDA_DialogParentEventArgs(message) {
  5345. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogParentMessageReceived) {
  5346. OSF.OUtil.defineEnumerableProperties(this, {
  5347. "type": {
  5348. value: Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  5349. },
  5350. "message": {
  5351. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5352. }
  5353. });
  5354. }
  5355. else {
  5356. OSF.OUtil.defineEnumerableProperties(this, {
  5357. "type": {
  5358. value: Microsoft.Office.WebExtension.EventType.DialogParentEventReceived
  5359. },
  5360. "error": {
  5361. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5362. }
  5363. });
  5364. }
  5365. };
  5366. OSF.DDA.AsyncMethodCalls.define({
  5367. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  5368. requiredArguments: [
  5369. {
  5370. "name": Microsoft.Office.WebExtension.Parameters.Url,
  5371. "types": ["string"]
  5372. }
  5373. ],
  5374. supportedOptions: [
  5375. {
  5376. name: Microsoft.Office.WebExtension.Parameters.Width,
  5377. value: {
  5378. "types": ["number"],
  5379. "defaultValue": 99
  5380. }
  5381. },
  5382. {
  5383. name: Microsoft.Office.WebExtension.Parameters.Height,
  5384. value: {
  5385. "types": ["number"],
  5386. "defaultValue": 99
  5387. }
  5388. },
  5389. {
  5390. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  5391. value: {
  5392. "types": ["boolean"],
  5393. "defaultValue": true
  5394. }
  5395. },
  5396. {
  5397. name: Microsoft.Office.WebExtension.Parameters.DisplayInIframe,
  5398. value: {
  5399. "types": ["boolean"],
  5400. "defaultValue": false
  5401. }
  5402. }
  5403. ],
  5404. privateStateCallbacks: [],
  5405. onSucceeded: function (args, caller, callArgs) {
  5406. var targetId=args[Microsoft.Office.WebExtension.Parameters.Id];
  5407. var eventDispatch=args[Microsoft.Office.WebExtension.Parameters.Data];
  5408. var dialog=new OSF.DialogHandler();
  5409. var closeDialog=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  5410. OSF.OUtil.defineEnumerableProperty(dialog, closeDialog, {
  5411. value: function () {
  5412. var closeDialogfunction=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  5413. closeDialogfunction(arguments, targetId, eventDispatch, dialog);
  5414. }
  5415. });
  5416. var addHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5417. OSF.OUtil.defineEnumerableProperty(dialog, addHandler, {
  5418. value: function () {
  5419. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  5420. var callArgs=syncMethodCall.verifyAndExtractCall(arguments, dialog, eventDispatch);
  5421. var eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  5422. var handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  5423. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType, handler);
  5424. }
  5425. });
  5426. var sendMessage=OSF.DDA.SyncMethodNames.SendMessage.displayName;
  5427. OSF.OUtil.defineEnumerableProperty(dialog, sendMessage, {
  5428. value: function () {
  5429. var execute=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.SendMessage];
  5430. return execute(arguments, eventDispatch, dialog);
  5431. }
  5432. });
  5433. return dialog;
  5434. },
  5435. checkCallArgs: function (callArgs, caller, stateInfo) {
  5436. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] <=0) {
  5437. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=1;
  5438. }
  5439. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100) {
  5440. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=99;
  5441. }
  5442. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] <=0) {
  5443. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=1;
  5444. }
  5445. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100) {
  5446. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=99;
  5447. }
  5448. if (!callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]) {
  5449. callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=true;
  5450. }
  5451. return callArgs;
  5452. }
  5453. });
  5454. OSF.DDA.AsyncMethodCalls.define({
  5455. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  5456. requiredArguments: [],
  5457. supportedOptions: [],
  5458. privateStateCallbacks: []
  5459. });
  5460. OSF.DDA.SyncMethodCalls.define({
  5461. method: OSF.DDA.SyncMethodNames.MessageParent,
  5462. requiredArguments: [
  5463. {
  5464. "name": Microsoft.Office.WebExtension.Parameters.MessageToParent,
  5465. "types": ["string", "number", "boolean"]
  5466. }
  5467. ],
  5468. supportedOptions: []
  5469. });
  5470. OSF.DDA.SyncMethodCalls.define({
  5471. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  5472. requiredArguments: [
  5473. {
  5474. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5475. "enum": Microsoft.Office.WebExtension.EventType,
  5476. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5477. },
  5478. {
  5479. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5480. "types": ["function"]
  5481. }
  5482. ],
  5483. supportedOptions: []
  5484. });
  5485. OSF.DDA.SyncMethodCalls.define({
  5486. method: OSF.DDA.SyncMethodNames.SendMessage,
  5487. requiredArguments: [
  5488. {
  5489. "name": Microsoft.Office.WebExtension.Parameters.MessageContent,
  5490. "types": ["string"]
  5491. }
  5492. ],
  5493. supportedOptions: [],
  5494. privateStateCallbacks: []
  5495. });
  5496. OSF.DDA.SafeArray.Delegate.openDialog=function OSF_DDA_SafeArray_Delegate$OpenDialog(args) {
  5497. try {
  5498. if (args.onCalling) {
  5499. args.onCalling();
  5500. }
  5501. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  5502. OSF.ClientHostController.openDialog(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  5503. if (args.onEvent) {
  5504. args.onEvent(payload);
  5505. }
  5506. if (OSF.AppTelemetry) {
  5507. OSF.AppTelemetry.onEventDone(args.dispId);
  5508. }
  5509. }, callback);
  5510. }
  5511. catch (ex) {
  5512. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5513. }
  5514. };
  5515. OSF.DDA.SafeArray.Delegate.closeDialog=function OSF_DDA_SafeArray_Delegate$CloseDialog(args) {
  5516. if (args.onCalling) {
  5517. args.onCalling();
  5518. }
  5519. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  5520. try {
  5521. OSF.ClientHostController.closeDialog(args.dispId, args.targetId, callback);
  5522. }
  5523. catch (ex) {
  5524. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5525. }
  5526. };
  5527. OSF.DDA.SafeArray.Delegate.messageParent=function OSF_DDA_SafeArray_Delegate$MessageParent(args) {
  5528. try {
  5529. if (args.onCalling) {
  5530. args.onCalling();
  5531. }
  5532. var startTime=(new Date()).getTime();
  5533. var result=OSF.ClientHostController.messageParent(args.hostCallArgs);
  5534. if (args.onReceiving) {
  5535. args.onReceiving();
  5536. }
  5537. if (OSF.AppTelemetry) {
  5538. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), result);
  5539. }
  5540. return result;
  5541. }
  5542. catch (ex) {
  5543. return OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod(ex);
  5544. }
  5545. };
  5546. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5547. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  5548. fromHost: [
  5549. { name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5550. ],
  5551. isComplexType: true
  5552. });
  5553. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5554. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  5555. fromHost: [
  5556. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5557. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5558. ],
  5559. isComplexType: true
  5560. });
  5561. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5562. type: OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,
  5563. fromHost: [
  5564. { name: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5565. ],
  5566. isComplexType: true
  5567. });
  5568. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5569. type: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,
  5570. fromHost: [
  5571. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5572. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5573. ],
  5574. isComplexType: true
  5575. });
  5576. Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) {
  5577. function fixData(data) {
  5578. if (data==null || data==undefined) {
  5579. return null;
  5580. }
  5581. try {
  5582. for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  5583. data=[data];
  5584. }
  5585. return data;
  5586. }
  5587. catch (ex) {
  5588. }
  5589. }
  5590. ;
  5591. OSF.OUtil.defineEnumerableProperties(this, {
  5592. "headers": {
  5593. get: function () { return headers; },
  5594. set: function (value) {
  5595. headers=fixData(value);
  5596. }
  5597. },
  5598. "rows": {
  5599. get: function () { return rows; },
  5600. set: function (value) {
  5601. rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ?
  5602. [] :
  5603. fixData(value);
  5604. }
  5605. }
  5606. });
  5607. this.headers=headers;
  5608. this.rows=rows;
  5609. };
  5610. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5611. OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  5612. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  5613. };
  5614. Microsoft.Office.WebExtension.CoercionType={
  5615. Text: "text",
  5616. Matrix: "matrix",
  5617. Table: "table"
  5618. };
  5619. OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() {
  5620. return {
  5621. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  5622. if (OSF.OUtil.isArray(obj)) {
  5623. var dim=0;
  5624. for (var index=0; index < obj.length; index++) {
  5625. dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  5626. }
  5627. return dim+1;
  5628. }
  5629. else {
  5630. return 0;
  5631. }
  5632. },
  5633. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  5634. switch (bindingType) {
  5635. case Microsoft.Office.WebExtension.BindingType.Matrix: return Microsoft.Office.WebExtension.CoercionType.Matrix;
  5636. case Microsoft.Office.WebExtension.BindingType.Table: return Microsoft.Office.WebExtension.CoercionType.Table;
  5637. case Microsoft.Office.WebExtension.BindingType.Text:
  5638. default:
  5639. return Microsoft.Office.WebExtension.CoercionType.Text;
  5640. }
  5641. },
  5642. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  5643. switch (coercionType) {
  5644. case Microsoft.Office.WebExtension.CoercionType.Matrix: return Microsoft.Office.WebExtension.BindingType.Matrix;
  5645. case Microsoft.Office.WebExtension.CoercionType.Table: return Microsoft.Office.WebExtension.BindingType.Table;
  5646. case Microsoft.Office.WebExtension.CoercionType.Text:
  5647. case Microsoft.Office.WebExtension.CoercionType.Html:
  5648. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5649. default:
  5650. return Microsoft.Office.WebExtension.BindingType.Text;
  5651. }
  5652. },
  5653. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  5654. if (data==null || data==undefined)
  5655. return null;
  5656. var sourceType=null;
  5657. var runtimeType=typeof data;
  5658. if (data.rows !==undefined) {
  5659. sourceType=Microsoft.Office.WebExtension.CoercionType.Table;
  5660. }
  5661. else if (OSF.OUtil.isArray(data)) {
  5662. sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix;
  5663. }
  5664. else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) {
  5665. sourceType=Microsoft.Office.WebExtension.CoercionType.Text;
  5666. }
  5667. else {
  5668. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  5669. }
  5670. return sourceType;
  5671. },
  5672. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  5673. sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  5674. if (sourceType && sourceType !=destinationType) {
  5675. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  5676. data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  5677. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  5678. }
  5679. return data;
  5680. },
  5681. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  5682. if (matrix.length==1 && matrix[0].length==1)
  5683. return ""+matrix[0][0];
  5684. var val="";
  5685. for (var i=0; i < matrix.length; i++) {
  5686. val+=matrix[i].join("\t")+"\n";
  5687. }
  5688. return val.substring(0, val.length - 1);
  5689. },
  5690. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  5691. var ret=text.split("\n");
  5692. for (var i=0; i < ret.length; i++)
  5693. ret[i]=ret[i].split("\t");
  5694. return ret;
  5695. },
  5696. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  5697. var headers="";
  5698. if (table.headers !=null) {
  5699. headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n";
  5700. }
  5701. var rows=OSF.DDA.DataCoercion._matrixToText(table.rows);
  5702. if (rows=="") {
  5703. headers=headers.substring(0, headers.length - 1);
  5704. }
  5705. return headers+rows;
  5706. },
  5707. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  5708. var matrix=table.rows;
  5709. if (table.headers !=null) {
  5710. matrix.unshift(table.headers);
  5711. }
  5712. return matrix;
  5713. },
  5714. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  5715. var value;
  5716. switch (coercionType) {
  5717. case Microsoft.Office.WebExtension.CoercionType.Table:
  5718. value=table;
  5719. break;
  5720. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5721. value=OSF.DDA.DataCoercion._tableToMatrix(table);
  5722. break;
  5723. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  5724. value=null;
  5725. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  5726. value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  5727. }
  5728. if (value==null) {
  5729. value=OSF.DDA.DataCoercion._tableToText(table);
  5730. }
  5731. break;
  5732. case Microsoft.Office.WebExtension.CoercionType.Text:
  5733. case Microsoft.Office.WebExtension.CoercionType.Html:
  5734. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5735. default:
  5736. value=OSF.DDA.DataCoercion._tableToText(table);
  5737. break;
  5738. }
  5739. return value;
  5740. },
  5741. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  5742. if (sourceType==undefined) {
  5743. sourceType=OSF.DDA.DataCoercion.determineCoercionType(data);
  5744. }
  5745. var value;
  5746. switch (sourceType) {
  5747. case Microsoft.Office.WebExtension.CoercionType.Table:
  5748. value=data;
  5749. break;
  5750. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5751. value=new Microsoft.Office.WebExtension.TableData(data);
  5752. break;
  5753. case Microsoft.Office.WebExtension.CoercionType.Text:
  5754. case Microsoft.Office.WebExtension.CoercionType.Html:
  5755. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5756. default:
  5757. value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  5758. break;
  5759. }
  5760. return value;
  5761. }
  5762. };
  5763. })();
  5764. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5765. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5766. toHost: [
  5767. { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 },
  5768. { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 },
  5769. { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 }
  5770. ]
  5771. });
  5772. OSF.DDA.AsyncMethodNames.addNames({
  5773. GetSelectedDataAsync: "getSelectedDataAsync",
  5774. SetSelectedDataAsync: "setSelectedDataAsync"
  5775. });
  5776. (function () {
  5777. function processData(dataDescriptor, caller, callArgs) {
  5778. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  5779. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  5780. data=OSF.DDA.OMFactory.manufactureTableData(data);
  5781. }
  5782. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  5783. return data==undefined ? null : data;
  5784. }
  5785. OSF.DDA.AsyncMethodCalls.define({
  5786. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  5787. requiredArguments: [
  5788. {
  5789. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  5790. "enum": Microsoft.Office.WebExtension.CoercionType
  5791. }
  5792. ],
  5793. supportedOptions: [
  5794. {
  5795. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  5796. value: {
  5797. "enum": Microsoft.Office.WebExtension.ValueFormat,
  5798. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  5799. }
  5800. },
  5801. {
  5802. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  5803. value: {
  5804. "enum": Microsoft.Office.WebExtension.FilterType,
  5805. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  5806. }
  5807. }
  5808. ],
  5809. privateStateCallbacks: [],
  5810. onSucceeded: processData
  5811. });
  5812. OSF.DDA.AsyncMethodCalls.define({
  5813. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  5814. requiredArguments: [
  5815. {
  5816. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5817. "types": ["string", "object", "number", "boolean"]
  5818. }
  5819. ],
  5820. supportedOptions: [
  5821. {
  5822. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5823. value: {
  5824. "enum": Microsoft.Office.WebExtension.CoercionType,
  5825. "calculate": function (requiredArgs) {
  5826. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  5827. }
  5828. }
  5829. },
  5830. {
  5831. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  5832. value: {
  5833. "types": ["number", "boolean"],
  5834. "defaultValue": false
  5835. }
  5836. },
  5837. {
  5838. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  5839. value: {
  5840. "types": ["number", "boolean"],
  5841. "defaultValue": false
  5842. }
  5843. },
  5844. {
  5845. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  5846. value: {
  5847. "types": ["number", "boolean"],
  5848. "defaultValue": false
  5849. }
  5850. },
  5851. {
  5852. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  5853. value: {
  5854. "types": ["number", "boolean"],
  5855. "defaultValue": false
  5856. }
  5857. }
  5858. ],
  5859. privateStateCallbacks: []
  5860. });
  5861. })();
  5862. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5863. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  5864. fromHost: [
  5865. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5866. ],
  5867. toHost: [
  5868. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5869. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 },
  5870. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 }
  5871. ]
  5872. });
  5873. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5874. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  5875. toHost: [
  5876. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5877. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  5878. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 },
  5879. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 },
  5880. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 },
  5881. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 },
  5882. ]
  5883. });
  5884. OSF.DDA.SettingsManager={
  5885. SerializedSettings: "serializedSettings",
  5886. RefreshingSettings: "refreshingSettings",
  5887. DateJSONPrefix: "Date(",
  5888. DataJSONSuffix: ")",
  5889. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  5890. var ret={};
  5891. for (var key in settingsCollection) {
  5892. var value=settingsCollection[key];
  5893. try {
  5894. if (JSON) {
  5895. value=JSON.stringify(value, function dateReplacer(k, v) {
  5896. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v;
  5897. });
  5898. }
  5899. else {
  5900. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  5901. }
  5902. ret[key]=value;
  5903. }
  5904. catch (ex) {
  5905. }
  5906. }
  5907. return ret;
  5908. },
  5909. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  5910. var ret={};
  5911. serializedSettings=serializedSettings || {};
  5912. for (var key in serializedSettings) {
  5913. var value=serializedSettings[key];
  5914. try {
  5915. if (JSON) {
  5916. value=JSON.parse(value, function dateReviver(k, v) {
  5917. var d;
  5918. if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) {
  5919. d=new Date(parseInt(v.slice(5, -1)));
  5920. if (d) {
  5921. return d;
  5922. }
  5923. }
  5924. return v;
  5925. });
  5926. }
  5927. else {
  5928. value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  5929. }
  5930. ret[key]=value;
  5931. }
  5932. catch (ex) {
  5933. }
  5934. }
  5935. return ret;
  5936. }
  5937. };
  5938. OSF.DDA.Settings=function OSF_DDA_Settings(settings) {
  5939. settings=settings || {};
  5940. var cacheSessionSettings=function (settings) {
  5941. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  5942. if (osfSessionStorage) {
  5943. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings);
  5944. var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  5945. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  5946. }
  5947. };
  5948. OSF.OUtil.defineEnumerableProperties(this, {
  5949. "get": {
  5950. value: function OSF_DDA_Settings$get(name) {
  5951. var e=Function._validateParams(arguments, [
  5952. { name: "name", type: String, mayBeNull: false }
  5953. ]);
  5954. if (e)
  5955. throw e;
  5956. var setting=settings[name];
  5957. return typeof (setting)==='undefined' ? null : setting;
  5958. }
  5959. },
  5960. "set": {
  5961. value: function OSF_DDA_Settings$set(name, value) {
  5962. var e=Function._validateParams(arguments, [
  5963. { name: "name", type: String, mayBeNull: false },
  5964. { name: "value", mayBeNull: true }
  5965. ]);
  5966. if (e)
  5967. throw e;
  5968. settings[name]=value;
  5969. cacheSessionSettings(settings);
  5970. }
  5971. },
  5972. "remove": {
  5973. value: function OSF_DDA_Settings$remove(name) {
  5974. var e=Function._validateParams(arguments, [
  5975. { name: "name", type: String, mayBeNull: false }
  5976. ]);
  5977. if (e)
  5978. throw e;
  5979. delete settings[name];
  5980. cacheSessionSettings(settings);
  5981. }
  5982. }
  5983. });
  5984. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  5985. };
  5986. OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) {
  5987. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  5988. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  5989. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  5990. };
  5991. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  5992. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5993. SettingsChanged: "settingsChanged"
  5994. });
  5995. OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  5996. OSF.OUtil.defineEnumerableProperties(this, {
  5997. "type": {
  5998. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  5999. },
  6000. "settings": {
  6001. value: settingsInstance
  6002. }
  6003. });
  6004. };
  6005. OSF.DDA.AsyncMethodNames.addNames({
  6006. RefreshAsync: "refreshAsync",
  6007. SaveAsync: "saveAsync"
  6008. });
  6009. OSF.DDA.AsyncMethodCalls.define({
  6010. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  6011. requiredArguments: [],
  6012. supportedOptions: [],
  6013. privateStateCallbacks: [
  6014. {
  6015. name: OSF.DDA.SettingsManager.RefreshingSettings,
  6016. value: function getRefreshingSettings(settingsInstance, settingsCollection) {
  6017. return settingsCollection;
  6018. }
  6019. }
  6020. ],
  6021. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings, refreshingSettingsArgs) {
  6022. var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  6023. var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  6024. var oldSettings=refreshingSettingsArgs[OSF.DDA.SettingsManager.RefreshingSettings];
  6025. for (var setting in oldSettings) {
  6026. refreshingSettings.remove(setting);
  6027. }
  6028. for (var setting in newSettings) {
  6029. refreshingSettings.set(setting, newSettings[setting]);
  6030. }
  6031. return refreshingSettings;
  6032. }
  6033. });
  6034. OSF.DDA.AsyncMethodCalls.define({
  6035. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  6036. requiredArguments: [],
  6037. supportedOptions: [
  6038. {
  6039. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  6040. value: {
  6041. "types": ["boolean"],
  6042. "defaultValue": true
  6043. }
  6044. }
  6045. ],
  6046. privateStateCallbacks: [
  6047. {
  6048. name: OSF.DDA.SettingsManager.SerializedSettings,
  6049. value: function serializeSettings(settingsInstance, settingsCollection) {
  6050. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  6051. }
  6052. }
  6053. ]
  6054. });
  6055. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6056. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  6057. fromHost: [
  6058. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6059. ]
  6060. });
  6061. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6062. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  6063. toHost: [
  6064. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings },
  6065. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale }
  6066. ]
  6067. });
  6068. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  6069. Microsoft.Office.WebExtension.BindingType={
  6070. Table: "table",
  6071. Text: "text",
  6072. Matrix: "matrix"
  6073. };
  6074. OSF.DDA.BindingProperties={
  6075. Id: "BindingId",
  6076. Type: Microsoft.Office.WebExtension.Parameters.BindingType
  6077. };
  6078. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" });
  6079. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  6080. Subset: "subset",
  6081. BindingProperties: "BindingProperties"
  6082. });
  6083. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties);
  6084. OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) {
  6085. this._id=bindingId;
  6086. OSF.OUtil.defineEnumerableProperty(this, "onFail", {
  6087. get: function () {
  6088. return errorCallback;
  6089. },
  6090. set: function (onError) {
  6091. var t=typeof onError;
  6092. if (t !="undefined" && t !="function") {
  6093. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t);
  6094. }
  6095. errorCallback=onError;
  6096. }
  6097. });
  6098. };
  6099. OSF.DDA.BindingPromise.prototype={
  6100. _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) {
  6101. if (this.binding) {
  6102. if (onComplete)
  6103. onComplete(this.binding);
  6104. }
  6105. else {
  6106. if (!this._binding) {
  6107. var me=this;
  6108. Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) {
  6109. if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) {
  6110. OSF.OUtil.defineEnumerableProperty(me, "binding", {
  6111. value: asyncResult.value
  6112. });
  6113. if (onComplete)
  6114. onComplete(me.binding);
  6115. }
  6116. else {
  6117. if (me.onFail)
  6118. me.onFail(asyncResult);
  6119. }
  6120. });
  6121. }
  6122. }
  6123. return this;
  6124. },
  6125. getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() {
  6126. var args=arguments;
  6127. this._fetch(function onComplete(binding) { binding.getDataAsync.apply(binding, args); });
  6128. return this;
  6129. },
  6130. setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() {
  6131. var args=arguments;
  6132. this._fetch(function onComplete(binding) { binding.setDataAsync.apply(binding, args); });
  6133. return this;
  6134. },
  6135. addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() {
  6136. var args=arguments;
  6137. this._fetch(function onComplete(binding) { binding.addHandlerAsync.apply(binding, args); });
  6138. return this;
  6139. },
  6140. removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() {
  6141. var args=arguments;
  6142. this._fetch(function onComplete(binding) { binding.removeHandlerAsync.apply(binding, args); });
  6143. return this;
  6144. }
  6145. };
  6146. OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) {
  6147. this._eventDispatches=[];
  6148. OSF.OUtil.defineEnumerableProperty(this, "document", {
  6149. value: docInstance
  6150. });
  6151. var am=OSF.DDA.AsyncMethodNames;
  6152. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6153. am.AddFromSelectionAsync,
  6154. am.AddFromNamedItemAsync,
  6155. am.GetAllAsync,
  6156. am.GetByIdAsync,
  6157. am.ReleaseByIdAsync
  6158. ]);
  6159. };
  6160. OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) {
  6161. OSF.OUtil.defineEnumerableProperties(this, {
  6162. "document": { value: docInstance },
  6163. "id": { value: id }
  6164. });
  6165. };
  6166. OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) {
  6167. OSF.OUtil.defineEnumerableProperties(this, {
  6168. "document": {
  6169. value: docInstance
  6170. },
  6171. "id": {
  6172. value: id
  6173. }
  6174. });
  6175. var am=OSF.DDA.AsyncMethodNames;
  6176. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6177. am.GetDataAsync,
  6178. am.SetDataAsync
  6179. ]);
  6180. var et=Microsoft.Office.WebExtension.EventType;
  6181. var bindingEventDispatches=docInstance.bindings._eventDispatches;
  6182. if (!bindingEventDispatches[id]) {
  6183. bindingEventDispatches[id]=new OSF.EventDispatch([
  6184. et.BindingSelectionChanged,
  6185. et.BindingDataChanged
  6186. ]);
  6187. }
  6188. var eventDispatch=bindingEventDispatches[id];
  6189. OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch);
  6190. };
  6191. OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() {
  6192. return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime();
  6193. };
  6194. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6195. OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) {
  6196. var id=bindingProperties[OSF.DDA.BindingProperties.Id];
  6197. var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount];
  6198. var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount];
  6199. var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders];
  6200. var binding;
  6201. switch (bindingProperties[OSF.DDA.BindingProperties.Type]) {
  6202. case Microsoft.Office.WebExtension.BindingType.Text:
  6203. binding=new OSF.DDA.TextBinding(id, containingDocument);
  6204. break;
  6205. case Microsoft.Office.WebExtension.BindingType.Matrix:
  6206. binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols);
  6207. break;
  6208. case Microsoft.Office.WebExtension.BindingType.Table:
  6209. var isExcelApp=function () {
  6210. return (OSF.DDA.ExcelDocument)
  6211. && (Microsoft.Office.WebExtension.context.document)
  6212. && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument);
  6213. };
  6214. var tableBindingObject;
  6215. if (isExcelApp() && OSF.DDA.ExcelTableBinding) {
  6216. tableBindingObject=OSF.DDA.ExcelTableBinding;
  6217. }
  6218. else {
  6219. tableBindingObject=OSF.DDA.TableBinding;
  6220. }
  6221. binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders);
  6222. break;
  6223. default:
  6224. binding=new OSF.DDA.UnknownBinding(id, containingDocument);
  6225. }
  6226. return binding;
  6227. };
  6228. OSF.DDA.AsyncMethodNames.addNames({
  6229. AddFromSelectionAsync: "addFromSelectionAsync",
  6230. AddFromNamedItemAsync: "addFromNamedItemAsync",
  6231. GetAllAsync: "getAllAsync",
  6232. GetByIdAsync: "getByIdAsync",
  6233. ReleaseByIdAsync: "releaseByIdAsync",
  6234. GetDataAsync: "getDataAsync",
  6235. SetDataAsync: "setDataAsync"
  6236. });
  6237. (function () {
  6238. function processBinding(bindingDescriptor) {
  6239. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  6240. }
  6241. function getObjectId(obj) { return obj.id; }
  6242. function processData(dataDescriptor, caller, callArgs) {
  6243. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6244. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6245. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6246. }
  6247. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  6248. return data==undefined ? null : data;
  6249. }
  6250. OSF.DDA.AsyncMethodCalls.define({
  6251. method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,
  6252. requiredArguments: [
  6253. {
  6254. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6255. "enum": Microsoft.Office.WebExtension.BindingType
  6256. }
  6257. ],
  6258. supportedOptions: [{
  6259. name: Microsoft.Office.WebExtension.Parameters.Id,
  6260. value: {
  6261. "types": ["string"],
  6262. "calculate": OSF.DDA.generateBindingId
  6263. }
  6264. },
  6265. {
  6266. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6267. value: {
  6268. "types": ["object"],
  6269. "defaultValue": null
  6270. }
  6271. }
  6272. ],
  6273. privateStateCallbacks: [],
  6274. onSucceeded: processBinding
  6275. });
  6276. OSF.DDA.AsyncMethodCalls.define({
  6277. method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,
  6278. requiredArguments: [{
  6279. "name": Microsoft.Office.WebExtension.Parameters.ItemName,
  6280. "types": ["string"]
  6281. },
  6282. {
  6283. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6284. "enum": Microsoft.Office.WebExtension.BindingType
  6285. }
  6286. ],
  6287. supportedOptions: [{
  6288. name: Microsoft.Office.WebExtension.Parameters.Id,
  6289. value: {
  6290. "types": ["string"],
  6291. "calculate": OSF.DDA.generateBindingId
  6292. }
  6293. },
  6294. {
  6295. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6296. value: {
  6297. "types": ["object"],
  6298. "defaultValue": null
  6299. }
  6300. }
  6301. ],
  6302. privateStateCallbacks: [
  6303. {
  6304. name: Microsoft.Office.WebExtension.Parameters.FailOnCollision,
  6305. value: function () { return true; }
  6306. }
  6307. ],
  6308. onSucceeded: processBinding
  6309. });
  6310. OSF.DDA.AsyncMethodCalls.define({
  6311. method: OSF.DDA.AsyncMethodNames.GetAllAsync,
  6312. requiredArguments: [],
  6313. supportedOptions: [],
  6314. privateStateCallbacks: [],
  6315. onSucceeded: function (response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); }
  6316. });
  6317. OSF.DDA.AsyncMethodCalls.define({
  6318. method: OSF.DDA.AsyncMethodNames.GetByIdAsync,
  6319. requiredArguments: [
  6320. {
  6321. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6322. "types": ["string"]
  6323. }
  6324. ],
  6325. supportedOptions: [],
  6326. privateStateCallbacks: [],
  6327. onSucceeded: processBinding
  6328. });
  6329. OSF.DDA.AsyncMethodCalls.define({
  6330. method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,
  6331. requiredArguments: [
  6332. {
  6333. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6334. "types": ["string"]
  6335. }
  6336. ],
  6337. supportedOptions: [],
  6338. privateStateCallbacks: [],
  6339. onSucceeded: function (response, caller, callArgs) {
  6340. var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id];
  6341. delete caller._eventDispatches[id];
  6342. }
  6343. });
  6344. OSF.DDA.AsyncMethodCalls.define({
  6345. method: OSF.DDA.AsyncMethodNames.GetDataAsync,
  6346. requiredArguments: [],
  6347. supportedOptions: [{
  6348. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6349. value: {
  6350. "enum": Microsoft.Office.WebExtension.CoercionType,
  6351. "calculate": function (requiredArgs, binding) { return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); }
  6352. }
  6353. },
  6354. {
  6355. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  6356. value: {
  6357. "enum": Microsoft.Office.WebExtension.ValueFormat,
  6358. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  6359. }
  6360. },
  6361. {
  6362. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  6363. value: {
  6364. "enum": Microsoft.Office.WebExtension.FilterType,
  6365. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  6366. }
  6367. },
  6368. {
  6369. name: Microsoft.Office.WebExtension.Parameters.Rows,
  6370. value: {
  6371. "types": ["object", "string"],
  6372. "defaultValue": null
  6373. }
  6374. },
  6375. {
  6376. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6377. value: {
  6378. "types": ["object"],
  6379. "defaultValue": null
  6380. }
  6381. },
  6382. {
  6383. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  6384. value: {
  6385. "types": ["number"],
  6386. "defaultValue": 0
  6387. }
  6388. },
  6389. {
  6390. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  6391. value: {
  6392. "types": ["number"],
  6393. "defaultValue": 0
  6394. }
  6395. },
  6396. {
  6397. name: Microsoft.Office.WebExtension.Parameters.RowCount,
  6398. value: {
  6399. "types": ["number"],
  6400. "defaultValue": 0
  6401. }
  6402. },
  6403. {
  6404. name: Microsoft.Office.WebExtension.Parameters.ColumnCount,
  6405. value: {
  6406. "types": ["number"],
  6407. "defaultValue": 0
  6408. }
  6409. }
  6410. ],
  6411. checkCallArgs: function (callArgs, caller, stateInfo) {
  6412. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  6413. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 &&
  6414. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 &&
  6415. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) {
  6416. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  6417. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  6418. delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount];
  6419. delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount];
  6420. }
  6421. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  6422. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  6423. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] ||
  6424. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] ||
  6425. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) {
  6426. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  6427. }
  6428. return callArgs;
  6429. },
  6430. privateStateCallbacks: [
  6431. {
  6432. name: Microsoft.Office.WebExtension.Parameters.Id,
  6433. value: getObjectId
  6434. }
  6435. ],
  6436. onSucceeded: processData
  6437. });
  6438. OSF.DDA.AsyncMethodCalls.define({
  6439. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  6440. requiredArguments: [
  6441. {
  6442. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6443. "types": ["string", "object", "number", "boolean"]
  6444. }
  6445. ],
  6446. supportedOptions: [{
  6447. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6448. value: {
  6449. "enum": Microsoft.Office.WebExtension.CoercionType,
  6450. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  6451. }
  6452. },
  6453. {
  6454. name: Microsoft.Office.WebExtension.Parameters.Rows,
  6455. value: {
  6456. "types": ["object", "string"],
  6457. "defaultValue": null
  6458. }
  6459. },
  6460. {
  6461. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6462. value: {
  6463. "types": ["object"],
  6464. "defaultValue": null
  6465. }
  6466. },
  6467. {
  6468. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  6469. value: {
  6470. "types": ["number"],
  6471. "defaultValue": 0
  6472. }
  6473. },
  6474. {
  6475. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  6476. value: {
  6477. "types": ["number"],
  6478. "defaultValue": 0
  6479. }
  6480. }
  6481. ],
  6482. checkCallArgs: function (callArgs, caller, stateInfo) {
  6483. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  6484. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) {
  6485. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  6486. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  6487. }
  6488. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  6489. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  6490. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) {
  6491. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  6492. }
  6493. return callArgs;
  6494. },
  6495. privateStateCallbacks: [
  6496. {
  6497. name: Microsoft.Office.WebExtension.Parameters.Id,
  6498. value: getObjectId
  6499. }
  6500. ]
  6501. });
  6502. })();
  6503. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  6504. RowCount: "BindingRowCount",
  6505. ColumnCount: "BindingColumnCount",
  6506. HasHeaders: "HasHeaders"
  6507. });
  6508. OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) {
  6509. OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance);
  6510. OSF.OUtil.defineEnumerableProperties(this, {
  6511. "type": {
  6512. value: Microsoft.Office.WebExtension.BindingType.Matrix
  6513. },
  6514. "rowCount": {
  6515. value: rows ? rows : 0
  6516. },
  6517. "columnCount": {
  6518. value: cols ? cols : 0
  6519. }
  6520. });
  6521. };
  6522. OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding);
  6523. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6524. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  6525. fromHost: [
  6526. { name: OSF.DDA.BindingProperties.Id, value: 0 },
  6527. { name: OSF.DDA.BindingProperties.Type, value: 1 },
  6528. { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 }
  6529. ],
  6530. isComplexType: true
  6531. });
  6532. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6533. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  6534. toHost: [
  6535. { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 },
  6536. { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 },
  6537. { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 }
  6538. ],
  6539. invertible: true
  6540. });
  6541. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6542. type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,
  6543. fromHost: [
  6544. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6545. ],
  6546. toHost: [
  6547. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6548. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 }
  6549. ]
  6550. });
  6551. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6552. type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,
  6553. fromHost: [
  6554. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6555. ],
  6556. toHost: [
  6557. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 },
  6558. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 },
  6559. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 },
  6560. { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 }
  6561. ]
  6562. });
  6563. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6564. type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod,
  6565. toHost: [
  6566. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6567. ]
  6568. });
  6569. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6570. type: OSF.DDA.MethodDispId.dispidGetBindingMethod,
  6571. fromHost: [
  6572. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6573. ],
  6574. toHost: [
  6575. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6576. ]
  6577. });
  6578. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6579. type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,
  6580. fromHost: [
  6581. { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6582. ]
  6583. });
  6584. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6585. type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod,
  6586. fromHost: [
  6587. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6588. ],
  6589. toHost: [
  6590. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6591. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  6592. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 },
  6593. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 },
  6594. { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 }
  6595. ]
  6596. });
  6597. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6598. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  6599. toHost: [
  6600. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6601. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  6602. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  6603. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }
  6604. ]
  6605. });
  6606. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6607. type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,
  6608. fromHost: [
  6609. { name: OSF.DDA.BindingProperties.RowCount, value: 0 },
  6610. { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 },
  6611. { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 }
  6612. ],
  6613. isComplexType: true
  6614. });
  6615. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6616. type: OSF.DDA.PropertyDescriptors.Subset,
  6617. toHost: [
  6618. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 },
  6619. { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 }
  6620. ],
  6621. canonical: true,
  6622. isComplexType: true
  6623. });
  6624. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6625. type: OSF.DDA.SafeArray.UniqueArguments.Offset,
  6626. toHost: [
  6627. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 },
  6628. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 }
  6629. ],
  6630. canonical: true,
  6631. isComplexType: true
  6632. });
  6633. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6634. type: OSF.DDA.SafeArray.UniqueArguments.Run,
  6635. toHost: [
  6636. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 },
  6637. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 }
  6638. ],
  6639. canonical: true,
  6640. isComplexType: true
  6641. });
  6642. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6643. type: OSF.DDA.MethodDispId.dispidAddRowsMethod,
  6644. toHost: [
  6645. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6646. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6647. ]
  6648. });
  6649. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6650. type: OSF.DDA.MethodDispId.dispidAddColumnsMethod,
  6651. toHost: [
  6652. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6653. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6654. ]
  6655. });
  6656. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6657. type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod,
  6658. toHost: [
  6659. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6660. ]
  6661. });
  6662. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" });
  6663. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  6664. RowCount: "BindingRowCount",
  6665. ColumnCount: "BindingColumnCount",
  6666. HasHeaders: "HasHeaders"
  6667. });
  6668. OSF.DDA.TableDataProperties={
  6669. TableRows: "TableRows",
  6670. TableHeaders: "TableHeaders"
  6671. };
  6672. OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) {
  6673. OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance);
  6674. OSF.OUtil.defineEnumerableProperties(this, {
  6675. "type": {
  6676. value: Microsoft.Office.WebExtension.BindingType.Table
  6677. },
  6678. "rowCount": {
  6679. value: rows ? rows : 0
  6680. },
  6681. "columnCount": {
  6682. value: cols ? cols : 0
  6683. },
  6684. "hasHeaders": {
  6685. value: hasHeaders ? hasHeaders : false
  6686. }
  6687. });
  6688. var am=OSF.DDA.AsyncMethodNames;
  6689. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6690. am.AddRowsAsync,
  6691. am.AddColumnsAsync,
  6692. am.DeleteAllDataValuesAsync
  6693. ]);
  6694. };
  6695. OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding);
  6696. OSF.DDA.AsyncMethodNames.addNames({
  6697. AddRowsAsync: "addRowsAsync",
  6698. AddColumnsAsync: "addColumnsAsync",
  6699. DeleteAllDataValuesAsync: "deleteAllDataValuesAsync"
  6700. });
  6701. (function () {
  6702. function getObjectId(obj) { return obj.id; }
  6703. OSF.DDA.AsyncMethodCalls.define({
  6704. method: OSF.DDA.AsyncMethodNames.AddRowsAsync,
  6705. requiredArguments: [
  6706. {
  6707. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6708. "types": ["object"]
  6709. }
  6710. ],
  6711. supportedOptions: [],
  6712. privateStateCallbacks: [
  6713. {
  6714. name: Microsoft.Office.WebExtension.Parameters.Id,
  6715. value: getObjectId
  6716. }
  6717. ]
  6718. });
  6719. OSF.DDA.AsyncMethodCalls.define({
  6720. method: OSF.DDA.AsyncMethodNames.AddColumnsAsync,
  6721. requiredArguments: [
  6722. {
  6723. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6724. "types": ["object"]
  6725. }
  6726. ],
  6727. supportedOptions: [],
  6728. privateStateCallbacks: [
  6729. {
  6730. name: Microsoft.Office.WebExtension.Parameters.Id,
  6731. value: getObjectId
  6732. }
  6733. ]
  6734. });
  6735. OSF.DDA.AsyncMethodCalls.define({
  6736. method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,
  6737. requiredArguments: [],
  6738. supportedOptions: [],
  6739. privateStateCallbacks: [
  6740. {
  6741. name: Microsoft.Office.WebExtension.Parameters.Id,
  6742. value: getObjectId
  6743. }
  6744. ]
  6745. });
  6746. })();
  6747. OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) {
  6748. OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance);
  6749. OSF.OUtil.defineEnumerableProperty(this, "type", {
  6750. value: Microsoft.Office.WebExtension.BindingType.Text
  6751. });
  6752. };
  6753. OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding);
  6754. OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" });
  6755. OSF.DDA.AsyncMethodCalls.define({
  6756. method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync,
  6757. requiredArguments: [
  6758. {
  6759. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6760. "enum": Microsoft.Office.WebExtension.BindingType
  6761. }
  6762. ],
  6763. supportedOptions: [{
  6764. name: Microsoft.Office.WebExtension.Parameters.Id,
  6765. value: {
  6766. "types": ["string"],
  6767. "calculate": OSF.DDA.generateBindingId
  6768. }
  6769. },
  6770. {
  6771. name: Microsoft.Office.WebExtension.Parameters.PromptText,
  6772. value: {
  6773. "types": ["string"],
  6774. "calculate": function () { return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; }
  6775. }
  6776. },
  6777. {
  6778. name: Microsoft.Office.WebExtension.Parameters.SampleData,
  6779. value: {
  6780. "types": ["object"],
  6781. "defaultValue": null
  6782. }
  6783. }
  6784. ],
  6785. privateStateCallbacks: [],
  6786. onSucceeded: function (bindingDescriptor) { return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); }
  6787. });
  6788. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6789. type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,
  6790. fromHost: [
  6791. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6792. ],
  6793. toHost: [
  6794. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6795. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 },
  6796. { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: 2 }
  6797. ]
  6798. });
  6799. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" });
  6800. OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) {
  6801. OSF.OUtil.defineEnumerableProperties(this, {
  6802. "type": {
  6803. value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged
  6804. },
  6805. "document": {
  6806. value: docInstance
  6807. }
  6808. });
  6809. };
  6810. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent });
  6811. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  6812. BindingSelectionChanged: "bindingSelectionChanged",
  6813. BindingDataChanged: "bindingDataChanged"
  6814. });
  6815. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" });
  6816. OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) {
  6817. OSF.OUtil.defineEnumerableProperties(this, {
  6818. "type": {
  6819. value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged
  6820. },
  6821. "binding": {
  6822. value: bindingInstance
  6823. }
  6824. });
  6825. for (var prop in subset) {
  6826. OSF.OUtil.defineEnumerableProperty(this, prop, {
  6827. value: subset[prop]
  6828. });
  6829. }
  6830. };
  6831. OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) {
  6832. OSF.OUtil.defineEnumerableProperties(this, {
  6833. "type": {
  6834. value: Microsoft.Office.WebExtension.EventType.BindingDataChanged
  6835. },
  6836. "binding": {
  6837. value: bindingInstance
  6838. }
  6839. });
  6840. };
  6841. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6842. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  6843. fromHost: [
  6844. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 },
  6845. { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 }
  6846. ],
  6847. isComplexType: true
  6848. });
  6849. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6850. type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,
  6851. fromHost: [
  6852. { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6853. ],
  6854. isComplexType: true
  6855. });
  6856. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6857. type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent,
  6858. fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  6859. });
  6860. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" });
  6861. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6862. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  6863. toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }]
  6864. });
  6865. Microsoft.Office.WebExtension.GoToType={
  6866. Binding: "binding",
  6867. NamedItem: "namedItem",
  6868. Slide: "slide",
  6869. Index: "index"
  6870. };
  6871. Microsoft.Office.WebExtension.SelectionMode={
  6872. Default: "default",
  6873. Selected: "selected",
  6874. None: "none"
  6875. };
  6876. Microsoft.Office.WebExtension.Index={
  6877. First: "first",
  6878. Last: "last",
  6879. Next: "next",
  6880. Previous: "previous"
  6881. };
  6882. OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" });
  6883. OSF.DDA.AsyncMethodCalls.define({
  6884. method: OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  6885. requiredArguments: [{
  6886. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6887. "types": ["string", "number"]
  6888. },
  6889. {
  6890. "name": Microsoft.Office.WebExtension.Parameters.GoToType,
  6891. "enum": Microsoft.Office.WebExtension.GoToType
  6892. }
  6893. ],
  6894. supportedOptions: [
  6895. {
  6896. name: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  6897. value: {
  6898. "enum": Microsoft.Office.WebExtension.SelectionMode,
  6899. "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default
  6900. }
  6901. }
  6902. ]
  6903. });
  6904. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6905. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  6906. toHost: [
  6907. { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 },
  6908. { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 },
  6909. { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 },
  6910. { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 }
  6911. ]
  6912. });
  6913. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6914. type: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  6915. toHost: [
  6916. { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 },
  6917. { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 },
  6918. { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 }
  6919. ]
  6920. });
  6921. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6922. type: OSF.DDA.MethodDispId.dispidNavigateToMethod,
  6923. toHost: [
  6924. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6925. { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 },
  6926. { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 }
  6927. ]
  6928. });
  6929. OSF.DDA.AsyncMethodNames.addNames({
  6930. ExecuteRichApiRequestAsync: "executeRichApiRequestAsync"
  6931. });
  6932. OSF.DDA.AsyncMethodCalls.define({
  6933. method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,
  6934. requiredArguments: [
  6935. {
  6936. name: Microsoft.Office.WebExtension.Parameters.Data,
  6937. types: ["object"]
  6938. }
  6939. ],
  6940. supportedOptions: []
  6941. });
  6942. OSF.OUtil.setNamespace("RichApi", OSF.DDA);
  6943. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6944. type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,
  6945. toHost: [
  6946. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }
  6947. ],
  6948. fromHost: [
  6949. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6950. ]
  6951. });
  6952. OSF.DDA.FilePropertiesDescriptor={
  6953. Url: "Url"
  6954. };
  6955. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  6956. FilePropertiesDescriptor: "FilePropertiesDescriptor"
  6957. });
  6958. Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) {
  6959. OSF.OUtil.defineEnumerableProperties(this, {
  6960. "url": {
  6961. value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url]
  6962. }
  6963. });
  6964. };
  6965. OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" });
  6966. OSF.DDA.AsyncMethodCalls.define({
  6967. method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,
  6968. fromHost: [
  6969. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 }
  6970. ],
  6971. requiredArguments: [],
  6972. supportedOptions: [],
  6973. onSucceeded: function (filePropertiesDescriptor, caller, callArgs) {
  6974. return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor);
  6975. }
  6976. });
  6977. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6978. type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  6979. fromHost: [
  6980. { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 }
  6981. ],
  6982. isComplexType: true
  6983. });
  6984. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6985. type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,
  6986. fromHost: [
  6987. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6988. ]
  6989. });
  6990. OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) {
  6991. var am=OSF.DDA.AsyncMethodNames;
  6992. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6993. am.ClearFormatsAsync,
  6994. am.SetTableOptionsAsync,
  6995. am.SetFormatsAsync
  6996. ]);
  6997. OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders);
  6998. OSF.OUtil.finalizeProperties(this);
  6999. };
  7000. OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding);
  7001. (function () {
  7002. OSF.DDA.AsyncMethodCalls.define({
  7003. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7004. requiredArguments: [
  7005. {
  7006. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7007. "types": ["string", "object", "number", "boolean"]
  7008. }
  7009. ],
  7010. supportedOptions: [{
  7011. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7012. value: {
  7013. "enum": Microsoft.Office.WebExtension.CoercionType,
  7014. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7015. }
  7016. },
  7017. {
  7018. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7019. value: {
  7020. "types": ["object"],
  7021. "defaultValue": []
  7022. }
  7023. },
  7024. {
  7025. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7026. value: {
  7027. "types": ["object"],
  7028. "defaultValue": []
  7029. }
  7030. }
  7031. ],
  7032. privateStateCallbacks: []
  7033. });
  7034. OSF.DDA.AsyncMethodCalls.define({
  7035. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  7036. requiredArguments: [
  7037. {
  7038. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7039. "types": ["string", "object", "number", "boolean"]
  7040. }
  7041. ],
  7042. supportedOptions: [{
  7043. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7044. value: {
  7045. "enum": Microsoft.Office.WebExtension.CoercionType,
  7046. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7047. }
  7048. },
  7049. {
  7050. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7051. value: {
  7052. "types": ["object", "string"],
  7053. "defaultValue": null
  7054. }
  7055. },
  7056. {
  7057. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7058. value: {
  7059. "types": ["object"],
  7060. "defaultValue": null
  7061. }
  7062. },
  7063. {
  7064. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7065. value: {
  7066. "types": ["number"],
  7067. "defaultValue": 0
  7068. }
  7069. },
  7070. {
  7071. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7072. value: {
  7073. "types": ["number"],
  7074. "defaultValue": 0
  7075. }
  7076. },
  7077. {
  7078. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7079. value: {
  7080. "types": ["object"],
  7081. "defaultValue": []
  7082. }
  7083. },
  7084. {
  7085. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7086. value: {
  7087. "types": ["object"],
  7088. "defaultValue": []
  7089. }
  7090. }
  7091. ],
  7092. checkCallArgs: function (callArgs, caller, stateInfo) {
  7093. var Parameters=Microsoft.Office.WebExtension.Parameters;
  7094. if (callArgs[Parameters.StartRow]==0 &&
  7095. callArgs[Parameters.StartColumn]==0 &&
  7096. OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 &&
  7097. OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) {
  7098. delete callArgs[Parameters.StartRow];
  7099. delete callArgs[Parameters.StartColumn];
  7100. delete callArgs[Parameters.CellFormat];
  7101. delete callArgs[Parameters.TableOptions];
  7102. }
  7103. if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7104. ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) ||
  7105. (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) ||
  7106. callArgs[Parameters.CellFormat] ||
  7107. callArgs[Parameters.TableOptions])) {
  7108. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7109. }
  7110. return callArgs;
  7111. },
  7112. privateStateCallbacks: [
  7113. {
  7114. name: Microsoft.Office.WebExtension.Parameters.Id,
  7115. value: function (obj) { return obj.id; }
  7116. }
  7117. ]
  7118. });
  7119. OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() {
  7120. var args=arguments;
  7121. this._fetch(function onComplete(binding) { binding.setTableOptionsAsync.apply(binding, args); });
  7122. return this;
  7123. },
  7124. OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() {
  7125. var args=arguments;
  7126. this._fetch(function onComplete(binding) { binding.setFormatsAsync.apply(binding, args); });
  7127. return this;
  7128. },
  7129. OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() {
  7130. var args=arguments;
  7131. this._fetch(function onComplete(binding) { binding.clearFormatsAsync.apply(binding, args); });
  7132. return this;
  7133. };
  7134. })();
  7135. (function () {
  7136. function getObjectId(obj) { return obj.id; }
  7137. OSF.DDA.AsyncMethodNames.addNames({
  7138. ClearFormatsAsync: "clearFormatsAsync",
  7139. SetTableOptionsAsync: "setTableOptionsAsync",
  7140. SetFormatsAsync: "setFormatsAsync"
  7141. });
  7142. OSF.DDA.AsyncMethodCalls.define({
  7143. method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync,
  7144. requiredArguments: [],
  7145. supportedOptions: [],
  7146. privateStateCallbacks: [
  7147. {
  7148. name: Microsoft.Office.WebExtension.Parameters.Id,
  7149. value: getObjectId
  7150. }
  7151. ]
  7152. });
  7153. OSF.DDA.AsyncMethodCalls.define({
  7154. method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,
  7155. requiredArguments: [
  7156. {
  7157. "name": Microsoft.Office.WebExtension.Parameters.TableOptions,
  7158. "defaultValue": []
  7159. }
  7160. ],
  7161. privateStateCallbacks: [
  7162. {
  7163. name: Microsoft.Office.WebExtension.Parameters.Id,
  7164. value: getObjectId
  7165. }
  7166. ]
  7167. });
  7168. OSF.DDA.AsyncMethodCalls.define({
  7169. method: OSF.DDA.AsyncMethodNames.SetFormatsAsync,
  7170. requiredArguments: [
  7171. {
  7172. "name": Microsoft.Office.WebExtension.Parameters.CellFormat,
  7173. "defaultValue": []
  7174. }
  7175. ],
  7176. privateStateCallbacks: [
  7177. {
  7178. name: Microsoft.Office.WebExtension.Parameters.Id,
  7179. value: getObjectId
  7180. }
  7181. ]
  7182. });
  7183. })();
  7184. Microsoft.Office.WebExtension.Table={
  7185. All: 0,
  7186. Data: 1,
  7187. Headers: 2
  7188. };
  7189. (function () {
  7190. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7191. type: OSF.DDA.MethodDispId.dispidClearFormatsMethod,
  7192. toHost: [
  7193. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  7194. ]
  7195. });
  7196. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7197. type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,
  7198. toHost: [
  7199. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7200. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 1 },
  7201. ]
  7202. });
  7203. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7204. type: OSF.DDA.MethodDispId.dispidSetFormatsMethod,
  7205. toHost: [
  7206. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7207. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 1 },
  7208. ]
  7209. });
  7210. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7211. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  7212. toHost: [
  7213. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  7214. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  7215. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 },
  7216. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 }
  7217. ]
  7218. });
  7219. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7220. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  7221. toHost: [
  7222. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7223. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  7224. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  7225. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 },
  7226. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 },
  7227. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 }
  7228. ]
  7229. });
  7230. var tableOptionProperties={
  7231. headerRow: 0,
  7232. bandedRows: 1,
  7233. firstColumn: 2,
  7234. lastColumn: 3,
  7235. bandedColumns: 4,
  7236. filterButton: 5,
  7237. style: 6,
  7238. totalRow: 7
  7239. };
  7240. var cellProperties={
  7241. row: 0,
  7242. column: 1
  7243. };
  7244. var formatProperties={
  7245. alignHorizontal: { text: "alignHorizontal", type: 1 },
  7246. alignVertical: { text: "alignVertical", type: 2 },
  7247. backgroundColor: { text: "backgroundColor", type: 101 },
  7248. borderStyle: { text: "borderStyle", type: 201 },
  7249. borderColor: { text: "borderColor", type: 202 },
  7250. borderTopStyle: { text: "borderTopStyle", type: 203 },
  7251. borderTopColor: { text: "borderTopColor", type: 204 },
  7252. borderBottomStyle: { text: "borderBottomStyle", type: 205 },
  7253. borderBottomColor: { text: "borderBottomColor", type: 206 },
  7254. borderLeftStyle: { text: "borderLeftStyle", type: 207 },
  7255. borderLeftColor: { text: "borderLeftColor", type: 208 },
  7256. borderRightStyle: { text: "borderRightStyle", type: 209 },
  7257. borderRightColor: { text: "borderRightColor", type: 210 },
  7258. borderOutlineStyle: { text: "borderOutlineStyle", type: 211 },
  7259. borderOutlineColor: { text: "borderOutlineColor", type: 212 },
  7260. borderInlineStyle: { text: "borderInlineStyle", type: 213 },
  7261. borderInlineColor: { text: "borderInlineColor", type: 214 },
  7262. fontFamily: { text: "fontFamily", type: 301 },
  7263. fontStyle: { text: "fontStyle", type: 302 },
  7264. fontSize: { text: "fontSize", type: 303 },
  7265. fontUnderlineStyle: { text: "fontUnderlineStyle", type: 304 },
  7266. fontColor: { text: "fontColor", type: 305 },
  7267. fontDirection: { text: "fontDirection", type: 306 },
  7268. fontStrikethrough: { text: "fontStrikethrough", type: 307 },
  7269. fontSuperscript: { text: "fontSuperscript", type: 308 },
  7270. fontSubscript: { text: "fontSubscript", type: 309 },
  7271. fontNormal: { text: "fontNormal", type: 310 },
  7272. indentLeft: { text: "indentLeft", type: 401 },
  7273. indentRight: { text: "indentRight", type: 402 },
  7274. numberFormat: { text: "numberFormat", type: 501 },
  7275. width: { text: "width", type: 701 },
  7276. height: { text: "height", type: 702 },
  7277. wrapping: { text: "wrapping", type: 703 }
  7278. };
  7279. var borderStyleSet=[
  7280. { name: "none", value: 0 },
  7281. { name: "thin", value: 1 },
  7282. { name: "medium", value: 2 },
  7283. { name: "dashed", value: 3 },
  7284. { name: "dotted", value: 4 },
  7285. { name: "thick", value: 5 },
  7286. { name: "double", value: 6 },
  7287. { name: "hair", value: 7 },
  7288. { name: "medium dashed", value: 8 },
  7289. { name: "dash dot", value: 9 },
  7290. { name: "medium dash dot", value: 10 },
  7291. { name: "dash dot dot", value: 11 },
  7292. { name: "medium dash dot dot", value: 12 },
  7293. { name: "slant dash dot", value: 13 },
  7294. ];
  7295. var colorSet=[
  7296. { name: "none", value: 0 },
  7297. { name: "black", value: 1 },
  7298. { name: "blue", value: 2 },
  7299. { name: "gray", value: 3 },
  7300. { name: "green", value: 4 },
  7301. { name: "orange", value: 5 },
  7302. { name: "pink", value: 6 },
  7303. { name: "purple", value: 7 },
  7304. { name: "red", value: 8 },
  7305. { name: "teal", value: 9 },
  7306. { name: "turquoise", value: 10 },
  7307. { name: "violet", value: 11 },
  7308. { name: "white", value: 12 },
  7309. { name: "yellow", value: 13 },
  7310. { name: "automatic", value: 14 },
  7311. ];
  7312. var ns=OSF.DDA.SafeArray.Delegate.ParameterMap;
  7313. ns.define({
  7314. type: formatProperties.alignHorizontal.text,
  7315. toHost: [
  7316. { name: "general", value: 0 },
  7317. { name: "left", value: 1 },
  7318. { name: "center", value: 2 },
  7319. { name: "right", value: 3 },
  7320. { name: "fill", value: 4 },
  7321. { name: "justify", value: 5 },
  7322. { name: "center across selection", value: 6 },
  7323. { name: "distributed", value: 7 },
  7324. ] });
  7325. ns.define({
  7326. type: formatProperties.alignVertical.text,
  7327. toHost: [
  7328. { name: "top", value: 0 },
  7329. { name: "center", value: 1 },
  7330. { name: "bottom", value: 2 },
  7331. { name: "justify", value: 3 },
  7332. { name: "distributed", value: 4 },
  7333. ] });
  7334. ns.define({
  7335. type: formatProperties.backgroundColor.text,
  7336. toHost: colorSet
  7337. });
  7338. ns.define({
  7339. type: formatProperties.borderStyle.text,
  7340. toHost: borderStyleSet
  7341. });
  7342. ns.define({
  7343. type: formatProperties.borderColor.text,
  7344. toHost: colorSet
  7345. });
  7346. ns.define({
  7347. type: formatProperties.borderTopStyle.text,
  7348. toHost: borderStyleSet
  7349. });
  7350. ns.define({
  7351. type: formatProperties.borderTopColor.text,
  7352. toHost: colorSet
  7353. });
  7354. ns.define({
  7355. type: formatProperties.borderBottomStyle.text,
  7356. toHost: borderStyleSet
  7357. });
  7358. ns.define({
  7359. type: formatProperties.borderBottomColor.text,
  7360. toHost: colorSet
  7361. });
  7362. ns.define({
  7363. type: formatProperties.borderLeftStyle.text,
  7364. toHost: borderStyleSet
  7365. });
  7366. ns.define({
  7367. type: formatProperties.borderLeftColor.text,
  7368. toHost: colorSet
  7369. });
  7370. ns.define({
  7371. type: formatProperties.borderRightStyle.text,
  7372. toHost: borderStyleSet
  7373. });
  7374. ns.define({
  7375. type: formatProperties.borderRightColor.text,
  7376. toHost: colorSet
  7377. });
  7378. ns.define({
  7379. type: formatProperties.borderOutlineStyle.text,
  7380. toHost: borderStyleSet
  7381. });
  7382. ns.define({
  7383. type: formatProperties.borderOutlineColor.text,
  7384. toHost: colorSet
  7385. });
  7386. ns.define({
  7387. type: formatProperties.borderInlineStyle.text,
  7388. toHost: borderStyleSet
  7389. });
  7390. ns.define({
  7391. type: formatProperties.borderInlineColor.text,
  7392. toHost: colorSet
  7393. });
  7394. ns.define({
  7395. type: formatProperties.fontStyle.text,
  7396. toHost: [
  7397. { name: "regular", value: 0 },
  7398. { name: "italic", value: 1 },
  7399. { name: "bold", value: 2 },
  7400. { name: "bold italic", value: 3 },
  7401. ] });
  7402. ns.define({
  7403. type: formatProperties.fontUnderlineStyle.text,
  7404. toHost: [
  7405. { name: "none", value: 0 },
  7406. { name: "single", value: 1 },
  7407. { name: "double", value: 2 },
  7408. { name: "single accounting", value: 3 },
  7409. { name: "double accounting", value: 4 },
  7410. ] });
  7411. ns.define({
  7412. type: formatProperties.fontColor.text,
  7413. toHost: colorSet
  7414. });
  7415. ns.define({
  7416. type: formatProperties.fontDirection.text,
  7417. toHost: [
  7418. { name: "context", value: 0 },
  7419. { name: "left-to-right", value: 1 },
  7420. { name: "right-to-left", value: 2 },
  7421. ] });
  7422. ns.define({
  7423. type: formatProperties.width.text,
  7424. toHost: [
  7425. { name: "auto fit", value: -1 },
  7426. ] });
  7427. ns.define({
  7428. type: formatProperties.height.text,
  7429. toHost: [
  7430. { name: "auto fit", value: -1 },
  7431. ] });
  7432. ns.define({
  7433. type: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7434. toHost: [
  7435. { name: "headerRow", value: 0 },
  7436. { name: "bandedRows", value: 1 },
  7437. { name: "firstColumn", value: 2 },
  7438. { name: "lastColumn", value: 3 },
  7439. { name: "bandedColumns", value: 4 },
  7440. { name: "filterButton", value: 5 },
  7441. { name: "style", value: 6 },
  7442. { name: "totalRow", value: 7 }
  7443. ] });
  7444. ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={
  7445. toHost: function (data) {
  7446. for (var entry in data) {
  7447. if (data[entry].format) {
  7448. data[entry].format=ns.doMapValues(data[entry].format, "toHost");
  7449. }
  7450. }
  7451. return data;
  7452. },
  7453. fromHost: function (args) {
  7454. return args;
  7455. }
  7456. };
  7457. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat, {
  7458. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) {
  7459. var textCells="cells";
  7460. var textFormat="format";
  7461. var posCells=0;
  7462. var posFormat=1;
  7463. var ret=[];
  7464. for (var index in cellFormats) {
  7465. var cfOld=cellFormats[index];
  7466. var cfNew=[];
  7467. if (typeof (cfOld[textCells]) !=='undefined') {
  7468. var cellsOld=cfOld[textCells];
  7469. var cellsNew;
  7470. if (typeof cfOld[textCells]==="object") {
  7471. cellsNew=[];
  7472. for (var entry in cellsOld) {
  7473. if (typeof (cellProperties[entry]) !=='undefined') {
  7474. cellsNew[cellProperties[entry]]=cellsOld[entry];
  7475. }
  7476. }
  7477. }
  7478. else {
  7479. cellsNew=cellsOld;
  7480. }
  7481. cfNew[posCells]=cellsNew;
  7482. }
  7483. if (cfOld[textFormat]) {
  7484. var formatOld=cfOld[textFormat];
  7485. var formatNew=[];
  7486. for (var entry2 in formatOld) {
  7487. if (typeof (formatProperties[entry2]) !=='undefined') {
  7488. formatNew.push([
  7489. formatProperties[entry2].type,
  7490. formatOld[entry2]
  7491. ]);
  7492. }
  7493. }
  7494. cfNew[posFormat]=formatNew;
  7495. }
  7496. ret[index]=cfNew;
  7497. }
  7498. return ret;
  7499. },
  7500. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) {
  7501. return hostArgs;
  7502. }
  7503. });
  7504. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions, {
  7505. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) {
  7506. var ret=[];
  7507. for (var entry in tableOptions) {
  7508. if (typeof (tableOptionProperties[entry]) !=='undefined') {
  7509. ret[tableOptionProperties[entry]]=tableOptions[entry];
  7510. }
  7511. }
  7512. return ret;
  7513. },
  7514. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) {
  7515. return hostArgs;
  7516. }
  7517. });
  7518. })();
  7519. var OfficeExt;
  7520. (function (OfficeExt) {
  7521. var AppCommand;
  7522. (function (AppCommand) {
  7523. var AppCommandManager=(function () {
  7524. function AppCommandManager() {
  7525. var _this=this;
  7526. this._pseudoDocument=null;
  7527. this._eventDispatch=null;
  7528. this._processAppCommandInvocation=function (args) {
  7529. var verifyResult=_this._verifyManifestCallback(args.callbackName);
  7530. if (verifyResult.errorCode !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  7531. _this._invokeAppCommandCompletedMethod(args.appCommandId, verifyResult.errorCode, "");
  7532. return;
  7533. }
  7534. var eventObj=_this._constructEventObjectForCallback(args);
  7535. if (eventObj) {
  7536. window.setTimeout(function () { verifyResult.callback(eventObj); }, 0);
  7537. }
  7538. else {
  7539. _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError, "");
  7540. }
  7541. };
  7542. }
  7543. AppCommandManager.initializeOsfDda=function () {
  7544. OSF.DDA.AsyncMethodNames.addNames({
  7545. AppCommandInvocationCompletedAsync: "appCommandInvocationCompletedAsync"
  7546. });
  7547. OSF.DDA.AsyncMethodCalls.define({
  7548. method: OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,
  7549. requiredArguments: [{
  7550. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7551. "types": ["string"]
  7552. },
  7553. {
  7554. "name": Microsoft.Office.WebExtension.Parameters.Status,
  7555. "types": ["number"]
  7556. },
  7557. {
  7558. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7559. "types": ["string"]
  7560. }
  7561. ]
  7562. });
  7563. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  7564. AppCommandInvokedEvent: "AppCommandInvokedEvent"
  7565. });
  7566. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  7567. AppCommandInvoked: "appCommandInvoked"
  7568. });
  7569. OSF.OUtil.setNamespace("AppCommand", OSF.DDA);
  7570. OSF.DDA.AppCommand.AppCommandInvokedEventArgs=OfficeExt.AppCommand.AppCommandInvokedEventArgs;
  7571. };
  7572. AppCommandManager.prototype.initializeAndChangeOnce=function (callback) {
  7573. AppCommand.registerDdaFacade();
  7574. this._pseudoDocument={};
  7575. OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument, [
  7576. OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,
  7577. ]);
  7578. this._eventDispatch=new OSF.EventDispatch([
  7579. Microsoft.Office.WebExtension.EventType.AppCommandInvoked,
  7580. ]);
  7581. var onRegisterCompleted=function (result) {
  7582. if (callback) {
  7583. if (result.status=="succeeded") {
  7584. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  7585. }
  7586. else {
  7587. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  7588. }
  7589. }
  7590. };
  7591. OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument, this._eventDispatch);
  7592. this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked, this._processAppCommandInvocation, onRegisterCompleted);
  7593. };
  7594. AppCommandManager.prototype._verifyManifestCallback=function (callbackName) {
  7595. var defaultResult={ callback: null, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback };
  7596. callbackName=callbackName.trim();
  7597. try {
  7598. var callList=callbackName.split(".");
  7599. var parentObject=window;
  7600. for (var i=0; i < callList.length - 1; i++) {
  7601. if (parentObject[callList[i]] && (typeof parentObject[callList[i]]=="object" || typeof parentObject[callList[i]]=="function")) {
  7602. parentObject=parentObject[callList[i]];
  7603. }
  7604. else {
  7605. return defaultResult;
  7606. }
  7607. }
  7608. var callbackFunc=parentObject[callList[callList.length - 1]];
  7609. if (typeof callbackFunc !="function") {
  7610. return defaultResult;
  7611. }
  7612. }
  7613. catch (e) {
  7614. return defaultResult;
  7615. }
  7616. return { callback: callbackFunc, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess };
  7617. };
  7618. AppCommandManager.prototype._invokeAppCommandCompletedMethod=function (appCommandId, resultCode, data) {
  7619. this._pseudoDocument.appCommandInvocationCompletedAsync(appCommandId, resultCode, data);
  7620. };
  7621. AppCommandManager.prototype._constructEventObjectForCallback=function (args) {
  7622. var _this=this;
  7623. var eventObj=new AppCommandCallbackEventArgs();
  7624. try {
  7625. var jsonData=JSON.parse(args.eventObjStr);
  7626. this._translateEventObjectInternal(jsonData, eventObj);
  7627. Object.defineProperty(eventObj, 'completed', {
  7628. value: function (completedContext) {
  7629. eventObj.completedContext=completedContext;
  7630. var jsonString=JSON.stringify(eventObj);
  7631. _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, jsonString);
  7632. },
  7633. enumerable: true
  7634. });
  7635. }
  7636. catch (e) {
  7637. eventObj=null;
  7638. }
  7639. return eventObj;
  7640. };
  7641. AppCommandManager.prototype._translateEventObjectInternal=function (input, output) {
  7642. for (var key in input) {
  7643. if (!input.hasOwnProperty(key))
  7644. continue;
  7645. var inputChild=input[key];
  7646. if (typeof inputChild=="object" && inputChild !=null) {
  7647. OSF.OUtil.defineEnumerableProperty(output, key, {
  7648. value: {}
  7649. });
  7650. this._translateEventObjectInternal(inputChild, output[key]);
  7651. }
  7652. else {
  7653. Object.defineProperty(output, key, {
  7654. value: inputChild,
  7655. enumerable: true,
  7656. writable: true
  7657. });
  7658. }
  7659. }
  7660. };
  7661. AppCommandManager.prototype._constructObjectByTemplate=function (template, input) {
  7662. var output={};
  7663. if (!template || !input)
  7664. return output;
  7665. for (var key in template) {
  7666. if (template.hasOwnProperty(key)) {
  7667. output[key]=null;
  7668. if (input[key] !=null) {
  7669. var templateChild=template[key];
  7670. var inputChild=input[key];
  7671. var inputChildType=typeof inputChild;
  7672. if (typeof templateChild=="object" && templateChild !=null) {
  7673. output[key]=this._constructObjectByTemplate(templateChild, inputChild);
  7674. }
  7675. else if (inputChildType=="number" || inputChildType=="string" || inputChildType=="boolean") {
  7676. output[key]=inputChild;
  7677. }
  7678. }
  7679. }
  7680. }
  7681. return output;
  7682. };
  7683. AppCommandManager.instance=function () {
  7684. if (AppCommandManager._instance==null) {
  7685. AppCommandManager._instance=new AppCommandManager();
  7686. }
  7687. return AppCommandManager._instance;
  7688. };
  7689. AppCommandManager._instance=null;
  7690. return AppCommandManager;
  7691. })();
  7692. AppCommand.AppCommandManager=AppCommandManager;
  7693. var AppCommandInvokedEventArgs=(function () {
  7694. function AppCommandInvokedEventArgs(appCommandId, callbackName, eventObjStr) {
  7695. this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked;
  7696. this.appCommandId=appCommandId;
  7697. this.callbackName=callbackName;
  7698. this.eventObjStr=eventObjStr;
  7699. }
  7700. AppCommandInvokedEventArgs.create=function (eventProperties) {
  7701. return new AppCommandInvokedEventArgs(eventProperties[AppCommand.AppCommandInvokedEventEnums.AppCommandId], eventProperties[AppCommand.AppCommandInvokedEventEnums.CallbackName], eventProperties[AppCommand.AppCommandInvokedEventEnums.EventObjStr]);
  7702. };
  7703. return AppCommandInvokedEventArgs;
  7704. })();
  7705. AppCommand.AppCommandInvokedEventArgs=AppCommandInvokedEventArgs;
  7706. var AppCommandCallbackEventArgs=(function () {
  7707. function AppCommandCallbackEventArgs() {
  7708. }
  7709. return AppCommandCallbackEventArgs;
  7710. })();
  7711. AppCommand.AppCommandCallbackEventArgs=AppCommandCallbackEventArgs;
  7712. AppCommand.AppCommandInvokedEventEnums={
  7713. AppCommandId: "appCommandId",
  7714. CallbackName: "callbackName",
  7715. EventObjStr: "eventObjStr"
  7716. };
  7717. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}));
  7718. })(OfficeExt || (OfficeExt={}));
  7719. OfficeExt.AppCommand.AppCommandManager.initializeOsfDda();
  7720. var OfficeExt;
  7721. (function (OfficeExt) {
  7722. var AppCommand;
  7723. (function (AppCommand) {
  7724. function registerDdaFacade() {
  7725. if (OSF.DDA.SafeArray) {
  7726. var parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  7727. parameterMap.define({
  7728. type: OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod,
  7729. toHost: [
  7730. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7731. { name: Microsoft.Office.WebExtension.Parameters.Status, value: 1 },
  7732. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }
  7733. ]
  7734. });
  7735. parameterMap.define({
  7736. type: OSF.DDA.EventDispId.dispidAppCommandInvokedEvent,
  7737. fromHost: [
  7738. { name: OSF.DDA.EventDescriptors.AppCommandInvokedEvent, value: parameterMap.self }
  7739. ],
  7740. isComplexType: true
  7741. });
  7742. parameterMap.define({
  7743. type: OSF.DDA.EventDescriptors.AppCommandInvokedEvent,
  7744. fromHost: [
  7745. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.AppCommandId, value: 0 },
  7746. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.CallbackName, value: 1 },
  7747. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.EventObjStr, value: 2 },
  7748. ],
  7749. isComplexType: true
  7750. });
  7751. }
  7752. }
  7753. AppCommand.registerDdaFacade=registerDdaFacade;
  7754. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}));
  7755. })(OfficeExt || (OfficeExt={}));
  7756. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Image: "image" });
  7757. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7758. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7759. toHost: [
  7760. { name: Microsoft.Office.WebExtension.CoercionType.Image, value: 8 }
  7761. ]
  7762. });
  7763. OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) {
  7764. var bf=new OSF.DDA.BindingFacade(this);
  7765. OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);
  7766. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]);
  7767. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);
  7768. OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings);
  7769. OSF.OUtil.finalizeProperties(this);
  7770. };
  7771. OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument);
  7772. OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function OSF_InitializationHelper$prepareRightAfterWebExtensionInitialize() {
  7773. var appCommandHandler=OfficeExt.AppCommand.AppCommandManager.instance();
  7774. appCommandHandler.initializeAndChangeOnce();
  7775. };
  7776. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  7777. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  7778. appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(true));
  7779. OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);
  7780. appReady();
  7781. };
  7782. (function () {
  7783. OSF.DDA.AsyncMethodCalls.define({
  7784. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7785. requiredArguments: [
  7786. {
  7787. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7788. "types": ["string", "object", "number", "boolean"]
  7789. }
  7790. ],
  7791. supportedOptions: [{
  7792. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7793. value: {
  7794. "enum": Microsoft.Office.WebExtension.CoercionType,
  7795. "calculate": function (requiredArgs) {
  7796. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  7797. }
  7798. }
  7799. },
  7800. {
  7801. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7802. value: {
  7803. "types": ["number", "object"],
  7804. "defaultValue": []
  7805. }
  7806. },
  7807. {
  7808. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7809. value: {
  7810. "types": ["number", "object"],
  7811. "defaultValue": []
  7812. }
  7813. },
  7814. {
  7815. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  7816. value: {
  7817. "types": ["number", "boolean"],
  7818. "defaultValue": false
  7819. }
  7820. },
  7821. {
  7822. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  7823. value: {
  7824. "types": ["number", "boolean"],
  7825. "defaultValue": false
  7826. }
  7827. }
  7828. ],
  7829. privateStateCallbacks: []
  7830. });
  7831. })();
  7832. var OfficeExtension;
  7833. (function (OfficeExtension) {
  7834. var Action=(function () {
  7835. function Action(actionInfo, isWriteOperation) {
  7836. this.m_actionInfo=actionInfo;
  7837. this.m_isWriteOperation=isWriteOperation;
  7838. }
  7839. Object.defineProperty(Action.prototype, "actionInfo", {
  7840. get: function () {
  7841. return this.m_actionInfo;
  7842. },
  7843. enumerable: true,
  7844. configurable: true
  7845. });
  7846. Object.defineProperty(Action.prototype, "isWriteOperation", {
  7847. get: function () {
  7848. return this.m_isWriteOperation;
  7849. },
  7850. enumerable: true,
  7851. configurable: true
  7852. });
  7853. return Action;
  7854. })();
  7855. OfficeExtension.Action=Action;
  7856. })(OfficeExtension || (OfficeExtension={}));
  7857. var OfficeExtension;
  7858. (function (OfficeExtension) {
  7859. var ActionFactory=(function () {
  7860. function ActionFactory() {
  7861. }
  7862. ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) {
  7863. OfficeExtension.Utility.validateObjectPath(parent);
  7864. var actionInfo={
  7865. Id: context._nextId(),
  7866. ActionType: 4 ,
  7867. Name: propertyName,
  7868. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7869. ArgumentInfo: {}
  7870. };
  7871. var args=[value];
  7872. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  7873. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  7874. var ret=new OfficeExtension.Action(actionInfo, true);
  7875. context._pendingRequest.addAction(ret);
  7876. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7877. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  7878. return ret;
  7879. };
  7880. ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) {
  7881. OfficeExtension.Utility.validateObjectPath(parent);
  7882. var actionInfo={
  7883. Id: context._nextId(),
  7884. ActionType: 3 ,
  7885. Name: methodName,
  7886. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7887. ArgumentInfo: {}
  7888. };
  7889. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  7890. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  7891. var isWriteOperation=operationType !=1 ;
  7892. var ret=new OfficeExtension.Action(actionInfo, isWriteOperation);
  7893. context._pendingRequest.addAction(ret);
  7894. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7895. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  7896. return ret;
  7897. };
  7898. ActionFactory.createQueryAction=function (context, parent, queryOption) {
  7899. OfficeExtension.Utility.validateObjectPath(parent);
  7900. var actionInfo={
  7901. Id: context._nextId(),
  7902. ActionType: 2 ,
  7903. Name: "",
  7904. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7905. };
  7906. actionInfo.QueryInfo=queryOption;
  7907. var ret=new OfficeExtension.Action(actionInfo, false);
  7908. context._pendingRequest.addAction(ret);
  7909. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7910. return ret;
  7911. };
  7912. ActionFactory.createRecursiveQueryAction=function (context, parent, query) {
  7913. OfficeExtension.Utility.validateObjectPath(parent);
  7914. var actionInfo={
  7915. Id: context._nextId(),
  7916. ActionType: 6 ,
  7917. Name: "",
  7918. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7919. RecursiveQueryInfo: query
  7920. };
  7921. var ret=new OfficeExtension.Action(actionInfo, false);
  7922. context._pendingRequest.addAction(ret);
  7923. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7924. return ret;
  7925. };
  7926. ActionFactory.createInstantiateAction=function (context, obj) {
  7927. OfficeExtension.Utility.validateObjectPath(obj);
  7928. var actionInfo={
  7929. Id: context._nextId(),
  7930. ActionType: 1 ,
  7931. Name: "",
  7932. ObjectPathId: obj._objectPath.objectPathInfo.Id
  7933. };
  7934. var ret=new OfficeExtension.Action(actionInfo, false);
  7935. context._pendingRequest.addAction(ret);
  7936. context._pendingRequest.addReferencedObjectPath(obj._objectPath);
  7937. context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj));
  7938. return ret;
  7939. };
  7940. ActionFactory.createTraceAction=function (context, message, addTraceMessage) {
  7941. var actionInfo={
  7942. Id: context._nextId(),
  7943. ActionType: 5 ,
  7944. Name: "Trace",
  7945. ObjectPathId: 0
  7946. };
  7947. var ret=new OfficeExtension.Action(actionInfo, false);
  7948. context._pendingRequest.addAction(ret);
  7949. if (addTraceMessage) {
  7950. context._pendingRequest.addTrace(actionInfo.Id, message);
  7951. }
  7952. return ret;
  7953. };
  7954. return ActionFactory;
  7955. })();
  7956. OfficeExtension.ActionFactory=ActionFactory;
  7957. })(OfficeExtension || (OfficeExtension={}));
  7958. var OfficeExtension;
  7959. (function (OfficeExtension) {
  7960. var ClientObject=(function () {
  7961. function ClientObject(context, objectPath) {
  7962. OfficeExtension.Utility.checkArgumentNull(context, "context");
  7963. this.m_context=context;
  7964. this.m_objectPath=objectPath;
  7965. if (this.m_objectPath) {
  7966. if (!context._processingResult) {
  7967. OfficeExtension.ActionFactory.createInstantiateAction(context, this);
  7968. if ((context._autoCleanup) && (this._KeepReference)) {
  7969. context.trackedObjects._autoAdd(this);
  7970. }
  7971. }
  7972. }
  7973. }
  7974. Object.defineProperty(ClientObject.prototype, "context", {
  7975. get: function () {
  7976. return this.m_context;
  7977. },
  7978. enumerable: true,
  7979. configurable: true
  7980. });
  7981. Object.defineProperty(ClientObject.prototype, "_objectPath", {
  7982. get: function () {
  7983. return this.m_objectPath;
  7984. },
  7985. set: function (value) {
  7986. this.m_objectPath=value;
  7987. },
  7988. enumerable: true,
  7989. configurable: true
  7990. });
  7991. Object.defineProperty(ClientObject.prototype, "isNull", {
  7992. get: function () {
  7993. OfficeExtension.Utility.throwIfNotLoaded("isNull", this._isNull, null, this._isNull);
  7994. return this._isNull;
  7995. },
  7996. enumerable: true,
  7997. configurable: true
  7998. });
  7999. Object.defineProperty(ClientObject.prototype, "isNullObject", {
  8000. get: function () {
  8001. OfficeExtension.Utility.throwIfNotLoaded("isNullObject", this._isNull, null, this._isNull);
  8002. return this._isNull;
  8003. },
  8004. enumerable: true,
  8005. configurable: true
  8006. });
  8007. Object.defineProperty(ClientObject.prototype, "_isNull", {
  8008. get: function () {
  8009. return this.m_isNull;
  8010. },
  8011. set: function (value) {
  8012. this.m_isNull=value;
  8013. if (value && this.m_objectPath) {
  8014. this.m_objectPath._updateAsNullObject();
  8015. }
  8016. },
  8017. enumerable: true,
  8018. configurable: true
  8019. });
  8020. ClientObject.prototype._handleResult=function (value) {
  8021. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  8022. };
  8023. ClientObject.prototype._handleIdResult=function (value) {
  8024. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  8025. OfficeExtension.Utility.fixObjectPathIfNecessary(this, value);
  8026. if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this._initReferenceId) {
  8027. this._initReferenceId(value[OfficeExtension.Constants.referenceId]);
  8028. }
  8029. };
  8030. return ClientObject;
  8031. })();
  8032. OfficeExtension.ClientObject=ClientObject;
  8033. })(OfficeExtension || (OfficeExtension={}));
  8034. var OfficeExtension;
  8035. (function (OfficeExtension) {
  8036. var ClientRequest=(function () {
  8037. function ClientRequest(context) {
  8038. this.m_context=context;
  8039. this.m_actions=[];
  8040. this.m_actionResultHandler={};
  8041. this.m_referencedObjectPaths={};
  8042. this.m_flags=0 ;
  8043. this.m_traceInfos={};
  8044. this.m_pendingProcessEventHandlers=[];
  8045. this.m_pendingEventHandlerActions={};
  8046. this.m_responseTraceIds={};
  8047. this.m_responseTraceMessages=[];
  8048. }
  8049. Object.defineProperty(ClientRequest.prototype, "flags", {
  8050. get: function () {
  8051. return this.m_flags;
  8052. },
  8053. enumerable: true,
  8054. configurable: true
  8055. });
  8056. Object.defineProperty(ClientRequest.prototype, "traceInfos", {
  8057. get: function () {
  8058. return this.m_traceInfos;
  8059. },
  8060. enumerable: true,
  8061. configurable: true
  8062. });
  8063. Object.defineProperty(ClientRequest.prototype, "_responseTraceMessages", {
  8064. get: function () {
  8065. return this.m_responseTraceMessages;
  8066. },
  8067. enumerable: true,
  8068. configurable: true
  8069. });
  8070. Object.defineProperty(ClientRequest.prototype, "_responseTraceIds", {
  8071. get: function () {
  8072. return this.m_responseTraceIds;
  8073. },
  8074. enumerable: true,
  8075. configurable: true
  8076. });
  8077. ClientRequest.prototype._setResponseTraceIds=function (value) {
  8078. if (value) {
  8079. for (var i=0; i < value.length; i++) {
  8080. var traceId=value[i];
  8081. this.m_responseTraceIds[traceId]=traceId;
  8082. var message=this.m_traceInfos[traceId];
  8083. if (!OfficeExtension.Utility.isNullOrUndefined(message)) {
  8084. this.m_responseTraceMessages.push(message);
  8085. }
  8086. }
  8087. }
  8088. };
  8089. ClientRequest.prototype.addAction=function (action) {
  8090. if (action.isWriteOperation) {
  8091. this.m_flags=this.m_flags | 1 ;
  8092. }
  8093. this.m_actions.push(action);
  8094. };
  8095. Object.defineProperty(ClientRequest.prototype, "hasActions", {
  8096. get: function () {
  8097. return this.m_actions.length > 0;
  8098. },
  8099. enumerable: true,
  8100. configurable: true
  8101. });
  8102. ClientRequest.prototype.addTrace=function (actionId, message) {
  8103. this.m_traceInfos[actionId]=message;
  8104. };
  8105. ClientRequest.prototype.addReferencedObjectPath=function (objectPath) {
  8106. if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) {
  8107. return;
  8108. }
  8109. if (!objectPath.isValid) {
  8110. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath));
  8111. }
  8112. while (objectPath) {
  8113. if (objectPath.isWriteOperation) {
  8114. this.m_flags=this.m_flags | 1 ;
  8115. }
  8116. this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath;
  8117. if (objectPath.objectPathInfo.ObjectPathType==3 ) {
  8118. this.addReferencedObjectPaths(objectPath.argumentObjectPaths);
  8119. }
  8120. objectPath=objectPath.parentObjectPath;
  8121. }
  8122. };
  8123. ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) {
  8124. if (objectPaths) {
  8125. for (var i=0; i < objectPaths.length; i++) {
  8126. this.addReferencedObjectPath(objectPaths[i]);
  8127. }
  8128. }
  8129. };
  8130. ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) {
  8131. this.m_actionResultHandler[action.actionInfo.Id]=resultHandler;
  8132. };
  8133. ClientRequest.prototype.buildRequestMessageBody=function () {
  8134. var objectPaths={};
  8135. for (var i in this.m_referencedObjectPaths) {
  8136. objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo;
  8137. }
  8138. var actions=[];
  8139. for (var index=0; index < this.m_actions.length; index++) {
  8140. actions.push(this.m_actions[index].actionInfo);
  8141. }
  8142. var ret={
  8143. Actions: actions,
  8144. ObjectPaths: objectPaths
  8145. };
  8146. return ret;
  8147. };
  8148. ClientRequest.prototype.processResponse=function (msg) {
  8149. if (msg && msg.Results) {
  8150. for (var i=0; i < msg.Results.length; i++) {
  8151. var actionResult=msg.Results[i];
  8152. var handler=this.m_actionResultHandler[actionResult.ActionId];
  8153. if (handler) {
  8154. handler._handleResult(actionResult.Value);
  8155. }
  8156. }
  8157. }
  8158. };
  8159. ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () {
  8160. for (var i in this.m_referencedObjectPaths) {
  8161. if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) {
  8162. this.m_referencedObjectPaths[i].isValid=false;
  8163. }
  8164. }
  8165. };
  8166. ClientRequest.prototype._addPendingEventHandlerAction=function (eventHandlers, action) {
  8167. if (!this.m_pendingEventHandlerActions[eventHandlers._id]) {
  8168. this.m_pendingEventHandlerActions[eventHandlers._id]=[];
  8169. this.m_pendingProcessEventHandlers.push(eventHandlers);
  8170. }
  8171. this.m_pendingEventHandlerActions[eventHandlers._id].push(action);
  8172. };
  8173. Object.defineProperty(ClientRequest.prototype, "_pendingProcessEventHandlers", {
  8174. get: function () {
  8175. return this.m_pendingProcessEventHandlers;
  8176. },
  8177. enumerable: true,
  8178. configurable: true
  8179. });
  8180. ClientRequest.prototype._getPendingEventHandlerActions=function (eventHandlers) {
  8181. return this.m_pendingEventHandlerActions[eventHandlers._id];
  8182. };
  8183. return ClientRequest;
  8184. })();
  8185. OfficeExtension.ClientRequest=ClientRequest;
  8186. })(OfficeExtension || (OfficeExtension={}));
  8187. var OfficeExtension;
  8188. (function (OfficeExtension) {
  8189. var _requestExecutorFactory;
  8190. function _setRequestExecutorFactory(reqExecFactory) {
  8191. _requestExecutorFactory=reqExecFactory;
  8192. }
  8193. OfficeExtension._setRequestExecutorFactory=_setRequestExecutorFactory;
  8194. var ClientRequestContext=(function () {
  8195. function ClientRequestContext(url) {
  8196. this.m_requestHeaders={};
  8197. this._onRunFinishedNotifiers=[];
  8198. this.m_nextId=0;
  8199. if (OfficeExtension.Utility.isNullOrUndefined(url) || typeof (url)==="string" && url.length===0) {
  8200. var defaultUrlAndHeaders=ClientRequestContext.defaultRequestUrlAndHeaders;
  8201. if (defaultUrlAndHeaders && !OfficeExtension.Utility.isNullOrEmptyString(defaultUrlAndHeaders.url)) {
  8202. this.m_url=defaultUrlAndHeaders.url;
  8203. if (defaultUrlAndHeaders.headers) {
  8204. for (var key in defaultUrlAndHeaders.headers) {
  8205. this.m_requestHeaders[key]=defaultUrlAndHeaders.headers[key];
  8206. }
  8207. }
  8208. }
  8209. else {
  8210. this.m_url=OfficeExtension.Constants.localDocument;
  8211. }
  8212. }
  8213. else if (typeof (url)==="string") {
  8214. this.m_url=url;
  8215. }
  8216. else {
  8217. var requestInfo=url;
  8218. if (OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url)) {
  8219. throw OfficeExtension.Utility.createInvalidArgumentException("url");
  8220. }
  8221. this.m_url=requestInfo.url;
  8222. if (requestInfo.headers) {
  8223. for (var key in requestInfo.headers) {
  8224. this.m_requestHeaders[key]=requestInfo.headers[key];
  8225. }
  8226. }
  8227. }
  8228. this._processingResult=false;
  8229. this._customData=OfficeExtension.Constants.iterativeExecutor;
  8230. if (_requestExecutorFactory) {
  8231. this._requestExecutor=_requestExecutorFactory();
  8232. }
  8233. else {
  8234. if (OfficeExtension.Utility._isLocalDocumentUrl(this.m_url)) {
  8235. this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  8236. }
  8237. else {
  8238. this._requestExecutor=new OfficeExtension.HttpRequestExecutor();
  8239. }
  8240. }
  8241. this.sync=this.sync.bind(this);
  8242. }
  8243. Object.defineProperty(ClientRequestContext.prototype, "_url", {
  8244. get: function () {
  8245. return this.m_url;
  8246. },
  8247. enumerable: true,
  8248. configurable: true
  8249. });
  8250. Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", {
  8251. get: function () {
  8252. if (this.m_pendingRequest==null) {
  8253. this.m_pendingRequest=new OfficeExtension.ClientRequest(this);
  8254. }
  8255. return this.m_pendingRequest;
  8256. },
  8257. enumerable: true,
  8258. configurable: true
  8259. });
  8260. Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", {
  8261. get: function () {
  8262. if (!this.m_trackedObjects) {
  8263. this.m_trackedObjects=new OfficeExtension.TrackedObjects(this);
  8264. }
  8265. return this.m_trackedObjects;
  8266. },
  8267. enumerable: true,
  8268. configurable: true
  8269. });
  8270. Object.defineProperty(ClientRequestContext.prototype, "requestHeaders", {
  8271. get: function () {
  8272. return this.m_requestHeaders;
  8273. },
  8274. enumerable: true,
  8275. configurable: true
  8276. });
  8277. ClientRequestContext.prototype.load=function (clientObj, option) {
  8278. OfficeExtension.Utility.validateContext(this, clientObj);
  8279. var queryOption=ClientRequestContext.parseQueryOption(option);
  8280. var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption);
  8281. this._pendingRequest.addActionResultHandler(action, clientObj);
  8282. };
  8283. ClientRequestContext.parseQueryOption=function (option) {
  8284. var queryOption={};
  8285. if (typeof (option)=="string") {
  8286. var select=option;
  8287. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(select);
  8288. }
  8289. else if (Array.isArray(option)) {
  8290. queryOption.Select=option;
  8291. }
  8292. else if (typeof (option)=="object") {
  8293. var loadOption=option;
  8294. if (typeof (loadOption.select)=="string") {
  8295. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(loadOption.select);
  8296. }
  8297. else if (Array.isArray(loadOption.select)) {
  8298. queryOption.Select=loadOption.select;
  8299. }
  8300. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) {
  8301. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select");
  8302. }
  8303. if (typeof (loadOption.expand)=="string") {
  8304. queryOption.Expand=OfficeExtension.Utility._parseSelectExpand(loadOption.expand);
  8305. }
  8306. else if (Array.isArray(loadOption.expand)) {
  8307. queryOption.Expand=loadOption.expand;
  8308. }
  8309. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) {
  8310. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand");
  8311. }
  8312. if (typeof (loadOption.top)=="number") {
  8313. queryOption.Top=loadOption.top;
  8314. }
  8315. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) {
  8316. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top");
  8317. }
  8318. if (typeof (loadOption.skip)=="number") {
  8319. queryOption.Skip=loadOption.skip;
  8320. }
  8321. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) {
  8322. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip");
  8323. }
  8324. }
  8325. else if (!OfficeExtension.Utility.isNullOrUndefined(option)) {
  8326. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option");
  8327. }
  8328. return queryOption;
  8329. };
  8330. ClientRequestContext.prototype.loadRecursive=function (clientObj, options, maxDepth) {
  8331. if (!OfficeExtension.Utility.isPlainJsonObject(options)) {
  8332. throw OfficeExtension.Utility.createInvalidArgumentException("options");
  8333. }
  8334. var quries={};
  8335. for (var key in options) {
  8336. quries[key]=ClientRequestContext.parseQueryOption(options[key]);
  8337. }
  8338. var action=OfficeExtension.ActionFactory.createRecursiveQueryAction(this, clientObj, { Queries: quries, MaxDepth: maxDepth });
  8339. this._pendingRequest.addActionResultHandler(action, clientObj);
  8340. };
  8341. ClientRequestContext.prototype.trace=function (message) {
  8342. OfficeExtension.ActionFactory.createTraceAction(this, message, true);
  8343. };
  8344. ClientRequestContext.prototype.syncPrivate=function () {
  8345. var _this=this;
  8346. var req=this._pendingRequest;
  8347. this.m_pendingRequest=null;
  8348. if (!req.hasActions) {
  8349. return this.processPendingEventHandlers(req);
  8350. }
  8351. var msgBody=req.buildRequestMessageBody();
  8352. var requestFlags=req.flags;
  8353. var requestExecutor=this._requestExecutor;
  8354. if (!requestExecutor) {
  8355. requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  8356. }
  8357. var requestExecutorRequestMessage={
  8358. Url: this.m_url,
  8359. Headers: this.m_requestHeaders,
  8360. Body: msgBody
  8361. };
  8362. req.invalidatePendingInvalidObjectPaths();
  8363. var errorFromResponse=null;
  8364. var errorFromProcessEventHandlers=null;
  8365. return requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage).then(function (response) {
  8366. errorFromResponse=_this.processRequestExecutorResponseMessage(req, response);
  8367. return _this.processPendingEventHandlers(req).catch(function (ex) {
  8368. OfficeExtension.Utility.log("Error in processPendingEventHandlers");
  8369. OfficeExtension.Utility.log(JSON.stringify(ex));
  8370. errorFromProcessEventHandlers=ex;
  8371. });
  8372. }).then(function () {
  8373. if (errorFromResponse) {
  8374. OfficeExtension.Utility.log("Throw error from response: "+JSON.stringify(errorFromResponse));
  8375. throw errorFromResponse;
  8376. }
  8377. if (errorFromProcessEventHandlers) {
  8378. OfficeExtension.Utility.log("Throw error from ProcessEventHandler: "+JSON.stringify(errorFromProcessEventHandlers));
  8379. var transformedError=null;
  8380. if (errorFromProcessEventHandlers instanceof OfficeExtension.Error) {
  8381. transformedError=errorFromProcessEventHandlers;
  8382. transformedError.traceMessages=req._responseTraceMessages;
  8383. }
  8384. else {
  8385. var message=null;
  8386. if (typeof (errorFromProcessEventHandlers)==="string") {
  8387. message=errorFromProcessEventHandlers;
  8388. }
  8389. else {
  8390. message=errorFromProcessEventHandlers.message;
  8391. }
  8392. if (OfficeExtension.Utility.isNullOrEmptyString(message)) {
  8393. message=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.cannotRegisterEvent);
  8394. }
  8395. transformedError=new OfficeExtension._Internal.RuntimeError(OfficeExtension.ErrorCodes.cannotRegisterEvent, message, req._responseTraceMessages, {});
  8396. }
  8397. throw transformedError;
  8398. }
  8399. });
  8400. };
  8401. ClientRequestContext.prototype.processRequestExecutorResponseMessage=function (req, response) {
  8402. if (response.Body && response.Body.TraceIds) {
  8403. req._setResponseTraceIds(response.Body.TraceIds);
  8404. }
  8405. var traceMessages=req._responseTraceMessages;
  8406. if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) {
  8407. return new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {});
  8408. }
  8409. else if (response.Body && response.Body.Error) {
  8410. return new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, {
  8411. errorLocation: response.Body.Error.Location
  8412. });
  8413. }
  8414. this._processingResult=true;
  8415. try {
  8416. req.processResponse(response.Body);
  8417. }
  8418. finally {
  8419. this._processingResult=false;
  8420. }
  8421. return null;
  8422. };
  8423. ClientRequestContext.prototype.processPendingEventHandlers=function (req) {
  8424. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  8425. for (var i=0; i < req._pendingProcessEventHandlers.length; i++) {
  8426. var eventHandlers=req._pendingProcessEventHandlers[i];
  8427. ret=ret.then(this.createProcessOneEventHandlersFunc(eventHandlers, req));
  8428. }
  8429. return ret;
  8430. };
  8431. ClientRequestContext.prototype.createProcessOneEventHandlersFunc=function (eventHandlers, req) {
  8432. return function () { return eventHandlers._processRegistration(req); };
  8433. };
  8434. ClientRequestContext.prototype.sync=function (passThroughValue) {
  8435. return this.syncPrivate().then(function () { return passThroughValue; });
  8436. };
  8437. ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8438. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  8439. if (retryDelay===void 0) { retryDelay=5000; }
  8440. return ClientRequestContext._runCommon("run", null, ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  8441. };
  8442. ClientRequestContext._runBatch=function (functionName, receivedRunArgs, ctxInitializer, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8443. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  8444. if (retryDelay===void 0) { retryDelay=5000; }
  8445. var ctxRetriever;
  8446. var batch;
  8447. var requestInfo=null;
  8448. var argOffset=0;
  8449. if (receivedRunArgs.length > 0 && typeof (receivedRunArgs[0])==="object" && receivedRunArgs[0] !==null && Object.getPrototypeOf(receivedRunArgs[0])===Object.getPrototypeOf({}) && !OfficeExtension.Utility.isNullOrUndefined(receivedRunArgs[0].url)) {
  8450. requestInfo=receivedRunArgs[0];
  8451. argOffset=1;
  8452. }
  8453. if (receivedRunArgs.length==argOffset+1) {
  8454. ctxRetriever=ctxInitializer;
  8455. batch=receivedRunArgs[argOffset+0];
  8456. }
  8457. else if (receivedRunArgs.length==argOffset+2) {
  8458. if (receivedRunArgs[argOffset+0] instanceof OfficeExtension.ClientObject) {
  8459. ctxRetriever=function () { return receivedRunArgs[argOffset+0].context; };
  8460. }
  8461. else if (Array.isArray(receivedRunArgs[argOffset+0])) {
  8462. var array=receivedRunArgs[argOffset+0];
  8463. if (array.length==0) {
  8464. return ClientRequestContext.createErrorPromise(functionName);
  8465. }
  8466. for (var i=0; i < array.length; i++) {
  8467. if (!(array[i] instanceof OfficeExtension.ClientObject)) {
  8468. return ClientRequestContext.createErrorPromise(functionName);
  8469. }
  8470. if (array[i].context !=array[0].context) {
  8471. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ResourceStrings.invalidRequestContext);
  8472. }
  8473. }
  8474. ctxRetriever=function () { return array[0].context; };
  8475. }
  8476. else {
  8477. return ClientRequestContext.createErrorPromise(functionName);
  8478. }
  8479. batch=receivedRunArgs[argOffset+1];
  8480. }
  8481. else {
  8482. return ClientRequestContext.createErrorPromise(functionName);
  8483. }
  8484. return ClientRequestContext._runCommon(functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  8485. };
  8486. ClientRequestContext.createErrorPromise=function (functionName, code) {
  8487. if (code===void 0) { code=OfficeExtension.ResourceStrings.invalidArgument; }
  8488. return OfficeExtension.Promise.reject(OfficeExtension.Utility.createRuntimeError(code, OfficeExtension.Utility._getResourceString(code), functionName));
  8489. };
  8490. ClientRequestContext._runCommon=function (functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8491. var starterPromise=new OfficeExtension.Promise(function (resolve, reject) {
  8492. resolve();
  8493. });
  8494. var ctx;
  8495. var succeeded=false;
  8496. var resultOrError;
  8497. return starterPromise.then(function () {
  8498. ctx=ctxRetriever(requestInfo);
  8499. if (requestInfo && !OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url) && requestInfo.url !==ctx.m_url) {
  8500. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ErrorCodes.invalidRequestContext);
  8501. }
  8502. if (ctx._autoCleanup) {
  8503. return new OfficeExtension.Promise(function (resolve, reject) {
  8504. ctx._onRunFinishedNotifiers.push(function () {
  8505. ctx._autoCleanup=true;
  8506. resolve();
  8507. });
  8508. });
  8509. }
  8510. else {
  8511. ctx._autoCleanup=true;
  8512. }
  8513. }).then(function () {
  8514. if (typeof batch !=='function') {
  8515. return ClientRequestContext.createErrorPromise(functionName);
  8516. }
  8517. var batchResult=batch(ctx);
  8518. if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) {
  8519. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise);
  8520. }
  8521. return batchResult;
  8522. }).then(function (batchResult) {
  8523. return ctx.sync(batchResult);
  8524. }).then(function (result) {
  8525. succeeded=true;
  8526. resultOrError=result;
  8527. }).catch(function (error) {
  8528. resultOrError=error;
  8529. }).then(function () {
  8530. var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList();
  8531. ctx._autoCleanup=false;
  8532. for (var key in itemsToRemove) {
  8533. itemsToRemove[key]._objectPath.isValid=false;
  8534. }
  8535. var cleanupCounter=0;
  8536. attemptCleanup();
  8537. function attemptCleanup() {
  8538. cleanupCounter++;
  8539. for (var key in itemsToRemove) {
  8540. ctx.trackedObjects.remove(itemsToRemove[key]);
  8541. }
  8542. ctx.sync().then(function () {
  8543. if (onCleanupSuccess) {
  8544. onCleanupSuccess(cleanupCounter);
  8545. }
  8546. }).catch(function () {
  8547. if (onCleanupFailure) {
  8548. onCleanupFailure(cleanupCounter);
  8549. }
  8550. if (cleanupCounter < numCleanupAttempts) {
  8551. setTimeout(function () {
  8552. attemptCleanup();
  8553. }, retryDelay);
  8554. }
  8555. });
  8556. }
  8557. }).then(function () {
  8558. if (ctx._onRunFinishedNotifiers && ctx._onRunFinishedNotifiers.length > 0) {
  8559. var func=ctx._onRunFinishedNotifiers.shift();
  8560. func();
  8561. }
  8562. if (succeeded) {
  8563. return resultOrError;
  8564. }
  8565. else {
  8566. throw resultOrError;
  8567. }
  8568. });
  8569. };
  8570. ClientRequestContext.prototype._nextId=function () {
  8571. return++this.m_nextId;
  8572. };
  8573. return ClientRequestContext;
  8574. })();
  8575. OfficeExtension.ClientRequestContext=ClientRequestContext;
  8576. })(OfficeExtension || (OfficeExtension={}));
  8577. var OfficeExtension;
  8578. (function (OfficeExtension) {
  8579. (function (ClientRequestFlags) {
  8580. ClientRequestFlags[ClientRequestFlags["None"]=0]="None";
  8581. ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation";
  8582. })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={}));
  8583. var ClientRequestFlags=OfficeExtension.ClientRequestFlags;
  8584. })(OfficeExtension || (OfficeExtension={}));
  8585. var OfficeExtension;
  8586. (function (OfficeExtension) {
  8587. (function (ClientResultProcessingType) {
  8588. ClientResultProcessingType[ClientResultProcessingType["none"]=0]="none";
  8589. ClientResultProcessingType[ClientResultProcessingType["date"]=1]="date";
  8590. })(OfficeExtension.ClientResultProcessingType || (OfficeExtension.ClientResultProcessingType={}));
  8591. var ClientResultProcessingType=OfficeExtension.ClientResultProcessingType;
  8592. var ClientResult=(function () {
  8593. function ClientResult(type) {
  8594. this.m_type=type;
  8595. }
  8596. Object.defineProperty(ClientResult.prototype, "value", {
  8597. get: function () {
  8598. if (!this.m_isLoaded) {
  8599. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.valueNotLoaded);
  8600. }
  8601. return this.m_value;
  8602. },
  8603. enumerable: true,
  8604. configurable: true
  8605. });
  8606. ClientResult.prototype._handleResult=function (value) {
  8607. this.m_isLoaded=true;
  8608. if (typeof (value)==="object" && value && value._IsNull) {
  8609. return;
  8610. }
  8611. if (this.m_type===1 ) {
  8612. this.m_value=OfficeExtension.Utility.adjustToDateTime(value);
  8613. }
  8614. else {
  8615. this.m_value=value;
  8616. }
  8617. };
  8618. return ClientResult;
  8619. })();
  8620. OfficeExtension.ClientResult=ClientResult;
  8621. })(OfficeExtension || (OfficeExtension={}));
  8622. var OfficeExtension;
  8623. (function (OfficeExtension) {
  8624. var Constants=(function () {
  8625. function Constants() {
  8626. }
  8627. Constants.getItemAt="GetItemAt";
  8628. Constants.id="Id";
  8629. Constants.idPrivate="_Id";
  8630. Constants.index="_Index";
  8631. Constants.items="_Items";
  8632. Constants.iterativeExecutor="IterativeExecutor";
  8633. Constants.localDocument="http://document.localhost/";
  8634. Constants.localDocumentApiPrefix="http://document.localhost/_api/";
  8635. Constants.referenceId="_ReferenceId";
  8636. Constants.isTracked="_IsTracked";
  8637. Constants.sourceLibHeader="SdkVersion";
  8638. Constants.requestInfoHeader="Office-RequestInfo";
  8639. return Constants;
  8640. })();
  8641. OfficeExtension.Constants=Constants;
  8642. })(OfficeExtension || (OfficeExtension={}));
  8643. var OfficeExtension;
  8644. (function (OfficeExtension) {
  8645. var EmbedRequestExecutor=(function () {
  8646. function EmbedRequestExecutor() {
  8647. }
  8648. EmbedRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  8649. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, EmbedRequestExecutor.SourceLibHeaderValue);
  8650. return new OfficeExtension.Promise(function (resolve, reject) {
  8651. var endpoint=OfficeExtension.Embedded && OfficeExtension.Embedded._getEndpoint();
  8652. if (!endpoint) {
  8653. resolve(OfficeExtension.RichApiMessageUtility.buildResponseOnError(OfficeExtension.Embedded.EmbeddedApiStatus.InternalError, ""));
  8654. return;
  8655. }
  8656. endpoint.invoke("executeMethod", function (status, result) {
  8657. OfficeExtension.Utility.log("Response:");
  8658. OfficeExtension.Utility.log(JSON.stringify(result));
  8659. var response;
  8660. if (status==OfficeExtension.Embedded.EmbeddedApiStatus.Success) {
  8661. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBodyFromSafeArray(result.Data), OfficeExtension.RichApiMessageUtility.getResponseHeadersFromSafeArray(result.Data));
  8662. }
  8663. else {
  8664. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.Code, result.error.Message);
  8665. }
  8666. resolve(response);
  8667. }, EmbedRequestExecutor._transformMessageArrayIntoParams(messageSafearray));
  8668. });
  8669. };
  8670. EmbedRequestExecutor._transformMessageArrayIntoParams=function (msgArray) {
  8671. return {
  8672. ArrayData: msgArray,
  8673. DdaMethod: {
  8674. DispatchId: EmbedRequestExecutor.DispidExecuteRichApiRequestMethod
  8675. }
  8676. };
  8677. };
  8678. EmbedRequestExecutor.DispidExecuteRichApiRequestMethod=93;
  8679. EmbedRequestExecutor.SourceLibHeaderValue="Embedded";
  8680. return EmbedRequestExecutor;
  8681. })();
  8682. OfficeExtension.EmbedRequestExecutor=EmbedRequestExecutor;
  8683. })(OfficeExtension || (OfficeExtension={}));
  8684. var __extends=this.__extends || function (d, b) {
  8685. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  8686. function __() { this.constructor=d; }
  8687. __.prototype=b.prototype;
  8688. d.prototype=new __();
  8689. };
  8690. var OfficeExtension;
  8691. (function (OfficeExtension) {
  8692. var _Internal;
  8693. (function (_Internal) {
  8694. var RuntimeError=(function (_super) {
  8695. __extends(RuntimeError, _super);
  8696. function RuntimeError(code, message, traceMessages, debugInfo) {
  8697. _super.call(this, message);
  8698. this.name="OfficeExtension.Error";
  8699. this.code=code;
  8700. this.message=message;
  8701. this.traceMessages=traceMessages;
  8702. this.debugInfo=debugInfo;
  8703. }
  8704. RuntimeError.prototype.toString=function () {
  8705. return this.code+': '+this.message;
  8706. };
  8707. return RuntimeError;
  8708. })(Error);
  8709. _Internal.RuntimeError=RuntimeError;
  8710. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  8711. OfficeExtension.Error=OfficeExtension._Internal.RuntimeError;
  8712. })(OfficeExtension || (OfficeExtension={}));
  8713. var OfficeExtension;
  8714. (function (OfficeExtension) {
  8715. var ErrorCodes=(function () {
  8716. function ErrorCodes() {
  8717. }
  8718. ErrorCodes.accessDenied="AccessDenied";
  8719. ErrorCodes.generalException="GeneralException";
  8720. ErrorCodes.activityLimitReached="ActivityLimitReached";
  8721. ErrorCodes.invalidObjectPath="InvalidObjectPath";
  8722. ErrorCodes.propertyNotLoaded="PropertyNotLoaded";
  8723. ErrorCodes.valueNotLoaded="ValueNotLoaded";
  8724. ErrorCodes.invalidRequestContext="InvalidRequestContext";
  8725. ErrorCodes.invalidArgument="InvalidArgument";
  8726. ErrorCodes.runMustReturnPromise="RunMustReturnPromise";
  8727. ErrorCodes.cannotRegisterEvent="CannotRegisterEvent";
  8728. ErrorCodes.apiNotFound="ApiNotFound";
  8729. ErrorCodes.connectionFailure="ConnectionFailure";
  8730. return ErrorCodes;
  8731. })();
  8732. OfficeExtension.ErrorCodes=ErrorCodes;
  8733. })(OfficeExtension || (OfficeExtension={}));
  8734. var OfficeExtension;
  8735. (function (OfficeExtension) {
  8736. var _Internal;
  8737. (function (_Internal) {
  8738. (function (EventHandlerActionType) {
  8739. EventHandlerActionType[EventHandlerActionType["add"]=0]="add";
  8740. EventHandlerActionType[EventHandlerActionType["remove"]=1]="remove";
  8741. EventHandlerActionType[EventHandlerActionType["removeAll"]=2]="removeAll";
  8742. })(_Internal.EventHandlerActionType || (_Internal.EventHandlerActionType={}));
  8743. var EventHandlerActionType=_Internal.EventHandlerActionType;
  8744. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  8745. })(OfficeExtension || (OfficeExtension={}));
  8746. var OfficeExtension;
  8747. (function (OfficeExtension) {
  8748. var EventHandlers=(function () {
  8749. function EventHandlers(context, parentObject, name, eventInfo) {
  8750. var _this=this;
  8751. this.m_id=context._nextId();
  8752. this.m_context=context;
  8753. this.m_name=name;
  8754. this.m_handlers=[];
  8755. this.m_registered=false;
  8756. this.m_eventInfo=eventInfo;
  8757. this.m_callback=function (args) {
  8758. _this.m_eventInfo.eventArgsTransformFunc(args).then(function (newArgs) { return _this.fireEvent(newArgs); });
  8759. };
  8760. }
  8761. Object.defineProperty(EventHandlers.prototype, "_registered", {
  8762. get: function () {
  8763. return this.m_registered;
  8764. },
  8765. enumerable: true,
  8766. configurable: true
  8767. });
  8768. Object.defineProperty(EventHandlers.prototype, "_id", {
  8769. get: function () {
  8770. return this.m_id;
  8771. },
  8772. enumerable: true,
  8773. configurable: true
  8774. });
  8775. Object.defineProperty(EventHandlers.prototype, "_handlers", {
  8776. get: function () {
  8777. return this.m_handlers;
  8778. },
  8779. enumerable: true,
  8780. configurable: true
  8781. });
  8782. EventHandlers.prototype.add=function (handler) {
  8783. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8784. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 0 });
  8785. return new OfficeExtension.EventHandlerResult(this.m_context, this, handler);
  8786. };
  8787. EventHandlers.prototype.remove=function (handler) {
  8788. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8789. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 1 });
  8790. };
  8791. EventHandlers.prototype.removeAll=function () {
  8792. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8793. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: null, operation: 2 });
  8794. };
  8795. EventHandlers.prototype._processRegistration=function (req) {
  8796. var _this=this;
  8797. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  8798. var actions=req._getPendingEventHandlerActions(this);
  8799. if (!actions) {
  8800. return ret;
  8801. }
  8802. var handlersResult=[];
  8803. for (var i=0; i < this.m_handlers.length; i++) {
  8804. handlersResult.push(this.m_handlers[i]);
  8805. }
  8806. var hasChange=false;
  8807. for (var i=0; i < actions.length; i++) {
  8808. if (req._responseTraceIds[actions[i].id]) {
  8809. hasChange=true;
  8810. switch (actions[i].operation) {
  8811. case 0 :
  8812. handlersResult.push(actions[i].handler);
  8813. break;
  8814. case 1 :
  8815. for (var index=handlersResult.length - 1; index >=0; index--) {
  8816. if (handlersResult[index]===actions[i].handler) {
  8817. handlersResult.splice(index, 1);
  8818. break;
  8819. }
  8820. }
  8821. break;
  8822. case 2 :
  8823. handlersResult=[];
  8824. break;
  8825. }
  8826. }
  8827. }
  8828. if (hasChange) {
  8829. if (!this.m_registered && handlersResult.length > 0) {
  8830. ret=ret.then(function () { return _this.m_eventInfo.registerFunc(_this.m_callback); }).then(function () { return (_this.m_registered=true); });
  8831. }
  8832. else if (this.m_registered && handlersResult.length==0) {
  8833. ret=ret.then(function () { return _this.m_eventInfo.unregisterFunc(_this.m_callback); }).catch(function (ex) {
  8834. OfficeExtension.Utility.log("Error when unregister event: "+JSON.stringify(ex));
  8835. }).then(function () { return (_this.m_registered=false); });
  8836. }
  8837. ret=ret.then(function () { return (_this.m_handlers=handlersResult); });
  8838. }
  8839. return ret;
  8840. };
  8841. EventHandlers.prototype.fireEvent=function (args) {
  8842. var promises=[];
  8843. for (var i=0; i < this.m_handlers.length; i++) {
  8844. var handler=this.m_handlers[i];
  8845. var p=OfficeExtension.Utility._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(handler, args)).catch(function (ex) {
  8846. OfficeExtension.Utility.log("Error when invoke handler: "+JSON.stringify(ex));
  8847. });
  8848. promises.push(p);
  8849. }
  8850. OfficeExtension.Promise.all(promises);
  8851. };
  8852. EventHandlers.prototype.createFireOneEventHandlerFunc=function (handler, args) {
  8853. return function () { return handler(args); };
  8854. };
  8855. return EventHandlers;
  8856. })();
  8857. OfficeExtension.EventHandlers=EventHandlers;
  8858. })(OfficeExtension || (OfficeExtension={}));
  8859. var OfficeExtension;
  8860. (function (OfficeExtension) {
  8861. var EventHandlerResult=(function () {
  8862. function EventHandlerResult(context, handlers, handler) {
  8863. this.m_context=context;
  8864. this.m_allHandlers=handlers;
  8865. this.m_handler=handler;
  8866. }
  8867. EventHandlerResult.prototype.remove=function () {
  8868. if (this.m_allHandlers && this.m_handler) {
  8869. this.m_allHandlers.remove(this.m_handler);
  8870. this.m_allHandlers=null;
  8871. this.m_handler=null;
  8872. }
  8873. };
  8874. return EventHandlerResult;
  8875. })();
  8876. OfficeExtension.EventHandlerResult=EventHandlerResult;
  8877. })(OfficeExtension || (OfficeExtension={}));
  8878. var OfficeExtension;
  8879. (function (OfficeExtension) {
  8880. var HttpRequestExecutor=(function () {
  8881. function HttpRequestExecutor() {
  8882. }
  8883. HttpRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  8884. var requestMessageText=JSON.stringify(requestMessage.Body);
  8885. OfficeExtension.Utility.log("Request:");
  8886. OfficeExtension.Utility.log(requestMessageText);
  8887. var url=requestMessage.Url;
  8888. if (url.charAt(url.length - 1) !="/") {
  8889. url=url+"/";
  8890. }
  8891. url=url+"ProcessQuery";
  8892. var requestInfo={
  8893. method: "POST",
  8894. url: url,
  8895. headers: {},
  8896. body: requestMessageText
  8897. };
  8898. requestInfo.headers[OfficeExtension.Constants.sourceLibHeader]=HttpRequestExecutor.SourceLibHeaderValue;
  8899. requestInfo.headers[OfficeExtension.Constants.requestInfoHeader]="flags="+requestFlags.toString();
  8900. requestInfo.headers["CONTENT-TYPE"]="application/json";
  8901. if (requestMessage.Headers) {
  8902. for (var key in requestMessage.Headers) {
  8903. requestInfo.headers[key]=requestMessage.Headers[key];
  8904. }
  8905. }
  8906. return OfficeExtension.HttpUtility.sendRequest(requestInfo).then(function (responseInfo) {
  8907. var response;
  8908. if (responseInfo.statusCode===200) {
  8909. response={ ErrorCode: null, ErrorMessage: null, Headers: responseInfo.headers, Body: JSON.parse(responseInfo.body) };
  8910. }
  8911. else {
  8912. var errorObj=null;
  8913. OfficeExtension.Utility.log("Error Response:"+responseInfo.body);
  8914. if (!OfficeExtension.Utility.isNullOrEmptyString(responseInfo.body)) {
  8915. var errorResponseBody=OfficeExtension.Utility.trim(responseInfo.body);
  8916. try {
  8917. errorObj=JSON.parse(errorResponseBody);
  8918. }
  8919. catch (e) {
  8920. OfficeExtension.Utility.log("Error when parse "+errorResponseBody);
  8921. }
  8922. }
  8923. var errorMessage;
  8924. var errorCode;
  8925. if (!OfficeExtension.Utility.isNullOrUndefined(errorObj) && typeof (errorObj)==="object" && errorObj.error) {
  8926. errorCode=errorObj.error.code;
  8927. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithDetails, [responseInfo.statusCode.toString(), errorObj.error.code, errorObj.error.message]);
  8928. }
  8929. else {
  8930. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, responseInfo.statusCode.toString());
  8931. }
  8932. if (OfficeExtension.Utility.isNullOrEmptyString(errorCode)) {
  8933. errorCode=OfficeExtension.ErrorCodes.connectionFailure;
  8934. }
  8935. response={
  8936. ErrorCode: errorCode,
  8937. ErrorMessage: errorMessage,
  8938. Headers: responseInfo.headers,
  8939. Body: null
  8940. };
  8941. }
  8942. return response;
  8943. });
  8944. };
  8945. HttpRequestExecutor.SourceLibHeaderValue="officejs-rest";
  8946. return HttpRequestExecutor;
  8947. })();
  8948. OfficeExtension.HttpRequestExecutor=HttpRequestExecutor;
  8949. })(OfficeExtension || (OfficeExtension={}));
  8950. var OfficeExtension;
  8951. (function (OfficeExtension) {
  8952. var HttpUtility=(function () {
  8953. function HttpUtility() {
  8954. }
  8955. HttpUtility.setCustomSendRequestFunc=function (func) {
  8956. HttpUtility.s_customSendRequestFunc=func;
  8957. };
  8958. HttpUtility.xhrSendRequestFunc=function (request) {
  8959. return new OfficeExtension.Promise(function (resolve, reject) {
  8960. var xhr=new XMLHttpRequest();
  8961. xhr.open(request.method, request.url);
  8962. xhr.onload=function () {
  8963. var resp={
  8964. statusCode: xhr.status,
  8965. headers: OfficeExtension.Utility._parseHttpResponseHeaders(xhr.getAllResponseHeaders()),
  8966. body: xhr.responseText
  8967. };
  8968. resolve(resp);
  8969. };
  8970. xhr.onerror=function () {
  8971. reject(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.connectionFailure, OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, xhr.statusText), null));
  8972. };
  8973. if (request.headers) {
  8974. for (var key in request.headers) {
  8975. xhr.setRequestHeader(key, request.headers[key]);
  8976. }
  8977. }
  8978. xhr.send(request.body);
  8979. });
  8980. };
  8981. HttpUtility.sendRequest=function (request) {
  8982. HttpUtility.validateAndNormalizeRequest(request);
  8983. var func;
  8984. func=HttpUtility.s_customSendRequestFunc || HttpUtility.xhrSendRequestFunc;
  8985. return func(request);
  8986. };
  8987. HttpUtility.setCustomSendLocalDocumentRequestFunc=function (func) {
  8988. HttpUtility.s_customSendLocalDocumentRequestFunc=func;
  8989. };
  8990. HttpUtility.sendLocalDocumentRequest=function (request) {
  8991. HttpUtility.validateAndNormalizeRequest(request);
  8992. var func;
  8993. func=HttpUtility.s_customSendLocalDocumentRequestFunc || HttpUtility.officeJsSendLocalDocumentRequestFunc;
  8994. return func(request);
  8995. };
  8996. HttpUtility.officeJsSendLocalDocumentRequestFunc=function (request) {
  8997. request=OfficeExtension.Utility._validateLocalDocumentRequest(request);
  8998. var requestSafeArray=OfficeExtension.Utility._buildRequestMessageSafeArray(request);
  8999. return new OfficeExtension.Promise(function (resolve, reject) {
  9000. OSF.DDA.RichApi.executeRichApiRequestAsync(requestSafeArray, function (asyncResult) {
  9001. var response;
  9002. if (asyncResult.status=="succeeded") {
  9003. response={
  9004. statusCode: OfficeExtension.RichApiMessageUtility.getResponseStatusCode(asyncResult),
  9005. headers: OfficeExtension.RichApiMessageUtility.getResponseHeaders(asyncResult),
  9006. body: OfficeExtension.RichApiMessageUtility.getResponseBody(asyncResult)
  9007. };
  9008. }
  9009. else {
  9010. response=OfficeExtension.RichApiMessageUtility.buildHttpResponseFromOfficeJsError(asyncResult.error.code, asyncResult.error.message);
  9011. }
  9012. OfficeExtension.Utility.log(JSON.stringify(response));
  9013. resolve(response);
  9014. });
  9015. });
  9016. };
  9017. HttpUtility.validateAndNormalizeRequest=function (request) {
  9018. if (OfficeExtension.Utility.isNullOrUndefined(request)) {
  9019. throw OfficeExtension.Utility.createInvalidArgumentException("request");
  9020. }
  9021. if (OfficeExtension.Utility.isNullOrEmptyString(request.method)) {
  9022. request.method="GET";
  9023. }
  9024. request.method=request.method.toUpperCase();
  9025. };
  9026. return HttpUtility;
  9027. })();
  9028. OfficeExtension.HttpUtility=HttpUtility;
  9029. })(OfficeExtension || (OfficeExtension={}));
  9030. var OfficeExtension;
  9031. (function (OfficeExtension) {
  9032. var InstantiateActionResultHandler=(function () {
  9033. function InstantiateActionResultHandler(clientObject) {
  9034. this.m_clientObject=clientObject;
  9035. }
  9036. InstantiateActionResultHandler.prototype._handleResult=function (value) {
  9037. this.m_clientObject._handleIdResult(value);
  9038. };
  9039. return InstantiateActionResultHandler;
  9040. })();
  9041. OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler;
  9042. })(OfficeExtension || (OfficeExtension={}));
  9043. var OfficeExtension;
  9044. (function (OfficeExtension) {
  9045. })(OfficeExtension || (OfficeExtension={}));
  9046. var OfficeExtension;
  9047. (function (OfficeExtension) {
  9048. (function (RichApiRequestMessageIndex) {
  9049. RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData";
  9050. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method";
  9051. RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery";
  9052. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers";
  9053. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body";
  9054. RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission";
  9055. RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags";
  9056. })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={}));
  9057. var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex;
  9058. (function (RichApiResponseMessageIndex) {
  9059. RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode";
  9060. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers";
  9061. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body";
  9062. })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={}));
  9063. var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex;
  9064. ;
  9065. (function (ActionType) {
  9066. ActionType[ActionType["Instantiate"]=1]="Instantiate";
  9067. ActionType[ActionType["Query"]=2]="Query";
  9068. ActionType[ActionType["Method"]=3]="Method";
  9069. ActionType[ActionType["SetProperty"]=4]="SetProperty";
  9070. ActionType[ActionType["Trace"]=5]="Trace";
  9071. ActionType[ActionType["RecursiveQuery"]=6]="RecursiveQuery";
  9072. })(OfficeExtension.ActionType || (OfficeExtension.ActionType={}));
  9073. var ActionType=OfficeExtension.ActionType;
  9074. (function (ObjectPathType) {
  9075. ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject";
  9076. ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject";
  9077. ObjectPathType[ObjectPathType["Method"]=3]="Method";
  9078. ObjectPathType[ObjectPathType["Property"]=4]="Property";
  9079. ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer";
  9080. ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId";
  9081. ObjectPathType[ObjectPathType["NullObject"]=7]="NullObject";
  9082. })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={}));
  9083. var ObjectPathType=OfficeExtension.ObjectPathType;
  9084. })(OfficeExtension || (OfficeExtension={}));
  9085. var OfficeExtension;
  9086. (function (OfficeExtension) {
  9087. var ObjectPath=(function () {
  9088. function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) {
  9089. this.m_objectPathInfo=objectPathInfo;
  9090. this.m_parentObjectPath=parentObjectPath;
  9091. this.m_isWriteOperation=false;
  9092. this.m_isCollection=isCollection;
  9093. this.m_isInvalidAfterRequest=isInvalidAfterRequest;
  9094. this.m_isValid=true;
  9095. }
  9096. Object.defineProperty(ObjectPath.prototype, "objectPathInfo", {
  9097. get: function () {
  9098. return this.m_objectPathInfo;
  9099. },
  9100. enumerable: true,
  9101. configurable: true
  9102. });
  9103. Object.defineProperty(ObjectPath.prototype, "isWriteOperation", {
  9104. get: function () {
  9105. return this.m_isWriteOperation;
  9106. },
  9107. set: function (value) {
  9108. this.m_isWriteOperation=value;
  9109. },
  9110. enumerable: true,
  9111. configurable: true
  9112. });
  9113. Object.defineProperty(ObjectPath.prototype, "isCollection", {
  9114. get: function () {
  9115. return this.m_isCollection;
  9116. },
  9117. enumerable: true,
  9118. configurable: true
  9119. });
  9120. Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", {
  9121. get: function () {
  9122. return this.m_isInvalidAfterRequest;
  9123. },
  9124. enumerable: true,
  9125. configurable: true
  9126. });
  9127. Object.defineProperty(ObjectPath.prototype, "parentObjectPath", {
  9128. get: function () {
  9129. return this.m_parentObjectPath;
  9130. },
  9131. enumerable: true,
  9132. configurable: true
  9133. });
  9134. Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", {
  9135. get: function () {
  9136. return this.m_argumentObjectPaths;
  9137. },
  9138. set: function (value) {
  9139. this.m_argumentObjectPaths=value;
  9140. },
  9141. enumerable: true,
  9142. configurable: true
  9143. });
  9144. Object.defineProperty(ObjectPath.prototype, "isValid", {
  9145. get: function () {
  9146. return this.m_isValid;
  9147. },
  9148. set: function (value) {
  9149. this.m_isValid=value;
  9150. },
  9151. enumerable: true,
  9152. configurable: true
  9153. });
  9154. Object.defineProperty(ObjectPath.prototype, "getByIdMethodName", {
  9155. get: function () {
  9156. return this.m_getByIdMethodName;
  9157. },
  9158. set: function (value) {
  9159. this.m_getByIdMethodName=value;
  9160. },
  9161. enumerable: true,
  9162. configurable: true
  9163. });
  9164. ObjectPath.prototype._updateAsNullObject=function () {
  9165. this.m_isInvalidAfterRequest=false;
  9166. this.m_isValid=true;
  9167. this.m_objectPathInfo.ObjectPathType=7 ;
  9168. this.m_objectPathInfo.Name="";
  9169. this.m_objectPathInfo.ArgumentInfo={};
  9170. this.m_parentObjectPath=null;
  9171. this.m_argumentObjectPaths=null;
  9172. };
  9173. ObjectPath.prototype.updateUsingObjectData=function (value) {
  9174. var referenceId=value[OfficeExtension.Constants.referenceId];
  9175. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  9176. this.m_isInvalidAfterRequest=false;
  9177. this.m_isValid=true;
  9178. this.m_objectPathInfo.ObjectPathType=6 ;
  9179. this.m_objectPathInfo.Name=referenceId;
  9180. this.m_objectPathInfo.ArgumentInfo={};
  9181. this.m_parentObjectPath=null;
  9182. this.m_argumentObjectPaths=null;
  9183. return;
  9184. }
  9185. var parentIsCollection=this.parentObjectPath && this.parentObjectPath.isCollection;
  9186. var getByIdMethodName=this.getByIdMethodName;
  9187. if (parentIsCollection || !OfficeExtension.Utility.isNullOrEmptyString(getByIdMethodName)) {
  9188. var id=value[OfficeExtension.Constants.id];
  9189. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9190. id=value[OfficeExtension.Constants.idPrivate];
  9191. }
  9192. if (!OfficeExtension.Utility.isNullOrUndefined(id)) {
  9193. this.m_isInvalidAfterRequest=false;
  9194. this.m_isValid=true;
  9195. if (parentIsCollection) {
  9196. this.m_objectPathInfo.ObjectPathType=5 ;
  9197. this.m_objectPathInfo.Name="";
  9198. }
  9199. else {
  9200. this.m_objectPathInfo.ObjectPathType=3 ;
  9201. this.m_objectPathInfo.Name=getByIdMethodName;
  9202. this.m_getByIdMethodName=null;
  9203. }
  9204. this.isWriteOperation=false;
  9205. this.m_objectPathInfo.ArgumentInfo={};
  9206. this.m_objectPathInfo.ArgumentInfo.Arguments=[id];
  9207. this.m_argumentObjectPaths=null;
  9208. return;
  9209. }
  9210. }
  9211. };
  9212. return ObjectPath;
  9213. })();
  9214. OfficeExtension.ObjectPath=ObjectPath;
  9215. })(OfficeExtension || (OfficeExtension={}));
  9216. var OfficeExtension;
  9217. (function (OfficeExtension) {
  9218. var ObjectPathFactory=(function () {
  9219. function ObjectPathFactory() {
  9220. }
  9221. ObjectPathFactory.createGlobalObjectObjectPath=function (context) {
  9222. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" };
  9223. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  9224. };
  9225. ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) {
  9226. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName };
  9227. return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false);
  9228. };
  9229. ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) {
  9230. var objectPathInfo={
  9231. Id: context._nextId(),
  9232. ObjectPathType: 4 ,
  9233. Name: propertyName,
  9234. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9235. };
  9236. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  9237. };
  9238. ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) {
  9239. var objectPathInfo={
  9240. Id: context._nextId(),
  9241. ObjectPathType: 5 ,
  9242. Name: "",
  9243. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9244. ArgumentInfo: {}
  9245. };
  9246. objectPathInfo.ArgumentInfo.Arguments=args;
  9247. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9248. };
  9249. ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) {
  9250. var objectPathInfo={
  9251. Id: context._nextId(),
  9252. ObjectPathType: 5 ,
  9253. Name: "",
  9254. ParentObjectPathId: parentObjectPath.objectPathInfo.Id,
  9255. ArgumentInfo: {}
  9256. };
  9257. objectPathInfo.ArgumentInfo.Arguments=args;
  9258. return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false);
  9259. };
  9260. ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest, getByIdMethodName) {
  9261. var objectPathInfo={
  9262. Id: context._nextId(),
  9263. ObjectPathType: 3 ,
  9264. Name: methodName,
  9265. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9266. ArgumentInfo: {}
  9267. };
  9268. var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args);
  9269. var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  9270. ret.argumentObjectPaths=argumentObjectPaths;
  9271. ret.isWriteOperation=(operationType !=1 );
  9272. ret.getByIdMethodName=getByIdMethodName;
  9273. return ret;
  9274. };
  9275. ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt=function (hasIndexerMethod, context, parent, childItem, index) {
  9276. var id=childItem[OfficeExtension.Constants.id];
  9277. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9278. id=childItem[OfficeExtension.Constants.idPrivate];
  9279. }
  9280. if (hasIndexerMethod && !OfficeExtension.Utility.isNullOrUndefined(id)) {
  9281. return ObjectPathFactory.createChildItemObjectPathUsingIndexer(context, parent, childItem);
  9282. }
  9283. else {
  9284. return ObjectPathFactory.createChildItemObjectPathUsingGetItemAt(context, parent, childItem, index);
  9285. }
  9286. };
  9287. ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) {
  9288. var id=childItem[OfficeExtension.Constants.id];
  9289. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9290. id=childItem[OfficeExtension.Constants.idPrivate];
  9291. }
  9292. var objectPathInfo=objectPathInfo={
  9293. Id: context._nextId(),
  9294. ObjectPathType: 5 ,
  9295. Name: "",
  9296. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9297. ArgumentInfo: {}
  9298. };
  9299. objectPathInfo.ArgumentInfo.Arguments=[id];
  9300. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9301. };
  9302. ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) {
  9303. var indexFromServer=childItem[OfficeExtension.Constants.index];
  9304. if (indexFromServer) {
  9305. index=indexFromServer;
  9306. }
  9307. var objectPathInfo={
  9308. Id: context._nextId(),
  9309. ObjectPathType: 3 ,
  9310. Name: OfficeExtension.Constants.getItemAt,
  9311. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9312. ArgumentInfo: {}
  9313. };
  9314. objectPathInfo.ArgumentInfo.Arguments=[index];
  9315. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9316. };
  9317. return ObjectPathFactory;
  9318. })();
  9319. OfficeExtension.ObjectPathFactory=ObjectPathFactory;
  9320. })(OfficeExtension || (OfficeExtension={}));
  9321. var OfficeExtension;
  9322. (function (OfficeExtension) {
  9323. var OfficeJsRequestExecutor=(function () {
  9324. function OfficeJsRequestExecutor() {
  9325. }
  9326. OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  9327. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, OfficeJsRequestExecutor.SourceLibHeaderValue);
  9328. return new OfficeExtension.Promise(function (resolve, reject) {
  9329. OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) {
  9330. OfficeExtension.Utility.log("Response:");
  9331. OfficeExtension.Utility.log(JSON.stringify(result));
  9332. var response;
  9333. if (result.status=="succeeded") {
  9334. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBody(result), OfficeExtension.RichApiMessageUtility.getResponseHeaders(result));
  9335. }
  9336. else {
  9337. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.code, result.error.message);
  9338. }
  9339. resolve(response);
  9340. });
  9341. });
  9342. };
  9343. OfficeJsRequestExecutor.SourceLibHeaderValue="officejs";
  9344. return OfficeJsRequestExecutor;
  9345. })();
  9346. OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor;
  9347. })(OfficeExtension || (OfficeExtension={}));
  9348. var OfficeExtension;
  9349. (function (OfficeExtension) {
  9350. var _Internal;
  9351. (function (_Internal) {
  9352. var PromiseImpl;
  9353. (function (PromiseImpl) {
  9354. function Init() {
  9355. (function () {
  9356. "use strict";
  9357. function lib$es6$promise$utils$$objectOrFunction(x) {
  9358. return typeof x==='function' || (typeof x==='object' && x !==null);
  9359. }
  9360. function lib$es6$promise$utils$$isFunction(x) {
  9361. return typeof x==='function';
  9362. }
  9363. function lib$es6$promise$utils$$isMaybeThenable(x) {
  9364. return typeof x==='object' && x !==null;
  9365. }
  9366. var lib$es6$promise$utils$$_isArray;
  9367. if (!Array.isArray) {
  9368. lib$es6$promise$utils$$_isArray=function (x) {
  9369. return Object.prototype.toString.call(x)==='[object Array]';
  9370. };
  9371. }
  9372. else {
  9373. lib$es6$promise$utils$$_isArray=Array.isArray;
  9374. }
  9375. var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;
  9376. var lib$es6$promise$asap$$len=0;
  9377. var lib$es6$promise$asap$$toString={}.toString;
  9378. var lib$es6$promise$asap$$vertxNext;
  9379. var lib$es6$promise$asap$$customSchedulerFn;
  9380. var lib$es6$promise$asap$$asap=function asap(callback, arg) {
  9381. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;
  9382. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;
  9383. lib$es6$promise$asap$$len+=2;
  9384. if (lib$es6$promise$asap$$len===2) {
  9385. if (lib$es6$promise$asap$$customSchedulerFn) {
  9386. lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
  9387. }
  9388. else {
  9389. lib$es6$promise$asap$$scheduleFlush();
  9390. }
  9391. }
  9392. };
  9393. function lib$es6$promise$asap$$setScheduler(scheduleFn) {
  9394. lib$es6$promise$asap$$customSchedulerFn=scheduleFn;
  9395. }
  9396. function lib$es6$promise$asap$$setAsap(asapFn) {
  9397. lib$es6$promise$asap$$asap=asapFn;
  9398. }
  9399. var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined;
  9400. var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {};
  9401. var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
  9402. var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]';
  9403. var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined';
  9404. function lib$es6$promise$asap$$useNextTick() {
  9405. var nextTick=process.nextTick;
  9406. var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
  9407. if (Array.isArray(version) && version[1]==='0' && version[2]==='10') {
  9408. nextTick=setImmediate;
  9409. }
  9410. return function () {
  9411. nextTick(lib$es6$promise$asap$$flush);
  9412. };
  9413. }
  9414. function lib$es6$promise$asap$$useVertxTimer() {
  9415. return function () {
  9416. lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
  9417. };
  9418. }
  9419. function lib$es6$promise$asap$$useMutationObserver() {
  9420. var iterations=0;
  9421. var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
  9422. var node=document.createTextNode('');
  9423. observer.observe(node, { characterData: true });
  9424. return function () {
  9425. node.data=(iterations=++iterations % 2);
  9426. };
  9427. }
  9428. function lib$es6$promise$asap$$useMessageChannel() {
  9429. var channel=new MessageChannel();
  9430. channel.port1.onmessage=lib$es6$promise$asap$$flush;
  9431. return function () {
  9432. channel.port2.postMessage(0);
  9433. };
  9434. }
  9435. function lib$es6$promise$asap$$useSetTimeout() {
  9436. return function () {
  9437. setTimeout(lib$es6$promise$asap$$flush, 1);
  9438. };
  9439. }
  9440. var lib$es6$promise$asap$$queue=new Array(1000);
  9441. function lib$es6$promise$asap$$flush() {
  9442. for (var i=0; i < lib$es6$promise$asap$$len; i+=2) {
  9443. var callback=lib$es6$promise$asap$$queue[i];
  9444. var arg=lib$es6$promise$asap$$queue[i+1];
  9445. callback(arg);
  9446. lib$es6$promise$asap$$queue[i]=undefined;
  9447. lib$es6$promise$asap$$queue[i+1]=undefined;
  9448. }
  9449. lib$es6$promise$asap$$len=0;
  9450. }
  9451. function lib$es6$promise$asap$$attemptVertex() {
  9452. try {
  9453. var r=require;
  9454. var vertx=r('vertx');
  9455. lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext;
  9456. return lib$es6$promise$asap$$useVertxTimer();
  9457. }
  9458. catch (e) {
  9459. return lib$es6$promise$asap$$useSetTimeout();
  9460. }
  9461. }
  9462. var lib$es6$promise$asap$$scheduleFlush;
  9463. if (lib$es6$promise$asap$$isNode) {
  9464. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick();
  9465. }
  9466. else if (lib$es6$promise$asap$$BrowserMutationObserver) {
  9467. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver();
  9468. }
  9469. else if (lib$es6$promise$asap$$isWorker) {
  9470. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel();
  9471. }
  9472. else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') {
  9473. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex();
  9474. }
  9475. else {
  9476. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout();
  9477. }
  9478. function lib$es6$promise$$internal$$noop() {
  9479. }
  9480. var lib$es6$promise$$internal$$PENDING=void 0;
  9481. var lib$es6$promise$$internal$$FULFILLED=1;
  9482. var lib$es6$promise$$internal$$REJECTED=2;
  9483. var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  9484. function lib$es6$promise$$internal$$selfFullfillment() {
  9485. return new TypeError("You cannot resolve a promise with itself");
  9486. }
  9487. function lib$es6$promise$$internal$$cannotReturnOwn() {
  9488. return new TypeError('A promises callback cannot return that same promise.');
  9489. }
  9490. function lib$es6$promise$$internal$$getThen(promise) {
  9491. try {
  9492. return promise.then;
  9493. }
  9494. catch (error) {
  9495. lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;
  9496. return lib$es6$promise$$internal$$GET_THEN_ERROR;
  9497. }
  9498. }
  9499. function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
  9500. try {
  9501. then.call(value, fulfillmentHandler, rejectionHandler);
  9502. }
  9503. catch (e) {
  9504. return e;
  9505. }
  9506. }
  9507. function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
  9508. lib$es6$promise$asap$$asap(function (promise) {
  9509. var sealed=false;
  9510. var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {
  9511. if (sealed) {
  9512. return;
  9513. }
  9514. sealed=true;
  9515. if (thenable !==value) {
  9516. lib$es6$promise$$internal$$resolve(promise, value);
  9517. }
  9518. else {
  9519. lib$es6$promise$$internal$$fulfill(promise, value);
  9520. }
  9521. }, function (reason) {
  9522. if (sealed) {
  9523. return;
  9524. }
  9525. sealed=true;
  9526. lib$es6$promise$$internal$$reject(promise, reason);
  9527. }, 'Settle: '+(promise._label || ' unknown promise'));
  9528. if (!sealed && error) {
  9529. sealed=true;
  9530. lib$es6$promise$$internal$$reject(promise, error);
  9531. }
  9532. }, promise);
  9533. }
  9534. function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
  9535. if (thenable._state===lib$es6$promise$$internal$$FULFILLED) {
  9536. lib$es6$promise$$internal$$fulfill(promise, thenable._result);
  9537. }
  9538. else if (thenable._state===lib$es6$promise$$internal$$REJECTED) {
  9539. lib$es6$promise$$internal$$reject(promise, thenable._result);
  9540. }
  9541. else {
  9542. lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {
  9543. lib$es6$promise$$internal$$resolve(promise, value);
  9544. }, function (reason) {
  9545. lib$es6$promise$$internal$$reject(promise, reason);
  9546. });
  9547. }
  9548. }
  9549. function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
  9550. if (maybeThenable.constructor===promise.constructor) {
  9551. lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
  9552. }
  9553. else {
  9554. var then=lib$es6$promise$$internal$$getThen(maybeThenable);
  9555. if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) {
  9556. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
  9557. }
  9558. else if (then===undefined) {
  9559. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  9560. }
  9561. else if (lib$es6$promise$utils$$isFunction(then)) {
  9562. lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
  9563. }
  9564. else {
  9565. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  9566. }
  9567. }
  9568. }
  9569. function lib$es6$promise$$internal$$resolve(promise, value) {
  9570. if (promise===value) {
  9571. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
  9572. }
  9573. else if (lib$es6$promise$utils$$objectOrFunction(value)) {
  9574. lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
  9575. }
  9576. else {
  9577. lib$es6$promise$$internal$$fulfill(promise, value);
  9578. }
  9579. }
  9580. function lib$es6$promise$$internal$$publishRejection(promise) {
  9581. if (promise._onerror) {
  9582. promise._onerror(promise._result);
  9583. }
  9584. lib$es6$promise$$internal$$publish(promise);
  9585. }
  9586. function lib$es6$promise$$internal$$fulfill(promise, value) {
  9587. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9588. return;
  9589. }
  9590. promise._result=value;
  9591. promise._state=lib$es6$promise$$internal$$FULFILLED;
  9592. if (promise._subscribers.length !==0) {
  9593. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
  9594. }
  9595. }
  9596. function lib$es6$promise$$internal$$reject(promise, reason) {
  9597. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9598. return;
  9599. }
  9600. promise._state=lib$es6$promise$$internal$$REJECTED;
  9601. promise._result=reason;
  9602. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
  9603. }
  9604. function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
  9605. var subscribers=parent._subscribers;
  9606. var length=subscribers.length;
  9607. parent._onerror=null;
  9608. subscribers[length]=child;
  9609. subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;
  9610. subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;
  9611. if (length===0 && parent._state) {
  9612. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
  9613. }
  9614. }
  9615. function lib$es6$promise$$internal$$publish(promise) {
  9616. var subscribers=promise._subscribers;
  9617. var settled=promise._state;
  9618. if (subscribers.length===0) {
  9619. return;
  9620. }
  9621. var child, callback, detail=promise._result;
  9622. for (var i=0; i < subscribers.length; i+=3) {
  9623. child=subscribers[i];
  9624. callback=subscribers[i+settled];
  9625. if (child) {
  9626. lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
  9627. }
  9628. else {
  9629. callback(detail);
  9630. }
  9631. }
  9632. promise._subscribers.length=0;
  9633. }
  9634. function lib$es6$promise$$internal$$ErrorObject() {
  9635. this.error=null;
  9636. }
  9637. var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  9638. function lib$es6$promise$$internal$$tryCatch(callback, detail) {
  9639. try {
  9640. return callback(detail);
  9641. }
  9642. catch (e) {
  9643. lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;
  9644. return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
  9645. }
  9646. }
  9647. function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
  9648. var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed;
  9649. if (hasCallback) {
  9650. value=lib$es6$promise$$internal$$tryCatch(callback, detail);
  9651. if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
  9652. failed=true;
  9653. error=value.error;
  9654. value=null;
  9655. }
  9656. else {
  9657. succeeded=true;
  9658. }
  9659. if (promise===value) {
  9660. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
  9661. return;
  9662. }
  9663. }
  9664. else {
  9665. value=detail;
  9666. succeeded=true;
  9667. }
  9668. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9669. }
  9670. else if (hasCallback && succeeded) {
  9671. lib$es6$promise$$internal$$resolve(promise, value);
  9672. }
  9673. else if (failed) {
  9674. lib$es6$promise$$internal$$reject(promise, error);
  9675. }
  9676. else if (settled===lib$es6$promise$$internal$$FULFILLED) {
  9677. lib$es6$promise$$internal$$fulfill(promise, value);
  9678. }
  9679. else if (settled===lib$es6$promise$$internal$$REJECTED) {
  9680. lib$es6$promise$$internal$$reject(promise, value);
  9681. }
  9682. }
  9683. function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
  9684. try {
  9685. resolver(function resolvePromise(value) {
  9686. lib$es6$promise$$internal$$resolve(promise, value);
  9687. }, function rejectPromise(reason) {
  9688. lib$es6$promise$$internal$$reject(promise, reason);
  9689. });
  9690. }
  9691. catch (e) {
  9692. lib$es6$promise$$internal$$reject(promise, e);
  9693. }
  9694. }
  9695. function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
  9696. var enumerator=this;
  9697. enumerator._instanceConstructor=Constructor;
  9698. enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);
  9699. if (enumerator._validateInput(input)) {
  9700. enumerator._input=input;
  9701. enumerator.length=input.length;
  9702. enumerator._remaining=input.length;
  9703. enumerator._init();
  9704. if (enumerator.length===0) {
  9705. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  9706. }
  9707. else {
  9708. enumerator.length=enumerator.length || 0;
  9709. enumerator._enumerate();
  9710. if (enumerator._remaining===0) {
  9711. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  9712. }
  9713. }
  9714. }
  9715. else {
  9716. lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
  9717. }
  9718. }
  9719. lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) {
  9720. return lib$es6$promise$utils$$isArray(input);
  9721. };
  9722. lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () {
  9723. return new _Internal.Error('Array Methods must be provided an Array');
  9724. };
  9725. lib$es6$promise$enumerator$$Enumerator.prototype._init=function () {
  9726. this._result=new Array(this.length);
  9727. };
  9728. var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;
  9729. lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () {
  9730. var enumerator=this;
  9731. var length=enumerator.length;
  9732. var promise=enumerator.promise;
  9733. var input=enumerator._input;
  9734. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  9735. enumerator._eachEntry(input[i], i);
  9736. }
  9737. };
  9738. lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) {
  9739. var enumerator=this;
  9740. var c=enumerator._instanceConstructor;
  9741. if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
  9742. if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) {
  9743. entry._onerror=null;
  9744. enumerator._settledAt(entry._state, i, entry._result);
  9745. }
  9746. else {
  9747. enumerator._willSettleAt(c.resolve(entry), i);
  9748. }
  9749. }
  9750. else {
  9751. enumerator._remaining--;
  9752. enumerator._result[i]=entry;
  9753. }
  9754. };
  9755. lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) {
  9756. var enumerator=this;
  9757. var promise=enumerator.promise;
  9758. if (promise._state===lib$es6$promise$$internal$$PENDING) {
  9759. enumerator._remaining--;
  9760. if (state===lib$es6$promise$$internal$$REJECTED) {
  9761. lib$es6$promise$$internal$$reject(promise, value);
  9762. }
  9763. else {
  9764. enumerator._result[i]=value;
  9765. }
  9766. }
  9767. if (enumerator._remaining===0) {
  9768. lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
  9769. }
  9770. };
  9771. lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) {
  9772. var enumerator=this;
  9773. lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {
  9774. enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
  9775. }, function (reason) {
  9776. enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
  9777. });
  9778. };
  9779. function lib$es6$promise$promise$all$$all(entries) {
  9780. return new lib$es6$promise$enumerator$$default(this, entries).promise;
  9781. }
  9782. var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;
  9783. function lib$es6$promise$promise$race$$race(entries) {
  9784. var Constructor=this;
  9785. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9786. if (!lib$es6$promise$utils$$isArray(entries)) {
  9787. lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
  9788. return promise;
  9789. }
  9790. var length=entries.length;
  9791. function onFulfillment(value) {
  9792. lib$es6$promise$$internal$$resolve(promise, value);
  9793. }
  9794. function onRejection(reason) {
  9795. lib$es6$promise$$internal$$reject(promise, reason);
  9796. }
  9797. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  9798. lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
  9799. }
  9800. return promise;
  9801. }
  9802. var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;
  9803. function lib$es6$promise$promise$resolve$$resolve(object) {
  9804. var Constructor=this;
  9805. if (object && typeof object==='object' && object.constructor===Constructor) {
  9806. return object;
  9807. }
  9808. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9809. lib$es6$promise$$internal$$resolve(promise, object);
  9810. return promise;
  9811. }
  9812. var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;
  9813. function lib$es6$promise$promise$reject$$reject(reason) {
  9814. var Constructor=this;
  9815. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9816. lib$es6$promise$$internal$$reject(promise, reason);
  9817. return promise;
  9818. }
  9819. var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;
  9820. var lib$es6$promise$promise$$counter=0;
  9821. function lib$es6$promise$promise$$needsResolver() {
  9822. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  9823. }
  9824. function lib$es6$promise$promise$$needsNew() {
  9825. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  9826. }
  9827. var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;
  9828. function lib$es6$promise$promise$$Promise(resolver) {
  9829. this._id=lib$es6$promise$promise$$counter++;
  9830. this._state=undefined;
  9831. this._result=undefined;
  9832. this._subscribers=[];
  9833. if (lib$es6$promise$$internal$$noop !==resolver) {
  9834. if (!lib$es6$promise$utils$$isFunction(resolver)) {
  9835. lib$es6$promise$promise$$needsResolver();
  9836. }
  9837. if (!(this instanceof lib$es6$promise$promise$$Promise)) {
  9838. lib$es6$promise$promise$$needsNew();
  9839. }
  9840. lib$es6$promise$$internal$$initializePromise(this, resolver);
  9841. }
  9842. }
  9843. lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;
  9844. lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;
  9845. lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;
  9846. lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;
  9847. lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;
  9848. lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;
  9849. lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;
  9850. lib$es6$promise$promise$$Promise.prototype={
  9851. constructor: lib$es6$promise$promise$$Promise,
  9852. then: function (onFulfillment, onRejection) {
  9853. var parent=this;
  9854. var state=parent._state;
  9855. if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) {
  9856. return this;
  9857. }
  9858. var child=new this.constructor(lib$es6$promise$$internal$$noop);
  9859. var result=parent._result;
  9860. if (state) {
  9861. var callback=arguments[state - 1];
  9862. lib$es6$promise$asap$$asap(function () {
  9863. lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
  9864. });
  9865. }
  9866. else {
  9867. lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
  9868. }
  9869. return child;
  9870. },
  9871. 'catch': function (onRejection) {
  9872. return this.then(null, onRejection);
  9873. }
  9874. };
  9875. OfficeExtension.Promise=lib$es6$promise$promise$$default;
  9876. }).call(this);
  9877. }
  9878. PromiseImpl.Init=Init;
  9879. })(PromiseImpl=_Internal.PromiseImpl || (_Internal.PromiseImpl={}));
  9880. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  9881. if (!OfficeExtension["Promise"]) {
  9882. if (typeof (window) !=="undefined" && window.Promise) {
  9883. if (IsEdgeLessThan14()) {
  9884. _Internal.PromiseImpl.Init();
  9885. }
  9886. else {
  9887. OfficeExtension.Promise=window.Promise;
  9888. }
  9889. }
  9890. else {
  9891. _Internal.PromiseImpl.Init();
  9892. }
  9893. }
  9894. })(OfficeExtension || (OfficeExtension={}));
  9895. function IsEdgeLessThan14() {
  9896. var userAgent=window.navigator.userAgent;
  9897. var versionIdx=userAgent.indexOf("Edge/");
  9898. if (versionIdx >=0) {
  9899. userAgent=userAgent.substring(versionIdx+5, userAgent.length);
  9900. if (userAgent < "14.14393")
  9901. return true;
  9902. else
  9903. return false;
  9904. }
  9905. return false;
  9906. }
  9907. var OfficeExtension;
  9908. (function (OfficeExtension) {
  9909. (function (OperationType) {
  9910. OperationType[OperationType["Default"]=0]="Default";
  9911. OperationType[OperationType["Read"]=1]="Read";
  9912. })(OfficeExtension.OperationType || (OfficeExtension.OperationType={}));
  9913. var OperationType=OfficeExtension.OperationType;
  9914. })(OfficeExtension || (OfficeExtension={}));
  9915. var OfficeExtension;
  9916. (function (OfficeExtension) {
  9917. var TrackedObjects=(function () {
  9918. function TrackedObjects(context) {
  9919. this._autoCleanupList={};
  9920. this.m_context=context;
  9921. }
  9922. TrackedObjects.prototype.add=function (param) {
  9923. var _this=this;
  9924. if (Array.isArray(param)) {
  9925. param.forEach(function (item) { return _this._addCommon(item, true); });
  9926. }
  9927. else {
  9928. this._addCommon(param, true);
  9929. }
  9930. };
  9931. TrackedObjects.prototype._autoAdd=function (object) {
  9932. this._addCommon(object, false);
  9933. this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object;
  9934. };
  9935. TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) {
  9936. if (object[OfficeExtension.Constants.isTracked]) {
  9937. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  9938. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  9939. }
  9940. return;
  9941. }
  9942. var referenceId=object[OfficeExtension.Constants.referenceId];
  9943. if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) {
  9944. object._KeepReference();
  9945. OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object);
  9946. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  9947. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  9948. }
  9949. object[OfficeExtension.Constants.isTracked]=true;
  9950. }
  9951. };
  9952. TrackedObjects.prototype.remove=function (param) {
  9953. var _this=this;
  9954. if (Array.isArray(param)) {
  9955. param.forEach(function (item) { return _this._removeCommon(item); });
  9956. }
  9957. else {
  9958. this._removeCommon(param);
  9959. }
  9960. };
  9961. TrackedObjects.prototype._removeCommon=function (object) {
  9962. var referenceId=object[OfficeExtension.Constants.referenceId];
  9963. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  9964. var rootObject=this.m_context._rootObject;
  9965. if (rootObject._RemoveReference) {
  9966. rootObject._RemoveReference(referenceId);
  9967. }
  9968. delete object[OfficeExtension.Constants.isTracked];
  9969. }
  9970. };
  9971. TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () {
  9972. var list=this._autoCleanupList;
  9973. this._autoCleanupList={};
  9974. return list;
  9975. };
  9976. return TrackedObjects;
  9977. })();
  9978. OfficeExtension.TrackedObjects=TrackedObjects;
  9979. })(OfficeExtension || (OfficeExtension={}));
  9980. var OfficeExtension;
  9981. (function (OfficeExtension) {
  9982. var ResourceStrings=(function () {
  9983. function ResourceStrings() {
  9984. }
  9985. ResourceStrings.invalidObjectPath="InvalidObjectPath";
  9986. ResourceStrings.propertyNotLoaded="PropertyNotLoaded";
  9987. ResourceStrings.valueNotLoaded="ValueNotLoaded";
  9988. ResourceStrings.invalidRequestContext="InvalidRequestContext";
  9989. ResourceStrings.invalidArgument="InvalidArgument";
  9990. ResourceStrings.runMustReturnPromise="RunMustReturnPromise";
  9991. ResourceStrings.cannotRegisterEvent="CannotRegisterEvent";
  9992. ResourceStrings.connectionFailureWithStatus="ConnectionFailureWithStatus";
  9993. ResourceStrings.connectionFailureWithDetails="ConnectionFailureWithDetails";
  9994. return ResourceStrings;
  9995. })();
  9996. OfficeExtension.ResourceStrings=ResourceStrings;
  9997. })(OfficeExtension || (OfficeExtension={}));
  9998. var OfficeExtension;
  9999. (function (OfficeExtension) {
  10000. var RichApiMessageUtility=(function () {
  10001. function RichApiMessageUtility() {
  10002. }
  10003. RichApiMessageUtility.buildMessageArrayForIRequestExecutor=function (customData, requestFlags, requestMessage, sourceLibHeaderValue) {
  10004. var requestMessageText=JSON.stringify(requestMessage.Body);
  10005. OfficeExtension.Utility.log("Request:");
  10006. OfficeExtension.Utility.log(requestMessageText);
  10007. var headers={};
  10008. headers[OfficeExtension.Constants.sourceLibHeader]=sourceLibHeaderValue;
  10009. var messageSafearray=RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", headers, requestMessageText);
  10010. return messageSafearray;
  10011. };
  10012. RichApiMessageUtility.buildResponseOnSuccess=function (responseBody, responseHeaders) {
  10013. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  10014. response.Body=JSON.parse(responseBody);
  10015. response.Headers=responseHeaders;
  10016. return response;
  10017. };
  10018. RichApiMessageUtility.buildResponseOnError=function (errorCode, message) {
  10019. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  10020. response.ErrorCode=OfficeExtension.ErrorCodes.generalException;
  10021. if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  10022. response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied;
  10023. }
  10024. else if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  10025. response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached;
  10026. }
  10027. response.ErrorMessage=message;
  10028. return response;
  10029. };
  10030. RichApiMessageUtility.buildHttpResponseFromOfficeJsError=function (errorCode, message) {
  10031. var statusCode=500;
  10032. var errorBody={};
  10033. errorBody["error"]={};
  10034. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.generalException;
  10035. errorBody["error"]["message"]=message;
  10036. if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  10037. statusCode=403;
  10038. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.accessDenied;
  10039. }
  10040. else if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  10041. statusCode=429;
  10042. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.activityLimitReached;
  10043. }
  10044. return { statusCode: statusCode, headers: {}, body: JSON.stringify(errorBody) };
  10045. };
  10046. RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) {
  10047. var headerArray=[];
  10048. if (headers) {
  10049. for (var headerName in headers) {
  10050. headerArray.push(headerName);
  10051. headerArray.push(headers[headerName]);
  10052. }
  10053. }
  10054. var appPermission=0;
  10055. var solutionId="";
  10056. var instanceId="";
  10057. var marketplaceType="";
  10058. return [
  10059. customData,
  10060. method,
  10061. path,
  10062. headerArray,
  10063. body,
  10064. appPermission,
  10065. requestFlags,
  10066. solutionId,
  10067. instanceId,
  10068. marketplaceType
  10069. ];
  10070. };
  10071. RichApiMessageUtility.getResponseBody=function (result) {
  10072. return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data);
  10073. };
  10074. RichApiMessageUtility.getResponseHeaders=function (result) {
  10075. return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data);
  10076. };
  10077. RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) {
  10078. var ret=data[2 ];
  10079. if (typeof (ret)==="string") {
  10080. return ret;
  10081. }
  10082. var arr=ret;
  10083. return arr.join("");
  10084. };
  10085. RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) {
  10086. var arrayHeader=data[1 ];
  10087. if (!arrayHeader) {
  10088. return null;
  10089. }
  10090. var headers={};
  10091. for (var i=0; i < arrayHeader.length - 1; i+=2) {
  10092. headers[arrayHeader[i]]=arrayHeader[i+1];
  10093. }
  10094. return headers;
  10095. };
  10096. RichApiMessageUtility.getResponseStatusCode=function (result) {
  10097. return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data);
  10098. };
  10099. RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) {
  10100. return data[0 ];
  10101. };
  10102. RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability=7000;
  10103. RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached=5102;
  10104. return RichApiMessageUtility;
  10105. })();
  10106. OfficeExtension.RichApiMessageUtility=RichApiMessageUtility;
  10107. })(OfficeExtension || (OfficeExtension={}));
  10108. var OfficeExtension;
  10109. (function (OfficeExtension) {
  10110. var Utility=(function () {
  10111. function Utility() {
  10112. }
  10113. Utility.checkArgumentNull=function (value, name) {
  10114. if (Utility.isNullOrUndefined(value)) {
  10115. Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, name);
  10116. }
  10117. };
  10118. Utility.isNullOrUndefined=function (value) {
  10119. if (value===null) {
  10120. return true;
  10121. }
  10122. if (typeof (value)==="undefined") {
  10123. return true;
  10124. }
  10125. return false;
  10126. };
  10127. Utility.isUndefined=function (value) {
  10128. if (typeof (value)==="undefined") {
  10129. return true;
  10130. }
  10131. return false;
  10132. };
  10133. Utility.isNullOrEmptyString=function (value) {
  10134. if (value===null) {
  10135. return true;
  10136. }
  10137. if (typeof (value)==="undefined") {
  10138. return true;
  10139. }
  10140. if (value.length==0) {
  10141. return true;
  10142. }
  10143. return false;
  10144. };
  10145. Utility.isPlainJsonObject=function (value) {
  10146. if (Utility.isNullOrUndefined(value)) {
  10147. return false;
  10148. }
  10149. if (typeof (value) !=="object") {
  10150. return false;
  10151. }
  10152. return Object.getPrototypeOf(value)===Object.getPrototypeOf({});
  10153. };
  10154. Utility.trim=function (str) {
  10155. return str.replace(new RegExp("^\\s+|\\s+$", "g"), "");
  10156. };
  10157. Utility.caseInsensitiveCompareString=function (str1, str2) {
  10158. if (Utility.isNullOrUndefined(str1)) {
  10159. return Utility.isNullOrUndefined(str2);
  10160. }
  10161. else {
  10162. if (Utility.isNullOrUndefined(str2)) {
  10163. return false;
  10164. }
  10165. else {
  10166. return str1.toUpperCase()==str2.toUpperCase();
  10167. }
  10168. }
  10169. };
  10170. Utility.adjustToDateTime=function (value) {
  10171. if (Utility.isNullOrUndefined(value)) {
  10172. return null;
  10173. }
  10174. if (typeof (value)==="string") {
  10175. return new Date(value);
  10176. }
  10177. if (Array.isArray(value)) {
  10178. var arr=value;
  10179. for (var i=0; i < arr.length; i++) {
  10180. arr[i]=Utility.adjustToDateTime(arr[i]);
  10181. }
  10182. return arr;
  10183. }
  10184. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "date"), null);
  10185. };
  10186. Utility.isReadonlyRestRequest=function (method) {
  10187. return Utility.caseInsensitiveCompareString(method, "GET");
  10188. };
  10189. Utility.setMethodArguments=function (context, argumentInfo, args) {
  10190. if (Utility.isNullOrUndefined(args)) {
  10191. return null;
  10192. }
  10193. var referencedObjectPaths=new Array();
  10194. var referencedObjectPathIds=new Array();
  10195. var hasOne=Utility.collectObjectPathInfos(context, args, referencedObjectPaths, referencedObjectPathIds);
  10196. argumentInfo.Arguments=args;
  10197. if (hasOne) {
  10198. argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds;
  10199. return referencedObjectPaths;
  10200. }
  10201. return null;
  10202. };
  10203. Utility.collectObjectPathInfos=function (context, args, referencedObjectPaths, referencedObjectPathIds) {
  10204. var hasOne=false;
  10205. for (var i=0; i < args.length; i++) {
  10206. if (args[i] instanceof OfficeExtension.ClientObject) {
  10207. var clientObject=args[i];
  10208. Utility.validateContext(context, clientObject);
  10209. args[i]=clientObject._objectPath.objectPathInfo.Id;
  10210. referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id);
  10211. referencedObjectPaths.push(clientObject._objectPath);
  10212. hasOne=true;
  10213. }
  10214. else if (Array.isArray(args[i])) {
  10215. var childArrayObjectPathIds=new Array();
  10216. var childArrayHasOne=Utility.collectObjectPathInfos(context, args[i], referencedObjectPaths, childArrayObjectPathIds);
  10217. if (childArrayHasOne) {
  10218. referencedObjectPathIds.push(childArrayObjectPathIds);
  10219. hasOne=true;
  10220. }
  10221. else {
  10222. referencedObjectPathIds.push(0);
  10223. }
  10224. }
  10225. else {
  10226. referencedObjectPathIds.push(0);
  10227. }
  10228. }
  10229. return hasOne;
  10230. };
  10231. Utility.fixObjectPathIfNecessary=function (clientObject, value) {
  10232. if (clientObject && clientObject._objectPath && value) {
  10233. clientObject._objectPath.updateUsingObjectData(value);
  10234. }
  10235. };
  10236. Utility.validateObjectPath=function (clientObject) {
  10237. var objectPath=clientObject._objectPath;
  10238. while (objectPath) {
  10239. if (!objectPath.isValid) {
  10240. var pathExpression=Utility.getObjectPathExpression(objectPath);
  10241. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  10242. }
  10243. objectPath=objectPath.parentObjectPath;
  10244. }
  10245. };
  10246. Utility.validateReferencedObjectPaths=function (objectPaths) {
  10247. if (objectPaths) {
  10248. for (var i=0; i < objectPaths.length; i++) {
  10249. var objectPath=objectPaths[i];
  10250. while (objectPath) {
  10251. if (!objectPath.isValid) {
  10252. var pathExpression=Utility.getObjectPathExpression(objectPath);
  10253. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  10254. }
  10255. objectPath=objectPath.parentObjectPath;
  10256. }
  10257. }
  10258. }
  10259. };
  10260. Utility.validateContext=function (context, obj) {
  10261. if (obj && obj.context !==context) {
  10262. Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext);
  10263. }
  10264. };
  10265. Utility.log=function (message) {
  10266. if (Utility._logEnabled && typeof (console) !=="undefined" && console.log) {
  10267. console.log(message);
  10268. }
  10269. };
  10270. Utility.load=function (clientObj, option) {
  10271. clientObj.context.load(clientObj, option);
  10272. };
  10273. Utility._parseSelectExpand=function (select) {
  10274. var args=[];
  10275. if (!Utility.isNullOrEmptyString(select)) {
  10276. var propertyNames=select.split(",");
  10277. for (var i=0; i < propertyNames.length; i++) {
  10278. var propertyName=propertyNames[i];
  10279. propertyName=sanitizeForAnyItemsSlash(propertyName.trim());
  10280. if (propertyName.length > 0) {
  10281. args.push(propertyName);
  10282. }
  10283. }
  10284. }
  10285. return args;
  10286. function sanitizeForAnyItemsSlash(propertyName) {
  10287. var propertyNameLower=propertyName.toLowerCase();
  10288. if (propertyNameLower==="items" || propertyNameLower==="items/") {
  10289. return '*';
  10290. }
  10291. var itemsSlashLength=6;
  10292. if (propertyNameLower.substr(0, itemsSlashLength)==="items/") {
  10293. propertyName=propertyName.substr(itemsSlashLength);
  10294. }
  10295. return propertyName.replace(new RegExp("\/items\/", "gi"), "/");
  10296. }
  10297. };
  10298. Utility.throwError=function (resourceId, arg, errorLocation) {
  10299. throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), errorLocation ? { errorLocation: errorLocation } : {});
  10300. };
  10301. Utility.createRuntimeError=function (code, message, location) {
  10302. return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location });
  10303. };
  10304. Utility.createInvalidArgumentException=function (name, errorLocation) {
  10305. return Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, name), errorLocation);
  10306. };
  10307. Utility._getResourceString=function (resourceId, arg) {
  10308. var ret=resourceId;
  10309. if (typeof (window) !=="undefined" && window.Strings && window.Strings.OfficeOM) {
  10310. var stringName="L_"+resourceId;
  10311. var stringValue=window.Strings.OfficeOM[stringName];
  10312. if (stringValue) {
  10313. ret=stringValue;
  10314. }
  10315. }
  10316. if (!Utility.isNullOrUndefined(arg)) {
  10317. if (Array.isArray(arg)) {
  10318. var arrArg=arg;
  10319. ret=Utility._formatString(ret, arrArg);
  10320. }
  10321. else {
  10322. ret=ret.replace("{0}", arg);
  10323. }
  10324. }
  10325. return ret;
  10326. };
  10327. Utility._formatString=function (format, arrArg) {
  10328. return format.replace(/\{\d\}/g, function (v) {
  10329. var position=parseInt(v.substr(1, v.length - 2));
  10330. if (position < arrArg.length) {
  10331. return arrArg[position];
  10332. }
  10333. else {
  10334. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "format"), null);
  10335. }
  10336. return "";
  10337. });
  10338. };
  10339. Utility.throwIfNotLoaded=function (propertyName, fieldValue, entityName, isNull) {
  10340. if (!isNull && Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) {
  10341. Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName, (entityName ? entityName+"."+propertyName : null));
  10342. }
  10343. };
  10344. Utility.getObjectPathExpression=function (objectPath) {
  10345. var ret="";
  10346. while (objectPath) {
  10347. switch (objectPath.objectPathInfo.ObjectPathType) {
  10348. case 1 :
  10349. ret=ret;
  10350. break;
  10351. case 2 :
  10352. ret="new()"+(ret.length > 0 ? "." : "")+ret;
  10353. break;
  10354. case 3 :
  10355. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret;
  10356. break;
  10357. case 4 :
  10358. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret;
  10359. break;
  10360. case 5 :
  10361. ret="getItem()"+(ret.length > 0 ? "." : "")+ret;
  10362. break;
  10363. case 6 :
  10364. ret="_reference()"+(ret.length > 0 ? "." : "")+ret;
  10365. break;
  10366. }
  10367. objectPath=objectPath.parentObjectPath;
  10368. }
  10369. return ret;
  10370. };
  10371. Utility._createPromiseFromResult=function (value) {
  10372. return new OfficeExtension.Promise(function (resolve, reject) {
  10373. resolve(value);
  10374. });
  10375. };
  10376. Utility._createTimeoutPromise=function (timeout) {
  10377. return new OfficeExtension.Promise(function (resolve, reject) {
  10378. setTimeout(function () {
  10379. resolve(null);
  10380. }, timeout);
  10381. });
  10382. };
  10383. Utility.promisify=function (action) {
  10384. return new OfficeExtension.Promise(function (resolve, reject) {
  10385. var callback=function (result) {
  10386. if (result.status=="failed") {
  10387. reject(result.error);
  10388. }
  10389. else {
  10390. resolve(result.value);
  10391. }
  10392. };
  10393. action(callback);
  10394. });
  10395. };
  10396. Utility._addActionResultHandler=function (clientObj, action, resultHandler) {
  10397. clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler);
  10398. };
  10399. Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) {
  10400. for (var i=0; i < propertyNames.length - 1; i+=2) {
  10401. if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) {
  10402. clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]);
  10403. }
  10404. }
  10405. };
  10406. Utility.normalizeName=function (name) {
  10407. return name.substr(0, 1).toLowerCase()+name.substr(1);
  10408. };
  10409. Utility._isLocalDocumentUrl=function (url) {
  10410. return Utility._getLocalDocumentUrlPrefixLength(url) > 0;
  10411. };
  10412. Utility._getLocalDocumentUrlPrefixLength=function (url) {
  10413. var localDocumentPrefixes=["http://document.localhost", "https://document.localhost", "//document.localhost"];
  10414. var urlLower=url.toLowerCase().trim();
  10415. for (var i=0; i < localDocumentPrefixes.length; i++) {
  10416. if (urlLower===localDocumentPrefixes[i]) {
  10417. return localDocumentPrefixes[i].length;
  10418. }
  10419. else if (urlLower.substr(0, localDocumentPrefixes[i].length+1)===localDocumentPrefixes[i]+"/") {
  10420. return localDocumentPrefixes[i].length+1;
  10421. }
  10422. }
  10423. return 0;
  10424. };
  10425. Utility._validateLocalDocumentRequest=function (request) {
  10426. var index=Utility._getLocalDocumentUrlPrefixLength(request.url);
  10427. if (index <=0) {
  10428. throw Utility.createInvalidArgumentException("request");
  10429. }
  10430. var path=request.url.substr(index);
  10431. var pathLower=path.toLowerCase();
  10432. if (pathLower==="_api") {
  10433. path="";
  10434. }
  10435. else if (pathLower.substr(0, "_api/".length)==="_api/") {
  10436. path=path.substr("_api/".length);
  10437. }
  10438. return {
  10439. method: request.method,
  10440. url: path,
  10441. headers: request.headers,
  10442. body: request.body
  10443. };
  10444. };
  10445. Utility._buildRequestMessageSafeArray=function (request) {
  10446. var requestFlags=0 ;
  10447. if (!Utility.isReadonlyRestRequest(request.method)) {
  10448. requestFlags=1 ;
  10449. }
  10450. var requestInfo="";
  10451. if (request.headers) {
  10452. requestInfo=request.headers[OfficeExtension.Constants.requestInfoHeader];
  10453. if (!Utility.isNullOrEmptyString(requestInfo)) {
  10454. var parts=requestInfo.split("&");
  10455. for (var i=0; i < parts.length; i++) {
  10456. var keyvalue=parts[i].split("=");
  10457. if (keyvalue[0]=="flags") {
  10458. var flags=parseInt(keyvalue[1]);
  10459. requestFlags=flags;
  10460. break;
  10461. }
  10462. }
  10463. }
  10464. }
  10465. return OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray("", requestFlags, request.method, request.url, request.headers, request.body);
  10466. };
  10467. Utility._parseHttpResponseHeaders=function (allResponseHeaders) {
  10468. var responseHeaders={};
  10469. if (!Utility.isNullOrEmptyString(allResponseHeaders)) {
  10470. var regex=new RegExp("\r?\n");
  10471. var entries=allResponseHeaders.split(regex);
  10472. for (var i=0; i < entries.length; i++) {
  10473. var entry=entries[i];
  10474. if (entry !=null) {
  10475. var index=entry.indexOf(':');
  10476. if (index > 0) {
  10477. var key=entry.substr(0, index);
  10478. var value=entry.substr(index+1);
  10479. key=Utility.trim(key);
  10480. value=Utility.trim(value);
  10481. responseHeaders[key.toUpperCase()]=value;
  10482. }
  10483. }
  10484. }
  10485. }
  10486. return responseHeaders;
  10487. };
  10488. Utility._logEnabled=false;
  10489. Utility.s_underscoreCharCode="_".charCodeAt(0);
  10490. return Utility;
  10491. })();
  10492. OfficeExtension.Utility=Utility;
  10493. })(OfficeExtension || (OfficeExtension={}));
  10494. var __extends=(this && this.__extends) || function (d, b) {
  10495. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  10496. function __() { this.constructor=d; }
  10497. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  10498. };
  10499. var Excel;
  10500. (function (Excel) {
  10501. function lowerCaseFirst(str) {
  10502. return str[0].toLowerCase()+str.slice(1);
  10503. }
  10504. var iconSets=["ThreeArrows",
  10505. "ThreeArrowsGray",
  10506. "ThreeFlags",
  10507. "ThreeTrafficLights1",
  10508. "ThreeTrafficLights2",
  10509. "ThreeSigns",
  10510. "ThreeSymbols",
  10511. "ThreeSymbols2",
  10512. "FourArrows",
  10513. "FourArrowsGray",
  10514. "FourRedToBlack",
  10515. "FourRating",
  10516. "FourTrafficLights",
  10517. "FiveArrows",
  10518. "FiveArrowsGray",
  10519. "FiveRating",
  10520. "FiveQuarters",
  10521. "ThreeStars",
  10522. "ThreeTriangles",
  10523. "FiveBoxes"];
  10524. var iconNames=[["RedDownArrow", "YellowSideArrow", "GreenUpArrow"],
  10525. ["GrayDownArrow", "GraySideArrow", "GrayUpArrow"],
  10526. ["RedFlag", "YellowFlag", "GreenFlag"],
  10527. ["RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  10528. ["RedTrafficLight", "YellowTrafficLight", "GreenTrafficLight"],
  10529. ["RedDiamond", "YellowTriangle", "GreenCircle"],
  10530. ["RedCrossSymbol", "YellowExclamationSymbol", "GreenCheckSymbol"],
  10531. ["RedCross", "YellowExclamation", "GreenCheck"],
  10532. ["RedDownArrow", "YellowDownInclineArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  10533. ["GrayDownArrow", "GrayDownInclineArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  10534. ["BlackCircle", "GrayCircle", "PinkCircle", "RedCircle"],
  10535. ["OneBar", "TwoBars", "ThreeBars", "FourBars"],
  10536. ["BlackCircleWithBorder", "RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  10537. ["RedDownArrow", "YellowDownInclineArrow", "YellowSideArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  10538. ["GrayDownArrow", "GrayDownInclineArrow", "GraySideArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  10539. ["NoBars", "OneBar", "TwoBars", "ThreeBars", "FourBars"],
  10540. ["WhiteCircleAllWhiteQuarters", "CircleWithThreeWhiteQuarters", "CircleWithTwoWhiteQuarters", "CircleWithOneWhiteQuarter", "BlackCircle"],
  10541. ["SilverStar", "HalfGoldStar", "GoldStar"],
  10542. ["RedDownTriangle", "YellowDash", "GreenUpTriangle"],
  10543. ["NoFilledBoxes", "OneFilledBox", "TwoFilledBoxes", "ThreeFilledBoxes", "FourFilledBoxes"],];
  10544. Excel.icons={};
  10545. iconSets.map(function (title, i) {
  10546. var camelTitle=lowerCaseFirst(title);
  10547. Excel.icons[camelTitle]=[];
  10548. iconNames[i].map(function (iconName, j) {
  10549. iconName=lowerCaseFirst(iconName);
  10550. var obj={ set: title, index: j };
  10551. Excel.icons[camelTitle].push(obj);
  10552. Excel.icons[camelTitle][iconName]=obj;
  10553. });
  10554. });
  10555. function setRangePropertiesInBulk(range, propertyName, values) {
  10556. var maxCellCount=1500;
  10557. if (Array.isArray(values) && values.length > 0 && Array.isArray(values[0]) && (values.length * values[0].length > maxCellCount) && isExcel1_3OrAbove()) {
  10558. var maxRowCount=Math.max(1, Math.round(maxCellCount / values[0].length));
  10559. range._ValidateArraySize(values.length, values[0].length);
  10560. for (var startRowIndex=0; startRowIndex < values.length; startRowIndex+=maxRowCount) {
  10561. var rowCount=maxRowCount;
  10562. if (startRowIndex+rowCount > values.length) {
  10563. rowCount=values.length - startRowIndex;
  10564. }
  10565. var chunk=range.getRow(startRowIndex).getBoundingRect(range.getRow(startRowIndex+rowCount - 1));
  10566. var valueSlice=values.slice(startRowIndex, startRowIndex+rowCount);
  10567. _createSetPropertyAction(chunk.context, chunk, propertyName, valueSlice);
  10568. }
  10569. return true;
  10570. }
  10571. return false;
  10572. }
  10573. function isExcel1_3OrAbove() {
  10574. if (typeof (window) !=="undefined" && window.Office && window.Office.context && window.Office.context.requirements) {
  10575. return window.Office.context.requirements.isSetSupported("ExcelApi", 1.3);
  10576. }
  10577. else {
  10578. return true;
  10579. }
  10580. }
  10581. var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath;
  10582. var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath;
  10583. var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath;
  10584. var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath;
  10585. var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer;
  10586. var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt;
  10587. var _createChildItemObjectPathUsingIndexerOrGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt;
  10588. var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction;
  10589. var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction;
  10590. var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined;
  10591. var _isUndefined=OfficeExtension.Utility.isUndefined;
  10592. var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded;
  10593. var _load=OfficeExtension.Utility.load;
  10594. var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary;
  10595. var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler;
  10596. var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults;
  10597. var _adjustToDateTime=OfficeExtension.Utility.adjustToDateTime;
  10598. var Application=(function (_super) {
  10599. __extends(Application, _super);
  10600. function Application() {
  10601. _super.apply(this, arguments);
  10602. }
  10603. Object.defineProperty(Application.prototype, "calculationMode", {
  10604. get: function () {
  10605. _throwIfNotLoaded("calculationMode", this.m_calculationMode, "Application", this._isNull);
  10606. return this.m_calculationMode;
  10607. },
  10608. enumerable: true,
  10609. configurable: true
  10610. });
  10611. Application.prototype.calculate=function (calculationType) {
  10612. _createMethodAction(this.context, this, "Calculate", OfficeExtension.OperationType.Default, [calculationType]);
  10613. };
  10614. Application.prototype._handleResult=function (value) {
  10615. _super.prototype._handleResult.call(this, value);
  10616. if (_isNullOrUndefined(value))
  10617. return;
  10618. var obj=value;
  10619. _fixObjectPathIfNecessary(this, obj);
  10620. if (!_isUndefined(obj["CalculationMode"])) {
  10621. this.m_calculationMode=obj["CalculationMode"];
  10622. }
  10623. };
  10624. Application.prototype.load=function (option) {
  10625. _load(this, option);
  10626. return this;
  10627. };
  10628. Application.prototype.toJSON=function () {
  10629. return {
  10630. "calculationMode": this.m_calculationMode
  10631. };
  10632. };
  10633. return Application;
  10634. }(OfficeExtension.ClientObject));
  10635. Excel.Application=Application;
  10636. var Workbook=(function (_super) {
  10637. __extends(Workbook, _super);
  10638. function Workbook() {
  10639. _super.apply(this, arguments);
  10640. }
  10641. Object.defineProperty(Workbook.prototype, "application", {
  10642. get: function () {
  10643. if (!this.m_application) {
  10644. this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false));
  10645. }
  10646. return this.m_application;
  10647. },
  10648. enumerable: true,
  10649. configurable: true
  10650. });
  10651. Object.defineProperty(Workbook.prototype, "bindings", {
  10652. get: function () {
  10653. if (!this.m_bindings) {
  10654. this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false));
  10655. }
  10656. return this.m_bindings;
  10657. },
  10658. enumerable: true,
  10659. configurable: true
  10660. });
  10661. Object.defineProperty(Workbook.prototype, "functions", {
  10662. get: function () {
  10663. if (!this.m_functions) {
  10664. this.m_functions=new Excel.Functions(this.context, _createPropertyObjectPath(this.context, this, "Functions", false, false));
  10665. }
  10666. return this.m_functions;
  10667. },
  10668. enumerable: true,
  10669. configurable: true
  10670. });
  10671. Object.defineProperty(Workbook.prototype, "names", {
  10672. get: function () {
  10673. if (!this.m_names) {
  10674. this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false));
  10675. }
  10676. return this.m_names;
  10677. },
  10678. enumerable: true,
  10679. configurable: true
  10680. });
  10681. Object.defineProperty(Workbook.prototype, "pivotTables", {
  10682. get: function () {
  10683. if (!this.m_pivotTables) {
  10684. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  10685. }
  10686. return this.m_pivotTables;
  10687. },
  10688. enumerable: true,
  10689. configurable: true
  10690. });
  10691. Object.defineProperty(Workbook.prototype, "tables", {
  10692. get: function () {
  10693. if (!this.m_tables) {
  10694. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  10695. }
  10696. return this.m_tables;
  10697. },
  10698. enumerable: true,
  10699. configurable: true
  10700. });
  10701. Object.defineProperty(Workbook.prototype, "worksheets", {
  10702. get: function () {
  10703. if (!this.m_worksheets) {
  10704. this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false));
  10705. }
  10706. return this.m_worksheets;
  10707. },
  10708. enumerable: true,
  10709. configurable: true
  10710. });
  10711. Object.defineProperty(Workbook.prototype, "_V1Api", {
  10712. get: function () {
  10713. if (!this.m__V1Api) {
  10714. this.m__V1Api=new Excel._V1Api(this.context, _createPropertyObjectPath(this.context, this, "_V1Api", false, false));
  10715. }
  10716. return this.m__V1Api;
  10717. },
  10718. enumerable: true,
  10719. configurable: true
  10720. });
  10721. Workbook.prototype.getSelectedRange=function () {
  10722. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", OfficeExtension.OperationType.Read, [], false, true, null));
  10723. };
  10724. Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) {
  10725. var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10726. var ret=new OfficeExtension.ClientResult();
  10727. _addActionResultHandler(this, action, ret);
  10728. return ret;
  10729. };
  10730. Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) {
  10731. var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10732. var ret=new OfficeExtension.ClientResult();
  10733. _addActionResultHandler(this, action, ret);
  10734. return ret;
  10735. };
  10736. Workbook.prototype._GetReferenceCount=function () {
  10737. var action=_createMethodAction(this.context, this, "_GetReferenceCount", OfficeExtension.OperationType.Read, []);
  10738. var ret=new OfficeExtension.ClientResult();
  10739. _addActionResultHandler(this, action, ret);
  10740. return ret;
  10741. };
  10742. Workbook.prototype._RemoveAllReferences=function () {
  10743. _createMethodAction(this.context, this, "_RemoveAllReferences", OfficeExtension.OperationType.Read, []);
  10744. };
  10745. Workbook.prototype._RemoveReference=function (bstrReferenceId) {
  10746. _createMethodAction(this.context, this, "_RemoveReference", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10747. };
  10748. Workbook.prototype._handleResult=function (value) {
  10749. _super.prototype._handleResult.call(this, value);
  10750. if (_isNullOrUndefined(value))
  10751. return;
  10752. var obj=value;
  10753. _fixObjectPathIfNecessary(this, obj);
  10754. _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "functions", "Functions", "names", "Names", "pivotTables", "PivotTables", "tables", "Tables", "worksheets", "Worksheets", "_V1Api", "_V1Api"]);
  10755. };
  10756. Workbook.prototype.load=function (option) {
  10757. _load(this, option);
  10758. return this;
  10759. };
  10760. Object.defineProperty(Workbook.prototype, "onSelectionChanged", {
  10761. get: function () {
  10762. var _this=this;
  10763. if (!this.m_selectionChanged) {
  10764. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  10765. registerFunc: function (handlerCallback) {
  10766. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, handlerCallback, callback); });
  10767. },
  10768. unregisterFunc: function (handlerCallback) {
  10769. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged, { handler: handlerCallback }, callback); });
  10770. },
  10771. eventArgsTransformFunc: function (args) {
  10772. return OfficeExtension.Utility._createPromiseFromResult({ workbook: _this });
  10773. }
  10774. });
  10775. }
  10776. return this.m_selectionChanged;
  10777. },
  10778. enumerable: true,
  10779. configurable: true
  10780. });
  10781. Workbook.prototype.toJSON=function () {
  10782. return {};
  10783. };
  10784. return Workbook;
  10785. }(OfficeExtension.ClientObject));
  10786. Excel.Workbook=Workbook;
  10787. var Worksheet=(function (_super) {
  10788. __extends(Worksheet, _super);
  10789. function Worksheet() {
  10790. _super.apply(this, arguments);
  10791. }
  10792. Object.defineProperty(Worksheet.prototype, "charts", {
  10793. get: function () {
  10794. if (!this.m_charts) {
  10795. this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false));
  10796. }
  10797. return this.m_charts;
  10798. },
  10799. enumerable: true,
  10800. configurable: true
  10801. });
  10802. Object.defineProperty(Worksheet.prototype, "pivotTables", {
  10803. get: function () {
  10804. if (!this.m_pivotTables) {
  10805. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  10806. }
  10807. return this.m_pivotTables;
  10808. },
  10809. enumerable: true,
  10810. configurable: true
  10811. });
  10812. Object.defineProperty(Worksheet.prototype, "protection", {
  10813. get: function () {
  10814. if (!this.m_protection) {
  10815. this.m_protection=new Excel.WorksheetProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  10816. }
  10817. return this.m_protection;
  10818. },
  10819. enumerable: true,
  10820. configurable: true
  10821. });
  10822. Object.defineProperty(Worksheet.prototype, "tables", {
  10823. get: function () {
  10824. if (!this.m_tables) {
  10825. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  10826. }
  10827. return this.m_tables;
  10828. },
  10829. enumerable: true,
  10830. configurable: true
  10831. });
  10832. Object.defineProperty(Worksheet.prototype, "id", {
  10833. get: function () {
  10834. _throwIfNotLoaded("id", this.m_id, "Worksheet", this._isNull);
  10835. return this.m_id;
  10836. },
  10837. enumerable: true,
  10838. configurable: true
  10839. });
  10840. Object.defineProperty(Worksheet.prototype, "name", {
  10841. get: function () {
  10842. _throwIfNotLoaded("name", this.m_name, "Worksheet", this._isNull);
  10843. return this.m_name;
  10844. },
  10845. set: function (value) {
  10846. this.m_name=value;
  10847. _createSetPropertyAction(this.context, this, "Name", value);
  10848. },
  10849. enumerable: true,
  10850. configurable: true
  10851. });
  10852. Object.defineProperty(Worksheet.prototype, "position", {
  10853. get: function () {
  10854. _throwIfNotLoaded("position", this.m_position, "Worksheet", this._isNull);
  10855. return this.m_position;
  10856. },
  10857. set: function (value) {
  10858. this.m_position=value;
  10859. _createSetPropertyAction(this.context, this, "Position", value);
  10860. },
  10861. enumerable: true,
  10862. configurable: true
  10863. });
  10864. Object.defineProperty(Worksheet.prototype, "visibility", {
  10865. get: function () {
  10866. _throwIfNotLoaded("visibility", this.m_visibility, "Worksheet", this._isNull);
  10867. return this.m_visibility;
  10868. },
  10869. set: function (value) {
  10870. this.m_visibility=value;
  10871. _createSetPropertyAction(this.context, this, "Visibility", value);
  10872. },
  10873. enumerable: true,
  10874. configurable: true
  10875. });
  10876. Worksheet.prototype.activate=function () {
  10877. _createMethodAction(this.context, this, "Activate", OfficeExtension.OperationType.Read, []);
  10878. };
  10879. Worksheet.prototype.delete=function () {
  10880. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  10881. };
  10882. Worksheet.prototype.getCell=function (row, column) {
  10883. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  10884. };
  10885. Worksheet.prototype.getRange=function (address) {
  10886. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [address], false, true, null));
  10887. };
  10888. Worksheet.prototype.getUsedRange=function (valuesOnly) {
  10889. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  10890. };
  10891. Worksheet.prototype._handleResult=function (value) {
  10892. _super.prototype._handleResult.call(this, value);
  10893. if (_isNullOrUndefined(value))
  10894. return;
  10895. var obj=value;
  10896. _fixObjectPathIfNecessary(this, obj);
  10897. if (!_isUndefined(obj["Id"])) {
  10898. this.m_id=obj["Id"];
  10899. }
  10900. if (!_isUndefined(obj["Name"])) {
  10901. this.m_name=obj["Name"];
  10902. }
  10903. if (!_isUndefined(obj["Position"])) {
  10904. this.m_position=obj["Position"];
  10905. }
  10906. if (!_isUndefined(obj["Visibility"])) {
  10907. this.m_visibility=obj["Visibility"];
  10908. }
  10909. _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "pivotTables", "PivotTables", "protection", "Protection", "tables", "Tables"]);
  10910. };
  10911. Worksheet.prototype.load=function (option) {
  10912. _load(this, option);
  10913. return this;
  10914. };
  10915. Worksheet.prototype._handleIdResult=function (value) {
  10916. _super.prototype._handleIdResult.call(this, value);
  10917. if (_isNullOrUndefined(value)) {
  10918. return;
  10919. }
  10920. if (!_isUndefined(value["Id"])) {
  10921. this.m_id=value["Id"];
  10922. }
  10923. };
  10924. Worksheet.prototype.toJSON=function () {
  10925. return {
  10926. "id": this.m_id,
  10927. "name": this.m_name,
  10928. "position": this.m_position,
  10929. "protection": this.m_protection,
  10930. "visibility": this.m_visibility
  10931. };
  10932. };
  10933. return Worksheet;
  10934. }(OfficeExtension.ClientObject));
  10935. Excel.Worksheet=Worksheet;
  10936. var WorksheetCollection=(function (_super) {
  10937. __extends(WorksheetCollection, _super);
  10938. function WorksheetCollection() {
  10939. _super.apply(this, arguments);
  10940. }
  10941. Object.defineProperty(WorksheetCollection.prototype, "items", {
  10942. get: function () {
  10943. _throwIfNotLoaded("items", this.m__items, "WorksheetCollection", this._isNull);
  10944. return this.m__items;
  10945. },
  10946. enumerable: true,
  10947. configurable: true
  10948. });
  10949. WorksheetCollection.prototype.add=function (name) {
  10950. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [name], false, true, null));
  10951. };
  10952. WorksheetCollection.prototype.getActiveWorksheet=function () {
  10953. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", OfficeExtension.OperationType.Read, [], false, false, null));
  10954. };
  10955. WorksheetCollection.prototype.getItem=function (key) {
  10956. return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key]));
  10957. };
  10958. WorksheetCollection.prototype._handleResult=function (value) {
  10959. _super.prototype._handleResult.call(this, value);
  10960. if (_isNullOrUndefined(value))
  10961. return;
  10962. var obj=value;
  10963. _fixObjectPathIfNecessary(this, obj);
  10964. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  10965. this.m__items=[];
  10966. var _data=obj[OfficeExtension.Constants.items];
  10967. for (var i=0; i < _data.length; i++) {
  10968. var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  10969. _item._handleResult(_data[i]);
  10970. this.m__items.push(_item);
  10971. }
  10972. }
  10973. };
  10974. WorksheetCollection.prototype.load=function (option) {
  10975. _load(this, option);
  10976. return this;
  10977. };
  10978. WorksheetCollection.prototype.toJSON=function () {
  10979. return {};
  10980. };
  10981. return WorksheetCollection;
  10982. }(OfficeExtension.ClientObject));
  10983. Excel.WorksheetCollection=WorksheetCollection;
  10984. var WorksheetProtection=(function (_super) {
  10985. __extends(WorksheetProtection, _super);
  10986. function WorksheetProtection() {
  10987. _super.apply(this, arguments);
  10988. }
  10989. Object.defineProperty(WorksheetProtection.prototype, "options", {
  10990. get: function () {
  10991. _throwIfNotLoaded("options", this.m_options, "WorksheetProtection", this._isNull);
  10992. return this.m_options;
  10993. },
  10994. enumerable: true,
  10995. configurable: true
  10996. });
  10997. Object.defineProperty(WorksheetProtection.prototype, "protected", {
  10998. get: function () {
  10999. _throwIfNotLoaded("protected", this.m_protected, "WorksheetProtection", this._isNull);
  11000. return this.m_protected;
  11001. },
  11002. enumerable: true,
  11003. configurable: true
  11004. });
  11005. WorksheetProtection.prototype.protect=function (options) {
  11006. _createMethodAction(this.context, this, "Protect", OfficeExtension.OperationType.Default, [options]);
  11007. };
  11008. WorksheetProtection.prototype.unprotect=function () {
  11009. _createMethodAction(this.context, this, "Unprotect", OfficeExtension.OperationType.Default, []);
  11010. };
  11011. WorksheetProtection.prototype._handleResult=function (value) {
  11012. _super.prototype._handleResult.call(this, value);
  11013. if (_isNullOrUndefined(value))
  11014. return;
  11015. var obj=value;
  11016. _fixObjectPathIfNecessary(this, obj);
  11017. if (!_isUndefined(obj["Options"])) {
  11018. this.m_options=obj["Options"];
  11019. }
  11020. if (!_isUndefined(obj["Protected"])) {
  11021. this.m_protected=obj["Protected"];
  11022. }
  11023. };
  11024. WorksheetProtection.prototype.load=function (option) {
  11025. _load(this, option);
  11026. return this;
  11027. };
  11028. WorksheetProtection.prototype.toJSON=function () {
  11029. return {
  11030. "options": this.m_options,
  11031. "protected": this.m_protected
  11032. };
  11033. };
  11034. return WorksheetProtection;
  11035. }(OfficeExtension.ClientObject));
  11036. Excel.WorksheetProtection=WorksheetProtection;
  11037. var Range=(function (_super) {
  11038. __extends(Range, _super);
  11039. function Range() {
  11040. _super.apply(this, arguments);
  11041. }
  11042. Range.prototype._ensureInteger=function (num, methodName) {
  11043. if (!(typeof num==="number" && isFinite(num) && Math.floor(num)===num)) {
  11044. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, num, methodName);
  11045. }
  11046. };
  11047. Range.prototype._getAdjacentRange=function (functionName, count, referenceRange, rowDirection, columnDirection) {
  11048. if (count==null) {
  11049. count=1;
  11050. }
  11051. this._ensureInteger(count, functionName);
  11052. var startRange;
  11053. var rowOffset=0;
  11054. var columnOffset=0;
  11055. if (count > 0) {
  11056. startRange=referenceRange.getOffsetRange(rowDirection, columnDirection);
  11057. }
  11058. else {
  11059. startRange=referenceRange;
  11060. rowOffset=rowDirection;
  11061. columnOffset=columnDirection;
  11062. }
  11063. if (Math.abs(count)==1) {
  11064. return startRange;
  11065. }
  11066. return startRange.getBoundingRect(referenceRange.getOffsetRange(rowDirection * count+rowOffset, columnDirection * count+columnOffset));
  11067. };
  11068. Object.defineProperty(Range.prototype, "format", {
  11069. get: function () {
  11070. if (!this.m_format) {
  11071. this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  11072. }
  11073. return this.m_format;
  11074. },
  11075. enumerable: true,
  11076. configurable: true
  11077. });
  11078. Object.defineProperty(Range.prototype, "sort", {
  11079. get: function () {
  11080. if (!this.m_sort) {
  11081. this.m_sort=new Excel.RangeSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  11082. }
  11083. return this.m_sort;
  11084. },
  11085. enumerable: true,
  11086. configurable: true
  11087. });
  11088. Object.defineProperty(Range.prototype, "worksheet", {
  11089. get: function () {
  11090. if (!this.m_worksheet) {
  11091. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  11092. }
  11093. return this.m_worksheet;
  11094. },
  11095. enumerable: true,
  11096. configurable: true
  11097. });
  11098. Object.defineProperty(Range.prototype, "address", {
  11099. get: function () {
  11100. _throwIfNotLoaded("address", this.m_address, "Range", this._isNull);
  11101. return this.m_address;
  11102. },
  11103. enumerable: true,
  11104. configurable: true
  11105. });
  11106. Object.defineProperty(Range.prototype, "addressLocal", {
  11107. get: function () {
  11108. _throwIfNotLoaded("addressLocal", this.m_addressLocal, "Range", this._isNull);
  11109. return this.m_addressLocal;
  11110. },
  11111. enumerable: true,
  11112. configurable: true
  11113. });
  11114. Object.defineProperty(Range.prototype, "cellCount", {
  11115. get: function () {
  11116. _throwIfNotLoaded("cellCount", this.m_cellCount, "Range", this._isNull);
  11117. return this.m_cellCount;
  11118. },
  11119. enumerable: true,
  11120. configurable: true
  11121. });
  11122. Object.defineProperty(Range.prototype, "columnCount", {
  11123. get: function () {
  11124. _throwIfNotLoaded("columnCount", this.m_columnCount, "Range", this._isNull);
  11125. return this.m_columnCount;
  11126. },
  11127. enumerable: true,
  11128. configurable: true
  11129. });
  11130. Object.defineProperty(Range.prototype, "columnHidden", {
  11131. get: function () {
  11132. _throwIfNotLoaded("columnHidden", this.m_columnHidden, "Range", this._isNull);
  11133. return this.m_columnHidden;
  11134. },
  11135. set: function (value) {
  11136. this.m_columnHidden=value;
  11137. _createSetPropertyAction(this.context, this, "ColumnHidden", value);
  11138. },
  11139. enumerable: true,
  11140. configurable: true
  11141. });
  11142. Object.defineProperty(Range.prototype, "columnIndex", {
  11143. get: function () {
  11144. _throwIfNotLoaded("columnIndex", this.m_columnIndex, "Range", this._isNull);
  11145. return this.m_columnIndex;
  11146. },
  11147. enumerable: true,
  11148. configurable: true
  11149. });
  11150. Object.defineProperty(Range.prototype, "formulas", {
  11151. get: function () {
  11152. _throwIfNotLoaded("formulas", this.m_formulas, "Range", this._isNull);
  11153. return this.m_formulas;
  11154. },
  11155. set: function (value) {
  11156. this.m_formulas=value;
  11157. if (setRangePropertiesInBulk(this, "Formulas", value)) {
  11158. return;
  11159. }
  11160. this.m_formulas=value;
  11161. _createSetPropertyAction(this.context, this, "Formulas", value);
  11162. },
  11163. enumerable: true,
  11164. configurable: true
  11165. });
  11166. Object.defineProperty(Range.prototype, "formulasLocal", {
  11167. get: function () {
  11168. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "Range", this._isNull);
  11169. return this.m_formulasLocal;
  11170. },
  11171. set: function (value) {
  11172. this.m_formulasLocal=value;
  11173. if (setRangePropertiesInBulk(this, "FormulasLocal", value)) {
  11174. return;
  11175. }
  11176. this.m_formulasLocal=value;
  11177. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  11178. },
  11179. enumerable: true,
  11180. configurable: true
  11181. });
  11182. Object.defineProperty(Range.prototype, "formulasR1C1", {
  11183. get: function () {
  11184. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "Range", this._isNull);
  11185. return this.m_formulasR1C1;
  11186. },
  11187. set: function (value) {
  11188. this.m_formulasR1C1=value;
  11189. if (setRangePropertiesInBulk(this, "FormulasR1C1", value)) {
  11190. return;
  11191. }
  11192. this.m_formulasR1C1=value;
  11193. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  11194. },
  11195. enumerable: true,
  11196. configurable: true
  11197. });
  11198. Object.defineProperty(Range.prototype, "hidden", {
  11199. get: function () {
  11200. _throwIfNotLoaded("hidden", this.m_hidden, "Range", this._isNull);
  11201. return this.m_hidden;
  11202. },
  11203. enumerable: true,
  11204. configurable: true
  11205. });
  11206. Object.defineProperty(Range.prototype, "numberFormat", {
  11207. get: function () {
  11208. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "Range", this._isNull);
  11209. return this.m_numberFormat;
  11210. },
  11211. set: function (value) {
  11212. this.m_numberFormat=value;
  11213. if (setRangePropertiesInBulk(this, "NumberFormat", value)) {
  11214. return;
  11215. }
  11216. this.m_numberFormat=value;
  11217. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  11218. },
  11219. enumerable: true,
  11220. configurable: true
  11221. });
  11222. Object.defineProperty(Range.prototype, "rowCount", {
  11223. get: function () {
  11224. _throwIfNotLoaded("rowCount", this.m_rowCount, "Range", this._isNull);
  11225. return this.m_rowCount;
  11226. },
  11227. enumerable: true,
  11228. configurable: true
  11229. });
  11230. Object.defineProperty(Range.prototype, "rowHidden", {
  11231. get: function () {
  11232. _throwIfNotLoaded("rowHidden", this.m_rowHidden, "Range", this._isNull);
  11233. return this.m_rowHidden;
  11234. },
  11235. set: function (value) {
  11236. this.m_rowHidden=value;
  11237. _createSetPropertyAction(this.context, this, "RowHidden", value);
  11238. },
  11239. enumerable: true,
  11240. configurable: true
  11241. });
  11242. Object.defineProperty(Range.prototype, "rowIndex", {
  11243. get: function () {
  11244. _throwIfNotLoaded("rowIndex", this.m_rowIndex, "Range", this._isNull);
  11245. return this.m_rowIndex;
  11246. },
  11247. enumerable: true,
  11248. configurable: true
  11249. });
  11250. Object.defineProperty(Range.prototype, "text", {
  11251. get: function () {
  11252. _throwIfNotLoaded("text", this.m_text, "Range", this._isNull);
  11253. return this.m_text;
  11254. },
  11255. enumerable: true,
  11256. configurable: true
  11257. });
  11258. Object.defineProperty(Range.prototype, "valueTypes", {
  11259. get: function () {
  11260. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "Range", this._isNull);
  11261. return this.m_valueTypes;
  11262. },
  11263. enumerable: true,
  11264. configurable: true
  11265. });
  11266. Object.defineProperty(Range.prototype, "values", {
  11267. get: function () {
  11268. _throwIfNotLoaded("values", this.m_values, "Range", this._isNull);
  11269. return this.m_values;
  11270. },
  11271. set: function (value) {
  11272. this.m_values=value;
  11273. if (setRangePropertiesInBulk(this, "Values", value)) {
  11274. return;
  11275. }
  11276. this.m_values=value;
  11277. _createSetPropertyAction(this.context, this, "Values", value);
  11278. },
  11279. enumerable: true,
  11280. configurable: true
  11281. });
  11282. Object.defineProperty(Range.prototype, "_ReferenceId", {
  11283. get: function () {
  11284. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId, "Range", this._isNull);
  11285. return this.m__ReferenceId;
  11286. },
  11287. enumerable: true,
  11288. configurable: true
  11289. });
  11290. Range.prototype.clear=function (applyTo) {
  11291. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, [applyTo]);
  11292. };
  11293. Range.prototype.delete=function (shift) {
  11294. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, [shift]);
  11295. };
  11296. Range.prototype.getBoundingRect=function (anotherRange) {
  11297. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  11298. };
  11299. Range.prototype.getCell=function (row, column) {
  11300. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  11301. };
  11302. Range.prototype.getColumn=function (column) {
  11303. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", OfficeExtension.OperationType.Read, [column], false, true, null));
  11304. };
  11305. Range.prototype.getColumnsAfter=function (count) {
  11306. if (!isExcel1_3OrAbove()) {
  11307. if (count==null) {
  11308. count=1;
  11309. }
  11310. this._ensureInteger(count, "RowsAbove");
  11311. if (count==0) {
  11312. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11313. }
  11314. return this._getAdjacentRange("getColumnsAfter", count, this.getLastColumn(), 0, 1);
  11315. }
  11316. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsAfter", OfficeExtension.OperationType.Read, [count], false, true, null));
  11317. };
  11318. Range.prototype.getColumnsBefore=function (count) {
  11319. if (!isExcel1_3OrAbove()) {
  11320. if (count==null) {
  11321. count=1;
  11322. }
  11323. this._ensureInteger(count, "RowsAbove");
  11324. if (count==0) {
  11325. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11326. }
  11327. return this._getAdjacentRange("getColumnsBefore", count, this.getColumn(0), 0, -1);
  11328. }
  11329. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsBefore", OfficeExtension.OperationType.Read, [count], false, true, null));
  11330. };
  11331. Range.prototype.getEntireColumn=function () {
  11332. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  11333. };
  11334. Range.prototype.getEntireRow=function () {
  11335. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", OfficeExtension.OperationType.Read, [], false, true, null));
  11336. };
  11337. Range.prototype.getIntersection=function (anotherRange) {
  11338. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  11339. };
  11340. Range.prototype.getLastCell=function () {
  11341. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", OfficeExtension.OperationType.Read, [], false, true, null));
  11342. };
  11343. Range.prototype.getLastColumn=function () {
  11344. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  11345. };
  11346. Range.prototype.getLastRow=function () {
  11347. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", OfficeExtension.OperationType.Read, [], false, true, null));
  11348. };
  11349. Range.prototype.getOffsetRange=function (rowOffset, columnOffset) {
  11350. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", OfficeExtension.OperationType.Read, [rowOffset, columnOffset], false, true, null));
  11351. };
  11352. Range.prototype.getResizedRange=function (deltaRows, deltaColumns) {
  11353. if (!isExcel1_3OrAbove()) {
  11354. this._ensureInteger(deltaRows, "getResizedRange");
  11355. this._ensureInteger(deltaColumns, "getResizedRange");
  11356. var referenceRange=(deltaRows >=0 && deltaColumns >=0) ? this : this.getCell(0, 0);
  11357. return referenceRange.getBoundingRect(this.getLastCell().getOffsetRange(deltaRows, deltaColumns));
  11358. }
  11359. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetResizedRange", OfficeExtension.OperationType.Read, [deltaRows, deltaColumns], false, true, null));
  11360. };
  11361. Range.prototype.getRow=function (row) {
  11362. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", OfficeExtension.OperationType.Read, [row], false, true, null));
  11363. };
  11364. Range.prototype.getRowsAbove=function (count) {
  11365. if (!isExcel1_3OrAbove()) {
  11366. if (count==null) {
  11367. count=1;
  11368. }
  11369. this._ensureInteger(count, "RowsAbove");
  11370. if (count==0) {
  11371. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11372. }
  11373. return this._getAdjacentRange("getRowsAbove", count, this.getRow(0), -1, 0);
  11374. }
  11375. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsAbove", OfficeExtension.OperationType.Read, [count], false, true, null));
  11376. };
  11377. Range.prototype.getRowsBelow=function (count) {
  11378. if (!isExcel1_3OrAbove()) {
  11379. if (count==null) {
  11380. count=1;
  11381. }
  11382. this._ensureInteger(count, "RowsAbove");
  11383. if (count==0) {
  11384. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11385. }
  11386. return this._getAdjacentRange("getRowsBelow", count, this.getLastRow(), 1, 0);
  11387. }
  11388. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsBelow", OfficeExtension.OperationType.Read, [count], false, true, null));
  11389. };
  11390. Range.prototype.getUsedRange=function (valuesOnly) {
  11391. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  11392. };
  11393. Range.prototype.getVisibleView=function () {
  11394. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetVisibleView", OfficeExtension.OperationType.Read, [], false, false, null));
  11395. };
  11396. Range.prototype.insert=function (shift) {
  11397. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", OfficeExtension.OperationType.Default, [shift], false, true, null));
  11398. };
  11399. Range.prototype.merge=function (across) {
  11400. _createMethodAction(this.context, this, "Merge", OfficeExtension.OperationType.Default, [across]);
  11401. };
  11402. Range.prototype.select=function () {
  11403. _createMethodAction(this.context, this, "Select", OfficeExtension.OperationType.Read, []);
  11404. };
  11405. Range.prototype.unmerge=function () {
  11406. _createMethodAction(this.context, this, "Unmerge", OfficeExtension.OperationType.Default, []);
  11407. };
  11408. Range.prototype._KeepReference=function () {
  11409. _createMethodAction(this.context, this, "_KeepReference", OfficeExtension.OperationType.Read, []);
  11410. };
  11411. Range.prototype._ValidateArraySize=function (rows, columns) {
  11412. _createMethodAction(this.context, this, "_ValidateArraySize", OfficeExtension.OperationType.Read, [rows, columns]);
  11413. };
  11414. Range.prototype._handleResult=function (value) {
  11415. _super.prototype._handleResult.call(this, value);
  11416. if (_isNullOrUndefined(value))
  11417. return;
  11418. var obj=value;
  11419. _fixObjectPathIfNecessary(this, obj);
  11420. if (!_isUndefined(obj["Address"])) {
  11421. this.m_address=obj["Address"];
  11422. }
  11423. if (!_isUndefined(obj["AddressLocal"])) {
  11424. this.m_addressLocal=obj["AddressLocal"];
  11425. }
  11426. if (!_isUndefined(obj["CellCount"])) {
  11427. this.m_cellCount=obj["CellCount"];
  11428. }
  11429. if (!_isUndefined(obj["ColumnCount"])) {
  11430. this.m_columnCount=obj["ColumnCount"];
  11431. }
  11432. if (!_isUndefined(obj["ColumnHidden"])) {
  11433. this.m_columnHidden=obj["ColumnHidden"];
  11434. }
  11435. if (!_isUndefined(obj["ColumnIndex"])) {
  11436. this.m_columnIndex=obj["ColumnIndex"];
  11437. }
  11438. if (!_isUndefined(obj["Formulas"])) {
  11439. this.m_formulas=obj["Formulas"];
  11440. }
  11441. if (!_isUndefined(obj["FormulasLocal"])) {
  11442. this.m_formulasLocal=obj["FormulasLocal"];
  11443. }
  11444. if (!_isUndefined(obj["FormulasR1C1"])) {
  11445. this.m_formulasR1C1=obj["FormulasR1C1"];
  11446. }
  11447. if (!_isUndefined(obj["Hidden"])) {
  11448. this.m_hidden=obj["Hidden"];
  11449. }
  11450. if (!_isUndefined(obj["NumberFormat"])) {
  11451. this.m_numberFormat=obj["NumberFormat"];
  11452. }
  11453. if (!_isUndefined(obj["RowCount"])) {
  11454. this.m_rowCount=obj["RowCount"];
  11455. }
  11456. if (!_isUndefined(obj["RowHidden"])) {
  11457. this.m_rowHidden=obj["RowHidden"];
  11458. }
  11459. if (!_isUndefined(obj["RowIndex"])) {
  11460. this.m_rowIndex=obj["RowIndex"];
  11461. }
  11462. if (!_isUndefined(obj["Text"])) {
  11463. this.m_text=obj["Text"];
  11464. }
  11465. if (!_isUndefined(obj["ValueTypes"])) {
  11466. this.m_valueTypes=obj["ValueTypes"];
  11467. }
  11468. if (!_isUndefined(obj["Values"])) {
  11469. this.m_values=obj["Values"];
  11470. }
  11471. if (!_isUndefined(obj["_ReferenceId"])) {
  11472. this.m__ReferenceId=obj["_ReferenceId"];
  11473. }
  11474. _handleNavigationPropertyResults(this, obj, ["format", "Format", "sort", "Sort", "worksheet", "Worksheet"]);
  11475. };
  11476. Range.prototype.load=function (option) {
  11477. _load(this, option);
  11478. return this;
  11479. };
  11480. Range.prototype._handleIdResult=function (value) {
  11481. _super.prototype._handleIdResult.call(this, value);
  11482. if (_isNullOrUndefined(value)) {
  11483. return;
  11484. }
  11485. if (!_isUndefined(value["_ReferenceId"])) {
  11486. this.m__ReferenceId=value["_ReferenceId"];
  11487. }
  11488. };
  11489. Range.prototype.track=function () {
  11490. this.context.trackedObjects.add(this);
  11491. return this;
  11492. };
  11493. Range.prototype.untrack=function () {
  11494. this.context.trackedObjects.remove(this);
  11495. return this;
  11496. };
  11497. Range.prototype.toJSON=function () {
  11498. return {
  11499. "address": this.m_address,
  11500. "addressLocal": this.m_addressLocal,
  11501. "cellCount": this.m_cellCount,
  11502. "columnCount": this.m_columnCount,
  11503. "columnHidden": this.m_columnHidden,
  11504. "columnIndex": this.m_columnIndex,
  11505. "format": this.m_format,
  11506. "formulas": this.m_formulas,
  11507. "formulasLocal": this.m_formulasLocal,
  11508. "formulasR1C1": this.m_formulasR1C1,
  11509. "hidden": this.m_hidden,
  11510. "numberFormat": this.m_numberFormat,
  11511. "rowCount": this.m_rowCount,
  11512. "rowHidden": this.m_rowHidden,
  11513. "rowIndex": this.m_rowIndex,
  11514. "text": this.m_text,
  11515. "values": this.m_values,
  11516. "valueTypes": this.m_valueTypes
  11517. };
  11518. };
  11519. return Range;
  11520. }(OfficeExtension.ClientObject));
  11521. Excel.Range=Range;
  11522. var RangeView=(function (_super) {
  11523. __extends(RangeView, _super);
  11524. function RangeView() {
  11525. _super.apply(this, arguments);
  11526. }
  11527. Object.defineProperty(RangeView.prototype, "rows", {
  11528. get: function () {
  11529. if (!this.m_rows) {
  11530. this.m_rows=new Excel.RangeViewCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  11531. }
  11532. return this.m_rows;
  11533. },
  11534. enumerable: true,
  11535. configurable: true
  11536. });
  11537. Object.defineProperty(RangeView.prototype, "cellAddresses", {
  11538. get: function () {
  11539. _throwIfNotLoaded("cellAddresses", this.m_cellAddresses, "RangeView", this._isNull);
  11540. return this.m_cellAddresses;
  11541. },
  11542. enumerable: true,
  11543. configurable: true
  11544. });
  11545. Object.defineProperty(RangeView.prototype, "columnCount", {
  11546. get: function () {
  11547. _throwIfNotLoaded("columnCount", this.m_columnCount, "RangeView", this._isNull);
  11548. return this.m_columnCount;
  11549. },
  11550. enumerable: true,
  11551. configurable: true
  11552. });
  11553. Object.defineProperty(RangeView.prototype, "formulas", {
  11554. get: function () {
  11555. _throwIfNotLoaded("formulas", this.m_formulas, "RangeView", this._isNull);
  11556. return this.m_formulas;
  11557. },
  11558. set: function (value) {
  11559. this.m_formulas=value;
  11560. _createSetPropertyAction(this.context, this, "Formulas", value);
  11561. },
  11562. enumerable: true,
  11563. configurable: true
  11564. });
  11565. Object.defineProperty(RangeView.prototype, "formulasLocal", {
  11566. get: function () {
  11567. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "RangeView", this._isNull);
  11568. return this.m_formulasLocal;
  11569. },
  11570. set: function (value) {
  11571. this.m_formulasLocal=value;
  11572. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  11573. },
  11574. enumerable: true,
  11575. configurable: true
  11576. });
  11577. Object.defineProperty(RangeView.prototype, "formulasR1C1", {
  11578. get: function () {
  11579. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "RangeView", this._isNull);
  11580. return this.m_formulasR1C1;
  11581. },
  11582. set: function (value) {
  11583. this.m_formulasR1C1=value;
  11584. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  11585. },
  11586. enumerable: true,
  11587. configurable: true
  11588. });
  11589. Object.defineProperty(RangeView.prototype, "index", {
  11590. get: function () {
  11591. _throwIfNotLoaded("index", this.m_index, "RangeView", this._isNull);
  11592. return this.m_index;
  11593. },
  11594. enumerable: true,
  11595. configurable: true
  11596. });
  11597. Object.defineProperty(RangeView.prototype, "numberFormat", {
  11598. get: function () {
  11599. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "RangeView", this._isNull);
  11600. return this.m_numberFormat;
  11601. },
  11602. set: function (value) {
  11603. this.m_numberFormat=value;
  11604. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  11605. },
  11606. enumerable: true,
  11607. configurable: true
  11608. });
  11609. Object.defineProperty(RangeView.prototype, "rowCount", {
  11610. get: function () {
  11611. _throwIfNotLoaded("rowCount", this.m_rowCount, "RangeView", this._isNull);
  11612. return this.m_rowCount;
  11613. },
  11614. enumerable: true,
  11615. configurable: true
  11616. });
  11617. Object.defineProperty(RangeView.prototype, "text", {
  11618. get: function () {
  11619. _throwIfNotLoaded("text", this.m_text, "RangeView", this._isNull);
  11620. return this.m_text;
  11621. },
  11622. enumerable: true,
  11623. configurable: true
  11624. });
  11625. Object.defineProperty(RangeView.prototype, "valueTypes", {
  11626. get: function () {
  11627. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "RangeView", this._isNull);
  11628. return this.m_valueTypes;
  11629. },
  11630. enumerable: true,
  11631. configurable: true
  11632. });
  11633. Object.defineProperty(RangeView.prototype, "values", {
  11634. get: function () {
  11635. _throwIfNotLoaded("values", this.m_values, "RangeView", this._isNull);
  11636. return this.m_values;
  11637. },
  11638. set: function (value) {
  11639. this.m_values=value;
  11640. _createSetPropertyAction(this.context, this, "Values", value);
  11641. },
  11642. enumerable: true,
  11643. configurable: true
  11644. });
  11645. RangeView.prototype.getRange=function () {
  11646. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  11647. };
  11648. RangeView.prototype._handleResult=function (value) {
  11649. _super.prototype._handleResult.call(this, value);
  11650. if (_isNullOrUndefined(value))
  11651. return;
  11652. var obj=value;
  11653. _fixObjectPathIfNecessary(this, obj);
  11654. if (!_isUndefined(obj["CellAddresses"])) {
  11655. this.m_cellAddresses=obj["CellAddresses"];
  11656. }
  11657. if (!_isUndefined(obj["ColumnCount"])) {
  11658. this.m_columnCount=obj["ColumnCount"];
  11659. }
  11660. if (!_isUndefined(obj["Formulas"])) {
  11661. this.m_formulas=obj["Formulas"];
  11662. }
  11663. if (!_isUndefined(obj["FormulasLocal"])) {
  11664. this.m_formulasLocal=obj["FormulasLocal"];
  11665. }
  11666. if (!_isUndefined(obj["FormulasR1C1"])) {
  11667. this.m_formulasR1C1=obj["FormulasR1C1"];
  11668. }
  11669. if (!_isUndefined(obj["Index"])) {
  11670. this.m_index=obj["Index"];
  11671. }
  11672. if (!_isUndefined(obj["NumberFormat"])) {
  11673. this.m_numberFormat=obj["NumberFormat"];
  11674. }
  11675. if (!_isUndefined(obj["RowCount"])) {
  11676. this.m_rowCount=obj["RowCount"];
  11677. }
  11678. if (!_isUndefined(obj["Text"])) {
  11679. this.m_text=obj["Text"];
  11680. }
  11681. if (!_isUndefined(obj["ValueTypes"])) {
  11682. this.m_valueTypes=obj["ValueTypes"];
  11683. }
  11684. if (!_isUndefined(obj["Values"])) {
  11685. this.m_values=obj["Values"];
  11686. }
  11687. _handleNavigationPropertyResults(this, obj, ["rows", "Rows"]);
  11688. };
  11689. RangeView.prototype.load=function (option) {
  11690. _load(this, option);
  11691. return this;
  11692. };
  11693. RangeView.prototype.toJSON=function () {
  11694. return {
  11695. "cellAddresses": this.m_cellAddresses,
  11696. "columnCount": this.m_columnCount,
  11697. "formulas": this.m_formulas,
  11698. "formulasLocal": this.m_formulasLocal,
  11699. "formulasR1C1": this.m_formulasR1C1,
  11700. "index": this.m_index,
  11701. "numberFormat": this.m_numberFormat,
  11702. "rowCount": this.m_rowCount,
  11703. "text": this.m_text,
  11704. "values": this.m_values,
  11705. "valueTypes": this.m_valueTypes
  11706. };
  11707. };
  11708. return RangeView;
  11709. }(OfficeExtension.ClientObject));
  11710. Excel.RangeView=RangeView;
  11711. var RangeViewCollection=(function (_super) {
  11712. __extends(RangeViewCollection, _super);
  11713. function RangeViewCollection() {
  11714. _super.apply(this, arguments);
  11715. }
  11716. Object.defineProperty(RangeViewCollection.prototype, "items", {
  11717. get: function () {
  11718. _throwIfNotLoaded("items", this.m__items, "RangeViewCollection", this._isNull);
  11719. return this.m__items;
  11720. },
  11721. enumerable: true,
  11722. configurable: true
  11723. });
  11724. RangeViewCollection.prototype.getItemAt=function (index) {
  11725. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  11726. };
  11727. RangeViewCollection.prototype._handleResult=function (value) {
  11728. _super.prototype._handleResult.call(this, value);
  11729. if (_isNullOrUndefined(value))
  11730. return;
  11731. var obj=value;
  11732. _fixObjectPathIfNecessary(this, obj);
  11733. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11734. this.m__items=[];
  11735. var _data=obj[OfficeExtension.Constants.items];
  11736. for (var i=0; i < _data.length; i++) {
  11737. var _item=new Excel.RangeView(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  11738. _item._handleResult(_data[i]);
  11739. this.m__items.push(_item);
  11740. }
  11741. }
  11742. };
  11743. RangeViewCollection.prototype.load=function (option) {
  11744. _load(this, option);
  11745. return this;
  11746. };
  11747. RangeViewCollection.prototype.toJSON=function () {
  11748. return {};
  11749. };
  11750. return RangeViewCollection;
  11751. }(OfficeExtension.ClientObject));
  11752. Excel.RangeViewCollection=RangeViewCollection;
  11753. var Setting=(function (_super) {
  11754. __extends(Setting, _super);
  11755. function Setting() {
  11756. _super.apply(this, arguments);
  11757. }
  11758. Object.defineProperty(Setting.prototype, "value", {
  11759. get: function () {
  11760. return JSON.parse(this._Value);
  11761. },
  11762. set: function (value) {
  11763. this._Value=JSON.stringify(value);
  11764. },
  11765. enumerable: true,
  11766. configurable: true
  11767. });
  11768. Object.defineProperty(Setting.prototype, "key", {
  11769. get: function () {
  11770. _throwIfNotLoaded("key", this.m_key, "Setting", this._isNull);
  11771. return this.m_key;
  11772. },
  11773. enumerable: true,
  11774. configurable: true
  11775. });
  11776. Object.defineProperty(Setting.prototype, "_Value", {
  11777. get: function () {
  11778. _throwIfNotLoaded("_Value", this.m__Value, "Setting", this._isNull);
  11779. return this.m__Value;
  11780. },
  11781. set: function (value) {
  11782. this.m__Value=value;
  11783. _createSetPropertyAction(this.context, this, "_Value", value);
  11784. },
  11785. enumerable: true,
  11786. configurable: true
  11787. });
  11788. Setting.prototype.delete=function () {
  11789. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  11790. };
  11791. Setting.prototype._handleResult=function (value) {
  11792. _super.prototype._handleResult.call(this, value);
  11793. if (_isNullOrUndefined(value))
  11794. return;
  11795. var obj=value;
  11796. _fixObjectPathIfNecessary(this, obj);
  11797. if (!_isUndefined(obj["Key"])) {
  11798. this.m_key=obj["Key"];
  11799. }
  11800. if (!_isUndefined(obj["_Value"])) {
  11801. this.m__Value=obj["_Value"];
  11802. }
  11803. };
  11804. Setting.prototype.load=function (option) {
  11805. _load(this, option);
  11806. return this;
  11807. };
  11808. Setting.prototype.toJSON=function () {
  11809. return {
  11810. "key": this.m_key
  11811. };
  11812. };
  11813. return Setting;
  11814. }(OfficeExtension.ClientObject));
  11815. Excel.Setting=Setting;
  11816. var NamedItemCollection=(function (_super) {
  11817. __extends(NamedItemCollection, _super);
  11818. function NamedItemCollection() {
  11819. _super.apply(this, arguments);
  11820. }
  11821. Object.defineProperty(NamedItemCollection.prototype, "items", {
  11822. get: function () {
  11823. _throwIfNotLoaded("items", this.m__items, "NamedItemCollection", this._isNull);
  11824. return this.m__items;
  11825. },
  11826. enumerable: true,
  11827. configurable: true
  11828. });
  11829. NamedItemCollection.prototype.getItem=function (name) {
  11830. return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name]));
  11831. };
  11832. NamedItemCollection.prototype._handleResult=function (value) {
  11833. _super.prototype._handleResult.call(this, value);
  11834. if (_isNullOrUndefined(value))
  11835. return;
  11836. var obj=value;
  11837. _fixObjectPathIfNecessary(this, obj);
  11838. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11839. this.m__items=[];
  11840. var _data=obj[OfficeExtension.Constants.items];
  11841. for (var i=0; i < _data.length; i++) {
  11842. var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  11843. _item._handleResult(_data[i]);
  11844. this.m__items.push(_item);
  11845. }
  11846. }
  11847. };
  11848. NamedItemCollection.prototype.load=function (option) {
  11849. _load(this, option);
  11850. return this;
  11851. };
  11852. NamedItemCollection.prototype.toJSON=function () {
  11853. return {};
  11854. };
  11855. return NamedItemCollection;
  11856. }(OfficeExtension.ClientObject));
  11857. Excel.NamedItemCollection=NamedItemCollection;
  11858. var NamedItem=(function (_super) {
  11859. __extends(NamedItem, _super);
  11860. function NamedItem() {
  11861. _super.apply(this, arguments);
  11862. }
  11863. Object.defineProperty(NamedItem.prototype, "name", {
  11864. get: function () {
  11865. _throwIfNotLoaded("name", this.m_name, "NamedItem", this._isNull);
  11866. return this.m_name;
  11867. },
  11868. enumerable: true,
  11869. configurable: true
  11870. });
  11871. Object.defineProperty(NamedItem.prototype, "type", {
  11872. get: function () {
  11873. _throwIfNotLoaded("type", this.m_type, "NamedItem", this._isNull);
  11874. return this.m_type;
  11875. },
  11876. enumerable: true,
  11877. configurable: true
  11878. });
  11879. Object.defineProperty(NamedItem.prototype, "value", {
  11880. get: function () {
  11881. _throwIfNotLoaded("value", this.m_value, "NamedItem", this._isNull);
  11882. return this.m_value;
  11883. },
  11884. enumerable: true,
  11885. configurable: true
  11886. });
  11887. Object.defineProperty(NamedItem.prototype, "visible", {
  11888. get: function () {
  11889. _throwIfNotLoaded("visible", this.m_visible, "NamedItem", this._isNull);
  11890. return this.m_visible;
  11891. },
  11892. set: function (value) {
  11893. this.m_visible=value;
  11894. _createSetPropertyAction(this.context, this, "Visible", value);
  11895. },
  11896. enumerable: true,
  11897. configurable: true
  11898. });
  11899. Object.defineProperty(NamedItem.prototype, "_Id", {
  11900. get: function () {
  11901. _throwIfNotLoaded("_Id", this.m__Id, "NamedItem", this._isNull);
  11902. return this.m__Id;
  11903. },
  11904. enumerable: true,
  11905. configurable: true
  11906. });
  11907. NamedItem.prototype.getRange=function () {
  11908. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  11909. };
  11910. NamedItem.prototype._handleResult=function (value) {
  11911. _super.prototype._handleResult.call(this, value);
  11912. if (_isNullOrUndefined(value))
  11913. return;
  11914. var obj=value;
  11915. _fixObjectPathIfNecessary(this, obj);
  11916. if (!_isUndefined(obj["Name"])) {
  11917. this.m_name=obj["Name"];
  11918. }
  11919. if (!_isUndefined(obj["Type"])) {
  11920. this.m_type=obj["Type"];
  11921. }
  11922. if (!_isUndefined(obj["Value"])) {
  11923. this.m_value=obj["Value"];
  11924. }
  11925. if (!_isUndefined(obj["Visible"])) {
  11926. this.m_visible=obj["Visible"];
  11927. }
  11928. if (!_isUndefined(obj["_Id"])) {
  11929. this.m__Id=obj["_Id"];
  11930. }
  11931. };
  11932. NamedItem.prototype.load=function (option) {
  11933. _load(this, option);
  11934. return this;
  11935. };
  11936. NamedItem.prototype._handleIdResult=function (value) {
  11937. _super.prototype._handleIdResult.call(this, value);
  11938. if (_isNullOrUndefined(value)) {
  11939. return;
  11940. }
  11941. if (!_isUndefined(value["_Id"])) {
  11942. this.m__Id=value["_Id"];
  11943. }
  11944. };
  11945. NamedItem.prototype.toJSON=function () {
  11946. return {
  11947. "name": this.m_name,
  11948. "type": this.m_type,
  11949. "value": this.m_value,
  11950. "visible": this.m_visible
  11951. };
  11952. };
  11953. return NamedItem;
  11954. }(OfficeExtension.ClientObject));
  11955. Excel.NamedItem=NamedItem;
  11956. var Binding=(function (_super) {
  11957. __extends(Binding, _super);
  11958. function Binding() {
  11959. _super.apply(this, arguments);
  11960. }
  11961. Object.defineProperty(Binding.prototype, "id", {
  11962. get: function () {
  11963. _throwIfNotLoaded("id", this.m_id, "Binding", this._isNull);
  11964. return this.m_id;
  11965. },
  11966. enumerable: true,
  11967. configurable: true
  11968. });
  11969. Object.defineProperty(Binding.prototype, "type", {
  11970. get: function () {
  11971. _throwIfNotLoaded("type", this.m_type, "Binding", this._isNull);
  11972. return this.m_type;
  11973. },
  11974. enumerable: true,
  11975. configurable: true
  11976. });
  11977. Binding.prototype.delete=function () {
  11978. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  11979. };
  11980. Binding.prototype.getRange=function () {
  11981. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, false, null));
  11982. };
  11983. Binding.prototype.getTable=function () {
  11984. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", OfficeExtension.OperationType.Read, [], false, false, null));
  11985. };
  11986. Binding.prototype.getText=function () {
  11987. var action=_createMethodAction(this.context, this, "GetText", OfficeExtension.OperationType.Read, []);
  11988. var ret=new OfficeExtension.ClientResult();
  11989. _addActionResultHandler(this, action, ret);
  11990. return ret;
  11991. };
  11992. Binding.prototype._handleResult=function (value) {
  11993. _super.prototype._handleResult.call(this, value);
  11994. if (_isNullOrUndefined(value))
  11995. return;
  11996. var obj=value;
  11997. _fixObjectPathIfNecessary(this, obj);
  11998. if (!_isUndefined(obj["Id"])) {
  11999. this.m_id=obj["Id"];
  12000. }
  12001. if (!_isUndefined(obj["Type"])) {
  12002. this.m_type=obj["Type"];
  12003. }
  12004. };
  12005. Binding.prototype.load=function (option) {
  12006. _load(this, option);
  12007. return this;
  12008. };
  12009. Binding.prototype._handleIdResult=function (value) {
  12010. _super.prototype._handleIdResult.call(this, value);
  12011. if (_isNullOrUndefined(value)) {
  12012. return;
  12013. }
  12014. if (!_isUndefined(value["Id"])) {
  12015. this.m_id=value["Id"];
  12016. }
  12017. };
  12018. Object.defineProperty(Binding.prototype, "onDataChanged", {
  12019. get: function () {
  12020. var _this=this;
  12021. if (!this.m_dataChanged) {
  12022. this.m_dataChanged=new OfficeExtension.EventHandlers(this.context, this, "DataChanged", {
  12023. registerFunc: function (handlerCallback) {
  12024. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12025. .then(function (officeBinding) {
  12026. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingDataChanged, handlerCallback, callback); });
  12027. });
  12028. },
  12029. unregisterFunc: function (handlerCallback) {
  12030. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12031. .then(function (officeBinding) {
  12032. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingDataChanged, { handler: handlerCallback }, callback); });
  12033. });
  12034. },
  12035. eventArgsTransformFunc: function (args) {
  12036. var evt={
  12037. binding: _this
  12038. };
  12039. return OfficeExtension.Utility._createPromiseFromResult(evt);
  12040. }
  12041. });
  12042. }
  12043. return this.m_dataChanged;
  12044. },
  12045. enumerable: true,
  12046. configurable: true
  12047. });
  12048. Object.defineProperty(Binding.prototype, "onSelectionChanged", {
  12049. get: function () {
  12050. var _this=this;
  12051. if (!this.m_selectionChanged) {
  12052. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  12053. registerFunc: function (handlerCallback) {
  12054. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12055. .then(function (officeBinding) {
  12056. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingSelectionChanged, handlerCallback, callback); });
  12057. });
  12058. },
  12059. unregisterFunc: function (handlerCallback) {
  12060. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12061. .then(function (officeBinding) {
  12062. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingSelectionChanged, { handler: handlerCallback }, callback); });
  12063. });
  12064. },
  12065. eventArgsTransformFunc: function (args) {
  12066. var evt={
  12067. binding: _this,
  12068. columnCount: args.columnCount,
  12069. rowCount: args.rowCount,
  12070. startColumn: args.startColumn,
  12071. startRow: args.startRow
  12072. };
  12073. return OfficeExtension.Utility._createPromiseFromResult(evt);
  12074. }
  12075. });
  12076. }
  12077. return this.m_selectionChanged;
  12078. },
  12079. enumerable: true,
  12080. configurable: true
  12081. });
  12082. Binding.prototype.toJSON=function () {
  12083. return {
  12084. "id": this.m_id,
  12085. "type": this.m_type
  12086. };
  12087. };
  12088. return Binding;
  12089. }(OfficeExtension.ClientObject));
  12090. Excel.Binding=Binding;
  12091. var BindingCollection=(function (_super) {
  12092. __extends(BindingCollection, _super);
  12093. function BindingCollection() {
  12094. _super.apply(this, arguments);
  12095. }
  12096. Object.defineProperty(BindingCollection.prototype, "items", {
  12097. get: function () {
  12098. _throwIfNotLoaded("items", this.m__items, "BindingCollection", this._isNull);
  12099. return this.m__items;
  12100. },
  12101. enumerable: true,
  12102. configurable: true
  12103. });
  12104. Object.defineProperty(BindingCollection.prototype, "count", {
  12105. get: function () {
  12106. _throwIfNotLoaded("count", this.m_count, "BindingCollection", this._isNull);
  12107. return this.m_count;
  12108. },
  12109. enumerable: true,
  12110. configurable: true
  12111. });
  12112. BindingCollection.prototype.add=function (range, bindingType, id) {
  12113. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [range, bindingType, id], false, true, null));
  12114. };
  12115. BindingCollection.prototype.addFromNamedItem=function (name, bindingType, id) {
  12116. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromNamedItem", OfficeExtension.OperationType.Default, [name, bindingType, id], false, false, null));
  12117. };
  12118. BindingCollection.prototype.addFromSelection=function (bindingType, id) {
  12119. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromSelection", OfficeExtension.OperationType.Default, [bindingType, id], false, false, null));
  12120. };
  12121. BindingCollection.prototype.getItem=function (id) {
  12122. return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id]));
  12123. };
  12124. BindingCollection.prototype.getItemAt=function (index) {
  12125. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12126. };
  12127. BindingCollection.prototype._handleResult=function (value) {
  12128. _super.prototype._handleResult.call(this, value);
  12129. if (_isNullOrUndefined(value))
  12130. return;
  12131. var obj=value;
  12132. _fixObjectPathIfNecessary(this, obj);
  12133. if (!_isUndefined(obj["Count"])) {
  12134. this.m_count=obj["Count"];
  12135. }
  12136. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12137. this.m__items=[];
  12138. var _data=obj[OfficeExtension.Constants.items];
  12139. for (var i=0; i < _data.length; i++) {
  12140. var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12141. _item._handleResult(_data[i]);
  12142. this.m__items.push(_item);
  12143. }
  12144. }
  12145. };
  12146. BindingCollection.prototype.load=function (option) {
  12147. _load(this, option);
  12148. return this;
  12149. };
  12150. BindingCollection.prototype.toJSON=function () {
  12151. return {
  12152. "count": this.m_count
  12153. };
  12154. };
  12155. return BindingCollection;
  12156. }(OfficeExtension.ClientObject));
  12157. Excel.BindingCollection=BindingCollection;
  12158. var TableCollection=(function (_super) {
  12159. __extends(TableCollection, _super);
  12160. function TableCollection() {
  12161. _super.apply(this, arguments);
  12162. }
  12163. Object.defineProperty(TableCollection.prototype, "items", {
  12164. get: function () {
  12165. _throwIfNotLoaded("items", this.m__items, "TableCollection", this._isNull);
  12166. return this.m__items;
  12167. },
  12168. enumerable: true,
  12169. configurable: true
  12170. });
  12171. Object.defineProperty(TableCollection.prototype, "count", {
  12172. get: function () {
  12173. _throwIfNotLoaded("count", this.m_count, "TableCollection", this._isNull);
  12174. return this.m_count;
  12175. },
  12176. enumerable: true,
  12177. configurable: true
  12178. });
  12179. TableCollection.prototype.add=function (address, hasHeaders) {
  12180. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [address, hasHeaders], false, true, null));
  12181. };
  12182. TableCollection.prototype.getItem=function (key) {
  12183. return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12184. };
  12185. TableCollection.prototype.getItemAt=function (index) {
  12186. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12187. };
  12188. TableCollection.prototype._handleResult=function (value) {
  12189. _super.prototype._handleResult.call(this, value);
  12190. if (_isNullOrUndefined(value))
  12191. return;
  12192. var obj=value;
  12193. _fixObjectPathIfNecessary(this, obj);
  12194. if (!_isUndefined(obj["Count"])) {
  12195. this.m_count=obj["Count"];
  12196. }
  12197. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12198. this.m__items=[];
  12199. var _data=obj[OfficeExtension.Constants.items];
  12200. for (var i=0; i < _data.length; i++) {
  12201. var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12202. _item._handleResult(_data[i]);
  12203. this.m__items.push(_item);
  12204. }
  12205. }
  12206. };
  12207. TableCollection.prototype.load=function (option) {
  12208. _load(this, option);
  12209. return this;
  12210. };
  12211. TableCollection.prototype.toJSON=function () {
  12212. return {
  12213. "count": this.m_count
  12214. };
  12215. };
  12216. return TableCollection;
  12217. }(OfficeExtension.ClientObject));
  12218. Excel.TableCollection=TableCollection;
  12219. var Table=(function (_super) {
  12220. __extends(Table, _super);
  12221. function Table() {
  12222. _super.apply(this, arguments);
  12223. }
  12224. Object.defineProperty(Table.prototype, "columns", {
  12225. get: function () {
  12226. if (!this.m_columns) {
  12227. this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false));
  12228. }
  12229. return this.m_columns;
  12230. },
  12231. enumerable: true,
  12232. configurable: true
  12233. });
  12234. Object.defineProperty(Table.prototype, "rows", {
  12235. get: function () {
  12236. if (!this.m_rows) {
  12237. this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  12238. }
  12239. return this.m_rows;
  12240. },
  12241. enumerable: true,
  12242. configurable: true
  12243. });
  12244. Object.defineProperty(Table.prototype, "sort", {
  12245. get: function () {
  12246. if (!this.m_sort) {
  12247. this.m_sort=new Excel.TableSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  12248. }
  12249. return this.m_sort;
  12250. },
  12251. enumerable: true,
  12252. configurable: true
  12253. });
  12254. Object.defineProperty(Table.prototype, "worksheet", {
  12255. get: function () {
  12256. if (!this.m_worksheet) {
  12257. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  12258. }
  12259. return this.m_worksheet;
  12260. },
  12261. enumerable: true,
  12262. configurable: true
  12263. });
  12264. Object.defineProperty(Table.prototype, "highlightFirstColumn", {
  12265. get: function () {
  12266. _throwIfNotLoaded("highlightFirstColumn", this.m_highlightFirstColumn, "Table", this._isNull);
  12267. return this.m_highlightFirstColumn;
  12268. },
  12269. set: function (value) {
  12270. this.m_highlightFirstColumn=value;
  12271. _createSetPropertyAction(this.context, this, "HighlightFirstColumn", value);
  12272. },
  12273. enumerable: true,
  12274. configurable: true
  12275. });
  12276. Object.defineProperty(Table.prototype, "highlightLastColumn", {
  12277. get: function () {
  12278. _throwIfNotLoaded("highlightLastColumn", this.m_highlightLastColumn, "Table", this._isNull);
  12279. return this.m_highlightLastColumn;
  12280. },
  12281. set: function (value) {
  12282. this.m_highlightLastColumn=value;
  12283. _createSetPropertyAction(this.context, this, "HighlightLastColumn", value);
  12284. },
  12285. enumerable: true,
  12286. configurable: true
  12287. });
  12288. Object.defineProperty(Table.prototype, "id", {
  12289. get: function () {
  12290. _throwIfNotLoaded("id", this.m_id, "Table", this._isNull);
  12291. return this.m_id;
  12292. },
  12293. enumerable: true,
  12294. configurable: true
  12295. });
  12296. Object.defineProperty(Table.prototype, "name", {
  12297. get: function () {
  12298. _throwIfNotLoaded("name", this.m_name, "Table", this._isNull);
  12299. return this.m_name;
  12300. },
  12301. set: function (value) {
  12302. this.m_name=value;
  12303. _createSetPropertyAction(this.context, this, "Name", value);
  12304. },
  12305. enumerable: true,
  12306. configurable: true
  12307. });
  12308. Object.defineProperty(Table.prototype, "showBandedColumns", {
  12309. get: function () {
  12310. _throwIfNotLoaded("showBandedColumns", this.m_showBandedColumns, "Table", this._isNull);
  12311. return this.m_showBandedColumns;
  12312. },
  12313. set: function (value) {
  12314. this.m_showBandedColumns=value;
  12315. _createSetPropertyAction(this.context, this, "ShowBandedColumns", value);
  12316. },
  12317. enumerable: true,
  12318. configurable: true
  12319. });
  12320. Object.defineProperty(Table.prototype, "showBandedRows", {
  12321. get: function () {
  12322. _throwIfNotLoaded("showBandedRows", this.m_showBandedRows, "Table", this._isNull);
  12323. return this.m_showBandedRows;
  12324. },
  12325. set: function (value) {
  12326. this.m_showBandedRows=value;
  12327. _createSetPropertyAction(this.context, this, "ShowBandedRows", value);
  12328. },
  12329. enumerable: true,
  12330. configurable: true
  12331. });
  12332. Object.defineProperty(Table.prototype, "showFilterButton", {
  12333. get: function () {
  12334. _throwIfNotLoaded("showFilterButton", this.m_showFilterButton, "Table", this._isNull);
  12335. return this.m_showFilterButton;
  12336. },
  12337. set: function (value) {
  12338. this.m_showFilterButton=value;
  12339. _createSetPropertyAction(this.context, this, "ShowFilterButton", value);
  12340. },
  12341. enumerable: true,
  12342. configurable: true
  12343. });
  12344. Object.defineProperty(Table.prototype, "showHeaders", {
  12345. get: function () {
  12346. _throwIfNotLoaded("showHeaders", this.m_showHeaders, "Table", this._isNull);
  12347. return this.m_showHeaders;
  12348. },
  12349. set: function (value) {
  12350. this.m_showHeaders=value;
  12351. _createSetPropertyAction(this.context, this, "ShowHeaders", value);
  12352. },
  12353. enumerable: true,
  12354. configurable: true
  12355. });
  12356. Object.defineProperty(Table.prototype, "showTotals", {
  12357. get: function () {
  12358. _throwIfNotLoaded("showTotals", this.m_showTotals, "Table", this._isNull);
  12359. return this.m_showTotals;
  12360. },
  12361. set: function (value) {
  12362. this.m_showTotals=value;
  12363. _createSetPropertyAction(this.context, this, "ShowTotals", value);
  12364. },
  12365. enumerable: true,
  12366. configurable: true
  12367. });
  12368. Object.defineProperty(Table.prototype, "style", {
  12369. get: function () {
  12370. _throwIfNotLoaded("style", this.m_style, "Table", this._isNull);
  12371. return this.m_style;
  12372. },
  12373. set: function (value) {
  12374. this.m_style=value;
  12375. _createSetPropertyAction(this.context, this, "Style", value);
  12376. },
  12377. enumerable: true,
  12378. configurable: true
  12379. });
  12380. Table.prototype.clearFilters=function () {
  12381. _createMethodAction(this.context, this, "ClearFilters", OfficeExtension.OperationType.Default, []);
  12382. };
  12383. Table.prototype.convertToRange=function () {
  12384. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "ConvertToRange", OfficeExtension.OperationType.Default, [], false, true, null));
  12385. };
  12386. Table.prototype.delete=function () {
  12387. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12388. };
  12389. Table.prototype.getDataBodyRange=function () {
  12390. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12391. };
  12392. Table.prototype.getHeaderRowRange=function () {
  12393. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12394. };
  12395. Table.prototype.getRange=function () {
  12396. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12397. };
  12398. Table.prototype.getTotalRowRange=function () {
  12399. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12400. };
  12401. Table.prototype.reapplyFilters=function () {
  12402. _createMethodAction(this.context, this, "ReapplyFilters", OfficeExtension.OperationType.Default, []);
  12403. };
  12404. Table.prototype._handleResult=function (value) {
  12405. _super.prototype._handleResult.call(this, value);
  12406. if (_isNullOrUndefined(value))
  12407. return;
  12408. var obj=value;
  12409. _fixObjectPathIfNecessary(this, obj);
  12410. if (!_isUndefined(obj["HighlightFirstColumn"])) {
  12411. this.m_highlightFirstColumn=obj["HighlightFirstColumn"];
  12412. }
  12413. if (!_isUndefined(obj["HighlightLastColumn"])) {
  12414. this.m_highlightLastColumn=obj["HighlightLastColumn"];
  12415. }
  12416. if (!_isUndefined(obj["Id"])) {
  12417. this.m_id=obj["Id"];
  12418. }
  12419. if (!_isUndefined(obj["Name"])) {
  12420. this.m_name=obj["Name"];
  12421. }
  12422. if (!_isUndefined(obj["ShowBandedColumns"])) {
  12423. this.m_showBandedColumns=obj["ShowBandedColumns"];
  12424. }
  12425. if (!_isUndefined(obj["ShowBandedRows"])) {
  12426. this.m_showBandedRows=obj["ShowBandedRows"];
  12427. }
  12428. if (!_isUndefined(obj["ShowFilterButton"])) {
  12429. this.m_showFilterButton=obj["ShowFilterButton"];
  12430. }
  12431. if (!_isUndefined(obj["ShowHeaders"])) {
  12432. this.m_showHeaders=obj["ShowHeaders"];
  12433. }
  12434. if (!_isUndefined(obj["ShowTotals"])) {
  12435. this.m_showTotals=obj["ShowTotals"];
  12436. }
  12437. if (!_isUndefined(obj["Style"])) {
  12438. this.m_style=obj["Style"];
  12439. }
  12440. _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows", "sort", "Sort", "worksheet", "Worksheet"]);
  12441. };
  12442. Table.prototype.load=function (option) {
  12443. _load(this, option);
  12444. return this;
  12445. };
  12446. Table.prototype._handleIdResult=function (value) {
  12447. _super.prototype._handleIdResult.call(this, value);
  12448. if (_isNullOrUndefined(value)) {
  12449. return;
  12450. }
  12451. if (!_isUndefined(value["Id"])) {
  12452. this.m_id=value["Id"];
  12453. }
  12454. };
  12455. Table.prototype.toJSON=function () {
  12456. return {
  12457. "highlightFirstColumn": this.m_highlightFirstColumn,
  12458. "highlightLastColumn": this.m_highlightLastColumn,
  12459. "id": this.m_id,
  12460. "name": this.m_name,
  12461. "showBandedColumns": this.m_showBandedColumns,
  12462. "showBandedRows": this.m_showBandedRows,
  12463. "showFilterButton": this.m_showFilterButton,
  12464. "showHeaders": this.m_showHeaders,
  12465. "showTotals": this.m_showTotals,
  12466. "style": this.m_style
  12467. };
  12468. };
  12469. return Table;
  12470. }(OfficeExtension.ClientObject));
  12471. Excel.Table=Table;
  12472. var TableColumnCollection=(function (_super) {
  12473. __extends(TableColumnCollection, _super);
  12474. function TableColumnCollection() {
  12475. _super.apply(this, arguments);
  12476. }
  12477. Object.defineProperty(TableColumnCollection.prototype, "items", {
  12478. get: function () {
  12479. _throwIfNotLoaded("items", this.m__items, "TableColumnCollection", this._isNull);
  12480. return this.m__items;
  12481. },
  12482. enumerable: true,
  12483. configurable: true
  12484. });
  12485. Object.defineProperty(TableColumnCollection.prototype, "count", {
  12486. get: function () {
  12487. _throwIfNotLoaded("count", this.m_count, "TableColumnCollection", this._isNull);
  12488. return this.m_count;
  12489. },
  12490. enumerable: true,
  12491. configurable: true
  12492. });
  12493. TableColumnCollection.prototype.add=function (index, values) {
  12494. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  12495. };
  12496. TableColumnCollection.prototype.getItem=function (key) {
  12497. return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12498. };
  12499. TableColumnCollection.prototype.getItemAt=function (index) {
  12500. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12501. };
  12502. TableColumnCollection.prototype._handleResult=function (value) {
  12503. _super.prototype._handleResult.call(this, value);
  12504. if (_isNullOrUndefined(value))
  12505. return;
  12506. var obj=value;
  12507. _fixObjectPathIfNecessary(this, obj);
  12508. if (!_isUndefined(obj["Count"])) {
  12509. this.m_count=obj["Count"];
  12510. }
  12511. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12512. this.m__items=[];
  12513. var _data=obj[OfficeExtension.Constants.items];
  12514. for (var i=0; i < _data.length; i++) {
  12515. var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12516. _item._handleResult(_data[i]);
  12517. this.m__items.push(_item);
  12518. }
  12519. }
  12520. };
  12521. TableColumnCollection.prototype.load=function (option) {
  12522. _load(this, option);
  12523. return this;
  12524. };
  12525. TableColumnCollection.prototype.toJSON=function () {
  12526. return {
  12527. "count": this.m_count
  12528. };
  12529. };
  12530. return TableColumnCollection;
  12531. }(OfficeExtension.ClientObject));
  12532. Excel.TableColumnCollection=TableColumnCollection;
  12533. var TableColumn=(function (_super) {
  12534. __extends(TableColumn, _super);
  12535. function TableColumn() {
  12536. _super.apply(this, arguments);
  12537. }
  12538. Object.defineProperty(TableColumn.prototype, "filter", {
  12539. get: function () {
  12540. if (!this.m_filter) {
  12541. this.m_filter=new Excel.Filter(this.context, _createPropertyObjectPath(this.context, this, "Filter", false, false));
  12542. }
  12543. return this.m_filter;
  12544. },
  12545. enumerable: true,
  12546. configurable: true
  12547. });
  12548. Object.defineProperty(TableColumn.prototype, "id", {
  12549. get: function () {
  12550. _throwIfNotLoaded("id", this.m_id, "TableColumn", this._isNull);
  12551. return this.m_id;
  12552. },
  12553. enumerable: true,
  12554. configurable: true
  12555. });
  12556. Object.defineProperty(TableColumn.prototype, "index", {
  12557. get: function () {
  12558. _throwIfNotLoaded("index", this.m_index, "TableColumn", this._isNull);
  12559. return this.m_index;
  12560. },
  12561. enumerable: true,
  12562. configurable: true
  12563. });
  12564. Object.defineProperty(TableColumn.prototype, "name", {
  12565. get: function () {
  12566. _throwIfNotLoaded("name", this.m_name, "TableColumn", this._isNull);
  12567. return this.m_name;
  12568. },
  12569. enumerable: true,
  12570. configurable: true
  12571. });
  12572. Object.defineProperty(TableColumn.prototype, "values", {
  12573. get: function () {
  12574. _throwIfNotLoaded("values", this.m_values, "TableColumn", this._isNull);
  12575. return this.m_values;
  12576. },
  12577. set: function (value) {
  12578. this.m_values=value;
  12579. _createSetPropertyAction(this.context, this, "Values", value);
  12580. },
  12581. enumerable: true,
  12582. configurable: true
  12583. });
  12584. TableColumn.prototype.delete=function () {
  12585. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12586. };
  12587. TableColumn.prototype.getDataBodyRange=function () {
  12588. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12589. };
  12590. TableColumn.prototype.getHeaderRowRange=function () {
  12591. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12592. };
  12593. TableColumn.prototype.getRange=function () {
  12594. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12595. };
  12596. TableColumn.prototype.getTotalRowRange=function () {
  12597. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12598. };
  12599. TableColumn.prototype._handleResult=function (value) {
  12600. _super.prototype._handleResult.call(this, value);
  12601. if (_isNullOrUndefined(value))
  12602. return;
  12603. var obj=value;
  12604. _fixObjectPathIfNecessary(this, obj);
  12605. if (!_isUndefined(obj["Id"])) {
  12606. this.m_id=obj["Id"];
  12607. }
  12608. if (!_isUndefined(obj["Index"])) {
  12609. this.m_index=obj["Index"];
  12610. }
  12611. if (!_isUndefined(obj["Name"])) {
  12612. this.m_name=obj["Name"];
  12613. }
  12614. if (!_isUndefined(obj["Values"])) {
  12615. this.m_values=obj["Values"];
  12616. }
  12617. _handleNavigationPropertyResults(this, obj, ["filter", "Filter"]);
  12618. };
  12619. TableColumn.prototype.load=function (option) {
  12620. _load(this, option);
  12621. return this;
  12622. };
  12623. TableColumn.prototype._handleIdResult=function (value) {
  12624. _super.prototype._handleIdResult.call(this, value);
  12625. if (_isNullOrUndefined(value)) {
  12626. return;
  12627. }
  12628. if (!_isUndefined(value["Id"])) {
  12629. this.m_id=value["Id"];
  12630. }
  12631. };
  12632. TableColumn.prototype.toJSON=function () {
  12633. return {
  12634. "id": this.m_id,
  12635. "index": this.m_index,
  12636. "name": this.m_name,
  12637. "values": this.m_values
  12638. };
  12639. };
  12640. return TableColumn;
  12641. }(OfficeExtension.ClientObject));
  12642. Excel.TableColumn=TableColumn;
  12643. var TableRowCollection=(function (_super) {
  12644. __extends(TableRowCollection, _super);
  12645. function TableRowCollection() {
  12646. _super.apply(this, arguments);
  12647. }
  12648. Object.defineProperty(TableRowCollection.prototype, "items", {
  12649. get: function () {
  12650. _throwIfNotLoaded("items", this.m__items, "TableRowCollection", this._isNull);
  12651. return this.m__items;
  12652. },
  12653. enumerable: true,
  12654. configurable: true
  12655. });
  12656. Object.defineProperty(TableRowCollection.prototype, "count", {
  12657. get: function () {
  12658. _throwIfNotLoaded("count", this.m_count, "TableRowCollection", this._isNull);
  12659. return this.m_count;
  12660. },
  12661. enumerable: true,
  12662. configurable: true
  12663. });
  12664. TableRowCollection.prototype.add=function (index, values) {
  12665. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  12666. };
  12667. TableRowCollection.prototype.getItemAt=function (index) {
  12668. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12669. };
  12670. TableRowCollection.prototype._handleResult=function (value) {
  12671. _super.prototype._handleResult.call(this, value);
  12672. if (_isNullOrUndefined(value))
  12673. return;
  12674. var obj=value;
  12675. _fixObjectPathIfNecessary(this, obj);
  12676. if (!_isUndefined(obj["Count"])) {
  12677. this.m_count=obj["Count"];
  12678. }
  12679. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12680. this.m__items=[];
  12681. var _data=obj[OfficeExtension.Constants.items];
  12682. for (var i=0; i < _data.length; i++) {
  12683. var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  12684. _item._handleResult(_data[i]);
  12685. this.m__items.push(_item);
  12686. }
  12687. }
  12688. };
  12689. TableRowCollection.prototype.load=function (option) {
  12690. _load(this, option);
  12691. return this;
  12692. };
  12693. TableRowCollection.prototype.toJSON=function () {
  12694. return {
  12695. "count": this.m_count
  12696. };
  12697. };
  12698. return TableRowCollection;
  12699. }(OfficeExtension.ClientObject));
  12700. Excel.TableRowCollection=TableRowCollection;
  12701. var TableRow=(function (_super) {
  12702. __extends(TableRow, _super);
  12703. function TableRow() {
  12704. _super.apply(this, arguments);
  12705. }
  12706. Object.defineProperty(TableRow.prototype, "index", {
  12707. get: function () {
  12708. _throwIfNotLoaded("index", this.m_index, "TableRow", this._isNull);
  12709. return this.m_index;
  12710. },
  12711. enumerable: true,
  12712. configurable: true
  12713. });
  12714. Object.defineProperty(TableRow.prototype, "values", {
  12715. get: function () {
  12716. _throwIfNotLoaded("values", this.m_values, "TableRow", this._isNull);
  12717. return this.m_values;
  12718. },
  12719. set: function (value) {
  12720. this.m_values=value;
  12721. _createSetPropertyAction(this.context, this, "Values", value);
  12722. },
  12723. enumerable: true,
  12724. configurable: true
  12725. });
  12726. TableRow.prototype.delete=function () {
  12727. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12728. };
  12729. TableRow.prototype.getRange=function () {
  12730. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12731. };
  12732. TableRow.prototype._handleResult=function (value) {
  12733. _super.prototype._handleResult.call(this, value);
  12734. if (_isNullOrUndefined(value))
  12735. return;
  12736. var obj=value;
  12737. _fixObjectPathIfNecessary(this, obj);
  12738. if (!_isUndefined(obj["Index"])) {
  12739. this.m_index=obj["Index"];
  12740. }
  12741. if (!_isUndefined(obj["Values"])) {
  12742. this.m_values=obj["Values"];
  12743. }
  12744. };
  12745. TableRow.prototype.load=function (option) {
  12746. _load(this, option);
  12747. return this;
  12748. };
  12749. TableRow.prototype.toJSON=function () {
  12750. return {
  12751. "index": this.m_index,
  12752. "values": this.m_values
  12753. };
  12754. };
  12755. return TableRow;
  12756. }(OfficeExtension.ClientObject));
  12757. Excel.TableRow=TableRow;
  12758. var RangeFormat=(function (_super) {
  12759. __extends(RangeFormat, _super);
  12760. function RangeFormat() {
  12761. _super.apply(this, arguments);
  12762. }
  12763. Object.defineProperty(RangeFormat.prototype, "borders", {
  12764. get: function () {
  12765. if (!this.m_borders) {
  12766. this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false));
  12767. }
  12768. return this.m_borders;
  12769. },
  12770. enumerable: true,
  12771. configurable: true
  12772. });
  12773. Object.defineProperty(RangeFormat.prototype, "fill", {
  12774. get: function () {
  12775. if (!this.m_fill) {
  12776. this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  12777. }
  12778. return this.m_fill;
  12779. },
  12780. enumerable: true,
  12781. configurable: true
  12782. });
  12783. Object.defineProperty(RangeFormat.prototype, "font", {
  12784. get: function () {
  12785. if (!this.m_font) {
  12786. this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  12787. }
  12788. return this.m_font;
  12789. },
  12790. enumerable: true,
  12791. configurable: true
  12792. });
  12793. Object.defineProperty(RangeFormat.prototype, "protection", {
  12794. get: function () {
  12795. if (!this.m_protection) {
  12796. this.m_protection=new Excel.FormatProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  12797. }
  12798. return this.m_protection;
  12799. },
  12800. enumerable: true,
  12801. configurable: true
  12802. });
  12803. Object.defineProperty(RangeFormat.prototype, "columnWidth", {
  12804. get: function () {
  12805. _throwIfNotLoaded("columnWidth", this.m_columnWidth, "RangeFormat", this._isNull);
  12806. return this.m_columnWidth;
  12807. },
  12808. set: function (value) {
  12809. this.m_columnWidth=value;
  12810. _createSetPropertyAction(this.context, this, "ColumnWidth", value);
  12811. },
  12812. enumerable: true,
  12813. configurable: true
  12814. });
  12815. Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", {
  12816. get: function () {
  12817. _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment, "RangeFormat", this._isNull);
  12818. return this.m_horizontalAlignment;
  12819. },
  12820. set: function (value) {
  12821. this.m_horizontalAlignment=value;
  12822. _createSetPropertyAction(this.context, this, "HorizontalAlignment", value);
  12823. },
  12824. enumerable: true,
  12825. configurable: true
  12826. });
  12827. Object.defineProperty(RangeFormat.prototype, "rowHeight", {
  12828. get: function () {
  12829. _throwIfNotLoaded("rowHeight", this.m_rowHeight, "RangeFormat", this._isNull);
  12830. return this.m_rowHeight;
  12831. },
  12832. set: function (value) {
  12833. this.m_rowHeight=value;
  12834. _createSetPropertyAction(this.context, this, "RowHeight", value);
  12835. },
  12836. enumerable: true,
  12837. configurable: true
  12838. });
  12839. Object.defineProperty(RangeFormat.prototype, "verticalAlignment", {
  12840. get: function () {
  12841. _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment, "RangeFormat", this._isNull);
  12842. return this.m_verticalAlignment;
  12843. },
  12844. set: function (value) {
  12845. this.m_verticalAlignment=value;
  12846. _createSetPropertyAction(this.context, this, "VerticalAlignment", value);
  12847. },
  12848. enumerable: true,
  12849. configurable: true
  12850. });
  12851. Object.defineProperty(RangeFormat.prototype, "wrapText", {
  12852. get: function () {
  12853. _throwIfNotLoaded("wrapText", this.m_wrapText, "RangeFormat", this._isNull);
  12854. return this.m_wrapText;
  12855. },
  12856. set: function (value) {
  12857. this.m_wrapText=value;
  12858. _createSetPropertyAction(this.context, this, "WrapText", value);
  12859. },
  12860. enumerable: true,
  12861. configurable: true
  12862. });
  12863. RangeFormat.prototype.autofitColumns=function () {
  12864. _createMethodAction(this.context, this, "AutofitColumns", OfficeExtension.OperationType.Default, []);
  12865. };
  12866. RangeFormat.prototype.autofitRows=function () {
  12867. _createMethodAction(this.context, this, "AutofitRows", OfficeExtension.OperationType.Default, []);
  12868. };
  12869. RangeFormat.prototype._handleResult=function (value) {
  12870. _super.prototype._handleResult.call(this, value);
  12871. if (_isNullOrUndefined(value))
  12872. return;
  12873. var obj=value;
  12874. _fixObjectPathIfNecessary(this, obj);
  12875. if (!_isUndefined(obj["ColumnWidth"])) {
  12876. this.m_columnWidth=obj["ColumnWidth"];
  12877. }
  12878. if (!_isUndefined(obj["HorizontalAlignment"])) {
  12879. this.m_horizontalAlignment=obj["HorizontalAlignment"];
  12880. }
  12881. if (!_isUndefined(obj["RowHeight"])) {
  12882. this.m_rowHeight=obj["RowHeight"];
  12883. }
  12884. if (!_isUndefined(obj["VerticalAlignment"])) {
  12885. this.m_verticalAlignment=obj["VerticalAlignment"];
  12886. }
  12887. if (!_isUndefined(obj["WrapText"])) {
  12888. this.m_wrapText=obj["WrapText"];
  12889. }
  12890. _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font", "protection", "Protection"]);
  12891. };
  12892. RangeFormat.prototype.load=function (option) {
  12893. _load(this, option);
  12894. return this;
  12895. };
  12896. RangeFormat.prototype.toJSON=function () {
  12897. return {
  12898. "columnWidth": this.m_columnWidth,
  12899. "fill": this.m_fill,
  12900. "font": this.m_font,
  12901. "horizontalAlignment": this.m_horizontalAlignment,
  12902. "protection": this.m_protection,
  12903. "rowHeight": this.m_rowHeight,
  12904. "verticalAlignment": this.m_verticalAlignment,
  12905. "wrapText": this.m_wrapText
  12906. };
  12907. };
  12908. return RangeFormat;
  12909. }(OfficeExtension.ClientObject));
  12910. Excel.RangeFormat=RangeFormat;
  12911. var FormatProtection=(function (_super) {
  12912. __extends(FormatProtection, _super);
  12913. function FormatProtection() {
  12914. _super.apply(this, arguments);
  12915. }
  12916. Object.defineProperty(FormatProtection.prototype, "formulaHidden", {
  12917. get: function () {
  12918. _throwIfNotLoaded("formulaHidden", this.m_formulaHidden, "FormatProtection", this._isNull);
  12919. return this.m_formulaHidden;
  12920. },
  12921. set: function (value) {
  12922. this.m_formulaHidden=value;
  12923. _createSetPropertyAction(this.context, this, "FormulaHidden", value);
  12924. },
  12925. enumerable: true,
  12926. configurable: true
  12927. });
  12928. Object.defineProperty(FormatProtection.prototype, "locked", {
  12929. get: function () {
  12930. _throwIfNotLoaded("locked", this.m_locked, "FormatProtection", this._isNull);
  12931. return this.m_locked;
  12932. },
  12933. set: function (value) {
  12934. this.m_locked=value;
  12935. _createSetPropertyAction(this.context, this, "Locked", value);
  12936. },
  12937. enumerable: true,
  12938. configurable: true
  12939. });
  12940. FormatProtection.prototype._handleResult=function (value) {
  12941. _super.prototype._handleResult.call(this, value);
  12942. if (_isNullOrUndefined(value))
  12943. return;
  12944. var obj=value;
  12945. _fixObjectPathIfNecessary(this, obj);
  12946. if (!_isUndefined(obj["FormulaHidden"])) {
  12947. this.m_formulaHidden=obj["FormulaHidden"];
  12948. }
  12949. if (!_isUndefined(obj["Locked"])) {
  12950. this.m_locked=obj["Locked"];
  12951. }
  12952. };
  12953. FormatProtection.prototype.load=function (option) {
  12954. _load(this, option);
  12955. return this;
  12956. };
  12957. FormatProtection.prototype.toJSON=function () {
  12958. return {
  12959. "formulaHidden": this.m_formulaHidden,
  12960. "locked": this.m_locked
  12961. };
  12962. };
  12963. return FormatProtection;
  12964. }(OfficeExtension.ClientObject));
  12965. Excel.FormatProtection=FormatProtection;
  12966. var RangeFill=(function (_super) {
  12967. __extends(RangeFill, _super);
  12968. function RangeFill() {
  12969. _super.apply(this, arguments);
  12970. }
  12971. Object.defineProperty(RangeFill.prototype, "color", {
  12972. get: function () {
  12973. _throwIfNotLoaded("color", this.m_color, "RangeFill", this._isNull);
  12974. return this.m_color;
  12975. },
  12976. set: function (value) {
  12977. this.m_color=value;
  12978. _createSetPropertyAction(this.context, this, "Color", value);
  12979. },
  12980. enumerable: true,
  12981. configurable: true
  12982. });
  12983. RangeFill.prototype.clear=function () {
  12984. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  12985. };
  12986. RangeFill.prototype._handleResult=function (value) {
  12987. _super.prototype._handleResult.call(this, value);
  12988. if (_isNullOrUndefined(value))
  12989. return;
  12990. var obj=value;
  12991. _fixObjectPathIfNecessary(this, obj);
  12992. if (!_isUndefined(obj["Color"])) {
  12993. this.m_color=obj["Color"];
  12994. }
  12995. };
  12996. RangeFill.prototype.load=function (option) {
  12997. _load(this, option);
  12998. return this;
  12999. };
  13000. RangeFill.prototype.toJSON=function () {
  13001. return {
  13002. "color": this.m_color
  13003. };
  13004. };
  13005. return RangeFill;
  13006. }(OfficeExtension.ClientObject));
  13007. Excel.RangeFill=RangeFill;
  13008. var RangeBorder=(function (_super) {
  13009. __extends(RangeBorder, _super);
  13010. function RangeBorder() {
  13011. _super.apply(this, arguments);
  13012. }
  13013. Object.defineProperty(RangeBorder.prototype, "color", {
  13014. get: function () {
  13015. _throwIfNotLoaded("color", this.m_color, "RangeBorder", this._isNull);
  13016. return this.m_color;
  13017. },
  13018. set: function (value) {
  13019. this.m_color=value;
  13020. _createSetPropertyAction(this.context, this, "Color", value);
  13021. },
  13022. enumerable: true,
  13023. configurable: true
  13024. });
  13025. Object.defineProperty(RangeBorder.prototype, "sideIndex", {
  13026. get: function () {
  13027. _throwIfNotLoaded("sideIndex", this.m_sideIndex, "RangeBorder", this._isNull);
  13028. return this.m_sideIndex;
  13029. },
  13030. enumerable: true,
  13031. configurable: true
  13032. });
  13033. Object.defineProperty(RangeBorder.prototype, "style", {
  13034. get: function () {
  13035. _throwIfNotLoaded("style", this.m_style, "RangeBorder", this._isNull);
  13036. return this.m_style;
  13037. },
  13038. set: function (value) {
  13039. this.m_style=value;
  13040. _createSetPropertyAction(this.context, this, "Style", value);
  13041. },
  13042. enumerable: true,
  13043. configurable: true
  13044. });
  13045. Object.defineProperty(RangeBorder.prototype, "weight", {
  13046. get: function () {
  13047. _throwIfNotLoaded("weight", this.m_weight, "RangeBorder", this._isNull);
  13048. return this.m_weight;
  13049. },
  13050. set: function (value) {
  13051. this.m_weight=value;
  13052. _createSetPropertyAction(this.context, this, "Weight", value);
  13053. },
  13054. enumerable: true,
  13055. configurable: true
  13056. });
  13057. RangeBorder.prototype._handleResult=function (value) {
  13058. _super.prototype._handleResult.call(this, value);
  13059. if (_isNullOrUndefined(value))
  13060. return;
  13061. var obj=value;
  13062. _fixObjectPathIfNecessary(this, obj);
  13063. if (!_isUndefined(obj["Color"])) {
  13064. this.m_color=obj["Color"];
  13065. }
  13066. if (!_isUndefined(obj["SideIndex"])) {
  13067. this.m_sideIndex=obj["SideIndex"];
  13068. }
  13069. if (!_isUndefined(obj["Style"])) {
  13070. this.m_style=obj["Style"];
  13071. }
  13072. if (!_isUndefined(obj["Weight"])) {
  13073. this.m_weight=obj["Weight"];
  13074. }
  13075. };
  13076. RangeBorder.prototype.load=function (option) {
  13077. _load(this, option);
  13078. return this;
  13079. };
  13080. RangeBorder.prototype.toJSON=function () {
  13081. return {
  13082. "color": this.m_color,
  13083. "sideIndex": this.m_sideIndex,
  13084. "style": this.m_style,
  13085. "weight": this.m_weight
  13086. };
  13087. };
  13088. return RangeBorder;
  13089. }(OfficeExtension.ClientObject));
  13090. Excel.RangeBorder=RangeBorder;
  13091. var RangeBorderCollection=(function (_super) {
  13092. __extends(RangeBorderCollection, _super);
  13093. function RangeBorderCollection() {
  13094. _super.apply(this, arguments);
  13095. }
  13096. Object.defineProperty(RangeBorderCollection.prototype, "items", {
  13097. get: function () {
  13098. _throwIfNotLoaded("items", this.m__items, "RangeBorderCollection", this._isNull);
  13099. return this.m__items;
  13100. },
  13101. enumerable: true,
  13102. configurable: true
  13103. });
  13104. Object.defineProperty(RangeBorderCollection.prototype, "count", {
  13105. get: function () {
  13106. _throwIfNotLoaded("count", this.m_count, "RangeBorderCollection", this._isNull);
  13107. return this.m_count;
  13108. },
  13109. enumerable: true,
  13110. configurable: true
  13111. });
  13112. RangeBorderCollection.prototype.getItem=function (index) {
  13113. return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index]));
  13114. };
  13115. RangeBorderCollection.prototype.getItemAt=function (index) {
  13116. return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13117. };
  13118. RangeBorderCollection.prototype._handleResult=function (value) {
  13119. _super.prototype._handleResult.call(this, value);
  13120. if (_isNullOrUndefined(value))
  13121. return;
  13122. var obj=value;
  13123. _fixObjectPathIfNecessary(this, obj);
  13124. if (!_isUndefined(obj["Count"])) {
  13125. this.m_count=obj["Count"];
  13126. }
  13127. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13128. this.m__items=[];
  13129. var _data=obj[OfficeExtension.Constants.items];
  13130. for (var i=0; i < _data.length; i++) {
  13131. var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13132. _item._handleResult(_data[i]);
  13133. this.m__items.push(_item);
  13134. }
  13135. }
  13136. };
  13137. RangeBorderCollection.prototype.load=function (option) {
  13138. _load(this, option);
  13139. return this;
  13140. };
  13141. RangeBorderCollection.prototype.toJSON=function () {
  13142. return {
  13143. "count": this.m_count
  13144. };
  13145. };
  13146. return RangeBorderCollection;
  13147. }(OfficeExtension.ClientObject));
  13148. Excel.RangeBorderCollection=RangeBorderCollection;
  13149. var RangeFont=(function (_super) {
  13150. __extends(RangeFont, _super);
  13151. function RangeFont() {
  13152. _super.apply(this, arguments);
  13153. }
  13154. Object.defineProperty(RangeFont.prototype, "bold", {
  13155. get: function () {
  13156. _throwIfNotLoaded("bold", this.m_bold, "RangeFont", this._isNull);
  13157. return this.m_bold;
  13158. },
  13159. set: function (value) {
  13160. this.m_bold=value;
  13161. _createSetPropertyAction(this.context, this, "Bold", value);
  13162. },
  13163. enumerable: true,
  13164. configurable: true
  13165. });
  13166. Object.defineProperty(RangeFont.prototype, "color", {
  13167. get: function () {
  13168. _throwIfNotLoaded("color", this.m_color, "RangeFont", this._isNull);
  13169. return this.m_color;
  13170. },
  13171. set: function (value) {
  13172. this.m_color=value;
  13173. _createSetPropertyAction(this.context, this, "Color", value);
  13174. },
  13175. enumerable: true,
  13176. configurable: true
  13177. });
  13178. Object.defineProperty(RangeFont.prototype, "italic", {
  13179. get: function () {
  13180. _throwIfNotLoaded("italic", this.m_italic, "RangeFont", this._isNull);
  13181. return this.m_italic;
  13182. },
  13183. set: function (value) {
  13184. this.m_italic=value;
  13185. _createSetPropertyAction(this.context, this, "Italic", value);
  13186. },
  13187. enumerable: true,
  13188. configurable: true
  13189. });
  13190. Object.defineProperty(RangeFont.prototype, "name", {
  13191. get: function () {
  13192. _throwIfNotLoaded("name", this.m_name, "RangeFont", this._isNull);
  13193. return this.m_name;
  13194. },
  13195. set: function (value) {
  13196. this.m_name=value;
  13197. _createSetPropertyAction(this.context, this, "Name", value);
  13198. },
  13199. enumerable: true,
  13200. configurable: true
  13201. });
  13202. Object.defineProperty(RangeFont.prototype, "size", {
  13203. get: function () {
  13204. _throwIfNotLoaded("size", this.m_size, "RangeFont", this._isNull);
  13205. return this.m_size;
  13206. },
  13207. set: function (value) {
  13208. this.m_size=value;
  13209. _createSetPropertyAction(this.context, this, "Size", value);
  13210. },
  13211. enumerable: true,
  13212. configurable: true
  13213. });
  13214. Object.defineProperty(RangeFont.prototype, "underline", {
  13215. get: function () {
  13216. _throwIfNotLoaded("underline", this.m_underline, "RangeFont", this._isNull);
  13217. return this.m_underline;
  13218. },
  13219. set: function (value) {
  13220. this.m_underline=value;
  13221. _createSetPropertyAction(this.context, this, "Underline", value);
  13222. },
  13223. enumerable: true,
  13224. configurable: true
  13225. });
  13226. RangeFont.prototype._handleResult=function (value) {
  13227. _super.prototype._handleResult.call(this, value);
  13228. if (_isNullOrUndefined(value))
  13229. return;
  13230. var obj=value;
  13231. _fixObjectPathIfNecessary(this, obj);
  13232. if (!_isUndefined(obj["Bold"])) {
  13233. this.m_bold=obj["Bold"];
  13234. }
  13235. if (!_isUndefined(obj["Color"])) {
  13236. this.m_color=obj["Color"];
  13237. }
  13238. if (!_isUndefined(obj["Italic"])) {
  13239. this.m_italic=obj["Italic"];
  13240. }
  13241. if (!_isUndefined(obj["Name"])) {
  13242. this.m_name=obj["Name"];
  13243. }
  13244. if (!_isUndefined(obj["Size"])) {
  13245. this.m_size=obj["Size"];
  13246. }
  13247. if (!_isUndefined(obj["Underline"])) {
  13248. this.m_underline=obj["Underline"];
  13249. }
  13250. };
  13251. RangeFont.prototype.load=function (option) {
  13252. _load(this, option);
  13253. return this;
  13254. };
  13255. RangeFont.prototype.toJSON=function () {
  13256. return {
  13257. "bold": this.m_bold,
  13258. "color": this.m_color,
  13259. "italic": this.m_italic,
  13260. "name": this.m_name,
  13261. "size": this.m_size,
  13262. "underline": this.m_underline
  13263. };
  13264. };
  13265. return RangeFont;
  13266. }(OfficeExtension.ClientObject));
  13267. Excel.RangeFont=RangeFont;
  13268. var ChartCollection=(function (_super) {
  13269. __extends(ChartCollection, _super);
  13270. function ChartCollection() {
  13271. _super.apply(this, arguments);
  13272. }
  13273. Object.defineProperty(ChartCollection.prototype, "items", {
  13274. get: function () {
  13275. _throwIfNotLoaded("items", this.m__items, "ChartCollection", this._isNull);
  13276. return this.m__items;
  13277. },
  13278. enumerable: true,
  13279. configurable: true
  13280. });
  13281. Object.defineProperty(ChartCollection.prototype, "count", {
  13282. get: function () {
  13283. _throwIfNotLoaded("count", this.m_count, "ChartCollection", this._isNull);
  13284. return this.m_count;
  13285. },
  13286. enumerable: true,
  13287. configurable: true
  13288. });
  13289. ChartCollection.prototype.add=function (type, sourceData, seriesBy) {
  13290. if (!(sourceData instanceof Range)) {
  13291. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add");
  13292. }
  13293. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [type, sourceData, seriesBy], false, true, null));
  13294. };
  13295. ChartCollection.prototype.getItem=function (name) {
  13296. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", OfficeExtension.OperationType.Read, [name], false, false, null));
  13297. };
  13298. ChartCollection.prototype.getItemAt=function (index) {
  13299. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13300. };
  13301. ChartCollection.prototype._GetItem=function (key) {
  13302. return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [key]));
  13303. };
  13304. ChartCollection.prototype._handleResult=function (value) {
  13305. _super.prototype._handleResult.call(this, value);
  13306. if (_isNullOrUndefined(value))
  13307. return;
  13308. var obj=value;
  13309. _fixObjectPathIfNecessary(this, obj);
  13310. if (!_isUndefined(obj["Count"])) {
  13311. this.m_count=obj["Count"];
  13312. }
  13313. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13314. this.m__items=[];
  13315. var _data=obj[OfficeExtension.Constants.items];
  13316. for (var i=0; i < _data.length; i++) {
  13317. var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13318. _item._handleResult(_data[i]);
  13319. this.m__items.push(_item);
  13320. }
  13321. }
  13322. };
  13323. ChartCollection.prototype.load=function (option) {
  13324. _load(this, option);
  13325. return this;
  13326. };
  13327. ChartCollection.prototype.toJSON=function () {
  13328. return {
  13329. "count": this.m_count
  13330. };
  13331. };
  13332. return ChartCollection;
  13333. }(OfficeExtension.ClientObject));
  13334. Excel.ChartCollection=ChartCollection;
  13335. var Chart=(function (_super) {
  13336. __extends(Chart, _super);
  13337. function Chart() {
  13338. _super.apply(this, arguments);
  13339. }
  13340. Object.defineProperty(Chart.prototype, "axes", {
  13341. get: function () {
  13342. if (!this.m_axes) {
  13343. this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false));
  13344. }
  13345. return this.m_axes;
  13346. },
  13347. enumerable: true,
  13348. configurable: true
  13349. });
  13350. Object.defineProperty(Chart.prototype, "dataLabels", {
  13351. get: function () {
  13352. if (!this.m_dataLabels) {
  13353. this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false));
  13354. }
  13355. return this.m_dataLabels;
  13356. },
  13357. enumerable: true,
  13358. configurable: true
  13359. });
  13360. Object.defineProperty(Chart.prototype, "format", {
  13361. get: function () {
  13362. if (!this.m_format) {
  13363. this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13364. }
  13365. return this.m_format;
  13366. },
  13367. enumerable: true,
  13368. configurable: true
  13369. });
  13370. Object.defineProperty(Chart.prototype, "legend", {
  13371. get: function () {
  13372. if (!this.m_legend) {
  13373. this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false));
  13374. }
  13375. return this.m_legend;
  13376. },
  13377. enumerable: true,
  13378. configurable: true
  13379. });
  13380. Object.defineProperty(Chart.prototype, "series", {
  13381. get: function () {
  13382. if (!this.m_series) {
  13383. this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false));
  13384. }
  13385. return this.m_series;
  13386. },
  13387. enumerable: true,
  13388. configurable: true
  13389. });
  13390. Object.defineProperty(Chart.prototype, "title", {
  13391. get: function () {
  13392. if (!this.m_title) {
  13393. this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  13394. }
  13395. return this.m_title;
  13396. },
  13397. enumerable: true,
  13398. configurable: true
  13399. });
  13400. Object.defineProperty(Chart.prototype, "worksheet", {
  13401. get: function () {
  13402. if (!this.m_worksheet) {
  13403. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  13404. }
  13405. return this.m_worksheet;
  13406. },
  13407. enumerable: true,
  13408. configurable: true
  13409. });
  13410. Object.defineProperty(Chart.prototype, "height", {
  13411. get: function () {
  13412. _throwIfNotLoaded("height", this.m_height, "Chart", this._isNull);
  13413. return this.m_height;
  13414. },
  13415. set: function (value) {
  13416. this.m_height=value;
  13417. _createSetPropertyAction(this.context, this, "Height", value);
  13418. },
  13419. enumerable: true,
  13420. configurable: true
  13421. });
  13422. Object.defineProperty(Chart.prototype, "left", {
  13423. get: function () {
  13424. _throwIfNotLoaded("left", this.m_left, "Chart", this._isNull);
  13425. return this.m_left;
  13426. },
  13427. set: function (value) {
  13428. this.m_left=value;
  13429. _createSetPropertyAction(this.context, this, "Left", value);
  13430. },
  13431. enumerable: true,
  13432. configurable: true
  13433. });
  13434. Object.defineProperty(Chart.prototype, "name", {
  13435. get: function () {
  13436. _throwIfNotLoaded("name", this.m_name, "Chart", this._isNull);
  13437. return this.m_name;
  13438. },
  13439. set: function (value) {
  13440. this.m_name=value;
  13441. _createSetPropertyAction(this.context, this, "Name", value);
  13442. },
  13443. enumerable: true,
  13444. configurable: true
  13445. });
  13446. Object.defineProperty(Chart.prototype, "top", {
  13447. get: function () {
  13448. _throwIfNotLoaded("top", this.m_top, "Chart", this._isNull);
  13449. return this.m_top;
  13450. },
  13451. set: function (value) {
  13452. this.m_top=value;
  13453. _createSetPropertyAction(this.context, this, "Top", value);
  13454. },
  13455. enumerable: true,
  13456. configurable: true
  13457. });
  13458. Object.defineProperty(Chart.prototype, "width", {
  13459. get: function () {
  13460. _throwIfNotLoaded("width", this.m_width, "Chart", this._isNull);
  13461. return this.m_width;
  13462. },
  13463. set: function (value) {
  13464. this.m_width=value;
  13465. _createSetPropertyAction(this.context, this, "Width", value);
  13466. },
  13467. enumerable: true,
  13468. configurable: true
  13469. });
  13470. Chart.prototype.delete=function () {
  13471. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  13472. };
  13473. Chart.prototype.getImage=function (width, height, fittingMode) {
  13474. var action=_createMethodAction(this.context, this, "GetImage", OfficeExtension.OperationType.Read, [width, height, fittingMode]);
  13475. var ret=new OfficeExtension.ClientResult();
  13476. _addActionResultHandler(this, action, ret);
  13477. return ret;
  13478. };
  13479. Chart.prototype.setData=function (sourceData, seriesBy) {
  13480. if (!(sourceData instanceof Range)) {
  13481. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData");
  13482. }
  13483. _createMethodAction(this.context, this, "SetData", OfficeExtension.OperationType.Default, [sourceData, seriesBy]);
  13484. };
  13485. Chart.prototype.setPosition=function (startCell, endCell) {
  13486. _createMethodAction(this.context, this, "SetPosition", OfficeExtension.OperationType.Default, [startCell, endCell]);
  13487. };
  13488. Chart.prototype._handleResult=function (value) {
  13489. _super.prototype._handleResult.call(this, value);
  13490. if (_isNullOrUndefined(value))
  13491. return;
  13492. var obj=value;
  13493. _fixObjectPathIfNecessary(this, obj);
  13494. if (!_isUndefined(obj["Height"])) {
  13495. this.m_height=obj["Height"];
  13496. }
  13497. if (!_isUndefined(obj["Left"])) {
  13498. this.m_left=obj["Left"];
  13499. }
  13500. if (!_isUndefined(obj["Name"])) {
  13501. this.m_name=obj["Name"];
  13502. }
  13503. if (!_isUndefined(obj["Top"])) {
  13504. this.m_top=obj["Top"];
  13505. }
  13506. if (!_isUndefined(obj["Width"])) {
  13507. this.m_width=obj["Width"];
  13508. }
  13509. _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title", "worksheet", "Worksheet"]);
  13510. };
  13511. Chart.prototype.load=function (option) {
  13512. _load(this, option);
  13513. return this;
  13514. };
  13515. Chart.prototype.toJSON=function () {
  13516. return {
  13517. "axes": this.m_axes,
  13518. "dataLabels": this.m_dataLabels,
  13519. "format": this.m_format,
  13520. "height": this.m_height,
  13521. "left": this.m_left,
  13522. "legend": this.m_legend,
  13523. "name": this.m_name,
  13524. "title": this.m_title,
  13525. "top": this.m_top,
  13526. "width": this.m_width
  13527. };
  13528. };
  13529. return Chart;
  13530. }(OfficeExtension.ClientObject));
  13531. Excel.Chart=Chart;
  13532. var ChartAreaFormat=(function (_super) {
  13533. __extends(ChartAreaFormat, _super);
  13534. function ChartAreaFormat() {
  13535. _super.apply(this, arguments);
  13536. }
  13537. Object.defineProperty(ChartAreaFormat.prototype, "fill", {
  13538. get: function () {
  13539. if (!this.m_fill) {
  13540. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13541. }
  13542. return this.m_fill;
  13543. },
  13544. enumerable: true,
  13545. configurable: true
  13546. });
  13547. Object.defineProperty(ChartAreaFormat.prototype, "font", {
  13548. get: function () {
  13549. if (!this.m_font) {
  13550. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  13551. }
  13552. return this.m_font;
  13553. },
  13554. enumerable: true,
  13555. configurable: true
  13556. });
  13557. ChartAreaFormat.prototype._handleResult=function (value) {
  13558. _super.prototype._handleResult.call(this, value);
  13559. if (_isNullOrUndefined(value))
  13560. return;
  13561. var obj=value;
  13562. _fixObjectPathIfNecessary(this, obj);
  13563. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  13564. };
  13565. ChartAreaFormat.prototype.load=function (option) {
  13566. _load(this, option);
  13567. return this;
  13568. };
  13569. ChartAreaFormat.prototype.toJSON=function () {
  13570. return {
  13571. "fill": this.m_fill,
  13572. "font": this.m_font
  13573. };
  13574. };
  13575. return ChartAreaFormat;
  13576. }(OfficeExtension.ClientObject));
  13577. Excel.ChartAreaFormat=ChartAreaFormat;
  13578. var ChartSeriesCollection=(function (_super) {
  13579. __extends(ChartSeriesCollection, _super);
  13580. function ChartSeriesCollection() {
  13581. _super.apply(this, arguments);
  13582. }
  13583. Object.defineProperty(ChartSeriesCollection.prototype, "items", {
  13584. get: function () {
  13585. _throwIfNotLoaded("items", this.m__items, "ChartSeriesCollection", this._isNull);
  13586. return this.m__items;
  13587. },
  13588. enumerable: true,
  13589. configurable: true
  13590. });
  13591. Object.defineProperty(ChartSeriesCollection.prototype, "count", {
  13592. get: function () {
  13593. _throwIfNotLoaded("count", this.m_count, "ChartSeriesCollection", this._isNull);
  13594. return this.m_count;
  13595. },
  13596. enumerable: true,
  13597. configurable: true
  13598. });
  13599. ChartSeriesCollection.prototype.getItemAt=function (index) {
  13600. return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13601. };
  13602. ChartSeriesCollection.prototype._handleResult=function (value) {
  13603. _super.prototype._handleResult.call(this, value);
  13604. if (_isNullOrUndefined(value))
  13605. return;
  13606. var obj=value;
  13607. _fixObjectPathIfNecessary(this, obj);
  13608. if (!_isUndefined(obj["Count"])) {
  13609. this.m_count=obj["Count"];
  13610. }
  13611. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13612. this.m__items=[];
  13613. var _data=obj[OfficeExtension.Constants.items];
  13614. for (var i=0; i < _data.length; i++) {
  13615. var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13616. _item._handleResult(_data[i]);
  13617. this.m__items.push(_item);
  13618. }
  13619. }
  13620. };
  13621. ChartSeriesCollection.prototype.load=function (option) {
  13622. _load(this, option);
  13623. return this;
  13624. };
  13625. ChartSeriesCollection.prototype.toJSON=function () {
  13626. return {
  13627. "count": this.m_count
  13628. };
  13629. };
  13630. return ChartSeriesCollection;
  13631. }(OfficeExtension.ClientObject));
  13632. Excel.ChartSeriesCollection=ChartSeriesCollection;
  13633. var ChartSeries=(function (_super) {
  13634. __extends(ChartSeries, _super);
  13635. function ChartSeries() {
  13636. _super.apply(this, arguments);
  13637. }
  13638. Object.defineProperty(ChartSeries.prototype, "format", {
  13639. get: function () {
  13640. if (!this.m_format) {
  13641. this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13642. }
  13643. return this.m_format;
  13644. },
  13645. enumerable: true,
  13646. configurable: true
  13647. });
  13648. Object.defineProperty(ChartSeries.prototype, "points", {
  13649. get: function () {
  13650. if (!this.m_points) {
  13651. this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false));
  13652. }
  13653. return this.m_points;
  13654. },
  13655. enumerable: true,
  13656. configurable: true
  13657. });
  13658. Object.defineProperty(ChartSeries.prototype, "name", {
  13659. get: function () {
  13660. _throwIfNotLoaded("name", this.m_name, "ChartSeries", this._isNull);
  13661. return this.m_name;
  13662. },
  13663. set: function (value) {
  13664. this.m_name=value;
  13665. _createSetPropertyAction(this.context, this, "Name", value);
  13666. },
  13667. enumerable: true,
  13668. configurable: true
  13669. });
  13670. ChartSeries.prototype._handleResult=function (value) {
  13671. _super.prototype._handleResult.call(this, value);
  13672. if (_isNullOrUndefined(value))
  13673. return;
  13674. var obj=value;
  13675. _fixObjectPathIfNecessary(this, obj);
  13676. if (!_isUndefined(obj["Name"])) {
  13677. this.m_name=obj["Name"];
  13678. }
  13679. _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]);
  13680. };
  13681. ChartSeries.prototype.load=function (option) {
  13682. _load(this, option);
  13683. return this;
  13684. };
  13685. ChartSeries.prototype.toJSON=function () {
  13686. return {
  13687. "format": this.m_format,
  13688. "name": this.m_name
  13689. };
  13690. };
  13691. return ChartSeries;
  13692. }(OfficeExtension.ClientObject));
  13693. Excel.ChartSeries=ChartSeries;
  13694. var ChartSeriesFormat=(function (_super) {
  13695. __extends(ChartSeriesFormat, _super);
  13696. function ChartSeriesFormat() {
  13697. _super.apply(this, arguments);
  13698. }
  13699. Object.defineProperty(ChartSeriesFormat.prototype, "fill", {
  13700. get: function () {
  13701. if (!this.m_fill) {
  13702. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13703. }
  13704. return this.m_fill;
  13705. },
  13706. enumerable: true,
  13707. configurable: true
  13708. });
  13709. Object.defineProperty(ChartSeriesFormat.prototype, "line", {
  13710. get: function () {
  13711. if (!this.m_line) {
  13712. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  13713. }
  13714. return this.m_line;
  13715. },
  13716. enumerable: true,
  13717. configurable: true
  13718. });
  13719. ChartSeriesFormat.prototype._handleResult=function (value) {
  13720. _super.prototype._handleResult.call(this, value);
  13721. if (_isNullOrUndefined(value))
  13722. return;
  13723. var obj=value;
  13724. _fixObjectPathIfNecessary(this, obj);
  13725. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]);
  13726. };
  13727. ChartSeriesFormat.prototype.load=function (option) {
  13728. _load(this, option);
  13729. return this;
  13730. };
  13731. ChartSeriesFormat.prototype.toJSON=function () {
  13732. return {
  13733. "fill": this.m_fill,
  13734. "line": this.m_line
  13735. };
  13736. };
  13737. return ChartSeriesFormat;
  13738. }(OfficeExtension.ClientObject));
  13739. Excel.ChartSeriesFormat=ChartSeriesFormat;
  13740. var ChartPointsCollection=(function (_super) {
  13741. __extends(ChartPointsCollection, _super);
  13742. function ChartPointsCollection() {
  13743. _super.apply(this, arguments);
  13744. }
  13745. Object.defineProperty(ChartPointsCollection.prototype, "items", {
  13746. get: function () {
  13747. _throwIfNotLoaded("items", this.m__items, "ChartPointsCollection", this._isNull);
  13748. return this.m__items;
  13749. },
  13750. enumerable: true,
  13751. configurable: true
  13752. });
  13753. Object.defineProperty(ChartPointsCollection.prototype, "count", {
  13754. get: function () {
  13755. _throwIfNotLoaded("count", this.m_count, "ChartPointsCollection", this._isNull);
  13756. return this.m_count;
  13757. },
  13758. enumerable: true,
  13759. configurable: true
  13760. });
  13761. ChartPointsCollection.prototype.getItemAt=function (index) {
  13762. return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13763. };
  13764. ChartPointsCollection.prototype._handleResult=function (value) {
  13765. _super.prototype._handleResult.call(this, value);
  13766. if (_isNullOrUndefined(value))
  13767. return;
  13768. var obj=value;
  13769. _fixObjectPathIfNecessary(this, obj);
  13770. if (!_isUndefined(obj["Count"])) {
  13771. this.m_count=obj["Count"];
  13772. }
  13773. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13774. this.m__items=[];
  13775. var _data=obj[OfficeExtension.Constants.items];
  13776. for (var i=0; i < _data.length; i++) {
  13777. var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13778. _item._handleResult(_data[i]);
  13779. this.m__items.push(_item);
  13780. }
  13781. }
  13782. };
  13783. ChartPointsCollection.prototype.load=function (option) {
  13784. _load(this, option);
  13785. return this;
  13786. };
  13787. ChartPointsCollection.prototype.toJSON=function () {
  13788. return {
  13789. "count": this.m_count
  13790. };
  13791. };
  13792. return ChartPointsCollection;
  13793. }(OfficeExtension.ClientObject));
  13794. Excel.ChartPointsCollection=ChartPointsCollection;
  13795. var ChartPoint=(function (_super) {
  13796. __extends(ChartPoint, _super);
  13797. function ChartPoint() {
  13798. _super.apply(this, arguments);
  13799. }
  13800. Object.defineProperty(ChartPoint.prototype, "format", {
  13801. get: function () {
  13802. if (!this.m_format) {
  13803. this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13804. }
  13805. return this.m_format;
  13806. },
  13807. enumerable: true,
  13808. configurable: true
  13809. });
  13810. Object.defineProperty(ChartPoint.prototype, "value", {
  13811. get: function () {
  13812. _throwIfNotLoaded("value", this.m_value, "ChartPoint", this._isNull);
  13813. return this.m_value;
  13814. },
  13815. enumerable: true,
  13816. configurable: true
  13817. });
  13818. ChartPoint.prototype._handleResult=function (value) {
  13819. _super.prototype._handleResult.call(this, value);
  13820. if (_isNullOrUndefined(value))
  13821. return;
  13822. var obj=value;
  13823. _fixObjectPathIfNecessary(this, obj);
  13824. if (!_isUndefined(obj["Value"])) {
  13825. this.m_value=obj["Value"];
  13826. }
  13827. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  13828. };
  13829. ChartPoint.prototype.load=function (option) {
  13830. _load(this, option);
  13831. return this;
  13832. };
  13833. ChartPoint.prototype.toJSON=function () {
  13834. return {
  13835. "format": this.m_format,
  13836. "value": this.m_value
  13837. };
  13838. };
  13839. return ChartPoint;
  13840. }(OfficeExtension.ClientObject));
  13841. Excel.ChartPoint=ChartPoint;
  13842. var ChartPointFormat=(function (_super) {
  13843. __extends(ChartPointFormat, _super);
  13844. function ChartPointFormat() {
  13845. _super.apply(this, arguments);
  13846. }
  13847. Object.defineProperty(ChartPointFormat.prototype, "fill", {
  13848. get: function () {
  13849. if (!this.m_fill) {
  13850. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13851. }
  13852. return this.m_fill;
  13853. },
  13854. enumerable: true,
  13855. configurable: true
  13856. });
  13857. ChartPointFormat.prototype._handleResult=function (value) {
  13858. _super.prototype._handleResult.call(this, value);
  13859. if (_isNullOrUndefined(value))
  13860. return;
  13861. var obj=value;
  13862. _fixObjectPathIfNecessary(this, obj);
  13863. _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]);
  13864. };
  13865. ChartPointFormat.prototype.load=function (option) {
  13866. _load(this, option);
  13867. return this;
  13868. };
  13869. ChartPointFormat.prototype.toJSON=function () {
  13870. return {
  13871. "fill": this.m_fill
  13872. };
  13873. };
  13874. return ChartPointFormat;
  13875. }(OfficeExtension.ClientObject));
  13876. Excel.ChartPointFormat=ChartPointFormat;
  13877. var ChartAxes=(function (_super) {
  13878. __extends(ChartAxes, _super);
  13879. function ChartAxes() {
  13880. _super.apply(this, arguments);
  13881. }
  13882. Object.defineProperty(ChartAxes.prototype, "categoryAxis", {
  13883. get: function () {
  13884. if (!this.m_categoryAxis) {
  13885. this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false));
  13886. }
  13887. return this.m_categoryAxis;
  13888. },
  13889. enumerable: true,
  13890. configurable: true
  13891. });
  13892. Object.defineProperty(ChartAxes.prototype, "seriesAxis", {
  13893. get: function () {
  13894. if (!this.m_seriesAxis) {
  13895. this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false));
  13896. }
  13897. return this.m_seriesAxis;
  13898. },
  13899. enumerable: true,
  13900. configurable: true
  13901. });
  13902. Object.defineProperty(ChartAxes.prototype, "valueAxis", {
  13903. get: function () {
  13904. if (!this.m_valueAxis) {
  13905. this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false));
  13906. }
  13907. return this.m_valueAxis;
  13908. },
  13909. enumerable: true,
  13910. configurable: true
  13911. });
  13912. ChartAxes.prototype._handleResult=function (value) {
  13913. _super.prototype._handleResult.call(this, value);
  13914. if (_isNullOrUndefined(value))
  13915. return;
  13916. var obj=value;
  13917. _fixObjectPathIfNecessary(this, obj);
  13918. _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]);
  13919. };
  13920. ChartAxes.prototype.load=function (option) {
  13921. _load(this, option);
  13922. return this;
  13923. };
  13924. ChartAxes.prototype.toJSON=function () {
  13925. return {
  13926. "categoryAxis": this.m_categoryAxis,
  13927. "seriesAxis": this.m_seriesAxis,
  13928. "valueAxis": this.m_valueAxis
  13929. };
  13930. };
  13931. return ChartAxes;
  13932. }(OfficeExtension.ClientObject));
  13933. Excel.ChartAxes=ChartAxes;
  13934. var ChartAxis=(function (_super) {
  13935. __extends(ChartAxis, _super);
  13936. function ChartAxis() {
  13937. _super.apply(this, arguments);
  13938. }
  13939. Object.defineProperty(ChartAxis.prototype, "format", {
  13940. get: function () {
  13941. if (!this.m_format) {
  13942. this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13943. }
  13944. return this.m_format;
  13945. },
  13946. enumerable: true,
  13947. configurable: true
  13948. });
  13949. Object.defineProperty(ChartAxis.prototype, "majorGridlines", {
  13950. get: function () {
  13951. if (!this.m_majorGridlines) {
  13952. this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false));
  13953. }
  13954. return this.m_majorGridlines;
  13955. },
  13956. enumerable: true,
  13957. configurable: true
  13958. });
  13959. Object.defineProperty(ChartAxis.prototype, "minorGridlines", {
  13960. get: function () {
  13961. if (!this.m_minorGridlines) {
  13962. this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false));
  13963. }
  13964. return this.m_minorGridlines;
  13965. },
  13966. enumerable: true,
  13967. configurable: true
  13968. });
  13969. Object.defineProperty(ChartAxis.prototype, "title", {
  13970. get: function () {
  13971. if (!this.m_title) {
  13972. this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  13973. }
  13974. return this.m_title;
  13975. },
  13976. enumerable: true,
  13977. configurable: true
  13978. });
  13979. Object.defineProperty(ChartAxis.prototype, "majorUnit", {
  13980. get: function () {
  13981. _throwIfNotLoaded("majorUnit", this.m_majorUnit, "ChartAxis", this._isNull);
  13982. return this.m_majorUnit;
  13983. },
  13984. set: function (value) {
  13985. this.m_majorUnit=value;
  13986. _createSetPropertyAction(this.context, this, "MajorUnit", value);
  13987. },
  13988. enumerable: true,
  13989. configurable: true
  13990. });
  13991. Object.defineProperty(ChartAxis.prototype, "maximum", {
  13992. get: function () {
  13993. _throwIfNotLoaded("maximum", this.m_maximum, "ChartAxis", this._isNull);
  13994. return this.m_maximum;
  13995. },
  13996. set: function (value) {
  13997. this.m_maximum=value;
  13998. _createSetPropertyAction(this.context, this, "Maximum", value);
  13999. },
  14000. enumerable: true,
  14001. configurable: true
  14002. });
  14003. Object.defineProperty(ChartAxis.prototype, "minimum", {
  14004. get: function () {
  14005. _throwIfNotLoaded("minimum", this.m_minimum, "ChartAxis", this._isNull);
  14006. return this.m_minimum;
  14007. },
  14008. set: function (value) {
  14009. this.m_minimum=value;
  14010. _createSetPropertyAction(this.context, this, "Minimum", value);
  14011. },
  14012. enumerable: true,
  14013. configurable: true
  14014. });
  14015. Object.defineProperty(ChartAxis.prototype, "minorUnit", {
  14016. get: function () {
  14017. _throwIfNotLoaded("minorUnit", this.m_minorUnit, "ChartAxis", this._isNull);
  14018. return this.m_minorUnit;
  14019. },
  14020. set: function (value) {
  14021. this.m_minorUnit=value;
  14022. _createSetPropertyAction(this.context, this, "MinorUnit", value);
  14023. },
  14024. enumerable: true,
  14025. configurable: true
  14026. });
  14027. ChartAxis.prototype._handleResult=function (value) {
  14028. _super.prototype._handleResult.call(this, value);
  14029. if (_isNullOrUndefined(value))
  14030. return;
  14031. var obj=value;
  14032. _fixObjectPathIfNecessary(this, obj);
  14033. if (!_isUndefined(obj["MajorUnit"])) {
  14034. this.m_majorUnit=obj["MajorUnit"];
  14035. }
  14036. if (!_isUndefined(obj["Maximum"])) {
  14037. this.m_maximum=obj["Maximum"];
  14038. }
  14039. if (!_isUndefined(obj["Minimum"])) {
  14040. this.m_minimum=obj["Minimum"];
  14041. }
  14042. if (!_isUndefined(obj["MinorUnit"])) {
  14043. this.m_minorUnit=obj["MinorUnit"];
  14044. }
  14045. _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]);
  14046. };
  14047. ChartAxis.prototype.load=function (option) {
  14048. _load(this, option);
  14049. return this;
  14050. };
  14051. ChartAxis.prototype.toJSON=function () {
  14052. return {
  14053. "format": this.m_format,
  14054. "majorGridlines": this.m_majorGridlines,
  14055. "majorUnit": this.m_majorUnit,
  14056. "maximum": this.m_maximum,
  14057. "minimum": this.m_minimum,
  14058. "minorGridlines": this.m_minorGridlines,
  14059. "minorUnit": this.m_minorUnit,
  14060. "title": this.m_title
  14061. };
  14062. };
  14063. return ChartAxis;
  14064. }(OfficeExtension.ClientObject));
  14065. Excel.ChartAxis=ChartAxis;
  14066. var ChartAxisFormat=(function (_super) {
  14067. __extends(ChartAxisFormat, _super);
  14068. function ChartAxisFormat() {
  14069. _super.apply(this, arguments);
  14070. }
  14071. Object.defineProperty(ChartAxisFormat.prototype, "font", {
  14072. get: function () {
  14073. if (!this.m_font) {
  14074. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14075. }
  14076. return this.m_font;
  14077. },
  14078. enumerable: true,
  14079. configurable: true
  14080. });
  14081. Object.defineProperty(ChartAxisFormat.prototype, "line", {
  14082. get: function () {
  14083. if (!this.m_line) {
  14084. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  14085. }
  14086. return this.m_line;
  14087. },
  14088. enumerable: true,
  14089. configurable: true
  14090. });
  14091. ChartAxisFormat.prototype._handleResult=function (value) {
  14092. _super.prototype._handleResult.call(this, value);
  14093. if (_isNullOrUndefined(value))
  14094. return;
  14095. var obj=value;
  14096. _fixObjectPathIfNecessary(this, obj);
  14097. _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]);
  14098. };
  14099. ChartAxisFormat.prototype.load=function (option) {
  14100. _load(this, option);
  14101. return this;
  14102. };
  14103. ChartAxisFormat.prototype.toJSON=function () {
  14104. return {
  14105. "font": this.m_font,
  14106. "line": this.m_line
  14107. };
  14108. };
  14109. return ChartAxisFormat;
  14110. }(OfficeExtension.ClientObject));
  14111. Excel.ChartAxisFormat=ChartAxisFormat;
  14112. var ChartAxisTitle=(function (_super) {
  14113. __extends(ChartAxisTitle, _super);
  14114. function ChartAxisTitle() {
  14115. _super.apply(this, arguments);
  14116. }
  14117. Object.defineProperty(ChartAxisTitle.prototype, "format", {
  14118. get: function () {
  14119. if (!this.m_format) {
  14120. this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14121. }
  14122. return this.m_format;
  14123. },
  14124. enumerable: true,
  14125. configurable: true
  14126. });
  14127. Object.defineProperty(ChartAxisTitle.prototype, "text", {
  14128. get: function () {
  14129. _throwIfNotLoaded("text", this.m_text, "ChartAxisTitle", this._isNull);
  14130. return this.m_text;
  14131. },
  14132. set: function (value) {
  14133. this.m_text=value;
  14134. _createSetPropertyAction(this.context, this, "Text", value);
  14135. },
  14136. enumerable: true,
  14137. configurable: true
  14138. });
  14139. Object.defineProperty(ChartAxisTitle.prototype, "visible", {
  14140. get: function () {
  14141. _throwIfNotLoaded("visible", this.m_visible, "ChartAxisTitle", this._isNull);
  14142. return this.m_visible;
  14143. },
  14144. set: function (value) {
  14145. this.m_visible=value;
  14146. _createSetPropertyAction(this.context, this, "Visible", value);
  14147. },
  14148. enumerable: true,
  14149. configurable: true
  14150. });
  14151. ChartAxisTitle.prototype._handleResult=function (value) {
  14152. _super.prototype._handleResult.call(this, value);
  14153. if (_isNullOrUndefined(value))
  14154. return;
  14155. var obj=value;
  14156. _fixObjectPathIfNecessary(this, obj);
  14157. if (!_isUndefined(obj["Text"])) {
  14158. this.m_text=obj["Text"];
  14159. }
  14160. if (!_isUndefined(obj["Visible"])) {
  14161. this.m_visible=obj["Visible"];
  14162. }
  14163. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14164. };
  14165. ChartAxisTitle.prototype.load=function (option) {
  14166. _load(this, option);
  14167. return this;
  14168. };
  14169. ChartAxisTitle.prototype.toJSON=function () {
  14170. return {
  14171. "format": this.m_format,
  14172. "text": this.m_text,
  14173. "visible": this.m_visible
  14174. };
  14175. };
  14176. return ChartAxisTitle;
  14177. }(OfficeExtension.ClientObject));
  14178. Excel.ChartAxisTitle=ChartAxisTitle;
  14179. var ChartAxisTitleFormat=(function (_super) {
  14180. __extends(ChartAxisTitleFormat, _super);
  14181. function ChartAxisTitleFormat() {
  14182. _super.apply(this, arguments);
  14183. }
  14184. Object.defineProperty(ChartAxisTitleFormat.prototype, "font", {
  14185. get: function () {
  14186. if (!this.m_font) {
  14187. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14188. }
  14189. return this.m_font;
  14190. },
  14191. enumerable: true,
  14192. configurable: true
  14193. });
  14194. ChartAxisTitleFormat.prototype._handleResult=function (value) {
  14195. _super.prototype._handleResult.call(this, value);
  14196. if (_isNullOrUndefined(value))
  14197. return;
  14198. var obj=value;
  14199. _fixObjectPathIfNecessary(this, obj);
  14200. _handleNavigationPropertyResults(this, obj, ["font", "Font"]);
  14201. };
  14202. ChartAxisTitleFormat.prototype.load=function (option) {
  14203. _load(this, option);
  14204. return this;
  14205. };
  14206. ChartAxisTitleFormat.prototype.toJSON=function () {
  14207. return {
  14208. "font": this.m_font
  14209. };
  14210. };
  14211. return ChartAxisTitleFormat;
  14212. }(OfficeExtension.ClientObject));
  14213. Excel.ChartAxisTitleFormat=ChartAxisTitleFormat;
  14214. var ChartDataLabels=(function (_super) {
  14215. __extends(ChartDataLabels, _super);
  14216. function ChartDataLabels() {
  14217. _super.apply(this, arguments);
  14218. }
  14219. Object.defineProperty(ChartDataLabels.prototype, "format", {
  14220. get: function () {
  14221. if (!this.m_format) {
  14222. this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14223. }
  14224. return this.m_format;
  14225. },
  14226. enumerable: true,
  14227. configurable: true
  14228. });
  14229. Object.defineProperty(ChartDataLabels.prototype, "position", {
  14230. get: function () {
  14231. _throwIfNotLoaded("position", this.m_position, "ChartDataLabels", this._isNull);
  14232. return this.m_position;
  14233. },
  14234. set: function (value) {
  14235. this.m_position=value;
  14236. _createSetPropertyAction(this.context, this, "Position", value);
  14237. },
  14238. enumerable: true,
  14239. configurable: true
  14240. });
  14241. Object.defineProperty(ChartDataLabels.prototype, "separator", {
  14242. get: function () {
  14243. _throwIfNotLoaded("separator", this.m_separator, "ChartDataLabels", this._isNull);
  14244. return this.m_separator;
  14245. },
  14246. set: function (value) {
  14247. this.m_separator=value;
  14248. _createSetPropertyAction(this.context, this, "Separator", value);
  14249. },
  14250. enumerable: true,
  14251. configurable: true
  14252. });
  14253. Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", {
  14254. get: function () {
  14255. _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize, "ChartDataLabels", this._isNull);
  14256. return this.m_showBubbleSize;
  14257. },
  14258. set: function (value) {
  14259. this.m_showBubbleSize=value;
  14260. _createSetPropertyAction(this.context, this, "ShowBubbleSize", value);
  14261. },
  14262. enumerable: true,
  14263. configurable: true
  14264. });
  14265. Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", {
  14266. get: function () {
  14267. _throwIfNotLoaded("showCategoryName", this.m_showCategoryName, "ChartDataLabels", this._isNull);
  14268. return this.m_showCategoryName;
  14269. },
  14270. set: function (value) {
  14271. this.m_showCategoryName=value;
  14272. _createSetPropertyAction(this.context, this, "ShowCategoryName", value);
  14273. },
  14274. enumerable: true,
  14275. configurable: true
  14276. });
  14277. Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", {
  14278. get: function () {
  14279. _throwIfNotLoaded("showLegendKey", this.m_showLegendKey, "ChartDataLabels", this._isNull);
  14280. return this.m_showLegendKey;
  14281. },
  14282. set: function (value) {
  14283. this.m_showLegendKey=value;
  14284. _createSetPropertyAction(this.context, this, "ShowLegendKey", value);
  14285. },
  14286. enumerable: true,
  14287. configurable: true
  14288. });
  14289. Object.defineProperty(ChartDataLabels.prototype, "showPercentage", {
  14290. get: function () {
  14291. _throwIfNotLoaded("showPercentage", this.m_showPercentage, "ChartDataLabels", this._isNull);
  14292. return this.m_showPercentage;
  14293. },
  14294. set: function (value) {
  14295. this.m_showPercentage=value;
  14296. _createSetPropertyAction(this.context, this, "ShowPercentage", value);
  14297. },
  14298. enumerable: true,
  14299. configurable: true
  14300. });
  14301. Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", {
  14302. get: function () {
  14303. _throwIfNotLoaded("showSeriesName", this.m_showSeriesName, "ChartDataLabels", this._isNull);
  14304. return this.m_showSeriesName;
  14305. },
  14306. set: function (value) {
  14307. this.m_showSeriesName=value;
  14308. _createSetPropertyAction(this.context, this, "ShowSeriesName", value);
  14309. },
  14310. enumerable: true,
  14311. configurable: true
  14312. });
  14313. Object.defineProperty(ChartDataLabels.prototype, "showValue", {
  14314. get: function () {
  14315. _throwIfNotLoaded("showValue", this.m_showValue, "ChartDataLabels", this._isNull);
  14316. return this.m_showValue;
  14317. },
  14318. set: function (value) {
  14319. this.m_showValue=value;
  14320. _createSetPropertyAction(this.context, this, "ShowValue", value);
  14321. },
  14322. enumerable: true,
  14323. configurable: true
  14324. });
  14325. ChartDataLabels.prototype._handleResult=function (value) {
  14326. _super.prototype._handleResult.call(this, value);
  14327. if (_isNullOrUndefined(value))
  14328. return;
  14329. var obj=value;
  14330. _fixObjectPathIfNecessary(this, obj);
  14331. if (!_isUndefined(obj["Position"])) {
  14332. this.m_position=obj["Position"];
  14333. }
  14334. if (!_isUndefined(obj["Separator"])) {
  14335. this.m_separator=obj["Separator"];
  14336. }
  14337. if (!_isUndefined(obj["ShowBubbleSize"])) {
  14338. this.m_showBubbleSize=obj["ShowBubbleSize"];
  14339. }
  14340. if (!_isUndefined(obj["ShowCategoryName"])) {
  14341. this.m_showCategoryName=obj["ShowCategoryName"];
  14342. }
  14343. if (!_isUndefined(obj["ShowLegendKey"])) {
  14344. this.m_showLegendKey=obj["ShowLegendKey"];
  14345. }
  14346. if (!_isUndefined(obj["ShowPercentage"])) {
  14347. this.m_showPercentage=obj["ShowPercentage"];
  14348. }
  14349. if (!_isUndefined(obj["ShowSeriesName"])) {
  14350. this.m_showSeriesName=obj["ShowSeriesName"];
  14351. }
  14352. if (!_isUndefined(obj["ShowValue"])) {
  14353. this.m_showValue=obj["ShowValue"];
  14354. }
  14355. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14356. };
  14357. ChartDataLabels.prototype.load=function (option) {
  14358. _load(this, option);
  14359. return this;
  14360. };
  14361. ChartDataLabels.prototype.toJSON=function () {
  14362. return {
  14363. "format": this.m_format,
  14364. "position": this.m_position,
  14365. "separator": this.m_separator,
  14366. "showBubbleSize": this.m_showBubbleSize,
  14367. "showCategoryName": this.m_showCategoryName,
  14368. "showLegendKey": this.m_showLegendKey,
  14369. "showPercentage": this.m_showPercentage,
  14370. "showSeriesName": this.m_showSeriesName,
  14371. "showValue": this.m_showValue
  14372. };
  14373. };
  14374. return ChartDataLabels;
  14375. }(OfficeExtension.ClientObject));
  14376. Excel.ChartDataLabels=ChartDataLabels;
  14377. var ChartDataLabelFormat=(function (_super) {
  14378. __extends(ChartDataLabelFormat, _super);
  14379. function ChartDataLabelFormat() {
  14380. _super.apply(this, arguments);
  14381. }
  14382. Object.defineProperty(ChartDataLabelFormat.prototype, "fill", {
  14383. get: function () {
  14384. if (!this.m_fill) {
  14385. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14386. }
  14387. return this.m_fill;
  14388. },
  14389. enumerable: true,
  14390. configurable: true
  14391. });
  14392. Object.defineProperty(ChartDataLabelFormat.prototype, "font", {
  14393. get: function () {
  14394. if (!this.m_font) {
  14395. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14396. }
  14397. return this.m_font;
  14398. },
  14399. enumerable: true,
  14400. configurable: true
  14401. });
  14402. ChartDataLabelFormat.prototype._handleResult=function (value) {
  14403. _super.prototype._handleResult.call(this, value);
  14404. if (_isNullOrUndefined(value))
  14405. return;
  14406. var obj=value;
  14407. _fixObjectPathIfNecessary(this, obj);
  14408. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14409. };
  14410. ChartDataLabelFormat.prototype.load=function (option) {
  14411. _load(this, option);
  14412. return this;
  14413. };
  14414. ChartDataLabelFormat.prototype.toJSON=function () {
  14415. return {
  14416. "fill": this.m_fill,
  14417. "font": this.m_font
  14418. };
  14419. };
  14420. return ChartDataLabelFormat;
  14421. }(OfficeExtension.ClientObject));
  14422. Excel.ChartDataLabelFormat=ChartDataLabelFormat;
  14423. var ChartGridlines=(function (_super) {
  14424. __extends(ChartGridlines, _super);
  14425. function ChartGridlines() {
  14426. _super.apply(this, arguments);
  14427. }
  14428. Object.defineProperty(ChartGridlines.prototype, "format", {
  14429. get: function () {
  14430. if (!this.m_format) {
  14431. this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14432. }
  14433. return this.m_format;
  14434. },
  14435. enumerable: true,
  14436. configurable: true
  14437. });
  14438. Object.defineProperty(ChartGridlines.prototype, "visible", {
  14439. get: function () {
  14440. _throwIfNotLoaded("visible", this.m_visible, "ChartGridlines", this._isNull);
  14441. return this.m_visible;
  14442. },
  14443. set: function (value) {
  14444. this.m_visible=value;
  14445. _createSetPropertyAction(this.context, this, "Visible", value);
  14446. },
  14447. enumerable: true,
  14448. configurable: true
  14449. });
  14450. ChartGridlines.prototype._handleResult=function (value) {
  14451. _super.prototype._handleResult.call(this, value);
  14452. if (_isNullOrUndefined(value))
  14453. return;
  14454. var obj=value;
  14455. _fixObjectPathIfNecessary(this, obj);
  14456. if (!_isUndefined(obj["Visible"])) {
  14457. this.m_visible=obj["Visible"];
  14458. }
  14459. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14460. };
  14461. ChartGridlines.prototype.load=function (option) {
  14462. _load(this, option);
  14463. return this;
  14464. };
  14465. ChartGridlines.prototype.toJSON=function () {
  14466. return {
  14467. "format": this.m_format,
  14468. "visible": this.m_visible
  14469. };
  14470. };
  14471. return ChartGridlines;
  14472. }(OfficeExtension.ClientObject));
  14473. Excel.ChartGridlines=ChartGridlines;
  14474. var ChartGridlinesFormat=(function (_super) {
  14475. __extends(ChartGridlinesFormat, _super);
  14476. function ChartGridlinesFormat() {
  14477. _super.apply(this, arguments);
  14478. }
  14479. Object.defineProperty(ChartGridlinesFormat.prototype, "line", {
  14480. get: function () {
  14481. if (!this.m_line) {
  14482. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  14483. }
  14484. return this.m_line;
  14485. },
  14486. enumerable: true,
  14487. configurable: true
  14488. });
  14489. ChartGridlinesFormat.prototype._handleResult=function (value) {
  14490. _super.prototype._handleResult.call(this, value);
  14491. if (_isNullOrUndefined(value))
  14492. return;
  14493. var obj=value;
  14494. _fixObjectPathIfNecessary(this, obj);
  14495. _handleNavigationPropertyResults(this, obj, ["line", "Line"]);
  14496. };
  14497. ChartGridlinesFormat.prototype.load=function (option) {
  14498. _load(this, option);
  14499. return this;
  14500. };
  14501. ChartGridlinesFormat.prototype.toJSON=function () {
  14502. return {
  14503. "line": this.m_line
  14504. };
  14505. };
  14506. return ChartGridlinesFormat;
  14507. }(OfficeExtension.ClientObject));
  14508. Excel.ChartGridlinesFormat=ChartGridlinesFormat;
  14509. var ChartLegend=(function (_super) {
  14510. __extends(ChartLegend, _super);
  14511. function ChartLegend() {
  14512. _super.apply(this, arguments);
  14513. }
  14514. Object.defineProperty(ChartLegend.prototype, "format", {
  14515. get: function () {
  14516. if (!this.m_format) {
  14517. this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14518. }
  14519. return this.m_format;
  14520. },
  14521. enumerable: true,
  14522. configurable: true
  14523. });
  14524. Object.defineProperty(ChartLegend.prototype, "overlay", {
  14525. get: function () {
  14526. _throwIfNotLoaded("overlay", this.m_overlay, "ChartLegend", this._isNull);
  14527. return this.m_overlay;
  14528. },
  14529. set: function (value) {
  14530. this.m_overlay=value;
  14531. _createSetPropertyAction(this.context, this, "Overlay", value);
  14532. },
  14533. enumerable: true,
  14534. configurable: true
  14535. });
  14536. Object.defineProperty(ChartLegend.prototype, "position", {
  14537. get: function () {
  14538. _throwIfNotLoaded("position", this.m_position, "ChartLegend", this._isNull);
  14539. return this.m_position;
  14540. },
  14541. set: function (value) {
  14542. this.m_position=value;
  14543. _createSetPropertyAction(this.context, this, "Position", value);
  14544. },
  14545. enumerable: true,
  14546. configurable: true
  14547. });
  14548. Object.defineProperty(ChartLegend.prototype, "visible", {
  14549. get: function () {
  14550. _throwIfNotLoaded("visible", this.m_visible, "ChartLegend", this._isNull);
  14551. return this.m_visible;
  14552. },
  14553. set: function (value) {
  14554. this.m_visible=value;
  14555. _createSetPropertyAction(this.context, this, "Visible", value);
  14556. },
  14557. enumerable: true,
  14558. configurable: true
  14559. });
  14560. ChartLegend.prototype._handleResult=function (value) {
  14561. _super.prototype._handleResult.call(this, value);
  14562. if (_isNullOrUndefined(value))
  14563. return;
  14564. var obj=value;
  14565. _fixObjectPathIfNecessary(this, obj);
  14566. if (!_isUndefined(obj["Overlay"])) {
  14567. this.m_overlay=obj["Overlay"];
  14568. }
  14569. if (!_isUndefined(obj["Position"])) {
  14570. this.m_position=obj["Position"];
  14571. }
  14572. if (!_isUndefined(obj["Visible"])) {
  14573. this.m_visible=obj["Visible"];
  14574. }
  14575. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14576. };
  14577. ChartLegend.prototype.load=function (option) {
  14578. _load(this, option);
  14579. return this;
  14580. };
  14581. ChartLegend.prototype.toJSON=function () {
  14582. return {
  14583. "format": this.m_format,
  14584. "overlay": this.m_overlay,
  14585. "position": this.m_position,
  14586. "visible": this.m_visible
  14587. };
  14588. };
  14589. return ChartLegend;
  14590. }(OfficeExtension.ClientObject));
  14591. Excel.ChartLegend=ChartLegend;
  14592. var ChartLegendFormat=(function (_super) {
  14593. __extends(ChartLegendFormat, _super);
  14594. function ChartLegendFormat() {
  14595. _super.apply(this, arguments);
  14596. }
  14597. Object.defineProperty(ChartLegendFormat.prototype, "fill", {
  14598. get: function () {
  14599. if (!this.m_fill) {
  14600. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14601. }
  14602. return this.m_fill;
  14603. },
  14604. enumerable: true,
  14605. configurable: true
  14606. });
  14607. Object.defineProperty(ChartLegendFormat.prototype, "font", {
  14608. get: function () {
  14609. if (!this.m_font) {
  14610. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14611. }
  14612. return this.m_font;
  14613. },
  14614. enumerable: true,
  14615. configurable: true
  14616. });
  14617. ChartLegendFormat.prototype._handleResult=function (value) {
  14618. _super.prototype._handleResult.call(this, value);
  14619. if (_isNullOrUndefined(value))
  14620. return;
  14621. var obj=value;
  14622. _fixObjectPathIfNecessary(this, obj);
  14623. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14624. };
  14625. ChartLegendFormat.prototype.load=function (option) {
  14626. _load(this, option);
  14627. return this;
  14628. };
  14629. ChartLegendFormat.prototype.toJSON=function () {
  14630. return {
  14631. "fill": this.m_fill,
  14632. "font": this.m_font
  14633. };
  14634. };
  14635. return ChartLegendFormat;
  14636. }(OfficeExtension.ClientObject));
  14637. Excel.ChartLegendFormat=ChartLegendFormat;
  14638. var ChartTitle=(function (_super) {
  14639. __extends(ChartTitle, _super);
  14640. function ChartTitle() {
  14641. _super.apply(this, arguments);
  14642. }
  14643. Object.defineProperty(ChartTitle.prototype, "format", {
  14644. get: function () {
  14645. if (!this.m_format) {
  14646. this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14647. }
  14648. return this.m_format;
  14649. },
  14650. enumerable: true,
  14651. configurable: true
  14652. });
  14653. Object.defineProperty(ChartTitle.prototype, "overlay", {
  14654. get: function () {
  14655. _throwIfNotLoaded("overlay", this.m_overlay, "ChartTitle", this._isNull);
  14656. return this.m_overlay;
  14657. },
  14658. set: function (value) {
  14659. this.m_overlay=value;
  14660. _createSetPropertyAction(this.context, this, "Overlay", value);
  14661. },
  14662. enumerable: true,
  14663. configurable: true
  14664. });
  14665. Object.defineProperty(ChartTitle.prototype, "text", {
  14666. get: function () {
  14667. _throwIfNotLoaded("text", this.m_text, "ChartTitle", this._isNull);
  14668. return this.m_text;
  14669. },
  14670. set: function (value) {
  14671. this.m_text=value;
  14672. _createSetPropertyAction(this.context, this, "Text", value);
  14673. },
  14674. enumerable: true,
  14675. configurable: true
  14676. });
  14677. Object.defineProperty(ChartTitle.prototype, "visible", {
  14678. get: function () {
  14679. _throwIfNotLoaded("visible", this.m_visible, "ChartTitle", this._isNull);
  14680. return this.m_visible;
  14681. },
  14682. set: function (value) {
  14683. this.m_visible=value;
  14684. _createSetPropertyAction(this.context, this, "Visible", value);
  14685. },
  14686. enumerable: true,
  14687. configurable: true
  14688. });
  14689. ChartTitle.prototype._handleResult=function (value) {
  14690. _super.prototype._handleResult.call(this, value);
  14691. if (_isNullOrUndefined(value))
  14692. return;
  14693. var obj=value;
  14694. _fixObjectPathIfNecessary(this, obj);
  14695. if (!_isUndefined(obj["Overlay"])) {
  14696. this.m_overlay=obj["Overlay"];
  14697. }
  14698. if (!_isUndefined(obj["Text"])) {
  14699. this.m_text=obj["Text"];
  14700. }
  14701. if (!_isUndefined(obj["Visible"])) {
  14702. this.m_visible=obj["Visible"];
  14703. }
  14704. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14705. };
  14706. ChartTitle.prototype.load=function (option) {
  14707. _load(this, option);
  14708. return this;
  14709. };
  14710. ChartTitle.prototype.toJSON=function () {
  14711. return {
  14712. "format": this.m_format,
  14713. "overlay": this.m_overlay,
  14714. "text": this.m_text,
  14715. "visible": this.m_visible
  14716. };
  14717. };
  14718. return ChartTitle;
  14719. }(OfficeExtension.ClientObject));
  14720. Excel.ChartTitle=ChartTitle;
  14721. var ChartTitleFormat=(function (_super) {
  14722. __extends(ChartTitleFormat, _super);
  14723. function ChartTitleFormat() {
  14724. _super.apply(this, arguments);
  14725. }
  14726. Object.defineProperty(ChartTitleFormat.prototype, "fill", {
  14727. get: function () {
  14728. if (!this.m_fill) {
  14729. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14730. }
  14731. return this.m_fill;
  14732. },
  14733. enumerable: true,
  14734. configurable: true
  14735. });
  14736. Object.defineProperty(ChartTitleFormat.prototype, "font", {
  14737. get: function () {
  14738. if (!this.m_font) {
  14739. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14740. }
  14741. return this.m_font;
  14742. },
  14743. enumerable: true,
  14744. configurable: true
  14745. });
  14746. ChartTitleFormat.prototype._handleResult=function (value) {
  14747. _super.prototype._handleResult.call(this, value);
  14748. if (_isNullOrUndefined(value))
  14749. return;
  14750. var obj=value;
  14751. _fixObjectPathIfNecessary(this, obj);
  14752. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14753. };
  14754. ChartTitleFormat.prototype.load=function (option) {
  14755. _load(this, option);
  14756. return this;
  14757. };
  14758. ChartTitleFormat.prototype.toJSON=function () {
  14759. return {
  14760. "fill": this.m_fill,
  14761. "font": this.m_font
  14762. };
  14763. };
  14764. return ChartTitleFormat;
  14765. }(OfficeExtension.ClientObject));
  14766. Excel.ChartTitleFormat=ChartTitleFormat;
  14767. var ChartFill=(function (_super) {
  14768. __extends(ChartFill, _super);
  14769. function ChartFill() {
  14770. _super.apply(this, arguments);
  14771. }
  14772. ChartFill.prototype.load=function (option) {
  14773. _load(this, option);
  14774. return this;
  14775. };
  14776. ChartFill.prototype.clear=function () {
  14777. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14778. };
  14779. ChartFill.prototype.setSolidColor=function (color) {
  14780. _createMethodAction(this.context, this, "SetSolidColor", OfficeExtension.OperationType.Default, [color]);
  14781. };
  14782. ChartFill.prototype._handleResult=function (value) {
  14783. _super.prototype._handleResult.call(this, value);
  14784. if (_isNullOrUndefined(value))
  14785. return;
  14786. var obj=value;
  14787. _fixObjectPathIfNecessary(this, obj);
  14788. };
  14789. ChartFill.prototype.toJSON=function () {
  14790. return {};
  14791. };
  14792. return ChartFill;
  14793. }(OfficeExtension.ClientObject));
  14794. Excel.ChartFill=ChartFill;
  14795. var ChartLineFormat=(function (_super) {
  14796. __extends(ChartLineFormat, _super);
  14797. function ChartLineFormat() {
  14798. _super.apply(this, arguments);
  14799. }
  14800. Object.defineProperty(ChartLineFormat.prototype, "color", {
  14801. get: function () {
  14802. _throwIfNotLoaded("color", this.m_color, "ChartLineFormat", this._isNull);
  14803. return this.m_color;
  14804. },
  14805. set: function (value) {
  14806. this.m_color=value;
  14807. _createSetPropertyAction(this.context, this, "Color", value);
  14808. },
  14809. enumerable: true,
  14810. configurable: true
  14811. });
  14812. ChartLineFormat.prototype.clear=function () {
  14813. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14814. };
  14815. ChartLineFormat.prototype._handleResult=function (value) {
  14816. _super.prototype._handleResult.call(this, value);
  14817. if (_isNullOrUndefined(value))
  14818. return;
  14819. var obj=value;
  14820. _fixObjectPathIfNecessary(this, obj);
  14821. if (!_isUndefined(obj["Color"])) {
  14822. this.m_color=obj["Color"];
  14823. }
  14824. };
  14825. ChartLineFormat.prototype.load=function (option) {
  14826. _load(this, option);
  14827. return this;
  14828. };
  14829. ChartLineFormat.prototype.toJSON=function () {
  14830. return {
  14831. "color": this.m_color
  14832. };
  14833. };
  14834. return ChartLineFormat;
  14835. }(OfficeExtension.ClientObject));
  14836. Excel.ChartLineFormat=ChartLineFormat;
  14837. var ChartFont=(function (_super) {
  14838. __extends(ChartFont, _super);
  14839. function ChartFont() {
  14840. _super.apply(this, arguments);
  14841. }
  14842. Object.defineProperty(ChartFont.prototype, "bold", {
  14843. get: function () {
  14844. _throwIfNotLoaded("bold", this.m_bold, "ChartFont", this._isNull);
  14845. return this.m_bold;
  14846. },
  14847. set: function (value) {
  14848. this.m_bold=value;
  14849. _createSetPropertyAction(this.context, this, "Bold", value);
  14850. },
  14851. enumerable: true,
  14852. configurable: true
  14853. });
  14854. Object.defineProperty(ChartFont.prototype, "color", {
  14855. get: function () {
  14856. _throwIfNotLoaded("color", this.m_color, "ChartFont", this._isNull);
  14857. return this.m_color;
  14858. },
  14859. set: function (value) {
  14860. this.m_color=value;
  14861. _createSetPropertyAction(this.context, this, "Color", value);
  14862. },
  14863. enumerable: true,
  14864. configurable: true
  14865. });
  14866. Object.defineProperty(ChartFont.prototype, "italic", {
  14867. get: function () {
  14868. _throwIfNotLoaded("italic", this.m_italic, "ChartFont", this._isNull);
  14869. return this.m_italic;
  14870. },
  14871. set: function (value) {
  14872. this.m_italic=value;
  14873. _createSetPropertyAction(this.context, this, "Italic", value);
  14874. },
  14875. enumerable: true,
  14876. configurable: true
  14877. });
  14878. Object.defineProperty(ChartFont.prototype, "name", {
  14879. get: function () {
  14880. _throwIfNotLoaded("name", this.m_name, "ChartFont", this._isNull);
  14881. return this.m_name;
  14882. },
  14883. set: function (value) {
  14884. this.m_name=value;
  14885. _createSetPropertyAction(this.context, this, "Name", value);
  14886. },
  14887. enumerable: true,
  14888. configurable: true
  14889. });
  14890. Object.defineProperty(ChartFont.prototype, "size", {
  14891. get: function () {
  14892. _throwIfNotLoaded("size", this.m_size, "ChartFont", this._isNull);
  14893. return this.m_size;
  14894. },
  14895. set: function (value) {
  14896. this.m_size=value;
  14897. _createSetPropertyAction(this.context, this, "Size", value);
  14898. },
  14899. enumerable: true,
  14900. configurable: true
  14901. });
  14902. Object.defineProperty(ChartFont.prototype, "underline", {
  14903. get: function () {
  14904. _throwIfNotLoaded("underline", this.m_underline, "ChartFont", this._isNull);
  14905. return this.m_underline;
  14906. },
  14907. set: function (value) {
  14908. this.m_underline=value;
  14909. _createSetPropertyAction(this.context, this, "Underline", value);
  14910. },
  14911. enumerable: true,
  14912. configurable: true
  14913. });
  14914. ChartFont.prototype._handleResult=function (value) {
  14915. _super.prototype._handleResult.call(this, value);
  14916. if (_isNullOrUndefined(value))
  14917. return;
  14918. var obj=value;
  14919. _fixObjectPathIfNecessary(this, obj);
  14920. if (!_isUndefined(obj["Bold"])) {
  14921. this.m_bold=obj["Bold"];
  14922. }
  14923. if (!_isUndefined(obj["Color"])) {
  14924. this.m_color=obj["Color"];
  14925. }
  14926. if (!_isUndefined(obj["Italic"])) {
  14927. this.m_italic=obj["Italic"];
  14928. }
  14929. if (!_isUndefined(obj["Name"])) {
  14930. this.m_name=obj["Name"];
  14931. }
  14932. if (!_isUndefined(obj["Size"])) {
  14933. this.m_size=obj["Size"];
  14934. }
  14935. if (!_isUndefined(obj["Underline"])) {
  14936. this.m_underline=obj["Underline"];
  14937. }
  14938. };
  14939. ChartFont.prototype.load=function (option) {
  14940. _load(this, option);
  14941. return this;
  14942. };
  14943. ChartFont.prototype.toJSON=function () {
  14944. return {
  14945. "bold": this.m_bold,
  14946. "color": this.m_color,
  14947. "italic": this.m_italic,
  14948. "name": this.m_name,
  14949. "size": this.m_size,
  14950. "underline": this.m_underline
  14951. };
  14952. };
  14953. return ChartFont;
  14954. }(OfficeExtension.ClientObject));
  14955. Excel.ChartFont=ChartFont;
  14956. var RangeSort=(function (_super) {
  14957. __extends(RangeSort, _super);
  14958. function RangeSort() {
  14959. _super.apply(this, arguments);
  14960. }
  14961. RangeSort.prototype.apply=function (fields, matchCase, hasHeaders, orientation, method) {
  14962. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, hasHeaders, orientation, method]);
  14963. };
  14964. RangeSort.prototype._handleResult=function (value) {
  14965. _super.prototype._handleResult.call(this, value);
  14966. if (_isNullOrUndefined(value))
  14967. return;
  14968. var obj=value;
  14969. _fixObjectPathIfNecessary(this, obj);
  14970. };
  14971. RangeSort.prototype.toJSON=function () {
  14972. return {};
  14973. };
  14974. return RangeSort;
  14975. }(OfficeExtension.ClientObject));
  14976. Excel.RangeSort=RangeSort;
  14977. var TableSort=(function (_super) {
  14978. __extends(TableSort, _super);
  14979. function TableSort() {
  14980. _super.apply(this, arguments);
  14981. }
  14982. Object.defineProperty(TableSort.prototype, "fields", {
  14983. get: function () {
  14984. _throwIfNotLoaded("fields", this.m_fields, "TableSort", this._isNull);
  14985. return this.m_fields;
  14986. },
  14987. enumerable: true,
  14988. configurable: true
  14989. });
  14990. Object.defineProperty(TableSort.prototype, "matchCase", {
  14991. get: function () {
  14992. _throwIfNotLoaded("matchCase", this.m_matchCase, "TableSort", this._isNull);
  14993. return this.m_matchCase;
  14994. },
  14995. enumerable: true,
  14996. configurable: true
  14997. });
  14998. Object.defineProperty(TableSort.prototype, "method", {
  14999. get: function () {
  15000. _throwIfNotLoaded("method", this.m_method, "TableSort", this._isNull);
  15001. return this.m_method;
  15002. },
  15003. enumerable: true,
  15004. configurable: true
  15005. });
  15006. TableSort.prototype.apply=function (fields, matchCase, method) {
  15007. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, method]);
  15008. };
  15009. TableSort.prototype.clear=function () {
  15010. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  15011. };
  15012. TableSort.prototype.reapply=function () {
  15013. _createMethodAction(this.context, this, "Reapply", OfficeExtension.OperationType.Default, []);
  15014. };
  15015. TableSort.prototype._handleResult=function (value) {
  15016. _super.prototype._handleResult.call(this, value);
  15017. if (_isNullOrUndefined(value))
  15018. return;
  15019. var obj=value;
  15020. _fixObjectPathIfNecessary(this, obj);
  15021. if (!_isUndefined(obj["Fields"])) {
  15022. this.m_fields=obj["Fields"];
  15023. }
  15024. if (!_isUndefined(obj["MatchCase"])) {
  15025. this.m_matchCase=obj["MatchCase"];
  15026. }
  15027. if (!_isUndefined(obj["Method"])) {
  15028. this.m_method=obj["Method"];
  15029. }
  15030. };
  15031. TableSort.prototype.load=function (option) {
  15032. _load(this, option);
  15033. return this;
  15034. };
  15035. TableSort.prototype.toJSON=function () {
  15036. return {
  15037. "fields": this.m_fields,
  15038. "matchCase": this.m_matchCase,
  15039. "method": this.m_method
  15040. };
  15041. };
  15042. return TableSort;
  15043. }(OfficeExtension.ClientObject));
  15044. Excel.TableSort=TableSort;
  15045. var Filter=(function (_super) {
  15046. __extends(Filter, _super);
  15047. function Filter() {
  15048. _super.apply(this, arguments);
  15049. }
  15050. Object.defineProperty(Filter.prototype, "criteria", {
  15051. get: function () {
  15052. _throwIfNotLoaded("criteria", this.m_criteria, "Filter", this._isNull);
  15053. return this.m_criteria;
  15054. },
  15055. enumerable: true,
  15056. configurable: true
  15057. });
  15058. Filter.prototype.apply=function (criteria) {
  15059. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [criteria]);
  15060. };
  15061. Filter.prototype.applyBottomItemsFilter=function (count) {
  15062. _createMethodAction(this.context, this, "ApplyBottomItemsFilter", OfficeExtension.OperationType.Default, [count]);
  15063. };
  15064. Filter.prototype.applyBottomPercentFilter=function (percent) {
  15065. _createMethodAction(this.context, this, "ApplyBottomPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  15066. };
  15067. Filter.prototype.applyCellColorFilter=function (color) {
  15068. _createMethodAction(this.context, this, "ApplyCellColorFilter", OfficeExtension.OperationType.Default, [color]);
  15069. };
  15070. Filter.prototype.applyCustomFilter=function (criteria1, criteria2, oper) {
  15071. _createMethodAction(this.context, this, "ApplyCustomFilter", OfficeExtension.OperationType.Default, [criteria1, criteria2, oper]);
  15072. };
  15073. Filter.prototype.applyDynamicFilter=function (criteria) {
  15074. _createMethodAction(this.context, this, "ApplyDynamicFilter", OfficeExtension.OperationType.Default, [criteria]);
  15075. };
  15076. Filter.prototype.applyFontColorFilter=function (color) {
  15077. _createMethodAction(this.context, this, "ApplyFontColorFilter", OfficeExtension.OperationType.Default, [color]);
  15078. };
  15079. Filter.prototype.applyIconFilter=function (icon) {
  15080. _createMethodAction(this.context, this, "ApplyIconFilter", OfficeExtension.OperationType.Default, [icon]);
  15081. };
  15082. Filter.prototype.applyTopItemsFilter=function (count) {
  15083. _createMethodAction(this.context, this, "ApplyTopItemsFilter", OfficeExtension.OperationType.Default, [count]);
  15084. };
  15085. Filter.prototype.applyTopPercentFilter=function (percent) {
  15086. _createMethodAction(this.context, this, "ApplyTopPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  15087. };
  15088. Filter.prototype.applyValuesFilter=function (values) {
  15089. _createMethodAction(this.context, this, "ApplyValuesFilter", OfficeExtension.OperationType.Default, [values]);
  15090. };
  15091. Filter.prototype.clear=function () {
  15092. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  15093. };
  15094. Filter.prototype._handleResult=function (value) {
  15095. _super.prototype._handleResult.call(this, value);
  15096. if (_isNullOrUndefined(value))
  15097. return;
  15098. var obj=value;
  15099. _fixObjectPathIfNecessary(this, obj);
  15100. if (!_isUndefined(obj["Criteria"])) {
  15101. this.m_criteria=obj["Criteria"];
  15102. }
  15103. };
  15104. Filter.prototype.load=function (option) {
  15105. _load(this, option);
  15106. return this;
  15107. };
  15108. Filter.prototype.toJSON=function () {
  15109. return {
  15110. "criteria": this.m_criteria
  15111. };
  15112. };
  15113. return Filter;
  15114. }(OfficeExtension.ClientObject));
  15115. Excel.Filter=Filter;
  15116. var _V1Api=(function (_super) {
  15117. __extends(_V1Api, _super);
  15118. function _V1Api() {
  15119. _super.apply(this, arguments);
  15120. }
  15121. _V1Api.prototype.bindingAddColumns=function (input) {
  15122. var action=_createMethodAction(this.context, this, "BindingAddColumns", OfficeExtension.OperationType.Default, [input]);
  15123. var ret=new OfficeExtension.ClientResult();
  15124. _addActionResultHandler(this, action, ret);
  15125. return ret;
  15126. };
  15127. _V1Api.prototype.bindingAddFromNamedItem=function (input) {
  15128. var action=_createMethodAction(this.context, this, "BindingAddFromNamedItem", OfficeExtension.OperationType.Read, [input]);
  15129. var ret=new OfficeExtension.ClientResult();
  15130. _addActionResultHandler(this, action, ret);
  15131. return ret;
  15132. };
  15133. _V1Api.prototype.bindingAddFromPrompt=function (input) {
  15134. var action=_createMethodAction(this.context, this, "BindingAddFromPrompt", OfficeExtension.OperationType.Read, [input]);
  15135. var ret=new OfficeExtension.ClientResult();
  15136. _addActionResultHandler(this, action, ret);
  15137. return ret;
  15138. };
  15139. _V1Api.prototype.bindingAddFromSelection=function (input) {
  15140. var action=_createMethodAction(this.context, this, "BindingAddFromSelection", OfficeExtension.OperationType.Read, [input]);
  15141. var ret=new OfficeExtension.ClientResult();
  15142. _addActionResultHandler(this, action, ret);
  15143. return ret;
  15144. };
  15145. _V1Api.prototype.bindingAddRows=function (input) {
  15146. var action=_createMethodAction(this.context, this, "BindingAddRows", OfficeExtension.OperationType.Default, [input]);
  15147. var ret=new OfficeExtension.ClientResult();
  15148. _addActionResultHandler(this, action, ret);
  15149. return ret;
  15150. };
  15151. _V1Api.prototype.bindingClearFormats=function (input) {
  15152. var action=_createMethodAction(this.context, this, "BindingClearFormats", OfficeExtension.OperationType.Default, [input]);
  15153. var ret=new OfficeExtension.ClientResult();
  15154. _addActionResultHandler(this, action, ret);
  15155. return ret;
  15156. };
  15157. _V1Api.prototype.bindingDeleteAllDataValues=function (input) {
  15158. var action=_createMethodAction(this.context, this, "BindingDeleteAllDataValues", OfficeExtension.OperationType.Default, [input]);
  15159. var ret=new OfficeExtension.ClientResult();
  15160. _addActionResultHandler(this, action, ret);
  15161. return ret;
  15162. };
  15163. _V1Api.prototype.bindingGetAll=function () {
  15164. var action=_createMethodAction(this.context, this, "BindingGetAll", OfficeExtension.OperationType.Read, []);
  15165. var ret=new OfficeExtension.ClientResult();
  15166. _addActionResultHandler(this, action, ret);
  15167. return ret;
  15168. };
  15169. _V1Api.prototype.bindingGetById=function (input) {
  15170. var action=_createMethodAction(this.context, this, "BindingGetById", OfficeExtension.OperationType.Read, [input]);
  15171. var ret=new OfficeExtension.ClientResult();
  15172. _addActionResultHandler(this, action, ret);
  15173. return ret;
  15174. };
  15175. _V1Api.prototype.bindingGetData=function (input) {
  15176. var action=_createMethodAction(this.context, this, "BindingGetData", OfficeExtension.OperationType.Read, [input]);
  15177. var ret=new OfficeExtension.ClientResult();
  15178. _addActionResultHandler(this, action, ret);
  15179. return ret;
  15180. };
  15181. _V1Api.prototype.bindingReleaseById=function (input) {
  15182. var action=_createMethodAction(this.context, this, "BindingReleaseById", OfficeExtension.OperationType.Read, [input]);
  15183. var ret=new OfficeExtension.ClientResult();
  15184. _addActionResultHandler(this, action, ret);
  15185. return ret;
  15186. };
  15187. _V1Api.prototype.bindingSetData=function (input) {
  15188. var action=_createMethodAction(this.context, this, "BindingSetData", OfficeExtension.OperationType.Default, [input]);
  15189. var ret=new OfficeExtension.ClientResult();
  15190. _addActionResultHandler(this, action, ret);
  15191. return ret;
  15192. };
  15193. _V1Api.prototype.bindingSetFormats=function (input) {
  15194. var action=_createMethodAction(this.context, this, "BindingSetFormats", OfficeExtension.OperationType.Default, [input]);
  15195. var ret=new OfficeExtension.ClientResult();
  15196. _addActionResultHandler(this, action, ret);
  15197. return ret;
  15198. };
  15199. _V1Api.prototype.bindingSetTableOptions=function (input) {
  15200. var action=_createMethodAction(this.context, this, "BindingSetTableOptions", OfficeExtension.OperationType.Default, [input]);
  15201. var ret=new OfficeExtension.ClientResult();
  15202. _addActionResultHandler(this, action, ret);
  15203. return ret;
  15204. };
  15205. _V1Api.prototype.getSelectedData=function (input) {
  15206. var action=_createMethodAction(this.context, this, "GetSelectedData", OfficeExtension.OperationType.Read, [input]);
  15207. var ret=new OfficeExtension.ClientResult();
  15208. _addActionResultHandler(this, action, ret);
  15209. return ret;
  15210. };
  15211. _V1Api.prototype.gotoById=function (input) {
  15212. var action=_createMethodAction(this.context, this, "GotoById", OfficeExtension.OperationType.Read, [input]);
  15213. var ret=new OfficeExtension.ClientResult();
  15214. _addActionResultHandler(this, action, ret);
  15215. return ret;
  15216. };
  15217. _V1Api.prototype.setSelectedData=function (input) {
  15218. var action=_createMethodAction(this.context, this, "SetSelectedData", OfficeExtension.OperationType.Default, [input]);
  15219. var ret=new OfficeExtension.ClientResult();
  15220. _addActionResultHandler(this, action, ret);
  15221. return ret;
  15222. };
  15223. _V1Api.prototype._handleResult=function (value) {
  15224. _super.prototype._handleResult.call(this, value);
  15225. if (_isNullOrUndefined(value))
  15226. return;
  15227. var obj=value;
  15228. _fixObjectPathIfNecessary(this, obj);
  15229. };
  15230. _V1Api.prototype.toJSON=function () {
  15231. return {};
  15232. };
  15233. return _V1Api;
  15234. }(OfficeExtension.ClientObject));
  15235. Excel._V1Api=_V1Api;
  15236. var PivotTableCollection=(function (_super) {
  15237. __extends(PivotTableCollection, _super);
  15238. function PivotTableCollection() {
  15239. _super.apply(this, arguments);
  15240. }
  15241. Object.defineProperty(PivotTableCollection.prototype, "items", {
  15242. get: function () {
  15243. _throwIfNotLoaded("items", this.m__items, "PivotTableCollection", this._isNull);
  15244. return this.m__items;
  15245. },
  15246. enumerable: true,
  15247. configurable: true
  15248. });
  15249. PivotTableCollection.prototype.getItem=function (name) {
  15250. return new Excel.PivotTable(this.context, _createIndexerObjectPath(this.context, this, [name]));
  15251. };
  15252. PivotTableCollection.prototype.refreshAll=function () {
  15253. _createMethodAction(this.context, this, "RefreshAll", OfficeExtension.OperationType.Default, []);
  15254. };
  15255. PivotTableCollection.prototype._handleResult=function (value) {
  15256. _super.prototype._handleResult.call(this, value);
  15257. if (_isNullOrUndefined(value))
  15258. return;
  15259. var obj=value;
  15260. _fixObjectPathIfNecessary(this, obj);
  15261. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15262. this.m__items=[];
  15263. var _data=obj[OfficeExtension.Constants.items];
  15264. for (var i=0; i < _data.length; i++) {
  15265. var _item=new Excel.PivotTable(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  15266. _item._handleResult(_data[i]);
  15267. this.m__items.push(_item);
  15268. }
  15269. }
  15270. };
  15271. PivotTableCollection.prototype.load=function (option) {
  15272. _load(this, option);
  15273. return this;
  15274. };
  15275. PivotTableCollection.prototype.toJSON=function () {
  15276. return {};
  15277. };
  15278. return PivotTableCollection;
  15279. }(OfficeExtension.ClientObject));
  15280. Excel.PivotTableCollection=PivotTableCollection;
  15281. var PivotTable=(function (_super) {
  15282. __extends(PivotTable, _super);
  15283. function PivotTable() {
  15284. _super.apply(this, arguments);
  15285. }
  15286. Object.defineProperty(PivotTable.prototype, "worksheet", {
  15287. get: function () {
  15288. if (!this.m_worksheet) {
  15289. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  15290. }
  15291. return this.m_worksheet;
  15292. },
  15293. enumerable: true,
  15294. configurable: true
  15295. });
  15296. Object.defineProperty(PivotTable.prototype, "name", {
  15297. get: function () {
  15298. _throwIfNotLoaded("name", this.m_name, "PivotTable", this._isNull);
  15299. return this.m_name;
  15300. },
  15301. set: function (value) {
  15302. this.m_name=value;
  15303. _createSetPropertyAction(this.context, this, "Name", value);
  15304. },
  15305. enumerable: true,
  15306. configurable: true
  15307. });
  15308. PivotTable.prototype.refresh=function () {
  15309. _createMethodAction(this.context, this, "Refresh", OfficeExtension.OperationType.Default, []);
  15310. };
  15311. PivotTable.prototype._handleResult=function (value) {
  15312. _super.prototype._handleResult.call(this, value);
  15313. if (_isNullOrUndefined(value))
  15314. return;
  15315. var obj=value;
  15316. _fixObjectPathIfNecessary(this, obj);
  15317. if (!_isUndefined(obj["Name"])) {
  15318. this.m_name=obj["Name"];
  15319. }
  15320. _handleNavigationPropertyResults(this, obj, ["worksheet", "Worksheet"]);
  15321. };
  15322. PivotTable.prototype.load=function (option) {
  15323. _load(this, option);
  15324. return this;
  15325. };
  15326. PivotTable.prototype.toJSON=function () {
  15327. return {
  15328. "name": this.m_name
  15329. };
  15330. };
  15331. return PivotTable;
  15332. }(OfficeExtension.ClientObject));
  15333. Excel.PivotTable=PivotTable;
  15334. var BindingType;
  15335. (function (BindingType) {
  15336. BindingType.range="Range";
  15337. BindingType.table="Table";
  15338. BindingType.text="Text";
  15339. })(BindingType=Excel.BindingType || (Excel.BindingType={}));
  15340. var BorderIndex;
  15341. (function (BorderIndex) {
  15342. BorderIndex.edgeTop="EdgeTop";
  15343. BorderIndex.edgeBottom="EdgeBottom";
  15344. BorderIndex.edgeLeft="EdgeLeft";
  15345. BorderIndex.edgeRight="EdgeRight";
  15346. BorderIndex.insideVertical="InsideVertical";
  15347. BorderIndex.insideHorizontal="InsideHorizontal";
  15348. BorderIndex.diagonalDown="DiagonalDown";
  15349. BorderIndex.diagonalUp="DiagonalUp";
  15350. })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={}));
  15351. var BorderLineStyle;
  15352. (function (BorderLineStyle) {
  15353. BorderLineStyle.none="None";
  15354. BorderLineStyle.continuous="Continuous";
  15355. BorderLineStyle.dash="Dash";
  15356. BorderLineStyle.dashDot="DashDot";
  15357. BorderLineStyle.dashDotDot="DashDotDot";
  15358. BorderLineStyle.dot="Dot";
  15359. BorderLineStyle.double="Double";
  15360. BorderLineStyle.slantDashDot="SlantDashDot";
  15361. })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={}));
  15362. var BorderWeight;
  15363. (function (BorderWeight) {
  15364. BorderWeight.hairline="Hairline";
  15365. BorderWeight.thin="Thin";
  15366. BorderWeight.medium="Medium";
  15367. BorderWeight.thick="Thick";
  15368. })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={}));
  15369. var CalculationMode;
  15370. (function (CalculationMode) {
  15371. CalculationMode.automatic="Automatic";
  15372. CalculationMode.automaticExceptTables="AutomaticExceptTables";
  15373. CalculationMode.manual="Manual";
  15374. })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={}));
  15375. var CalculationType;
  15376. (function (CalculationType) {
  15377. CalculationType.recalculate="Recalculate";
  15378. CalculationType.full="Full";
  15379. CalculationType.fullRebuild="FullRebuild";
  15380. })(CalculationType=Excel.CalculationType || (Excel.CalculationType={}));
  15381. var ClearApplyTo;
  15382. (function (ClearApplyTo) {
  15383. ClearApplyTo.all="All";
  15384. ClearApplyTo.formats="Formats";
  15385. ClearApplyTo.contents="Contents";
  15386. })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={}));
  15387. var ChartDataLabelPosition;
  15388. (function (ChartDataLabelPosition) {
  15389. ChartDataLabelPosition.invalid="Invalid";
  15390. ChartDataLabelPosition.none="None";
  15391. ChartDataLabelPosition.center="Center";
  15392. ChartDataLabelPosition.insideEnd="InsideEnd";
  15393. ChartDataLabelPosition.insideBase="InsideBase";
  15394. ChartDataLabelPosition.outsideEnd="OutsideEnd";
  15395. ChartDataLabelPosition.left="Left";
  15396. ChartDataLabelPosition.right="Right";
  15397. ChartDataLabelPosition.top="Top";
  15398. ChartDataLabelPosition.bottom="Bottom";
  15399. ChartDataLabelPosition.bestFit="BestFit";
  15400. ChartDataLabelPosition.callout="Callout";
  15401. })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={}));
  15402. var ChartLegendPosition;
  15403. (function (ChartLegendPosition) {
  15404. ChartLegendPosition.invalid="Invalid";
  15405. ChartLegendPosition.top="Top";
  15406. ChartLegendPosition.bottom="Bottom";
  15407. ChartLegendPosition.left="Left";
  15408. ChartLegendPosition.right="Right";
  15409. ChartLegendPosition.corner="Corner";
  15410. ChartLegendPosition.custom="Custom";
  15411. })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={}));
  15412. var ChartSeriesBy;
  15413. (function (ChartSeriesBy) {
  15414. ChartSeriesBy.auto="Auto";
  15415. ChartSeriesBy.columns="Columns";
  15416. ChartSeriesBy.rows="Rows";
  15417. })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={}));
  15418. var ChartType;
  15419. (function (ChartType) {
  15420. ChartType.invalid="Invalid";
  15421. ChartType.columnClustered="ColumnClustered";
  15422. ChartType.columnStacked="ColumnStacked";
  15423. ChartType.columnStacked100="ColumnStacked100";
  15424. ChartType._3DColumnClustered="3DColumnClustered";
  15425. ChartType._3DColumnStacked="3DColumnStacked";
  15426. ChartType._3DColumnStacked100="3DColumnStacked100";
  15427. ChartType.barClustered="BarClustered";
  15428. ChartType.barStacked="BarStacked";
  15429. ChartType.barStacked100="BarStacked100";
  15430. ChartType._3DBarClustered="3DBarClustered";
  15431. ChartType._3DBarStacked="3DBarStacked";
  15432. ChartType._3DBarStacked100="3DBarStacked100";
  15433. ChartType.lineStacked="LineStacked";
  15434. ChartType.lineStacked100="LineStacked100";
  15435. ChartType.lineMarkers="LineMarkers";
  15436. ChartType.lineMarkersStacked="LineMarkersStacked";
  15437. ChartType.lineMarkersStacked100="LineMarkersStacked100";
  15438. ChartType.pieOfPie="PieOfPie";
  15439. ChartType.pieExploded="PieExploded";
  15440. ChartType._3DPieExploded="3DPieExploded";
  15441. ChartType.barOfPie="BarOfPie";
  15442. ChartType.xyscatterSmooth="XYScatterSmooth";
  15443. ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers";
  15444. ChartType.xyscatterLines="XYScatterLines";
  15445. ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers";
  15446. ChartType.areaStacked="AreaStacked";
  15447. ChartType.areaStacked100="AreaStacked100";
  15448. ChartType._3DAreaStacked="3DAreaStacked";
  15449. ChartType._3DAreaStacked100="3DAreaStacked100";
  15450. ChartType.doughnutExploded="DoughnutExploded";
  15451. ChartType.radarMarkers="RadarMarkers";
  15452. ChartType.radarFilled="RadarFilled";
  15453. ChartType.surface="Surface";
  15454. ChartType.surfaceWireframe="SurfaceWireframe";
  15455. ChartType.surfaceTopView="SurfaceTopView";
  15456. ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe";
  15457. ChartType.bubble="Bubble";
  15458. ChartType.bubble3DEffect="Bubble3DEffect";
  15459. ChartType.stockHLC="StockHLC";
  15460. ChartType.stockOHLC="StockOHLC";
  15461. ChartType.stockVHLC="StockVHLC";
  15462. ChartType.stockVOHLC="StockVOHLC";
  15463. ChartType.cylinderColClustered="CylinderColClustered";
  15464. ChartType.cylinderColStacked="CylinderColStacked";
  15465. ChartType.cylinderColStacked100="CylinderColStacked100";
  15466. ChartType.cylinderBarClustered="CylinderBarClustered";
  15467. ChartType.cylinderBarStacked="CylinderBarStacked";
  15468. ChartType.cylinderBarStacked100="CylinderBarStacked100";
  15469. ChartType.cylinderCol="CylinderCol";
  15470. ChartType.coneColClustered="ConeColClustered";
  15471. ChartType.coneColStacked="ConeColStacked";
  15472. ChartType.coneColStacked100="ConeColStacked100";
  15473. ChartType.coneBarClustered="ConeBarClustered";
  15474. ChartType.coneBarStacked="ConeBarStacked";
  15475. ChartType.coneBarStacked100="ConeBarStacked100";
  15476. ChartType.coneCol="ConeCol";
  15477. ChartType.pyramidColClustered="PyramidColClustered";
  15478. ChartType.pyramidColStacked="PyramidColStacked";
  15479. ChartType.pyramidColStacked100="PyramidColStacked100";
  15480. ChartType.pyramidBarClustered="PyramidBarClustered";
  15481. ChartType.pyramidBarStacked="PyramidBarStacked";
  15482. ChartType.pyramidBarStacked100="PyramidBarStacked100";
  15483. ChartType.pyramidCol="PyramidCol";
  15484. ChartType._3DColumn="3DColumn";
  15485. ChartType.line="Line";
  15486. ChartType._3DLine="3DLine";
  15487. ChartType._3DPie="3DPie";
  15488. ChartType.pie="Pie";
  15489. ChartType.xyscatter="XYScatter";
  15490. ChartType._3DArea="3DArea";
  15491. ChartType.area="Area";
  15492. ChartType.doughnut="Doughnut";
  15493. ChartType.radar="Radar";
  15494. })(ChartType=Excel.ChartType || (Excel.ChartType={}));
  15495. var ChartUnderlineStyle;
  15496. (function (ChartUnderlineStyle) {
  15497. ChartUnderlineStyle.none="None";
  15498. ChartUnderlineStyle.single="Single";
  15499. })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={}));
  15500. var DeleteShiftDirection;
  15501. (function (DeleteShiftDirection) {
  15502. DeleteShiftDirection.up="Up";
  15503. DeleteShiftDirection.left="Left";
  15504. })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={}));
  15505. var DynamicFilterCriteria;
  15506. (function (DynamicFilterCriteria) {
  15507. DynamicFilterCriteria.unknown="Unknown";
  15508. DynamicFilterCriteria.aboveAverage="AboveAverage";
  15509. DynamicFilterCriteria.allDatesInPeriodApril="AllDatesInPeriodApril";
  15510. DynamicFilterCriteria.allDatesInPeriodAugust="AllDatesInPeriodAugust";
  15511. DynamicFilterCriteria.allDatesInPeriodDecember="AllDatesInPeriodDecember";
  15512. DynamicFilterCriteria.allDatesInPeriodFebruray="AllDatesInPeriodFebruray";
  15513. DynamicFilterCriteria.allDatesInPeriodJanuary="AllDatesInPeriodJanuary";
  15514. DynamicFilterCriteria.allDatesInPeriodJuly="AllDatesInPeriodJuly";
  15515. DynamicFilterCriteria.allDatesInPeriodJune="AllDatesInPeriodJune";
  15516. DynamicFilterCriteria.allDatesInPeriodMarch="AllDatesInPeriodMarch";
  15517. DynamicFilterCriteria.allDatesInPeriodMay="AllDatesInPeriodMay";
  15518. DynamicFilterCriteria.allDatesInPeriodNovember="AllDatesInPeriodNovember";
  15519. DynamicFilterCriteria.allDatesInPeriodOctober="AllDatesInPeriodOctober";
  15520. DynamicFilterCriteria.allDatesInPeriodQuarter1="AllDatesInPeriodQuarter1";
  15521. DynamicFilterCriteria.allDatesInPeriodQuarter2="AllDatesInPeriodQuarter2";
  15522. DynamicFilterCriteria.allDatesInPeriodQuarter3="AllDatesInPeriodQuarter3";
  15523. DynamicFilterCriteria.allDatesInPeriodQuarter4="AllDatesInPeriodQuarter4";
  15524. DynamicFilterCriteria.allDatesInPeriodSeptember="AllDatesInPeriodSeptember";
  15525. DynamicFilterCriteria.belowAverage="BelowAverage";
  15526. DynamicFilterCriteria.lastMonth="LastMonth";
  15527. DynamicFilterCriteria.lastQuarter="LastQuarter";
  15528. DynamicFilterCriteria.lastWeek="LastWeek";
  15529. DynamicFilterCriteria.lastYear="LastYear";
  15530. DynamicFilterCriteria.nextMonth="NextMonth";
  15531. DynamicFilterCriteria.nextQuarter="NextQuarter";
  15532. DynamicFilterCriteria.nextWeek="NextWeek";
  15533. DynamicFilterCriteria.nextYear="NextYear";
  15534. DynamicFilterCriteria.thisMonth="ThisMonth";
  15535. DynamicFilterCriteria.thisQuarter="ThisQuarter";
  15536. DynamicFilterCriteria.thisWeek="ThisWeek";
  15537. DynamicFilterCriteria.thisYear="ThisYear";
  15538. DynamicFilterCriteria.today="Today";
  15539. DynamicFilterCriteria.tomorrow="Tomorrow";
  15540. DynamicFilterCriteria.yearToDate="YearToDate";
  15541. DynamicFilterCriteria.yesterday="Yesterday";
  15542. })(DynamicFilterCriteria=Excel.DynamicFilterCriteria || (Excel.DynamicFilterCriteria={}));
  15543. var FilterDatetimeSpecificity;
  15544. (function (FilterDatetimeSpecificity) {
  15545. FilterDatetimeSpecificity.year="Year";
  15546. FilterDatetimeSpecificity.month="Month";
  15547. FilterDatetimeSpecificity.day="Day";
  15548. FilterDatetimeSpecificity.hour="Hour";
  15549. FilterDatetimeSpecificity.minute="Minute";
  15550. FilterDatetimeSpecificity.second="Second";
  15551. })(FilterDatetimeSpecificity=Excel.FilterDatetimeSpecificity || (Excel.FilterDatetimeSpecificity={}));
  15552. var FilterOn;
  15553. (function (FilterOn) {
  15554. FilterOn.bottomItems="BottomItems";
  15555. FilterOn.bottomPercent="BottomPercent";
  15556. FilterOn.cellColor="CellColor";
  15557. FilterOn.dynamic="Dynamic";
  15558. FilterOn.fontColor="FontColor";
  15559. FilterOn.values="Values";
  15560. FilterOn.topItems="TopItems";
  15561. FilterOn.topPercent="TopPercent";
  15562. FilterOn.icon="Icon";
  15563. FilterOn.custom="Custom";
  15564. })(FilterOn=Excel.FilterOn || (Excel.FilterOn={}));
  15565. var FilterOperator;
  15566. (function (FilterOperator) {
  15567. FilterOperator.and="And";
  15568. FilterOperator.or="Or";
  15569. })(FilterOperator=Excel.FilterOperator || (Excel.FilterOperator={}));
  15570. var HorizontalAlignment;
  15571. (function (HorizontalAlignment) {
  15572. HorizontalAlignment.general="General";
  15573. HorizontalAlignment.left="Left";
  15574. HorizontalAlignment.center="Center";
  15575. HorizontalAlignment.right="Right";
  15576. HorizontalAlignment.fill="Fill";
  15577. HorizontalAlignment.justify="Justify";
  15578. HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection";
  15579. HorizontalAlignment.distributed="Distributed";
  15580. })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={}));
  15581. var IconSet;
  15582. (function (IconSet) {
  15583. IconSet.invalid="Invalid";
  15584. IconSet.threeArrows="ThreeArrows";
  15585. IconSet.threeArrowsGray="ThreeArrowsGray";
  15586. IconSet.threeFlags="ThreeFlags";
  15587. IconSet.threeTrafficLights1="ThreeTrafficLights1";
  15588. IconSet.threeTrafficLights2="ThreeTrafficLights2";
  15589. IconSet.threeSigns="ThreeSigns";
  15590. IconSet.threeSymbols="ThreeSymbols";
  15591. IconSet.threeSymbols2="ThreeSymbols2";
  15592. IconSet.fourArrows="FourArrows";
  15593. IconSet.fourArrowsGray="FourArrowsGray";
  15594. IconSet.fourRedToBlack="FourRedToBlack";
  15595. IconSet.fourRating="FourRating";
  15596. IconSet.fourTrafficLights="FourTrafficLights";
  15597. IconSet.fiveArrows="FiveArrows";
  15598. IconSet.fiveArrowsGray="FiveArrowsGray";
  15599. IconSet.fiveRating="FiveRating";
  15600. IconSet.fiveQuarters="FiveQuarters";
  15601. IconSet.threeStars="ThreeStars";
  15602. IconSet.threeTriangles="ThreeTriangles";
  15603. IconSet.fiveBoxes="FiveBoxes";
  15604. })(IconSet=Excel.IconSet || (Excel.IconSet={}));
  15605. var ImageFittingMode;
  15606. (function (ImageFittingMode) {
  15607. ImageFittingMode.fit="Fit";
  15608. ImageFittingMode.fitAndCenter="FitAndCenter";
  15609. ImageFittingMode.fill="Fill";
  15610. })(ImageFittingMode=Excel.ImageFittingMode || (Excel.ImageFittingMode={}));
  15611. var InsertShiftDirection;
  15612. (function (InsertShiftDirection) {
  15613. InsertShiftDirection.down="Down";
  15614. InsertShiftDirection.right="Right";
  15615. })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={}));
  15616. var NamedItemType;
  15617. (function (NamedItemType) {
  15618. NamedItemType.string="String";
  15619. NamedItemType.integer="Integer";
  15620. NamedItemType.double="Double";
  15621. NamedItemType.boolean="Boolean";
  15622. NamedItemType.range="Range";
  15623. })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={}));
  15624. var RangeUnderlineStyle;
  15625. (function (RangeUnderlineStyle) {
  15626. RangeUnderlineStyle.none="None";
  15627. RangeUnderlineStyle.single="Single";
  15628. RangeUnderlineStyle.double="Double";
  15629. RangeUnderlineStyle.singleAccountant="SingleAccountant";
  15630. RangeUnderlineStyle.doubleAccountant="DoubleAccountant";
  15631. })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={}));
  15632. var SheetVisibility;
  15633. (function (SheetVisibility) {
  15634. SheetVisibility.visible="Visible";
  15635. SheetVisibility.hidden="Hidden";
  15636. SheetVisibility.veryHidden="VeryHidden";
  15637. })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={}));
  15638. var RangeValueType;
  15639. (function (RangeValueType) {
  15640. RangeValueType.unknown="Unknown";
  15641. RangeValueType.empty="Empty";
  15642. RangeValueType.string="String";
  15643. RangeValueType.integer="Integer";
  15644. RangeValueType.double="Double";
  15645. RangeValueType.boolean="Boolean";
  15646. RangeValueType.error="Error";
  15647. })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={}));
  15648. var SortOrientation;
  15649. (function (SortOrientation) {
  15650. SortOrientation.rows="Rows";
  15651. SortOrientation.columns="Columns";
  15652. })(SortOrientation=Excel.SortOrientation || (Excel.SortOrientation={}));
  15653. var SortOn;
  15654. (function (SortOn) {
  15655. SortOn.value="Value";
  15656. SortOn.cellColor="CellColor";
  15657. SortOn.fontColor="FontColor";
  15658. SortOn.icon="Icon";
  15659. })(SortOn=Excel.SortOn || (Excel.SortOn={}));
  15660. var SortDataOption;
  15661. (function (SortDataOption) {
  15662. SortDataOption.normal="Normal";
  15663. SortDataOption.textAsNumber="TextAsNumber";
  15664. })(SortDataOption=Excel.SortDataOption || (Excel.SortDataOption={}));
  15665. var SortMethod;
  15666. (function (SortMethod) {
  15667. SortMethod.pinYin="PinYin";
  15668. SortMethod.strokeCount="StrokeCount";
  15669. })(SortMethod=Excel.SortMethod || (Excel.SortMethod={}));
  15670. var VerticalAlignment;
  15671. (function (VerticalAlignment) {
  15672. VerticalAlignment.top="Top";
  15673. VerticalAlignment.center="Center";
  15674. VerticalAlignment.bottom="Bottom";
  15675. VerticalAlignment.justify="Justify";
  15676. VerticalAlignment.distributed="Distributed";
  15677. })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={}));
  15678. var FunctionResult=(function (_super) {
  15679. __extends(FunctionResult, _super);
  15680. function FunctionResult() {
  15681. _super.apply(this, arguments);
  15682. }
  15683. Object.defineProperty(FunctionResult.prototype, "error", {
  15684. get: function () {
  15685. _throwIfNotLoaded("error", this.m_error, "FunctionResult", this._isNull);
  15686. return this.m_error;
  15687. },
  15688. enumerable: true,
  15689. configurable: true
  15690. });
  15691. Object.defineProperty(FunctionResult.prototype, "value", {
  15692. get: function () {
  15693. _throwIfNotLoaded("value", this.m_value, "FunctionResult", this._isNull);
  15694. return this.m_value;
  15695. },
  15696. enumerable: true,
  15697. configurable: true
  15698. });
  15699. FunctionResult.prototype._handleResult=function (value) {
  15700. _super.prototype._handleResult.call(this, value);
  15701. if (_isNullOrUndefined(value))
  15702. return;
  15703. var obj=value;
  15704. _fixObjectPathIfNecessary(this, obj);
  15705. if (!_isUndefined(obj["Error"])) {
  15706. this.m_error=obj["Error"];
  15707. }
  15708. if (!_isUndefined(obj["Value"])) {
  15709. this.m_value=obj["Value"];
  15710. }
  15711. };
  15712. FunctionResult.prototype.load=function (option) {
  15713. _load(this, option);
  15714. return this;
  15715. };
  15716. FunctionResult.prototype.toJSON=function () {
  15717. return {
  15718. "error": this.m_error,
  15719. "value": this.m_value
  15720. };
  15721. };
  15722. return FunctionResult;
  15723. }(OfficeExtension.ClientObject));
  15724. Excel.FunctionResult=FunctionResult;
  15725. var Functions=(function (_super) {
  15726. __extends(Functions, _super);
  15727. function Functions() {
  15728. _super.apply(this, arguments);
  15729. }
  15730. Functions.prototype.abs=function (number) {
  15731. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Abs", OfficeExtension.OperationType.Default, [number], false, true, null));
  15732. };
  15733. Functions.prototype.accrInt=function (issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod) {
  15734. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrInt", OfficeExtension.OperationType.Default, [issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod], false, true, null));
  15735. };
  15736. Functions.prototype.accrIntM=function (issue, settlement, rate, par, basis) {
  15737. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrIntM", OfficeExtension.OperationType.Default, [issue, settlement, rate, par, basis], false, true, null));
  15738. };
  15739. Functions.prototype.acos=function (number) {
  15740. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acos", OfficeExtension.OperationType.Default, [number], false, true, null));
  15741. };
  15742. Functions.prototype.acosh=function (number) {
  15743. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15744. };
  15745. Functions.prototype.acot=function (number) {
  15746. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acot", OfficeExtension.OperationType.Default, [number], false, true, null));
  15747. };
  15748. Functions.prototype.acoth=function (number) {
  15749. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acoth", OfficeExtension.OperationType.Default, [number], false, true, null));
  15750. };
  15751. Functions.prototype.amorDegrc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  15752. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorDegrc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  15753. };
  15754. Functions.prototype.amorLinc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  15755. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorLinc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  15756. };
  15757. Functions.prototype.and=function () {
  15758. var values=[];
  15759. for (var _i=0; _i < arguments.length; _i++) {
  15760. values[_i - 0]=arguments[_i];
  15761. }
  15762. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "And", OfficeExtension.OperationType.Default, [values], false, true, null));
  15763. };
  15764. Functions.prototype.arabic=function (text) {
  15765. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Arabic", OfficeExtension.OperationType.Default, [text], false, true, null));
  15766. };
  15767. Functions.prototype.areas=function (reference) {
  15768. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Areas", OfficeExtension.OperationType.Default, [reference], false, true, null));
  15769. };
  15770. Functions.prototype.asc=function (text) {
  15771. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asc", OfficeExtension.OperationType.Default, [text], false, true, null));
  15772. };
  15773. Functions.prototype.asin=function (number) {
  15774. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asin", OfficeExtension.OperationType.Default, [number], false, true, null));
  15775. };
  15776. Functions.prototype.asinh=function (number) {
  15777. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15778. };
  15779. Functions.prototype.atan=function (number) {
  15780. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan", OfficeExtension.OperationType.Default, [number], false, true, null));
  15781. };
  15782. Functions.prototype.atan2=function (xNum, yNum) {
  15783. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan2", OfficeExtension.OperationType.Default, [xNum, yNum], false, true, null));
  15784. };
  15785. Functions.prototype.atanh=function (number) {
  15786. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15787. };
  15788. Functions.prototype.aveDev=function () {
  15789. var values=[];
  15790. for (var _i=0; _i < arguments.length; _i++) {
  15791. values[_i - 0]=arguments[_i];
  15792. }
  15793. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AveDev", OfficeExtension.OperationType.Default, [values], false, true, null));
  15794. };
  15795. Functions.prototype.average=function () {
  15796. var values=[];
  15797. for (var _i=0; _i < arguments.length; _i++) {
  15798. values[_i - 0]=arguments[_i];
  15799. }
  15800. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Average", OfficeExtension.OperationType.Default, [values], false, true, null));
  15801. };
  15802. Functions.prototype.averageA=function () {
  15803. var values=[];
  15804. for (var _i=0; _i < arguments.length; _i++) {
  15805. values[_i - 0]=arguments[_i];
  15806. }
  15807. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageA", OfficeExtension.OperationType.Default, [values], false, true, null));
  15808. };
  15809. Functions.prototype.averageIf=function (range, criteria, averageRange) {
  15810. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIf", OfficeExtension.OperationType.Default, [range, criteria, averageRange], false, true, null));
  15811. };
  15812. Functions.prototype.averageIfs=function (averageRange) {
  15813. var values=[];
  15814. for (var _i=1; _i < arguments.length; _i++) {
  15815. values[_i - 1]=arguments[_i];
  15816. }
  15817. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIfs", OfficeExtension.OperationType.Default, [averageRange, values], false, true, null));
  15818. };
  15819. Functions.prototype.bahtText=function (number) {
  15820. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BahtText", OfficeExtension.OperationType.Default, [number], false, true, null));
  15821. };
  15822. Functions.prototype.base=function (number, radix, minLength) {
  15823. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Base", OfficeExtension.OperationType.Default, [number, radix, minLength], false, true, null));
  15824. };
  15825. Functions.prototype.besselI=function (x, n) {
  15826. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselI", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15827. };
  15828. Functions.prototype.besselJ=function (x, n) {
  15829. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselJ", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15830. };
  15831. Functions.prototype.besselK=function (x, n) {
  15832. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselK", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15833. };
  15834. Functions.prototype.besselY=function (x, n) {
  15835. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselY", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15836. };
  15837. Functions.prototype.beta_Dist=function (x, alpha, beta, cumulative, A, B) {
  15838. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative, A, B], false, true, null));
  15839. };
  15840. Functions.prototype.beta_Inv=function (probability, alpha, beta, A, B) {
  15841. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta, A, B], false, true, null));
  15842. };
  15843. Functions.prototype.bin2Dec=function (number) {
  15844. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  15845. };
  15846. Functions.prototype.bin2Hex=function (number, places) {
  15847. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15848. };
  15849. Functions.prototype.bin2Oct=function (number, places) {
  15850. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15851. };
  15852. Functions.prototype.binom_Dist=function (numberS, trials, probabilityS, cumulative) {
  15853. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist", OfficeExtension.OperationType.Default, [numberS, trials, probabilityS, cumulative], false, true, null));
  15854. };
  15855. Functions.prototype.binom_Dist_Range=function (trials, probabilityS, numberS, numberS2) {
  15856. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist_Range", OfficeExtension.OperationType.Default, [trials, probabilityS, numberS, numberS2], false, true, null));
  15857. };
  15858. Functions.prototype.binom_Inv=function (trials, probabilityS, alpha) {
  15859. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Inv", OfficeExtension.OperationType.Default, [trials, probabilityS, alpha], false, true, null));
  15860. };
  15861. Functions.prototype.bitand=function (number1, number2) {
  15862. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitand", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15863. };
  15864. Functions.prototype.bitlshift=function (number, shiftAmount) {
  15865. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitlshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  15866. };
  15867. Functions.prototype.bitor=function (number1, number2) {
  15868. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15869. };
  15870. Functions.prototype.bitrshift=function (number, shiftAmount) {
  15871. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitrshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  15872. };
  15873. Functions.prototype.bitxor=function (number1, number2) {
  15874. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitxor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15875. };
  15876. Functions.prototype.ceiling_Math=function (number, significance, mode) {
  15877. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  15878. };
  15879. Functions.prototype.ceiling_Precise=function (number, significance) {
  15880. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  15881. };
  15882. Functions.prototype.char=function (number) {
  15883. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Char", OfficeExtension.OperationType.Default, [number], false, true, null));
  15884. };
  15885. Functions.prototype.chiSq_Dist=function (x, degFreedom, cumulative) {
  15886. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  15887. };
  15888. Functions.prototype.chiSq_Dist_RT=function (x, degFreedom) {
  15889. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  15890. };
  15891. Functions.prototype.chiSq_Inv=function (probability, degFreedom) {
  15892. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  15893. };
  15894. Functions.prototype.chiSq_Inv_RT=function (probability, degFreedom) {
  15895. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  15896. };
  15897. Functions.prototype.choose=function (indexNum) {
  15898. var values=[];
  15899. for (var _i=1; _i < arguments.length; _i++) {
  15900. values[_i - 1]=arguments[_i];
  15901. }
  15902. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Choose", OfficeExtension.OperationType.Default, [indexNum, values], false, true, null));
  15903. };
  15904. Functions.prototype.clean=function (text) {
  15905. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Clean", OfficeExtension.OperationType.Default, [text], false, true, null));
  15906. };
  15907. Functions.prototype.code=function (text) {
  15908. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Code", OfficeExtension.OperationType.Default, [text], false, true, null));
  15909. };
  15910. Functions.prototype.columns=function (array) {
  15911. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Columns", OfficeExtension.OperationType.Default, [array], false, true, null));
  15912. };
  15913. Functions.prototype.combin=function (number, numberChosen) {
  15914. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combin", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  15915. };
  15916. Functions.prototype.combina=function (number, numberChosen) {
  15917. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combina", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  15918. };
  15919. Functions.prototype.complex=function (realNum, iNum, suffix) {
  15920. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Complex", OfficeExtension.OperationType.Default, [realNum, iNum, suffix], false, true, null));
  15921. };
  15922. Functions.prototype.concatenate=function () {
  15923. var values=[];
  15924. for (var _i=0; _i < arguments.length; _i++) {
  15925. values[_i - 0]=arguments[_i];
  15926. }
  15927. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Concatenate", OfficeExtension.OperationType.Default, [values], false, true, null));
  15928. };
  15929. Functions.prototype.confidence_Norm=function (alpha, standardDev, size) {
  15930. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_Norm", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  15931. };
  15932. Functions.prototype.confidence_T=function (alpha, standardDev, size) {
  15933. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_T", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  15934. };
  15935. Functions.prototype.convert=function (number, fromUnit, toUnit) {
  15936. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Convert", OfficeExtension.OperationType.Default, [number, fromUnit, toUnit], false, true, null));
  15937. };
  15938. Functions.prototype.cos=function (number) {
  15939. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cos", OfficeExtension.OperationType.Default, [number], false, true, null));
  15940. };
  15941. Functions.prototype.cosh=function (number) {
  15942. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15943. };
  15944. Functions.prototype.cot=function (number) {
  15945. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cot", OfficeExtension.OperationType.Default, [number], false, true, null));
  15946. };
  15947. Functions.prototype.coth=function (number) {
  15948. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Coth", OfficeExtension.OperationType.Default, [number], false, true, null));
  15949. };
  15950. Functions.prototype.count=function () {
  15951. var values=[];
  15952. for (var _i=0; _i < arguments.length; _i++) {
  15953. values[_i - 0]=arguments[_i];
  15954. }
  15955. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Count", OfficeExtension.OperationType.Default, [values], false, true, null));
  15956. };
  15957. Functions.prototype.countA=function () {
  15958. var values=[];
  15959. for (var _i=0; _i < arguments.length; _i++) {
  15960. values[_i - 0]=arguments[_i];
  15961. }
  15962. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountA", OfficeExtension.OperationType.Default, [values], false, true, null));
  15963. };
  15964. Functions.prototype.countBlank=function (range) {
  15965. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountBlank", OfficeExtension.OperationType.Default, [range], false, true, null));
  15966. };
  15967. Functions.prototype.countIf=function (range, criteria) {
  15968. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIf", OfficeExtension.OperationType.Default, [range, criteria], false, true, null));
  15969. };
  15970. Functions.prototype.countIfs=function () {
  15971. var values=[];
  15972. for (var _i=0; _i < arguments.length; _i++) {
  15973. values[_i - 0]=arguments[_i];
  15974. }
  15975. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIfs", OfficeExtension.OperationType.Default, [values], false, true, null));
  15976. };
  15977. Functions.prototype.coupDayBs=function (settlement, maturity, frequency, basis) {
  15978. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDayBs", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15979. };
  15980. Functions.prototype.coupDays=function (settlement, maturity, frequency, basis) {
  15981. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDays", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15982. };
  15983. Functions.prototype.coupDaysNc=function (settlement, maturity, frequency, basis) {
  15984. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDaysNc", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15985. };
  15986. Functions.prototype.coupNcd=function (settlement, maturity, frequency, basis) {
  15987. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15988. };
  15989. Functions.prototype.coupNum=function (settlement, maturity, frequency, basis) {
  15990. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNum", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15991. };
  15992. Functions.prototype.coupPcd=function (settlement, maturity, frequency, basis) {
  15993. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupPcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15994. };
  15995. Functions.prototype.csc=function (number) {
  15996. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csc", OfficeExtension.OperationType.Default, [number], false, true, null));
  15997. };
  15998. Functions.prototype.csch=function (number) {
  15999. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csch", OfficeExtension.OperationType.Default, [number], false, true, null));
  16000. };
  16001. Functions.prototype.cumIPmt=function (rate, nper, pv, startPeriod, endPeriod, type) {
  16002. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumIPmt", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  16003. };
  16004. Functions.prototype.cumPrinc=function (rate, nper, pv, startPeriod, endPeriod, type) {
  16005. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumPrinc", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  16006. };
  16007. Functions.prototype.daverage=function (database, field, criteria) {
  16008. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DAverage", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16009. };
  16010. Functions.prototype.dcount=function (database, field, criteria) {
  16011. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCount", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16012. };
  16013. Functions.prototype.dcountA=function (database, field, criteria) {
  16014. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCountA", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16015. };
  16016. Functions.prototype.dget=function (database, field, criteria) {
  16017. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DGet", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16018. };
  16019. Functions.prototype.dmax=function (database, field, criteria) {
  16020. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMax", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16021. };
  16022. Functions.prototype.dmin=function (database, field, criteria) {
  16023. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMin", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16024. };
  16025. Functions.prototype.dproduct=function (database, field, criteria) {
  16026. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DProduct", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16027. };
  16028. Functions.prototype.dstDev=function (database, field, criteria) {
  16029. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDev", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16030. };
  16031. Functions.prototype.dstDevP=function (database, field, criteria) {
  16032. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDevP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16033. };
  16034. Functions.prototype.dsum=function (database, field, criteria) {
  16035. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DSum", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16036. };
  16037. Functions.prototype.dvar=function (database, field, criteria) {
  16038. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVar", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16039. };
  16040. Functions.prototype.dvarP=function (database, field, criteria) {
  16041. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVarP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16042. };
  16043. Functions.prototype.date=function (year, month, day) {
  16044. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Date", OfficeExtension.OperationType.Default, [year, month, day], false, true, null));
  16045. };
  16046. Functions.prototype.datevalue=function (dateText) {
  16047. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Datevalue", OfficeExtension.OperationType.Default, [dateText], false, true, null));
  16048. };
  16049. Functions.prototype.day=function (serialNumber) {
  16050. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Day", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16051. };
  16052. Functions.prototype.days=function (endDate, startDate) {
  16053. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days", OfficeExtension.OperationType.Default, [endDate, startDate], false, true, null));
  16054. };
  16055. Functions.prototype.days360=function (startDate, endDate, method) {
  16056. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days360", OfficeExtension.OperationType.Default, [startDate, endDate, method], false, true, null));
  16057. };
  16058. Functions.prototype.db=function (cost, salvage, life, period, month) {
  16059. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Db", OfficeExtension.OperationType.Default, [cost, salvage, life, period, month], false, true, null));
  16060. };
  16061. Functions.prototype.dbcs=function (text) {
  16062. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dbcs", OfficeExtension.OperationType.Default, [text], false, true, null));
  16063. };
  16064. Functions.prototype.ddb=function (cost, salvage, life, period, factor) {
  16065. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ddb", OfficeExtension.OperationType.Default, [cost, salvage, life, period, factor], false, true, null));
  16066. };
  16067. Functions.prototype.dec2Bin=function (number, places) {
  16068. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16069. };
  16070. Functions.prototype.dec2Hex=function (number, places) {
  16071. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16072. };
  16073. Functions.prototype.dec2Oct=function (number, places) {
  16074. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16075. };
  16076. Functions.prototype.decimal=function (number, radix) {
  16077. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Decimal", OfficeExtension.OperationType.Default, [number, radix], false, true, null));
  16078. };
  16079. Functions.prototype.degrees=function (angle) {
  16080. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Degrees", OfficeExtension.OperationType.Default, [angle], false, true, null));
  16081. };
  16082. Functions.prototype.delta=function (number1, number2) {
  16083. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Delta", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  16084. };
  16085. Functions.prototype.devSq=function () {
  16086. var values=[];
  16087. for (var _i=0; _i < arguments.length; _i++) {
  16088. values[_i - 0]=arguments[_i];
  16089. }
  16090. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DevSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  16091. };
  16092. Functions.prototype.disc=function (settlement, maturity, pr, redemption, basis) {
  16093. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Disc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  16094. };
  16095. Functions.prototype.dollar=function (number, decimals) {
  16096. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  16097. };
  16098. Functions.prototype.dollarDe=function (fractionalDollar, fraction) {
  16099. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarDe", OfficeExtension.OperationType.Default, [fractionalDollar, fraction], false, true, null));
  16100. };
  16101. Functions.prototype.dollarFr=function (decimalDollar, fraction) {
  16102. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarFr", OfficeExtension.OperationType.Default, [decimalDollar, fraction], false, true, null));
  16103. };
  16104. Functions.prototype.duration=function (settlement, maturity, coupon, yld, frequency, basis) {
  16105. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Duration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  16106. };
  16107. Functions.prototype.ecma_Ceiling=function (number, significance) {
  16108. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ECMA_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16109. };
  16110. Functions.prototype.edate=function (startDate, months) {
  16111. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EDate", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  16112. };
  16113. Functions.prototype.effect=function (nominalRate, npery) {
  16114. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Effect", OfficeExtension.OperationType.Default, [nominalRate, npery], false, true, null));
  16115. };
  16116. Functions.prototype.eoMonth=function (startDate, months) {
  16117. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EoMonth", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  16118. };
  16119. Functions.prototype.erf=function (lowerLimit, upperLimit) {
  16120. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf", OfficeExtension.OperationType.Default, [lowerLimit, upperLimit], false, true, null));
  16121. };
  16122. Functions.prototype.erfC=function (x) {
  16123. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC", OfficeExtension.OperationType.Default, [x], false, true, null));
  16124. };
  16125. Functions.prototype.erfC_Precise=function (X) {
  16126. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  16127. };
  16128. Functions.prototype.erf_Precise=function (X) {
  16129. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  16130. };
  16131. Functions.prototype.error_Type=function (errorVal) {
  16132. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Error_Type", OfficeExtension.OperationType.Default, [errorVal], false, true, null));
  16133. };
  16134. Functions.prototype.even=function (number) {
  16135. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Even", OfficeExtension.OperationType.Default, [number], false, true, null));
  16136. };
  16137. Functions.prototype.exact=function (text1, text2) {
  16138. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exact", OfficeExtension.OperationType.Default, [text1, text2], false, true, null));
  16139. };
  16140. Functions.prototype.exp=function (number) {
  16141. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exp", OfficeExtension.OperationType.Default, [number], false, true, null));
  16142. };
  16143. Functions.prototype.expon_Dist=function (x, lambda, cumulative) {
  16144. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Expon_Dist", OfficeExtension.OperationType.Default, [x, lambda, cumulative], false, true, null));
  16145. };
  16146. Functions.prototype.fvschedule=function (principal, schedule) {
  16147. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FVSchedule", OfficeExtension.OperationType.Default, [principal, schedule], false, true, null));
  16148. };
  16149. Functions.prototype.f_Dist=function (x, degFreedom1, degFreedom2, cumulative) {
  16150. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2, cumulative], false, true, null));
  16151. };
  16152. Functions.prototype.f_Dist_RT=function (x, degFreedom1, degFreedom2) {
  16153. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2], false, true, null));
  16154. };
  16155. Functions.prototype.f_Inv=function (probability, degFreedom1, degFreedom2) {
  16156. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  16157. };
  16158. Functions.prototype.f_Inv_RT=function (probability, degFreedom1, degFreedom2) {
  16159. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  16160. };
  16161. Functions.prototype.fact=function (number) {
  16162. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fact", OfficeExtension.OperationType.Default, [number], false, true, null));
  16163. };
  16164. Functions.prototype.factDouble=function (number) {
  16165. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FactDouble", OfficeExtension.OperationType.Default, [number], false, true, null));
  16166. };
  16167. Functions.prototype.false=function () {
  16168. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "False", OfficeExtension.OperationType.Default, [], false, true, null));
  16169. };
  16170. Functions.prototype.find=function (findText, withinText, startNum) {
  16171. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Find", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  16172. };
  16173. Functions.prototype.findB=function (findText, withinText, startNum) {
  16174. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FindB", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  16175. };
  16176. Functions.prototype.fisher=function (x) {
  16177. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fisher", OfficeExtension.OperationType.Default, [x], false, true, null));
  16178. };
  16179. Functions.prototype.fisherInv=function (y) {
  16180. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FisherInv", OfficeExtension.OperationType.Default, [y], false, true, null));
  16181. };
  16182. Functions.prototype.fixed=function (number, decimals, noCommas) {
  16183. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fixed", OfficeExtension.OperationType.Default, [number, decimals, noCommas], false, true, null));
  16184. };
  16185. Functions.prototype.floor_Math=function (number, significance, mode) {
  16186. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  16187. };
  16188. Functions.prototype.floor_Precise=function (number, significance) {
  16189. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16190. };
  16191. Functions.prototype.fv=function (rate, nper, pmt, pv, type) {
  16192. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fv", OfficeExtension.OperationType.Default, [rate, nper, pmt, pv, type], false, true, null));
  16193. };
  16194. Functions.prototype.gamma=function (x) {
  16195. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma", OfficeExtension.OperationType.Default, [x], false, true, null));
  16196. };
  16197. Functions.prototype.gammaLn=function (x) {
  16198. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn", OfficeExtension.OperationType.Default, [x], false, true, null));
  16199. };
  16200. Functions.prototype.gammaLn_Precise=function (x) {
  16201. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn_Precise", OfficeExtension.OperationType.Default, [x], false, true, null));
  16202. };
  16203. Functions.prototype.gamma_Dist=function (x, alpha, beta, cumulative) {
  16204. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  16205. };
  16206. Functions.prototype.gamma_Inv=function (probability, alpha, beta) {
  16207. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta], false, true, null));
  16208. };
  16209. Functions.prototype.gauss=function (x) {
  16210. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gauss", OfficeExtension.OperationType.Default, [x], false, true, null));
  16211. };
  16212. Functions.prototype.gcd=function () {
  16213. var values=[];
  16214. for (var _i=0; _i < arguments.length; _i++) {
  16215. values[_i - 0]=arguments[_i];
  16216. }
  16217. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gcd", OfficeExtension.OperationType.Default, [values], false, true, null));
  16218. };
  16219. Functions.prototype.geStep=function (number, step) {
  16220. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeStep", OfficeExtension.OperationType.Default, [number, step], false, true, null));
  16221. };
  16222. Functions.prototype.geoMean=function () {
  16223. var values=[];
  16224. for (var _i=0; _i < arguments.length; _i++) {
  16225. values[_i - 0]=arguments[_i];
  16226. }
  16227. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeoMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  16228. };
  16229. Functions.prototype.hlookup=function (lookupValue, tableArray, rowIndexNum, rangeLookup) {
  16230. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, rowIndexNum, rangeLookup], false, true, null));
  16231. };
  16232. Functions.prototype.harMean=function () {
  16233. var values=[];
  16234. for (var _i=0; _i < arguments.length; _i++) {
  16235. values[_i - 0]=arguments[_i];
  16236. }
  16237. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HarMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  16238. };
  16239. Functions.prototype.hex2Bin=function (number, places) {
  16240. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16241. };
  16242. Functions.prototype.hex2Dec=function (number) {
  16243. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16244. };
  16245. Functions.prototype.hex2Oct=function (number, places) {
  16246. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16247. };
  16248. Functions.prototype.hour=function (serialNumber) {
  16249. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hour", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16250. };
  16251. Functions.prototype.hypGeom_Dist=function (sampleS, numberSample, populationS, numberPop, cumulative) {
  16252. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HypGeom_Dist", OfficeExtension.OperationType.Default, [sampleS, numberSample, populationS, numberPop, cumulative], false, true, null));
  16253. };
  16254. Functions.prototype.hyperlink=function (linkLocation, friendlyName) {
  16255. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hyperlink", OfficeExtension.OperationType.Default, [linkLocation, friendlyName], false, true, null));
  16256. };
  16257. Functions.prototype.iso_Ceiling=function (number, significance) {
  16258. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ISO_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16259. };
  16260. Functions.prototype.if=function (logicalTest, valueIfTrue, valueIfFalse) {
  16261. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "If", OfficeExtension.OperationType.Default, [logicalTest, valueIfTrue, valueIfFalse], false, true, null));
  16262. };
  16263. Functions.prototype.imAbs=function (inumber) {
  16264. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImAbs", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16265. };
  16266. Functions.prototype.imArgument=function (inumber) {
  16267. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImArgument", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16268. };
  16269. Functions.prototype.imConjugate=function (inumber) {
  16270. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImConjugate", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16271. };
  16272. Functions.prototype.imCos=function (inumber) {
  16273. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCos", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16274. };
  16275. Functions.prototype.imCosh=function (inumber) {
  16276. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCosh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16277. };
  16278. Functions.prototype.imCot=function (inumber) {
  16279. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCot", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16280. };
  16281. Functions.prototype.imCsc=function (inumber) {
  16282. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsc", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16283. };
  16284. Functions.prototype.imCsch=function (inumber) {
  16285. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsch", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16286. };
  16287. Functions.prototype.imDiv=function (inumber1, inumber2) {
  16288. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImDiv", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  16289. };
  16290. Functions.prototype.imExp=function (inumber) {
  16291. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImExp", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16292. };
  16293. Functions.prototype.imLn=function (inumber) {
  16294. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLn", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16295. };
  16296. Functions.prototype.imLog10=function (inumber) {
  16297. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog10", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16298. };
  16299. Functions.prototype.imLog2=function (inumber) {
  16300. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog2", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16301. };
  16302. Functions.prototype.imPower=function (inumber, number) {
  16303. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImPower", OfficeExtension.OperationType.Default, [inumber, number], false, true, null));
  16304. };
  16305. Functions.prototype.imProduct=function () {
  16306. var values=[];
  16307. for (var _i=0; _i < arguments.length; _i++) {
  16308. values[_i - 0]=arguments[_i];
  16309. }
  16310. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImProduct", OfficeExtension.OperationType.Default, [values], false, true, null));
  16311. };
  16312. Functions.prototype.imReal=function (inumber) {
  16313. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImReal", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16314. };
  16315. Functions.prototype.imSec=function (inumber) {
  16316. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSec", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16317. };
  16318. Functions.prototype.imSech=function (inumber) {
  16319. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSech", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16320. };
  16321. Functions.prototype.imSin=function (inumber) {
  16322. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSin", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16323. };
  16324. Functions.prototype.imSinh=function (inumber) {
  16325. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSinh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16326. };
  16327. Functions.prototype.imSqrt=function (inumber) {
  16328. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSqrt", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16329. };
  16330. Functions.prototype.imSub=function (inumber1, inumber2) {
  16331. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSub", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  16332. };
  16333. Functions.prototype.imSum=function () {
  16334. var values=[];
  16335. for (var _i=0; _i < arguments.length; _i++) {
  16336. values[_i - 0]=arguments[_i];
  16337. }
  16338. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSum", OfficeExtension.OperationType.Default, [values], false, true, null));
  16339. };
  16340. Functions.prototype.imTan=function (inumber) {
  16341. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImTan", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16342. };
  16343. Functions.prototype.imaginary=function (inumber) {
  16344. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Imaginary", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16345. };
  16346. Functions.prototype.int=function (number) {
  16347. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Int", OfficeExtension.OperationType.Default, [number], false, true, null));
  16348. };
  16349. Functions.prototype.intRate=function (settlement, maturity, investment, redemption, basis) {
  16350. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IntRate", OfficeExtension.OperationType.Default, [settlement, maturity, investment, redemption, basis], false, true, null));
  16351. };
  16352. Functions.prototype.ipmt=function (rate, per, nper, pv, fv, type) {
  16353. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ipmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  16354. };
  16355. Functions.prototype.irr=function (values, guess) {
  16356. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Irr", OfficeExtension.OperationType.Default, [values, guess], false, true, null));
  16357. };
  16358. Functions.prototype.isErr=function (value) {
  16359. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsErr", OfficeExtension.OperationType.Default, [value], false, true, null));
  16360. };
  16361. Functions.prototype.isError=function (value) {
  16362. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsError", OfficeExtension.OperationType.Default, [value], false, true, null));
  16363. };
  16364. Functions.prototype.isEven=function (number) {
  16365. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsEven", OfficeExtension.OperationType.Default, [number], false, true, null));
  16366. };
  16367. Functions.prototype.isFormula=function (reference) {
  16368. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsFormula", OfficeExtension.OperationType.Default, [reference], false, true, null));
  16369. };
  16370. Functions.prototype.isLogical=function (value) {
  16371. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsLogical", OfficeExtension.OperationType.Default, [value], false, true, null));
  16372. };
  16373. Functions.prototype.isNA=function (value) {
  16374. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNA", OfficeExtension.OperationType.Default, [value], false, true, null));
  16375. };
  16376. Functions.prototype.isNonText=function (value) {
  16377. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNonText", OfficeExtension.OperationType.Default, [value], false, true, null));
  16378. };
  16379. Functions.prototype.isNumber=function (value) {
  16380. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNumber", OfficeExtension.OperationType.Default, [value], false, true, null));
  16381. };
  16382. Functions.prototype.isOdd=function (number) {
  16383. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsOdd", OfficeExtension.OperationType.Default, [number], false, true, null));
  16384. };
  16385. Functions.prototype.isText=function (value) {
  16386. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsText", OfficeExtension.OperationType.Default, [value], false, true, null));
  16387. };
  16388. Functions.prototype.isoWeekNum=function (date) {
  16389. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsoWeekNum", OfficeExtension.OperationType.Default, [date], false, true, null));
  16390. };
  16391. Functions.prototype.ispmt=function (rate, per, nper, pv) {
  16392. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ispmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv], false, true, null));
  16393. };
  16394. Functions.prototype.isref=function (value) {
  16395. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Isref", OfficeExtension.OperationType.Default, [value], false, true, null));
  16396. };
  16397. Functions.prototype.kurt=function () {
  16398. var values=[];
  16399. for (var _i=0; _i < arguments.length; _i++) {
  16400. values[_i - 0]=arguments[_i];
  16401. }
  16402. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Kurt", OfficeExtension.OperationType.Default, [values], false, true, null));
  16403. };
  16404. Functions.prototype.large=function (array, k) {
  16405. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Large", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16406. };
  16407. Functions.prototype.lcm=function () {
  16408. var values=[];
  16409. for (var _i=0; _i < arguments.length; _i++) {
  16410. values[_i - 0]=arguments[_i];
  16411. }
  16412. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lcm", OfficeExtension.OperationType.Default, [values], false, true, null));
  16413. };
  16414. Functions.prototype.left=function (text, numChars) {
  16415. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Left", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  16416. };
  16417. Functions.prototype.leftb=function (text, numBytes) {
  16418. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Leftb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  16419. };
  16420. Functions.prototype.len=function (text) {
  16421. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Len", OfficeExtension.OperationType.Default, [text], false, true, null));
  16422. };
  16423. Functions.prototype.lenb=function (text) {
  16424. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lenb", OfficeExtension.OperationType.Default, [text], false, true, null));
  16425. };
  16426. Functions.prototype.ln=function (number) {
  16427. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ln", OfficeExtension.OperationType.Default, [number], false, true, null));
  16428. };
  16429. Functions.prototype.log=function (number, base) {
  16430. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log", OfficeExtension.OperationType.Default, [number, base], false, true, null));
  16431. };
  16432. Functions.prototype.log10=function (number) {
  16433. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log10", OfficeExtension.OperationType.Default, [number], false, true, null));
  16434. };
  16435. Functions.prototype.logNorm_Dist=function (x, mean, standardDev, cumulative) {
  16436. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  16437. };
  16438. Functions.prototype.logNorm_Inv=function (probability, mean, standardDev) {
  16439. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  16440. };
  16441. Functions.prototype.lookup=function (lookupValue, lookupVector, resultVector) {
  16442. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lookup", OfficeExtension.OperationType.Default, [lookupValue, lookupVector, resultVector], false, true, null));
  16443. };
  16444. Functions.prototype.lower=function (text) {
  16445. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lower", OfficeExtension.OperationType.Default, [text], false, true, null));
  16446. };
  16447. Functions.prototype.mduration=function (settlement, maturity, coupon, yld, frequency, basis) {
  16448. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MDuration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  16449. };
  16450. Functions.prototype.mirr=function (values, financeRate, reinvestRate) {
  16451. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MIrr", OfficeExtension.OperationType.Default, [values, financeRate, reinvestRate], false, true, null));
  16452. };
  16453. Functions.prototype.mround=function (number, multiple) {
  16454. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MRound", OfficeExtension.OperationType.Default, [number, multiple], false, true, null));
  16455. };
  16456. Functions.prototype.match=function (lookupValue, lookupArray, matchType) {
  16457. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Match", OfficeExtension.OperationType.Default, [lookupValue, lookupArray, matchType], false, true, null));
  16458. };
  16459. Functions.prototype.max=function () {
  16460. var values=[];
  16461. for (var _i=0; _i < arguments.length; _i++) {
  16462. values[_i - 0]=arguments[_i];
  16463. }
  16464. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Max", OfficeExtension.OperationType.Default, [values], false, true, null));
  16465. };
  16466. Functions.prototype.maxA=function () {
  16467. var values=[];
  16468. for (var _i=0; _i < arguments.length; _i++) {
  16469. values[_i - 0]=arguments[_i];
  16470. }
  16471. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MaxA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16472. };
  16473. Functions.prototype.median=function () {
  16474. var values=[];
  16475. for (var _i=0; _i < arguments.length; _i++) {
  16476. values[_i - 0]=arguments[_i];
  16477. }
  16478. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Median", OfficeExtension.OperationType.Default, [values], false, true, null));
  16479. };
  16480. Functions.prototype.mid=function (text, startNum, numChars) {
  16481. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mid", OfficeExtension.OperationType.Default, [text, startNum, numChars], false, true, null));
  16482. };
  16483. Functions.prototype.midb=function (text, startNum, numBytes) {
  16484. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Midb", OfficeExtension.OperationType.Default, [text, startNum, numBytes], false, true, null));
  16485. };
  16486. Functions.prototype.min=function () {
  16487. var values=[];
  16488. for (var _i=0; _i < arguments.length; _i++) {
  16489. values[_i - 0]=arguments[_i];
  16490. }
  16491. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Min", OfficeExtension.OperationType.Default, [values], false, true, null));
  16492. };
  16493. Functions.prototype.minA=function () {
  16494. var values=[];
  16495. for (var _i=0; _i < arguments.length; _i++) {
  16496. values[_i - 0]=arguments[_i];
  16497. }
  16498. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MinA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16499. };
  16500. Functions.prototype.minute=function (serialNumber) {
  16501. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Minute", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16502. };
  16503. Functions.prototype.mod=function (number, divisor) {
  16504. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mod", OfficeExtension.OperationType.Default, [number, divisor], false, true, null));
  16505. };
  16506. Functions.prototype.month=function (serialNumber) {
  16507. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Month", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16508. };
  16509. Functions.prototype.multiNomial=function () {
  16510. var values=[];
  16511. for (var _i=0; _i < arguments.length; _i++) {
  16512. values[_i - 0]=arguments[_i];
  16513. }
  16514. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MultiNomial", OfficeExtension.OperationType.Default, [values], false, true, null));
  16515. };
  16516. Functions.prototype.n=function (value) {
  16517. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "N", OfficeExtension.OperationType.Default, [value], false, true, null));
  16518. };
  16519. Functions.prototype.nper=function (rate, pmt, pv, fv, type) {
  16520. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NPer", OfficeExtension.OperationType.Default, [rate, pmt, pv, fv, type], false, true, null));
  16521. };
  16522. Functions.prototype.na=function () {
  16523. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Na", OfficeExtension.OperationType.Default, [], false, true, null));
  16524. };
  16525. Functions.prototype.negBinom_Dist=function (numberF, numberS, probabilityS, cumulative) {
  16526. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NegBinom_Dist", OfficeExtension.OperationType.Default, [numberF, numberS, probabilityS, cumulative], false, true, null));
  16527. };
  16528. Functions.prototype.networkDays=function (startDate, endDate, holidays) {
  16529. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays", OfficeExtension.OperationType.Default, [startDate, endDate, holidays], false, true, null));
  16530. };
  16531. Functions.prototype.networkDays_Intl=function (startDate, endDate, weekend, holidays) {
  16532. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays_Intl", OfficeExtension.OperationType.Default, [startDate, endDate, weekend, holidays], false, true, null));
  16533. };
  16534. Functions.prototype.nominal=function (effectRate, npery) {
  16535. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Nominal", OfficeExtension.OperationType.Default, [effectRate, npery], false, true, null));
  16536. };
  16537. Functions.prototype.norm_Dist=function (x, mean, standardDev, cumulative) {
  16538. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  16539. };
  16540. Functions.prototype.norm_Inv=function (probability, mean, standardDev) {
  16541. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  16542. };
  16543. Functions.prototype.norm_S_Dist=function (z, cumulative) {
  16544. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Dist", OfficeExtension.OperationType.Default, [z, cumulative], false, true, null));
  16545. };
  16546. Functions.prototype.norm_S_Inv=function (probability) {
  16547. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Inv", OfficeExtension.OperationType.Default, [probability], false, true, null));
  16548. };
  16549. Functions.prototype.not=function (logical) {
  16550. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Not", OfficeExtension.OperationType.Default, [logical], false, true, null));
  16551. };
  16552. Functions.prototype.now=function () {
  16553. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Now", OfficeExtension.OperationType.Default, [], false, true, null));
  16554. };
  16555. Functions.prototype.npv=function (rate) {
  16556. var values=[];
  16557. for (var _i=1; _i < arguments.length; _i++) {
  16558. values[_i - 1]=arguments[_i];
  16559. }
  16560. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Npv", OfficeExtension.OperationType.Default, [rate, values], false, true, null));
  16561. };
  16562. Functions.prototype.numberValue=function (text, decimalSeparator, groupSeparator) {
  16563. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NumberValue", OfficeExtension.OperationType.Default, [text, decimalSeparator, groupSeparator], false, true, null));
  16564. };
  16565. Functions.prototype.oct2Bin=function (number, places) {
  16566. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16567. };
  16568. Functions.prototype.oct2Dec=function (number) {
  16569. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16570. };
  16571. Functions.prototype.oct2Hex=function (number, places) {
  16572. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16573. };
  16574. Functions.prototype.odd=function (number) {
  16575. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Odd", OfficeExtension.OperationType.Default, [number], false, true, null));
  16576. };
  16577. Functions.prototype.oddFPrice=function (settlement, maturity, issue, firstCoupon, rate, yld, redemption, frequency, basis) {
  16578. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddFPrice", OfficeExtension.OperationType.Default, [settlement, maturity, issue, firstCoupon, rate, yld, redemption, frequency, basis], false, true, null));
  16579. };
  16580. Functions.prototype.oddFYield=function (settlement, maturity, issue, firstCoupon, rate, pr, redemption, frequency, basis) {
  16581. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddFYield", OfficeExtension.OperationType.Default, [settlement, maturity, issue, firstCoupon, rate, pr, redemption, frequency, basis], false, true, null));
  16582. };
  16583. Functions.prototype.oddLPrice=function (settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis) {
  16584. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLPrice", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis], false, true, null));
  16585. };
  16586. Functions.prototype.oddLYield=function (settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis) {
  16587. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLYield", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis], false, true, null));
  16588. };
  16589. Functions.prototype.or=function () {
  16590. var values=[];
  16591. for (var _i=0; _i < arguments.length; _i++) {
  16592. values[_i - 0]=arguments[_i];
  16593. }
  16594. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Or", OfficeExtension.OperationType.Default, [values], false, true, null));
  16595. };
  16596. Functions.prototype.pduration=function (rate, pv, fv) {
  16597. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PDuration", OfficeExtension.OperationType.Default, [rate, pv, fv], false, true, null));
  16598. };
  16599. Functions.prototype.percentRank_Exc=function (array, x, significance) {
  16600. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Exc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  16601. };
  16602. Functions.prototype.percentRank_Inc=function (array, x, significance) {
  16603. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Inc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  16604. };
  16605. Functions.prototype.percentile_Exc=function (array, k) {
  16606. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Exc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16607. };
  16608. Functions.prototype.percentile_Inc=function (array, k) {
  16609. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Inc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16610. };
  16611. Functions.prototype.permut=function (number, numberChosen) {
  16612. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permut", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  16613. };
  16614. Functions.prototype.permutationa=function (number, numberChosen) {
  16615. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permutationa", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  16616. };
  16617. Functions.prototype.phi=function (x) {
  16618. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Phi", OfficeExtension.OperationType.Default, [x], false, true, null));
  16619. };
  16620. Functions.prototype.pi=function () {
  16621. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pi", OfficeExtension.OperationType.Default, [], false, true, null));
  16622. };
  16623. Functions.prototype.pmt=function (rate, nper, pv, fv, type) {
  16624. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pmt", OfficeExtension.OperationType.Default, [rate, nper, pv, fv, type], false, true, null));
  16625. };
  16626. Functions.prototype.poisson_Dist=function (x, mean, cumulative) {
  16627. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Poisson_Dist", OfficeExtension.OperationType.Default, [x, mean, cumulative], false, true, null));
  16628. };
  16629. Functions.prototype.power=function (number, power) {
  16630. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Power", OfficeExtension.OperationType.Default, [number, power], false, true, null));
  16631. };
  16632. Functions.prototype.ppmt=function (rate, per, nper, pv, fv, type) {
  16633. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ppmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  16634. };
  16635. Functions.prototype.price=function (settlement, maturity, rate, yld, redemption, frequency, basis) {
  16636. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Price", OfficeExtension.OperationType.Default, [settlement, maturity, rate, yld, redemption, frequency, basis], false, true, null));
  16637. };
  16638. Functions.prototype.priceDisc=function (settlement, maturity, discount, redemption, basis) {
  16639. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceDisc", OfficeExtension.OperationType.Default, [settlement, maturity, discount, redemption, basis], false, true, null));
  16640. };
  16641. Functions.prototype.priceMat=function (settlement, maturity, issue, rate, yld, basis) {
  16642. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, yld, basis], false, true, null));
  16643. };
  16644. Functions.prototype.product=function () {
  16645. var values=[];
  16646. for (var _i=0; _i < arguments.length; _i++) {
  16647. values[_i - 0]=arguments[_i];
  16648. }
  16649. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Product", OfficeExtension.OperationType.Default, [values], false, true, null));
  16650. };
  16651. Functions.prototype.proper=function (text) {
  16652. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Proper", OfficeExtension.OperationType.Default, [text], false, true, null));
  16653. };
  16654. Functions.prototype.pv=function (rate, nper, pmt, fv, type) {
  16655. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pv", OfficeExtension.OperationType.Default, [rate, nper, pmt, fv, type], false, true, null));
  16656. };
  16657. Functions.prototype.quartile_Exc=function (array, quart) {
  16658. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Exc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  16659. };
  16660. Functions.prototype.quartile_Inc=function (array, quart) {
  16661. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Inc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  16662. };
  16663. Functions.prototype.quotient=function (numerator, denominator) {
  16664. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quotient", OfficeExtension.OperationType.Default, [numerator, denominator], false, true, null));
  16665. };
  16666. Functions.prototype.radians=function (angle) {
  16667. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Radians", OfficeExtension.OperationType.Default, [angle], false, true, null));
  16668. };
  16669. Functions.prototype.rand=function () {
  16670. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rand", OfficeExtension.OperationType.Default, [], false, true, null));
  16671. };
  16672. Functions.prototype.randBetween=function (bottom, top) {
  16673. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RandBetween", OfficeExtension.OperationType.Default, [bottom, top], false, true, null));
  16674. };
  16675. Functions.prototype.rank_Avg=function (number, ref, order) {
  16676. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Avg", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  16677. };
  16678. Functions.prototype.rank_Eq=function (number, ref, order) {
  16679. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Eq", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  16680. };
  16681. Functions.prototype.rate=function (nper, pmt, pv, fv, type, guess) {
  16682. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rate", OfficeExtension.OperationType.Default, [nper, pmt, pv, fv, type, guess], false, true, null));
  16683. };
  16684. Functions.prototype.received=function (settlement, maturity, investment, discount, basis) {
  16685. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Received", OfficeExtension.OperationType.Default, [settlement, maturity, investment, discount, basis], false, true, null));
  16686. };
  16687. Functions.prototype.replace=function (oldText, startNum, numChars, newText) {
  16688. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Replace", OfficeExtension.OperationType.Default, [oldText, startNum, numChars, newText], false, true, null));
  16689. };
  16690. Functions.prototype.replaceB=function (oldText, startNum, numBytes, newText) {
  16691. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ReplaceB", OfficeExtension.OperationType.Default, [oldText, startNum, numBytes, newText], false, true, null));
  16692. };
  16693. Functions.prototype.rept=function (text, numberTimes) {
  16694. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rept", OfficeExtension.OperationType.Default, [text, numberTimes], false, true, null));
  16695. };
  16696. Functions.prototype.right=function (text, numChars) {
  16697. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Right", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  16698. };
  16699. Functions.prototype.rightb=function (text, numBytes) {
  16700. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rightb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  16701. };
  16702. Functions.prototype.roman=function (number, form) {
  16703. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Roman", OfficeExtension.OperationType.Default, [number, form], false, true, null));
  16704. };
  16705. Functions.prototype.round=function (number, numDigits) {
  16706. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Round", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16707. };
  16708. Functions.prototype.roundDown=function (number, numDigits) {
  16709. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundDown", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16710. };
  16711. Functions.prototype.roundUp=function (number, numDigits) {
  16712. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundUp", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16713. };
  16714. Functions.prototype.rows=function (array) {
  16715. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rows", OfficeExtension.OperationType.Default, [array], false, true, null));
  16716. };
  16717. Functions.prototype.rri=function (nper, pv, fv) {
  16718. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rri", OfficeExtension.OperationType.Default, [nper, pv, fv], false, true, null));
  16719. };
  16720. Functions.prototype.sec=function (number) {
  16721. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16722. };
  16723. Functions.prototype.sech=function (number) {
  16724. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sech", OfficeExtension.OperationType.Default, [number], false, true, null));
  16725. };
  16726. Functions.prototype.second=function (serialNumber) {
  16727. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Second", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16728. };
  16729. Functions.prototype.seriesSum=function (x, n, m, coefficients) {
  16730. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SeriesSum", OfficeExtension.OperationType.Default, [x, n, m, coefficients], false, true, null));
  16731. };
  16732. Functions.prototype.sheet=function (value) {
  16733. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheet", OfficeExtension.OperationType.Default, [value], false, true, null));
  16734. };
  16735. Functions.prototype.sheets=function (reference) {
  16736. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheets", OfficeExtension.OperationType.Default, [reference], false, true, null));
  16737. };
  16738. Functions.prototype.sign=function (number) {
  16739. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sign", OfficeExtension.OperationType.Default, [number], false, true, null));
  16740. };
  16741. Functions.prototype.sin=function (number) {
  16742. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sin", OfficeExtension.OperationType.Default, [number], false, true, null));
  16743. };
  16744. Functions.prototype.sinh=function (number) {
  16745. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  16746. };
  16747. Functions.prototype.skew=function () {
  16748. var values=[];
  16749. for (var _i=0; _i < arguments.length; _i++) {
  16750. values[_i - 0]=arguments[_i];
  16751. }
  16752. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew", OfficeExtension.OperationType.Default, [values], false, true, null));
  16753. };
  16754. Functions.prototype.skew_p=function () {
  16755. var values=[];
  16756. for (var _i=0; _i < arguments.length; _i++) {
  16757. values[_i - 0]=arguments[_i];
  16758. }
  16759. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew_p", OfficeExtension.OperationType.Default, [values], false, true, null));
  16760. };
  16761. Functions.prototype.sln=function (cost, salvage, life) {
  16762. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sln", OfficeExtension.OperationType.Default, [cost, salvage, life], false, true, null));
  16763. };
  16764. Functions.prototype.small=function (array, k) {
  16765. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Small", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16766. };
  16767. Functions.prototype.sqrt=function (number) {
  16768. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sqrt", OfficeExtension.OperationType.Default, [number], false, true, null));
  16769. };
  16770. Functions.prototype.sqrtPi=function (number) {
  16771. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SqrtPi", OfficeExtension.OperationType.Default, [number], false, true, null));
  16772. };
  16773. Functions.prototype.stDevA=function () {
  16774. var values=[];
  16775. for (var _i=0; _i < arguments.length; _i++) {
  16776. values[_i - 0]=arguments[_i];
  16777. }
  16778. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16779. };
  16780. Functions.prototype.stDevPA=function () {
  16781. var values=[];
  16782. for (var _i=0; _i < arguments.length; _i++) {
  16783. values[_i - 0]=arguments[_i];
  16784. }
  16785. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16786. };
  16787. Functions.prototype.stDev_P=function () {
  16788. var values=[];
  16789. for (var _i=0; _i < arguments.length; _i++) {
  16790. values[_i - 0]=arguments[_i];
  16791. }
  16792. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  16793. };
  16794. Functions.prototype.stDev_S=function () {
  16795. var values=[];
  16796. for (var _i=0; _i < arguments.length; _i++) {
  16797. values[_i - 0]=arguments[_i];
  16798. }
  16799. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  16800. };
  16801. Functions.prototype.standardize=function (x, mean, standardDev) {
  16802. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Standardize", OfficeExtension.OperationType.Default, [x, mean, standardDev], false, true, null));
  16803. };
  16804. Functions.prototype.substitute=function (text, oldText, newText, instanceNum) {
  16805. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Substitute", OfficeExtension.OperationType.Default, [text, oldText, newText, instanceNum], false, true, null));
  16806. };
  16807. Functions.prototype.subtotal=function (functionNum) {
  16808. var values=[];
  16809. for (var _i=1; _i < arguments.length; _i++) {
  16810. values[_i - 1]=arguments[_i];
  16811. }
  16812. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Subtotal", OfficeExtension.OperationType.Default, [functionNum, values], false, true, null));
  16813. };
  16814. Functions.prototype.sum=function () {
  16815. var values=[];
  16816. for (var _i=0; _i < arguments.length; _i++) {
  16817. values[_i - 0]=arguments[_i];
  16818. }
  16819. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sum", OfficeExtension.OperationType.Default, [values], false, true, null));
  16820. };
  16821. Functions.prototype.sumIf=function (range, criteria, sumRange) {
  16822. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIf", OfficeExtension.OperationType.Default, [range, criteria, sumRange], false, true, null));
  16823. };
  16824. Functions.prototype.sumIfs=function (sumRange) {
  16825. var values=[];
  16826. for (var _i=1; _i < arguments.length; _i++) {
  16827. values[_i - 1]=arguments[_i];
  16828. }
  16829. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIfs", OfficeExtension.OperationType.Default, [sumRange, values], false, true, null));
  16830. };
  16831. Functions.prototype.sumSq=function () {
  16832. var values=[];
  16833. for (var _i=0; _i < arguments.length; _i++) {
  16834. values[_i - 0]=arguments[_i];
  16835. }
  16836. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  16837. };
  16838. Functions.prototype.syd=function (cost, salvage, life, per) {
  16839. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Syd", OfficeExtension.OperationType.Default, [cost, salvage, life, per], false, true, null));
  16840. };
  16841. Functions.prototype.t=function (value) {
  16842. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T", OfficeExtension.OperationType.Default, [value], false, true, null));
  16843. };
  16844. Functions.prototype.tbillEq=function (settlement, maturity, discount) {
  16845. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillEq", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  16846. };
  16847. Functions.prototype.tbillPrice=function (settlement, maturity, discount) {
  16848. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillPrice", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  16849. };
  16850. Functions.prototype.tbillYield=function (settlement, maturity, pr) {
  16851. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillYield", OfficeExtension.OperationType.Default, [settlement, maturity, pr], false, true, null));
  16852. };
  16853. Functions.prototype.t_Dist=function (x, degFreedom, cumulative) {
  16854. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  16855. };
  16856. Functions.prototype.t_Dist_2T=function (x, degFreedom) {
  16857. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_2T", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  16858. };
  16859. Functions.prototype.t_Dist_RT=function (x, degFreedom) {
  16860. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  16861. };
  16862. Functions.prototype.t_Inv=function (probability, degFreedom) {
  16863. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  16864. };
  16865. Functions.prototype.t_Inv_2T=function (probability, degFreedom) {
  16866. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv_2T", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  16867. };
  16868. Functions.prototype.tan=function (number) {
  16869. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tan", OfficeExtension.OperationType.Default, [number], false, true, null));
  16870. };
  16871. Functions.prototype.tanh=function (number) {
  16872. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  16873. };
  16874. Functions.prototype.text=function (value, formatText) {
  16875. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Text", OfficeExtension.OperationType.Default, [value, formatText], false, true, null));
  16876. };
  16877. Functions.prototype.time=function (hour, minute, second) {
  16878. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Time", OfficeExtension.OperationType.Default, [hour, minute, second], false, true, null));
  16879. };
  16880. Functions.prototype.timevalue=function (timeText) {
  16881. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Timevalue", OfficeExtension.OperationType.Default, [timeText], false, true, null));
  16882. };
  16883. Functions.prototype.today=function () {
  16884. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Today", OfficeExtension.OperationType.Default, [], false, true, null));
  16885. };
  16886. Functions.prototype.trim=function (text) {
  16887. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trim", OfficeExtension.OperationType.Default, [text], false, true, null));
  16888. };
  16889. Functions.prototype.trimMean=function (array, percent) {
  16890. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TrimMean", OfficeExtension.OperationType.Default, [array, percent], false, true, null));
  16891. };
  16892. Functions.prototype.true=function () {
  16893. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "True", OfficeExtension.OperationType.Default, [], false, true, null));
  16894. };
  16895. Functions.prototype.trunc=function (number, numDigits) {
  16896. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trunc", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16897. };
  16898. Functions.prototype.type=function (value) {
  16899. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Type", OfficeExtension.OperationType.Default, [value], false, true, null));
  16900. };
  16901. Functions.prototype.usdollar=function (number, decimals) {
  16902. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "USDollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  16903. };
  16904. Functions.prototype.unichar=function (number) {
  16905. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unichar", OfficeExtension.OperationType.Default, [number], false, true, null));
  16906. };
  16907. Functions.prototype.unicode=function (text) {
  16908. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unicode", OfficeExtension.OperationType.Default, [text], false, true, null));
  16909. };
  16910. Functions.prototype.upper=function (text) {
  16911. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Upper", OfficeExtension.OperationType.Default, [text], false, true, null));
  16912. };
  16913. Functions.prototype.vlookup=function (lookupValue, tableArray, colIndexNum, rangeLookup) {
  16914. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, colIndexNum, rangeLookup], false, true, null));
  16915. };
  16916. Functions.prototype.value=function (text) {
  16917. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Value", OfficeExtension.OperationType.Default, [text], false, true, null));
  16918. };
  16919. Functions.prototype.varA=function () {
  16920. var values=[];
  16921. for (var _i=0; _i < arguments.length; _i++) {
  16922. values[_i - 0]=arguments[_i];
  16923. }
  16924. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16925. };
  16926. Functions.prototype.varPA=function () {
  16927. var values=[];
  16928. for (var _i=0; _i < arguments.length; _i++) {
  16929. values[_i - 0]=arguments[_i];
  16930. }
  16931. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16932. };
  16933. Functions.prototype.var_P=function () {
  16934. var values=[];
  16935. for (var _i=0; _i < arguments.length; _i++) {
  16936. values[_i - 0]=arguments[_i];
  16937. }
  16938. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  16939. };
  16940. Functions.prototype.var_S=function () {
  16941. var values=[];
  16942. for (var _i=0; _i < arguments.length; _i++) {
  16943. values[_i - 0]=arguments[_i];
  16944. }
  16945. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  16946. };
  16947. Functions.prototype.vdb=function (cost, salvage, life, startPeriod, endPeriod, factor, noSwitch) {
  16948. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Vdb", OfficeExtension.OperationType.Default, [cost, salvage, life, startPeriod, endPeriod, factor, noSwitch], false, true, null));
  16949. };
  16950. Functions.prototype.weekNum=function (serialNumber, returnType) {
  16951. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WeekNum", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  16952. };
  16953. Functions.prototype.weekday=function (serialNumber, returnType) {
  16954. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weekday", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  16955. };
  16956. Functions.prototype.weibull_Dist=function (x, alpha, beta, cumulative) {
  16957. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weibull_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  16958. };
  16959. Functions.prototype.workDay=function (startDate, days, holidays) {
  16960. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay", OfficeExtension.OperationType.Default, [startDate, days, holidays], false, true, null));
  16961. };
  16962. Functions.prototype.workDay_Intl=function (startDate, days, weekend, holidays) {
  16963. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay_Intl", OfficeExtension.OperationType.Default, [startDate, days, weekend, holidays], false, true, null));
  16964. };
  16965. Functions.prototype.xirr=function (values, dates, guess) {
  16966. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xirr", OfficeExtension.OperationType.Default, [values, dates, guess], false, true, null));
  16967. };
  16968. Functions.prototype.xnpv=function (rate, values, dates) {
  16969. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xnpv", OfficeExtension.OperationType.Default, [rate, values, dates], false, true, null));
  16970. };
  16971. Functions.prototype.xor=function () {
  16972. var values=[];
  16973. for (var _i=0; _i < arguments.length; _i++) {
  16974. values[_i - 0]=arguments[_i];
  16975. }
  16976. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xor", OfficeExtension.OperationType.Default, [values], false, true, null));
  16977. };
  16978. Functions.prototype.year=function (serialNumber) {
  16979. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Year", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16980. };
  16981. Functions.prototype.yearFrac=function (startDate, endDate, basis) {
  16982. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YearFrac", OfficeExtension.OperationType.Default, [startDate, endDate, basis], false, true, null));
  16983. };
  16984. Functions.prototype.yield=function (settlement, maturity, rate, pr, redemption, frequency, basis) {
  16985. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Yield", OfficeExtension.OperationType.Default, [settlement, maturity, rate, pr, redemption, frequency, basis], false, true, null));
  16986. };
  16987. Functions.prototype.yieldDisc=function (settlement, maturity, pr, redemption, basis) {
  16988. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldDisc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  16989. };
  16990. Functions.prototype.yieldMat=function (settlement, maturity, issue, rate, pr, basis) {
  16991. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, pr, basis], false, true, null));
  16992. };
  16993. Functions.prototype.z_Test=function (array, x, sigma) {
  16994. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Z_Test", OfficeExtension.OperationType.Default, [array, x, sigma], false, true, null));
  16995. };
  16996. Functions.prototype._handleResult=function (value) {
  16997. _super.prototype._handleResult.call(this, value);
  16998. if (_isNullOrUndefined(value))
  16999. return;
  17000. var obj=value;
  17001. _fixObjectPathIfNecessary(this, obj);
  17002. };
  17003. Functions.prototype.toJSON=function () {
  17004. return {};
  17005. };
  17006. return Functions;
  17007. }(OfficeExtension.ClientObject));
  17008. Excel.Functions=Functions;
  17009. var ErrorCodes;
  17010. (function (ErrorCodes) {
  17011. ErrorCodes.accessDenied="AccessDenied";
  17012. ErrorCodes.apiNotFound="ApiNotFound";
  17013. ErrorCodes.generalException="GeneralException";
  17014. ErrorCodes.insertDeleteConflict="InsertDeleteConflict";
  17015. ErrorCodes.invalidArgument="InvalidArgument";
  17016. ErrorCodes.invalidBinding="InvalidBinding";
  17017. ErrorCodes.invalidOperation="InvalidOperation";
  17018. ErrorCodes.invalidReference="InvalidReference";
  17019. ErrorCodes.invalidSelection="InvalidSelection";
  17020. ErrorCodes.itemAlreadyExists="ItemAlreadyExists";
  17021. ErrorCodes.itemNotFound="ItemNotFound";
  17022. ErrorCodes.notImplemented="NotImplemented";
  17023. ErrorCodes.unsupportedOperation="UnsupportedOperation";
  17024. })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={}));
  17025. })(Excel || (Excel={}));
  17026. var Excel;
  17027. (function (Excel) {
  17028. var RequestContext=(function (_super) {
  17029. __extends(RequestContext, _super);
  17030. function RequestContext(url) {
  17031. _super.call(this, url);
  17032. this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this));
  17033. this._rootObject=this.m_workbook;
  17034. }
  17035. Object.defineProperty(RequestContext.prototype, "workbook", {
  17036. get: function () {
  17037. return this.m_workbook;
  17038. },
  17039. enumerable: true,
  17040. configurable: true
  17041. });
  17042. return RequestContext;
  17043. }(OfficeExtension.ClientRequestContext));
  17044. Excel.RequestContext=RequestContext;
  17045. function run(arg1, arg2, arg3) {
  17046. return OfficeExtension.ClientRequestContext._runBatch("Excel.run", arguments, function (requestInfo) {
  17047. var ret=new Excel.RequestContext(requestInfo ? requestInfo.url : null);
  17048. if (requestInfo && requestInfo.headers) {
  17049. for (var name in requestInfo.headers) {
  17050. ret.requestHeaders[name]=requestInfo.headers[name];
  17051. }
  17052. }
  17053. return ret;
  17054. });
  17055. }
  17056. Excel.run=run;
  17057. })(Excel || (Excel={}));
  17058. var Excel;
  17059. (function (Excel) {
  17060. Excel._RedirectV1APIs=false;
  17061. Excel._V1APIMap={
  17062. "GetDataAsync": {
  17063. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetData(callArgs); },
  17064. postprocess: getDataCommonPostprocess
  17065. },
  17066. "GetSelectedDataAsync": {
  17067. call: function (ctx, callArgs) { return ctx.workbook._V1Api.getSelectedData(callArgs); },
  17068. postprocess: getDataCommonPostprocess
  17069. },
  17070. "GoToByIdAsync": {
  17071. call: function (ctx, callArgs) { return ctx.workbook._V1Api.gotoById(callArgs); }
  17072. },
  17073. "AddColumnsAsync": {
  17074. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddColumns(callArgs); }
  17075. },
  17076. "AddFromSelectionAsync": {
  17077. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromSelection(callArgs); },
  17078. postprocess: postprocessBindingDescriptor
  17079. },
  17080. "AddFromNamedItemAsync": {
  17081. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromNamedItem(callArgs); },
  17082. postprocess: postprocessBindingDescriptor
  17083. },
  17084. "AddFromPromptAsync": {
  17085. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromPrompt(callArgs); },
  17086. postprocess: postprocessBindingDescriptor
  17087. },
  17088. "AddRowsAsync": {
  17089. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddRows(callArgs); }
  17090. },
  17091. "GetByIdAsync": {
  17092. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetById(callArgs); },
  17093. postprocess: postprocessBindingDescriptor
  17094. },
  17095. "ReleaseByIdAsync": {
  17096. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingReleaseById(callArgs); }
  17097. },
  17098. "GetAllAsync": {
  17099. call: function (ctx) { return ctx.workbook._V1Api.bindingGetAll(); },
  17100. postprocess: function (response) {
  17101. return response.bindings.map(function (descriptor) { return postprocessBindingDescriptor(descriptor); });
  17102. }
  17103. },
  17104. "DeleteAllDataValuesAsync": {
  17105. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingDeleteAllDataValues(callArgs); }
  17106. },
  17107. "SetSelectedDataAsync": {
  17108. preprocess: function (callArgs) {
  17109. var preimage=callArgs["cellFormat"];
  17110. if (window.OSF.DDA.SafeArray) {
  17111. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17112. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17113. }
  17114. }
  17115. else if (window.OSF.DDA.WAC) {
  17116. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17117. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17118. }
  17119. }
  17120. return callArgs;
  17121. },
  17122. call: function (ctx, callArgs) { return ctx.workbook._V1Api.setSelectedData(callArgs); }
  17123. },
  17124. "SetDataAsync": {
  17125. preprocess: function (callArgs) {
  17126. var preimage=callArgs["cellFormat"];
  17127. if (window.OSF.DDA.SafeArray) {
  17128. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17129. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17130. }
  17131. }
  17132. else if (window.OSF.DDA.WAC) {
  17133. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17134. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17135. }
  17136. }
  17137. return callArgs;
  17138. },
  17139. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetData(callArgs); }
  17140. },
  17141. "SetFormatsAsync": {
  17142. preprocess: function (callArgs) {
  17143. var preimage=callArgs["cellFormat"];
  17144. if (window.OSF.DDA.SafeArray) {
  17145. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17146. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17147. }
  17148. }
  17149. else if (window.OSF.DDA.WAC) {
  17150. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17151. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17152. }
  17153. }
  17154. return callArgs;
  17155. },
  17156. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetFormats(callArgs); }
  17157. },
  17158. "SetTableOptionsAsync": {
  17159. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetTableOptions(callArgs); }
  17160. },
  17161. "ClearFormatsAsync": {
  17162. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingClearFormats(callArgs); }
  17163. },
  17164. };
  17165. function postprocessBindingDescriptor(response) {
  17166. var bindingDescriptor={
  17167. BindingColumnCount: response.bindingColumnCount,
  17168. BindingId: response.bindingId,
  17169. BindingRowCount: response.bindingRowCount,
  17170. bindingType: response.bindingType,
  17171. HasHeaders: response.hasHeaders
  17172. };
  17173. return window.OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, window.Microsoft.Office.WebExtension.context.document);
  17174. }
  17175. function getDataCommonPostprocess(response, callArgs) {
  17176. var isPlainData=response.headers==null;
  17177. var data;
  17178. if (isPlainData) {
  17179. data=response.rows;
  17180. }
  17181. else {
  17182. data=response;
  17183. }
  17184. data=window.OSF.DDA.DataCoercion.coerceData(data, callArgs[window.Microsoft.Office.WebExtension.Parameters.CoercionType]);
  17185. return data==undefined ? null : data;
  17186. }
  17187. })(Excel || (Excel={}));