Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

excel-web-16.00.debug.js 761KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062
  1. /* Excel-Online-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. OSF.ShowWindowDialogParameterKeys={
  3240. Url: "url",
  3241. Width: "width",
  3242. Height: "height",
  3243. DisplayInIframe: "displayInIframe"
  3244. };
  3245. OSF.HostThemeButtonStyleKeys={
  3246. ButtonBorderColor: "buttonBorderColor",
  3247. ButtonBackgroundColor: "buttonBackgroundColor"
  3248. };
  3249. var OfficeExt;
  3250. (function (OfficeExt) {
  3251. var WACUtils;
  3252. (function (WACUtils) {
  3253. var _trustedDomain="^https:\/\/[a-zA-Z0-9]+\.(officeapps\.live|officeapps-df\.live|partner\.officewebapps)\.com\/";
  3254. function parseAppContextFromWindowName(skipSessionStorage, windowName) {
  3255. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.AppContext);
  3256. }
  3257. WACUtils.parseAppContextFromWindowName=parseAppContextFromWindowName;
  3258. function serializeObjectToString(response) {
  3259. if (typeof (JSON) !=="undefined") {
  3260. try {
  3261. return JSON.stringify(response);
  3262. }
  3263. catch (ex) {
  3264. }
  3265. }
  3266. return "";
  3267. }
  3268. WACUtils.serializeObjectToString=serializeObjectToString;
  3269. function isHostTrusted() {
  3270. return (new RegExp(_trustedDomain)).test(OSF.getClientEndPoint()._targetUrl);
  3271. }
  3272. WACUtils.isHostTrusted=isHostTrusted;
  3273. function addHostInfoAsQueryParam(url, hostInfoValue) {
  3274. if (!url) {
  3275. return null;
  3276. }
  3277. url=url.trim() || '';
  3278. var questionMark="?";
  3279. var hostInfo="_host_Info=";
  3280. var ampHostInfo="&_host_Info=";
  3281. var fragmentSeparator="#";
  3282. var urlParts=url.split(fragmentSeparator);
  3283. var urlWithoutFragment=urlParts.shift();
  3284. var fragment=urlParts.join(fragmentSeparator);
  3285. var querySplits=urlWithoutFragment.split(questionMark);
  3286. var urlWithoutFragmentWithHostInfo;
  3287. if (querySplits.length > 1) {
  3288. urlWithoutFragmentWithHostInfo=urlWithoutFragment+ampHostInfo+hostInfoValue;
  3289. }
  3290. else if (querySplits.length > 0) {
  3291. urlWithoutFragmentWithHostInfo=urlWithoutFragment+questionMark+hostInfo+hostInfoValue;
  3292. }
  3293. return [urlWithoutFragmentWithHostInfo, fragmentSeparator, fragment].join('');
  3294. }
  3295. WACUtils.addHostInfoAsQueryParam=addHostInfoAsQueryParam;
  3296. function getDomainForUrl(url) {
  3297. if (!url) {
  3298. return null;
  3299. }
  3300. var url_parser=document.createElement('a');
  3301. url_parser.href=url;
  3302. return url_parser.protocol+"//"+url_parser.host;
  3303. }
  3304. WACUtils.getDomainForUrl=getDomainForUrl;
  3305. })(WACUtils=OfficeExt.WACUtils || (OfficeExt.WACUtils={}));
  3306. })(OfficeExt || (OfficeExt={}));
  3307. var OfficeExt;
  3308. (function (OfficeExt) {
  3309. var MsAjaxTypeHelper=(function () {
  3310. function MsAjaxTypeHelper() {
  3311. }
  3312. MsAjaxTypeHelper.isInstanceOfType=function (type, instance) {
  3313. if (typeof (instance)==="undefined" || instance===null)
  3314. return false;
  3315. if (instance instanceof type)
  3316. return true;
  3317. var instanceType=instance.constructor;
  3318. if (!instanceType || (typeof (instanceType) !=="function") || !instanceType.__typeName || instanceType.__typeName==='Object') {
  3319. instanceType=Object;
  3320. }
  3321. return !!(instanceType===type) ||
  3322. (instanceType.__typeName && type.__typeName && instanceType.__typeName===type.__typeName);
  3323. };
  3324. return MsAjaxTypeHelper;
  3325. })();
  3326. OfficeExt.MsAjaxTypeHelper=MsAjaxTypeHelper;
  3327. var MsAjaxError=(function () {
  3328. function MsAjaxError() {
  3329. }
  3330. MsAjaxError.create=function (message, errorInfo) {
  3331. var err=new Error(message);
  3332. err.message=message;
  3333. if (errorInfo) {
  3334. for (var v in errorInfo) {
  3335. err[v]=errorInfo[v];
  3336. }
  3337. }
  3338. err.popStackFrame();
  3339. return err;
  3340. };
  3341. MsAjaxError.parameterCount=function (message) {
  3342. var displayMessage="Sys.ParameterCountException: "+(message ? message : "Parameter count mismatch.");
  3343. var err=MsAjaxError.create(displayMessage, { name: 'Sys.ParameterCountException' });
  3344. err.popStackFrame();
  3345. return err;
  3346. };
  3347. MsAjaxError.argument=function (paramName, message) {
  3348. var displayMessage="Sys.ArgumentException: "+(message ? message : "Value does not fall within the expected range.");
  3349. if (paramName) {
  3350. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3351. }
  3352. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName });
  3353. err.popStackFrame();
  3354. return err;
  3355. };
  3356. MsAjaxError.argumentNull=function (paramName, message) {
  3357. var displayMessage="Sys.ArgumentNullException: "+(message ? message : "Value cannot be null.");
  3358. if (paramName) {
  3359. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3360. }
  3361. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName });
  3362. err.popStackFrame();
  3363. return err;
  3364. };
  3365. MsAjaxError.argumentOutOfRange=function (paramName, actualValue, message) {
  3366. var displayMessage="Sys.ArgumentOutOfRangeException: "+(message ? message : "Specified argument was out of the range of valid values.");
  3367. if (paramName) {
  3368. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3369. }
  3370. if (typeof (actualValue) !=="undefined" && actualValue !==null) {
  3371. displayMessage+="\n"+MsAjaxString.format("Actual value was {0}.", actualValue);
  3372. }
  3373. var err=MsAjaxError.create(displayMessage, {
  3374. name: "Sys.ArgumentOutOfRangeException",
  3375. paramName: paramName,
  3376. actualValue: actualValue
  3377. });
  3378. err.popStackFrame();
  3379. return err;
  3380. };
  3381. MsAjaxError.argumentType=function (paramName, actualType, expectedType, message) {
  3382. var displayMessage="Sys.ArgumentTypeException: ";
  3383. if (message) {
  3384. displayMessage+=message;
  3385. }
  3386. else if (actualType && expectedType) {
  3387. displayMessage+=MsAjaxString.format("Object of type '{0}' cannot be converted to type '{1}'.", actualType.getName ? actualType.getName() : actualType, expectedType.getName ? expectedType.getName() : expectedType);
  3388. }
  3389. else {
  3390. displayMessage+="Object cannot be converted to the required type.";
  3391. }
  3392. if (paramName) {
  3393. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3394. }
  3395. var err=MsAjaxError.create(displayMessage, {
  3396. name: "Sys.ArgumentTypeException",
  3397. paramName: paramName,
  3398. actualType: actualType,
  3399. expectedType: expectedType
  3400. });
  3401. err.popStackFrame();
  3402. return err;
  3403. };
  3404. MsAjaxError.argumentUndefined=function (paramName, message) {
  3405. var displayMessage="Sys.ArgumentUndefinedException: "+(message ? message : "Value cannot be undefined.");
  3406. if (paramName) {
  3407. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3408. }
  3409. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName });
  3410. err.popStackFrame();
  3411. return err;
  3412. };
  3413. MsAjaxError.invalidOperation=function (message) {
  3414. var displayMessage="Sys.InvalidOperationException: "+(message ? message : "Operation is not valid due to the current state of the object.");
  3415. var err=MsAjaxError.create(displayMessage, { name: 'Sys.InvalidOperationException' });
  3416. err.popStackFrame();
  3417. return err;
  3418. };
  3419. return MsAjaxError;
  3420. })();
  3421. OfficeExt.MsAjaxError=MsAjaxError;
  3422. var MsAjaxString=(function () {
  3423. function MsAjaxString() {
  3424. }
  3425. MsAjaxString.format=function (format) {
  3426. var args=[];
  3427. for (var _i=1; _i < arguments.length; _i++) {
  3428. args[_i - 1]=arguments[_i];
  3429. }
  3430. var source=format;
  3431. return source.replace(/{(\d+)}/gm, function (match, number) {
  3432. var index=parseInt(number, 10);
  3433. return args[index]===undefined ? '{'+number+'}' : args[index];
  3434. });
  3435. };
  3436. MsAjaxString.startsWith=function (str, prefix) {
  3437. return (str.substr(0, prefix.length)===prefix);
  3438. };
  3439. return MsAjaxString;
  3440. })();
  3441. OfficeExt.MsAjaxString=MsAjaxString;
  3442. var MsAjaxDebug=(function () {
  3443. function MsAjaxDebug() {
  3444. }
  3445. MsAjaxDebug.trace=function (text) {
  3446. if (typeof Debug !=="undefined" && Debug.writeln)
  3447. Debug.writeln(text);
  3448. if (window.console && window.console.log)
  3449. window.console.log(text);
  3450. if (window.opera && window.opera.postError)
  3451. window.opera.postError(text);
  3452. if (window.debugService && window.debugService.trace)
  3453. window.debugService.trace(text);
  3454. var a=document.getElementById("TraceConsole");
  3455. if (a && a.tagName.toUpperCase()==="TEXTAREA") {
  3456. a.innerHTML+=text+"\n";
  3457. }
  3458. };
  3459. return MsAjaxDebug;
  3460. })();
  3461. OfficeExt.MsAjaxDebug=MsAjaxDebug;
  3462. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  3463. var registerTypeInternal=function registerTypeInternal(type, name, isClass) {
  3464. if (type.__typeName===undefined) {
  3465. type.__typeName=name;
  3466. }
  3467. if (type.__class===undefined) {
  3468. type.__class=isClass;
  3469. }
  3470. };
  3471. registerTypeInternal(Function, "Function", true);
  3472. registerTypeInternal(Error, "Error", true);
  3473. registerTypeInternal(Object, "Object", true);
  3474. registerTypeInternal(String, "String", true);
  3475. registerTypeInternal(Boolean, "Boolean", true);
  3476. registerTypeInternal(Date, "Date", true);
  3477. registerTypeInternal(Number, "Number", true);
  3478. registerTypeInternal(RegExp, "RegExp", true);
  3479. registerTypeInternal(Array, "Array", true);
  3480. if (!Function.createCallback) {
  3481. Function.createCallback=function Function$createCallback(method, context) {
  3482. var e=Function._validateParams(arguments, [
  3483. { name: "method", type: Function },
  3484. { name: "context", mayBeNull: true }
  3485. ]);
  3486. if (e)
  3487. throw e;
  3488. return function () {
  3489. var l=arguments.length;
  3490. if (l > 0) {
  3491. var args=[];
  3492. for (var i=0; i < l; i++) {
  3493. args[i]=arguments[i];
  3494. }
  3495. args[l]=context;
  3496. return method.apply(this, args);
  3497. }
  3498. return method.call(this, context);
  3499. };
  3500. };
  3501. }
  3502. if (!Function.createDelegate) {
  3503. Function.createDelegate=function Function$createDelegate(instance, method) {
  3504. var e=Function._validateParams(arguments, [
  3505. { name: "instance", mayBeNull: true },
  3506. { name: "method", type: Function }
  3507. ]);
  3508. if (e)
  3509. throw e;
  3510. return function () {
  3511. return method.apply(instance, arguments);
  3512. };
  3513. };
  3514. }
  3515. if (!Function._validateParams) {
  3516. Function._validateParams=function (params, expectedParams, validateParameterCount) {
  3517. var e, expectedLength=expectedParams.length;
  3518. validateParameterCount=validateParameterCount || (typeof (validateParameterCount)==="undefined");
  3519. e=Function._validateParameterCount(params, expectedParams, validateParameterCount);
  3520. if (e) {
  3521. e.popStackFrame();
  3522. return e;
  3523. }
  3524. for (var i=0, l=params.length; i < l; i++) {
  3525. var expectedParam=expectedParams[Math.min(i, expectedLength - 1)], paramName=expectedParam.name;
  3526. if (expectedParam.parameterArray) {
  3527. paramName+="["+(i - expectedLength+1)+"]";
  3528. }
  3529. else if (!validateParameterCount && (i >=expectedLength)) {
  3530. break;
  3531. }
  3532. e=Function._validateParameter(params[i], expectedParam, paramName);
  3533. if (e) {
  3534. e.popStackFrame();
  3535. return e;
  3536. }
  3537. }
  3538. return null;
  3539. };
  3540. }
  3541. if (!Function._validateParameterCount) {
  3542. Function._validateParameterCount=function (params, expectedParams, validateParameterCount) {
  3543. var i, error, expectedLen=expectedParams.length, actualLen=params.length;
  3544. if (actualLen < expectedLen) {
  3545. var minParams=expectedLen;
  3546. for (i=0; i < expectedLen; i++) {
  3547. var param=expectedParams[i];
  3548. if (param.optional || param.parameterArray) {
  3549. minParams--;
  3550. }
  3551. }
  3552. if (actualLen < minParams) {
  3553. error=true;
  3554. }
  3555. }
  3556. else if (validateParameterCount && (actualLen > expectedLen)) {
  3557. error=true;
  3558. for (i=0; i < expectedLen; i++) {
  3559. if (expectedParams[i].parameterArray) {
  3560. error=false;
  3561. break;
  3562. }
  3563. }
  3564. }
  3565. if (error) {
  3566. var e=MsAjaxError.parameterCount();
  3567. e.popStackFrame();
  3568. return e;
  3569. }
  3570. return null;
  3571. };
  3572. }
  3573. if (!Function._validateParameter) {
  3574. Function._validateParameter=function (param, expectedParam, paramName) {
  3575. var e, expectedType=expectedParam.type, expectedInteger=!!expectedParam.integer, expectedDomElement=!!expectedParam.domElement, mayBeNull=!!expectedParam.mayBeNull;
  3576. e=Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName);
  3577. if (e) {
  3578. e.popStackFrame();
  3579. return e;
  3580. }
  3581. var expectedElementType=expectedParam.elementType, elementMayBeNull=!!expectedParam.elementMayBeNull;
  3582. if (expectedType===Array && typeof (param) !=="undefined" && param !==null &&
  3583. (expectedElementType || !elementMayBeNull)) {
  3584. var expectedElementInteger=!!expectedParam.elementInteger, expectedElementDomElement=!!expectedParam.elementDomElement;
  3585. for (var i=0; i < param.length; i++) {
  3586. var elem=param[i];
  3587. e=Function._validateParameterType(elem, expectedElementType, expectedElementInteger, expectedElementDomElement, elementMayBeNull, paramName+"["+i+"]");
  3588. if (e) {
  3589. e.popStackFrame();
  3590. return e;
  3591. }
  3592. }
  3593. }
  3594. return null;
  3595. };
  3596. }
  3597. if (!Function._validateParameterType) {
  3598. Function._validateParameterType=function (param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) {
  3599. var e, i;
  3600. if (typeof (param)==="undefined") {
  3601. if (mayBeNull) {
  3602. return null;
  3603. }
  3604. else {
  3605. e=OfficeExt.MsAjaxError.argumentUndefined(paramName);
  3606. e.popStackFrame();
  3607. return e;
  3608. }
  3609. }
  3610. if (param===null) {
  3611. if (mayBeNull) {
  3612. return null;
  3613. }
  3614. else {
  3615. e=OfficeExt.MsAjaxError.argumentNull(paramName);
  3616. e.popStackFrame();
  3617. return e;
  3618. }
  3619. }
  3620. if (expectedType && !OfficeExt.MsAjaxTypeHelper.isInstanceOfType(expectedType, param)) {
  3621. e=OfficeExt.MsAjaxError.argumentType(paramName, typeof (param), expectedType);
  3622. e.popStackFrame();
  3623. return e;
  3624. }
  3625. return null;
  3626. };
  3627. }
  3628. if (!window.Type) {
  3629. window.Type=Function;
  3630. }
  3631. if (!Type.registerNamespace) {
  3632. Type.registerNamespace=function (ns) {
  3633. var namespaceParts=ns.split('.');
  3634. var currentNamespace=window;
  3635. for (var i=0; i < namespaceParts.length; i++) {
  3636. currentNamespace[namespaceParts[i]]=currentNamespace[namespaceParts[i]] || {};
  3637. currentNamespace=currentNamespace[namespaceParts[i]];
  3638. }
  3639. };
  3640. }
  3641. if (!Type.prototype.registerClass) {
  3642. Type.prototype.registerClass=function (cls) { cls={}; };
  3643. }
  3644. if (typeof (Sys)==="undefined") {
  3645. Type.registerNamespace('Sys');
  3646. }
  3647. if (!Error.prototype.popStackFrame) {
  3648. Error.prototype.popStackFrame=function () {
  3649. if (arguments.length !==0)
  3650. throw MsAjaxError.parameterCount();
  3651. if (typeof (this.stack)==="undefined" || this.stack===null ||
  3652. typeof (this.fileName)==="undefined" || this.fileName===null ||
  3653. typeof (this.lineNumber)==="undefined" || this.lineNumber===null) {
  3654. return;
  3655. }
  3656. var stackFrames=this.stack.split("\n");
  3657. var currentFrame=stackFrames[0];
  3658. var pattern=this.fileName+":"+this.lineNumber;
  3659. while (typeof (currentFrame) !=="undefined" &&
  3660. currentFrame !==null &&
  3661. currentFrame.indexOf(pattern)===-1) {
  3662. stackFrames.shift();
  3663. currentFrame=stackFrames[0];
  3664. }
  3665. var nextFrame=stackFrames[1];
  3666. if (typeof (nextFrame)==="undefined" || nextFrame===null) {
  3667. return;
  3668. }
  3669. var nextFrameParts=nextFrame.match(/@(.*):(\d+)$/);
  3670. if (typeof (nextFrameParts)==="undefined" || nextFrameParts===null) {
  3671. return;
  3672. }
  3673. this.fileName=nextFrameParts[1];
  3674. this.lineNumber=parseInt(nextFrameParts[2]);
  3675. stackFrames.shift();
  3676. this.stack=stackFrames.join("\n");
  3677. };
  3678. }
  3679. OsfMsAjaxFactory.msAjaxError=MsAjaxError;
  3680. OsfMsAjaxFactory.msAjaxString=MsAjaxString;
  3681. OsfMsAjaxFactory.msAjaxDebug=MsAjaxDebug;
  3682. }
  3683. })(OfficeExt || (OfficeExt={}));
  3684. OSF.OUtil.setNamespace("Microsoft", window);
  3685. OSF.OUtil.setNamespace("Office", Microsoft);
  3686. OSF.OUtil.setNamespace("Common", Microsoft.Office);
  3687. OSF.SerializerVersion={
  3688. MsAjax: 0,
  3689. Browser: 1
  3690. };
  3691. var OfficeExt;
  3692. (function (OfficeExt) {
  3693. function appSpecificCheckOriginFunction(url, eventObj, messageObj, checkOriginFunction) {
  3694. return true;
  3695. }
  3696. ;
  3697. OfficeExt.appSpecificCheckOrigin=appSpecificCheckOriginFunction;
  3698. })(OfficeExt || (OfficeExt={}));
  3699. Microsoft.Office.Common.InvokeType={ "async": 0,
  3700. "sync": 1,
  3701. "asyncRegisterEvent": 2,
  3702. "asyncUnregisterEvent": 3,
  3703. "syncRegisterEvent": 4,
  3704. "syncUnregisterEvent": 5
  3705. };
  3706. Microsoft.Office.Common.InvokeResultCode={
  3707. "noError": 0,
  3708. "errorInRequest": -1,
  3709. "errorHandlingRequest": -2,
  3710. "errorInResponse": -3,
  3711. "errorHandlingResponse": -4,
  3712. "errorHandlingRequestAccessDenied": -5,
  3713. "errorHandlingMethodCallTimedout": -6
  3714. };
  3715. Microsoft.Office.Common.MessageType={ "request": 0,
  3716. "response": 1
  3717. };
  3718. Microsoft.Office.Common.ActionType={ "invoke": 0,
  3719. "registerEvent": 1,
  3720. "unregisterEvent": 2 };
  3721. Microsoft.Office.Common.ResponseType={ "forCalling": 0,
  3722. "forEventing": 1
  3723. };
  3724. Microsoft.Office.Common.MethodObject=function Microsoft_Office_Common_MethodObject(method, invokeType, blockingOthers) {
  3725. this._method=method;
  3726. this._invokeType=invokeType;
  3727. this._blockingOthers=blockingOthers;
  3728. };
  3729. Microsoft.Office.Common.MethodObject.prototype={
  3730. getMethod: function Microsoft_Office_Common_MethodObject$getMethod() {
  3731. return this._method;
  3732. },
  3733. getInvokeType: function Microsoft_Office_Common_MethodObject$getInvokeType() {
  3734. return this._invokeType;
  3735. },
  3736. getBlockingFlag: function Microsoft_Office_Common_MethodObject$getBlockingFlag() {
  3737. return this._blockingOthers;
  3738. }
  3739. };
  3740. Microsoft.Office.Common.EventMethodObject=function Microsoft_Office_Common_EventMethodObject(registerMethodObject, unregisterMethodObject) {
  3741. this._registerMethodObject=registerMethodObject;
  3742. this._unregisterMethodObject=unregisterMethodObject;
  3743. };
  3744. Microsoft.Office.Common.EventMethodObject.prototype={
  3745. getRegisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getRegisterMethodObject() {
  3746. return this._registerMethodObject;
  3747. },
  3748. getUnregisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getUnregisterMethodObject() {
  3749. return this._unregisterMethodObject;
  3750. }
  3751. };
  3752. Microsoft.Office.Common.ServiceEndPoint=function Microsoft_Office_Common_ServiceEndPoint(serviceEndPointId) {
  3753. var e=Function._validateParams(arguments, [
  3754. { name: "serviceEndPointId", type: String, mayBeNull: false }
  3755. ]);
  3756. if (e)
  3757. throw e;
  3758. this._methodObjectList={};
  3759. this._eventHandlerProxyList={};
  3760. this._Id=serviceEndPointId;
  3761. this._conversations={};
  3762. this._policyManager=null;
  3763. this._appDomains={};
  3764. this._onHandleRequestError=null;
  3765. };
  3766. Microsoft.Office.Common.ServiceEndPoint.prototype={
  3767. registerMethod: function Microsoft_Office_Common_ServiceEndPoint$registerMethod(methodName, method, invokeType, blockingOthers) {
  3768. var e=Function._validateParams(arguments, [{ name: "methodName", type: String, mayBeNull: false },
  3769. { name: "method", type: Function, mayBeNull: false },
  3770. { name: "invokeType", type: Number, mayBeNull: false },
  3771. { name: "blockingOthers", type: Boolean, mayBeNull: false }
  3772. ]);
  3773. if (e)
  3774. throw e;
  3775. if (invokeType !==Microsoft.Office.Common.InvokeType.async
  3776. && invokeType !==Microsoft.Office.Common.InvokeType.sync) {
  3777. throw OsfMsAjaxFactory.msAjaxError.argument("invokeType");
  3778. }
  3779. var methodObject=new Microsoft.Office.Common.MethodObject(method, invokeType, blockingOthers);
  3780. this._methodObjectList[methodName]=methodObject;
  3781. },
  3782. unregisterMethod: function Microsoft_Office_Common_ServiceEndPoint$unregisterMethod(methodName) {
  3783. var e=Function._validateParams(arguments, [
  3784. { name: "methodName", type: String, mayBeNull: false }
  3785. ]);
  3786. if (e)
  3787. throw e;
  3788. delete this._methodObjectList[methodName];
  3789. },
  3790. registerEvent: function Microsoft_Office_Common_ServiceEndPoint$registerEvent(eventName, registerMethod, unregisterMethod) {
  3791. var e=Function._validateParams(arguments, [{ name: "eventName", type: String, mayBeNull: false },
  3792. { name: "registerMethod", type: Function, mayBeNull: false },
  3793. { name: "unregisterMethod", type: Function, mayBeNull: false }
  3794. ]);
  3795. if (e)
  3796. throw e;
  3797. var methodObject=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, Microsoft.Office.Common.InvokeType.syncRegisterEvent, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, Microsoft.Office.Common.InvokeType.syncUnregisterEvent, false));
  3798. this._methodObjectList[eventName]=methodObject;
  3799. },
  3800. registerEventEx: function Microsoft_Office_Common_ServiceEndPoint$registerEventEx(eventName, registerMethod, registerMethodInvokeType, unregisterMethod, unregisterMethodInvokeType) {
  3801. var e=Function._validateParams(arguments, [{ name: "eventName", type: String, mayBeNull: false },
  3802. { name: "registerMethod", type: Function, mayBeNull: false },
  3803. { name: "registerMethodInvokeType", type: Number, mayBeNull: false },
  3804. { name: "unregisterMethod", type: Function, mayBeNull: false },
  3805. { name: "unregisterMethodInvokeType", type: Number, mayBeNull: false }
  3806. ]);
  3807. if (e)
  3808. throw e;
  3809. var methodObject=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, registerMethodInvokeType, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, unregisterMethodInvokeType, false));
  3810. this._methodObjectList[eventName]=methodObject;
  3811. },
  3812. unregisterEvent: function (eventName) {
  3813. var e=Function._validateParams(arguments, [
  3814. { name: "eventName", type: String, mayBeNull: false }
  3815. ]);
  3816. if (e)
  3817. throw e;
  3818. this.unregisterMethod(eventName);
  3819. },
  3820. registerConversation: function Microsoft_Office_Common_ServiceEndPoint$registerConversation(conversationId, conversationUrl, appDomains, serializerVersion) {
  3821. var e=Function._validateParams(arguments, [
  3822. { name: "conversationId", type: String, mayBeNull: false },
  3823. { name: "conversationUrl", type: String, mayBeNull: false, optional: true },
  3824. { name: "appDomains", type: Object, mayBeNull: true, optional: true },
  3825. { name: "serializerVersion", type: Number, mayBeNull: true, optional: true }
  3826. ]);
  3827. if (e)
  3828. throw e;
  3829. ;
  3830. if (appDomains) {
  3831. if (!(appDomains instanceof Array)) {
  3832. throw OsfMsAjaxFactory.msAjaxError.argument("appDomains");
  3833. }
  3834. this._appDomains[conversationId]=appDomains;
  3835. }
  3836. this._conversations[conversationId]={ url: conversationUrl, serializerVersion: serializerVersion };
  3837. },
  3838. unregisterConversation: function Microsoft_Office_Common_ServiceEndPoint$unregisterConversation(conversationId) {
  3839. var e=Function._validateParams(arguments, [
  3840. { name: "conversationId", type: String, mayBeNull: false }
  3841. ]);
  3842. if (e)
  3843. throw e;
  3844. delete this._conversations[conversationId];
  3845. },
  3846. setPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$setPolicyManager(policyManager) {
  3847. var e=Function._validateParams(arguments, [
  3848. { name: "policyManager", type: Object, mayBeNull: false }
  3849. ]);
  3850. if (e)
  3851. throw e;
  3852. if (!policyManager.checkPermission) {
  3853. throw OsfMsAjaxFactory.msAjaxError.argument("policyManager");
  3854. }
  3855. this._policyManager=policyManager;
  3856. },
  3857. getPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$getPolicyManager() {
  3858. return this._policyManager;
  3859. },
  3860. dispose: function Microsoft_Office_Common_ServiceEndPoint$dispose() {
  3861. this._methodObjectList=null;
  3862. this._eventHandlerProxyList=null;
  3863. this._Id=null;
  3864. this._conversations=null;
  3865. this._policyManager=null;
  3866. this._appDomains=null;
  3867. this._onHandleRequestError=null;
  3868. }
  3869. };
  3870. Microsoft.Office.Common.ClientEndPoint=function Microsoft_Office_Common_ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion) {
  3871. var e=Function._validateParams(arguments, [
  3872. { name: "conversationId", type: String, mayBeNull: false },
  3873. { name: "targetWindow", mayBeNull: false },
  3874. { name: "targetUrl", type: String, mayBeNull: false },
  3875. { name: "serializerVersion", type: Number, mayBeNull: true, optional: true }
  3876. ]);
  3877. if (e)
  3878. throw e;
  3879. try {
  3880. if (!targetWindow.postMessage) {
  3881. throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow");
  3882. }
  3883. }
  3884. catch (ex) {
  3885. if (!Object.prototype.hasOwnProperty.call(targetWindow, "postMessage")) {
  3886. throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow");
  3887. }
  3888. }
  3889. this._conversationId=conversationId;
  3890. this._targetWindow=targetWindow;
  3891. this._targetUrl=targetUrl;
  3892. this._callingIndex=0;
  3893. this._callbackList={};
  3894. this._eventHandlerList={};
  3895. if (serializerVersion !=null) {
  3896. this._serializerVersion=serializerVersion;
  3897. }
  3898. else {
  3899. this._serializerVersion=OSF.SerializerVersion.Browser;
  3900. }
  3901. };
  3902. Microsoft.Office.Common.ClientEndPoint.prototype={
  3903. invoke: function Microsoft_Office_Common_ClientEndPoint$invoke(targetMethodName, callback, param) {
  3904. var e=Function._validateParams(arguments, [{ name: "targetMethodName", type: String, mayBeNull: false },
  3905. { name: "callback", type: Function, mayBeNull: true },
  3906. { name: "param", mayBeNull: true }
  3907. ]);
  3908. if (e)
  3909. throw e;
  3910. var correlationId=this._callingIndex++;
  3911. var now=new Date();
  3912. var callbackEntry={ "callback": callback, "createdOn": now.getTime() };
  3913. if (param && typeof param==="object" && typeof param.__timeout__==="number") {
  3914. callbackEntry.timeout=param.__timeout__;
  3915. delete param.__timeout__;
  3916. }
  3917. this._callbackList[correlationId]=callbackEntry;
  3918. try {
  3919. var callRequest=new Microsoft.Office.Common.Request(targetMethodName, Microsoft.Office.Common.ActionType.invoke, this._conversationId, correlationId, param);
  3920. var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion);
  3921. this._targetWindow.postMessage(msg, this._targetUrl);
  3922. Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();
  3923. }
  3924. catch (ex) {
  3925. try {
  3926. if (callback !==null)
  3927. callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex);
  3928. }
  3929. finally {
  3930. delete this._callbackList[correlationId];
  3931. }
  3932. }
  3933. },
  3934. registerForEvent: function Microsoft_Office_Common_ClientEndPoint$registerForEvent(targetEventName, eventHandler, callback, data) {
  3935. var e=Function._validateParams(arguments, [{ name: "targetEventName", type: String, mayBeNull: false },
  3936. { name: "eventHandler", type: Function, mayBeNull: false },
  3937. { name: "callback", type: Function, mayBeNull: true },
  3938. { name: "data", mayBeNull: true, optional: true }
  3939. ]);
  3940. if (e)
  3941. throw e;
  3942. var correlationId=this._callingIndex++;
  3943. var now=new Date();
  3944. this._callbackList[correlationId]={ "callback": callback, "createdOn": now.getTime() };
  3945. try {
  3946. var callRequest=new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.registerEvent, this._conversationId, correlationId, data);
  3947. var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion);
  3948. this._targetWindow.postMessage(msg, this._targetUrl);
  3949. Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();
  3950. this._eventHandlerList[targetEventName]=eventHandler;
  3951. }
  3952. catch (ex) {
  3953. try {
  3954. if (callback !==null) {
  3955. callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex);
  3956. }
  3957. }
  3958. finally {
  3959. delete this._callbackList[correlationId];
  3960. }
  3961. }
  3962. },
  3963. unregisterForEvent: function Microsoft_Office_Common_ClientEndPoint$unregisterForEvent(targetEventName, callback, data) {
  3964. var e=Function._validateParams(arguments, [{ name: "targetEventName", type: String, mayBeNull: false },
  3965. { name: "callback", type: Function, mayBeNull: true },
  3966. { name: "data", mayBeNull: true, optional: true }
  3967. ]);
  3968. if (e)
  3969. throw e;
  3970. var correlationId=this._callingIndex++;
  3971. var now=new Date();
  3972. this._callbackList[correlationId]={ "callback": callback, "createdOn": now.getTime() };
  3973. try {
  3974. var callRequest=new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.unregisterEvent, this._conversationId, correlationId, data);
  3975. var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion);
  3976. this._targetWindow.postMessage(msg, this._targetUrl);
  3977. Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();
  3978. }
  3979. catch (ex) {
  3980. try {
  3981. if (callback !==null) {
  3982. callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex);
  3983. }
  3984. }
  3985. finally {
  3986. delete this._callbackList[correlationId];
  3987. }
  3988. }
  3989. finally {
  3990. delete this._eventHandlerList[targetEventName];
  3991. }
  3992. }
  3993. };
  3994. Microsoft.Office.Common.XdmCommunicationManager=(function () {
  3995. var _invokerQueue=[];
  3996. var _lastMessageProcessTime=null;
  3997. var _messageProcessingTimer=null;
  3998. var _processInterval=10;
  3999. var _blockingFlag=false;
  4000. var _methodTimeoutTimer=null;
  4001. var _methodTimeoutProcessInterval=2000;
  4002. var _methodTimeoutDefault=65000;
  4003. var _methodTimeout=_methodTimeoutDefault;
  4004. var _serviceEndPoints={};
  4005. var _clientEndPoints={};
  4006. var _initialized=false;
  4007. function _lookupServiceEndPoint(conversationId) {
  4008. for (var id in _serviceEndPoints) {
  4009. if (_serviceEndPoints[id]._conversations[conversationId]) {
  4010. return _serviceEndPoints[id];
  4011. }
  4012. }
  4013. OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id.");
  4014. throw OsfMsAjaxFactory.msAjaxError.argument("conversationId");
  4015. }
  4016. ;
  4017. function _lookupClientEndPoint(conversationId) {
  4018. var clientEndPoint=_clientEndPoints[conversationId];
  4019. if (!clientEndPoint) {
  4020. OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id.");
  4021. }
  4022. return clientEndPoint;
  4023. }
  4024. ;
  4025. function _lookupMethodObject(serviceEndPoint, messageObject) {
  4026. var methodOrEventMethodObject=serviceEndPoint._methodObjectList[messageObject._actionName];
  4027. if (!methodOrEventMethodObject) {
  4028. OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+messageObject._actionName);
  4029. throw OsfMsAjaxFactory.msAjaxError.argument("messageObject");
  4030. }
  4031. var methodObject=null;
  4032. if (messageObject._actionType===Microsoft.Office.Common.ActionType.invoke) {
  4033. methodObject=methodOrEventMethodObject;
  4034. }
  4035. else if (messageObject._actionType===Microsoft.Office.Common.ActionType.registerEvent) {
  4036. methodObject=methodOrEventMethodObject.getRegisterMethodObject();
  4037. }
  4038. else {
  4039. methodObject=methodOrEventMethodObject.getUnregisterMethodObject();
  4040. }
  4041. return methodObject;
  4042. }
  4043. ;
  4044. function _enqueInvoker(invoker) {
  4045. _invokerQueue.push(invoker);
  4046. }
  4047. ;
  4048. function _dequeInvoker() {
  4049. if (_messageProcessingTimer !==null) {
  4050. if (!_blockingFlag) {
  4051. if (_invokerQueue.length > 0) {
  4052. var invoker=_invokerQueue.shift();
  4053. _executeCommand(invoker);
  4054. }
  4055. else {
  4056. clearInterval(_messageProcessingTimer);
  4057. _messageProcessingTimer=null;
  4058. }
  4059. }
  4060. }
  4061. else {
  4062. OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.");
  4063. }
  4064. }
  4065. ;
  4066. function _executeCommand(invoker) {
  4067. _blockingFlag=invoker.getInvokeBlockingFlag();
  4068. invoker.invoke();
  4069. _lastMessageProcessTime=(new Date()).getTime();
  4070. }
  4071. ;
  4072. function _checkMethodTimeout() {
  4073. if (_methodTimeoutTimer) {
  4074. var clientEndPoint;
  4075. var methodCallsNotTimedout=0;
  4076. var now=new Date();
  4077. var timeoutValue;
  4078. for (var conversationId in _clientEndPoints) {
  4079. clientEndPoint=_clientEndPoints[conversationId];
  4080. for (var correlationId in clientEndPoint._callbackList) {
  4081. var callbackEntry=clientEndPoint._callbackList[correlationId];
  4082. timeoutValue=callbackEntry.timeout ? callbackEntry.timeout : _methodTimeout;
  4083. if (timeoutValue >=0 && Math.abs(now.getTime() - callbackEntry.createdOn) >=timeoutValue) {
  4084. try {
  4085. if (callbackEntry.callback) {
  4086. callbackEntry.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout, null);
  4087. }
  4088. }
  4089. finally {
  4090. delete clientEndPoint._callbackList[correlationId];
  4091. }
  4092. }
  4093. else {
  4094. methodCallsNotTimedout++;
  4095. }
  4096. ;
  4097. }
  4098. }
  4099. if (methodCallsNotTimedout===0) {
  4100. clearInterval(_methodTimeoutTimer);
  4101. _methodTimeoutTimer=null;
  4102. }
  4103. }
  4104. else {
  4105. OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.");
  4106. }
  4107. }
  4108. ;
  4109. function _postCallbackHandler() {
  4110. _blockingFlag=false;
  4111. }
  4112. ;
  4113. function _registerListener(listener) {
  4114. if (window.addEventListener) {
  4115. window.addEventListener("message", listener, false);
  4116. }
  4117. else if ((navigator.userAgent.indexOf("MSIE") > -1) && window.attachEvent) {
  4118. window.attachEvent("onmessage", listener);
  4119. }
  4120. else {
  4121. OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API.");
  4122. throw OsfMsAjaxFactory.msAjaxError.argument("Browser");
  4123. }
  4124. }
  4125. ;
  4126. function _checkOrigin(url, origin) {
  4127. var res=false;
  4128. if (url===true) {
  4129. return true;
  4130. }
  4131. if (!url || !origin || !url.length || !origin.length) {
  4132. return res;
  4133. }
  4134. var url_parser, org_parser;
  4135. url_parser=document.createElement('a');
  4136. org_parser=document.createElement('a');
  4137. url_parser.href=url;
  4138. org_parser.href=origin;
  4139. res=_urlCompare(url_parser, org_parser);
  4140. delete url_parser, org_parser;
  4141. return res;
  4142. }
  4143. function _checkOriginWithAppDomains(allowed_domains, origin) {
  4144. var res=false;
  4145. if (!origin || !origin.length || !(allowed_domains) || !(allowed_domains instanceof Array) || !allowed_domains.length) {
  4146. return res;
  4147. }
  4148. var org_parser=document.createElement('a');
  4149. var app_domain_parser=document.createElement('a');
  4150. org_parser.href=origin;
  4151. for (var i=0; i < allowed_domains.length && !res; i++) {
  4152. if (allowed_domains[i].indexOf("://") !==-1) {
  4153. app_domain_parser.href=allowed_domains[i];
  4154. res=_urlCompare(org_parser, app_domain_parser);
  4155. }
  4156. }
  4157. delete org_parser, app_domain_parser;
  4158. return res;
  4159. }
  4160. function _urlCompare(url_parser1, url_parser2) {
  4161. return ((url_parser1.hostname==url_parser2.hostname) &&
  4162. (url_parser1.protocol==url_parser2.protocol) &&
  4163. (url_parser1.port==url_parser2.port));
  4164. }
  4165. function _receive(e) {
  4166. if (e.data !='') {
  4167. var messageObject;
  4168. var serializerVersion=OSF.SerializerVersion.Browser;
  4169. var serializedMessage=e.data;
  4170. try {
  4171. messageObject=Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, OSF.SerializerVersion.Browser);
  4172. serializerVersion=messageObject._serializerVersion !=null ? messageObject._serializerVersion : serializerVersion;
  4173. }
  4174. catch (ex) {
  4175. return;
  4176. }
  4177. if (messageObject._messageType===Microsoft.Office.Common.MessageType.request) {
  4178. var requesterUrl=(e.origin==null || e.origin=="null") ? messageObject._origin : e.origin;
  4179. try {
  4180. var serviceEndPoint=_lookupServiceEndPoint(messageObject._conversationId);
  4181. ;
  4182. var conversation=serviceEndPoint._conversations[messageObject._conversationId];
  4183. serializerVersion=conversation.serializerVersion !=null ? conversation.serializerVersion : serializerVersion;
  4184. ;
  4185. if (!_checkOrigin(conversation.url, e.origin) && !_checkOriginWithAppDomains(serviceEndPoint._appDomains[messageObject._conversationId], e.origin)) {
  4186. throw "Failed origin check";
  4187. }
  4188. var policyManager=serviceEndPoint.getPolicyManager();
  4189. if (policyManager && !policyManager.checkPermission(messageObject._conversationId, messageObject._actionName, messageObject._data)) {
  4190. throw "Access Denied";
  4191. }
  4192. var methodObject=_lookupMethodObject(serviceEndPoint, messageObject);
  4193. var invokeCompleteCallback=new Microsoft.Office.Common.InvokeCompleteCallback(e.source, requesterUrl, messageObject._actionName, messageObject._conversationId, messageObject._correlationId, _postCallbackHandler, serializerVersion);
  4194. var invoker=new Microsoft.Office.Common.Invoker(methodObject, messageObject._data, invokeCompleteCallback, serviceEndPoint._eventHandlerProxyList, messageObject._conversationId, messageObject._actionName, serializerVersion);
  4195. var shouldEnque=true;
  4196. if (_messageProcessingTimer==null) {
  4197. if ((_lastMessageProcessTime==null || (new Date()).getTime() - _lastMessageProcessTime > _processInterval) && !_blockingFlag) {
  4198. _executeCommand(invoker);
  4199. shouldEnque=false;
  4200. }
  4201. else {
  4202. _messageProcessingTimer=setInterval(_dequeInvoker, _processInterval);
  4203. }
  4204. }
  4205. if (shouldEnque) {
  4206. _enqueInvoker(invoker);
  4207. }
  4208. }
  4209. catch (ex) {
  4210. if (serviceEndPoint && serviceEndPoint._onHandleRequestError) {
  4211. serviceEndPoint._onHandleRequestError(messageObject, ex);
  4212. }
  4213. var errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;
  4214. if (ex=="Access Denied") {
  4215. errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied;
  4216. }
  4217. var callResponse=new Microsoft.Office.Common.Response(messageObject._actionName, messageObject._conversationId, messageObject._correlationId, errorCode, Microsoft.Office.Common.ResponseType.forCalling, ex);
  4218. var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(callResponse, serializerVersion);
  4219. if (e.source && e.source.postMessage) {
  4220. e.source.postMessage(envelopedResult, requesterUrl);
  4221. }
  4222. }
  4223. }
  4224. else if (messageObject._messageType===Microsoft.Office.Common.MessageType.response) {
  4225. var clientEndPoint=_lookupClientEndPoint(messageObject._conversationId);
  4226. if (!clientEndPoint) {
  4227. return;
  4228. }
  4229. clientEndPoint._serializerVersion=serializerVersion;
  4230. ;
  4231. if (!_checkOrigin(clientEndPoint._targetUrl, e.origin)) {
  4232. throw "Failed orgin check";
  4233. }
  4234. if (messageObject._responseType===Microsoft.Office.Common.ResponseType.forCalling) {
  4235. var callbackEntry=clientEndPoint._callbackList[messageObject._correlationId];
  4236. if (callbackEntry) {
  4237. try {
  4238. if (callbackEntry.callback)
  4239. callbackEntry.callback(messageObject._errorCode, messageObject._data);
  4240. }
  4241. finally {
  4242. delete clientEndPoint._callbackList[messageObject._correlationId];
  4243. }
  4244. }
  4245. }
  4246. else {
  4247. var eventhandler=clientEndPoint._eventHandlerList[messageObject._actionName];
  4248. if (eventhandler !==undefined && eventhandler !==null) {
  4249. eventhandler(messageObject._data);
  4250. }
  4251. }
  4252. }
  4253. else {
  4254. return;
  4255. }
  4256. }
  4257. }
  4258. ;
  4259. function _initialize() {
  4260. if (!_initialized) {
  4261. _registerListener(_receive);
  4262. _initialized=true;
  4263. }
  4264. }
  4265. ;
  4266. return {
  4267. connect: function Microsoft_Office_Common_XdmCommunicationManager$connect(conversationId, targetWindow, targetUrl, serializerVersion) {
  4268. var clientEndPoint=_clientEndPoints[conversationId];
  4269. if (!clientEndPoint) {
  4270. _initialize();
  4271. clientEndPoint=new Microsoft.Office.Common.ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion);
  4272. _clientEndPoints[conversationId]=clientEndPoint;
  4273. }
  4274. return clientEndPoint;
  4275. },
  4276. getClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getClientEndPoint(conversationId) {
  4277. var e=Function._validateParams(arguments, [
  4278. { name: "conversationId", type: String, mayBeNull: false }
  4279. ]);
  4280. if (e)
  4281. throw e;
  4282. return _clientEndPoints[conversationId];
  4283. },
  4284. createServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$createServiceEndPoint(serviceEndPointId) {
  4285. _initialize();
  4286. var serviceEndPoint=new Microsoft.Office.Common.ServiceEndPoint(serviceEndPointId);
  4287. _serviceEndPoints[serviceEndPointId]=serviceEndPoint;
  4288. return serviceEndPoint;
  4289. },
  4290. getServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getServiceEndPoint(serviceEndPointId) {
  4291. var e=Function._validateParams(arguments, [
  4292. { name: "serviceEndPointId", type: String, mayBeNull: false }
  4293. ]);
  4294. if (e)
  4295. throw e;
  4296. return _serviceEndPoints[serviceEndPointId];
  4297. },
  4298. deleteClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteClientEndPoint(conversationId) {
  4299. var e=Function._validateParams(arguments, [
  4300. { name: "conversationId", type: String, mayBeNull: false }
  4301. ]);
  4302. if (e)
  4303. throw e;
  4304. delete _clientEndPoints[conversationId];
  4305. },
  4306. deleteServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteServiceEndPoint(serviceEndPointId) {
  4307. var e=Function._validateParams(arguments, [
  4308. { name: "serviceEndPointId", type: String, mayBeNull: false }
  4309. ]);
  4310. if (e)
  4311. throw e;
  4312. delete _serviceEndPoints[serviceEndPointId];
  4313. },
  4314. checkUrlWithAppDomains: function Microsoft_Office_Common_XdmCommunicationManager$_checkUrlWithAppDomains(appDomains, origin) {
  4315. return _checkOriginWithAppDomains(appDomains, origin);
  4316. },
  4317. _setMethodTimeout: function Microsoft_Office_Common_XdmCommunicationManager$_setMethodTimeout(methodTimeout) {
  4318. var e=Function._validateParams(arguments, [
  4319. { name: "methodTimeout", type: Number, mayBeNull: false }
  4320. ]);
  4321. if (e)
  4322. throw e;
  4323. _methodTimeout=(methodTimeout <=0) ? _methodTimeoutDefault : methodTimeout;
  4324. },
  4325. _startMethodTimeoutTimer: function Microsoft_Office_Common_XdmCommunicationManager$_startMethodTimeoutTimer() {
  4326. if (!_methodTimeoutTimer) {
  4327. _methodTimeoutTimer=setInterval(_checkMethodTimeout, _methodTimeoutProcessInterval);
  4328. }
  4329. }
  4330. };
  4331. })();
  4332. Microsoft.Office.Common.Message=function Microsoft_Office_Common_Message(messageType, actionName, conversationId, correlationId, data) {
  4333. var e=Function._validateParams(arguments, [{ name: "messageType", type: Number, mayBeNull: false },
  4334. { name: "actionName", type: String, mayBeNull: false },
  4335. { name: "conversationId", type: String, mayBeNull: false },
  4336. { name: "correlationId", mayBeNull: false },
  4337. { name: "data", mayBeNull: true, optional: true }
  4338. ]);
  4339. if (e)
  4340. throw e;
  4341. this._messageType=messageType;
  4342. this._actionName=actionName;
  4343. this._conversationId=conversationId;
  4344. this._correlationId=correlationId;
  4345. this._origin=window.location.href;
  4346. if (typeof data=="undefined") {
  4347. this._data=null;
  4348. }
  4349. else {
  4350. this._data=data;
  4351. }
  4352. };
  4353. Microsoft.Office.Common.Message.prototype={
  4354. getActionName: function Microsoft_Office_Common_Message$getActionName() {
  4355. return this._actionName;
  4356. },
  4357. getConversationId: function Microsoft_Office_Common_Message$getConversationId() {
  4358. return this._conversationId;
  4359. },
  4360. getCorrelationId: function Microsoft_Office_Common_Message$getCorrelationId() {
  4361. return this._correlationId;
  4362. },
  4363. getOrigin: function Microsoft_Office_Common_Message$getOrigin() {
  4364. return this._origin;
  4365. },
  4366. getData: function Microsoft_Office_Common_Message$getData() {
  4367. return this._data;
  4368. },
  4369. getMessageType: function Microsoft_Office_Common_Message$getMessageType() {
  4370. return this._messageType;
  4371. }
  4372. };
  4373. Microsoft.Office.Common.Request=function Microsoft_Office_Common_Request(actionName, actionType, conversationId, correlationId, data) {
  4374. Microsoft.Office.Common.Request.uber.constructor.call(this, Microsoft.Office.Common.MessageType.request, actionName, conversationId, correlationId, data);
  4375. this._actionType=actionType;
  4376. };
  4377. OSF.OUtil.extend(Microsoft.Office.Common.Request, Microsoft.Office.Common.Message);
  4378. Microsoft.Office.Common.Request.prototype.getActionType=function Microsoft_Office_Common_Request$getActionType() {
  4379. return this._actionType;
  4380. };
  4381. Microsoft.Office.Common.Response=function Microsoft_Office_Common_Response(actionName, conversationId, correlationId, errorCode, responseType, data) {
  4382. Microsoft.Office.Common.Response.uber.constructor.call(this, Microsoft.Office.Common.MessageType.response, actionName, conversationId, correlationId, data);
  4383. this._errorCode=errorCode;
  4384. this._responseType=responseType;
  4385. };
  4386. OSF.OUtil.extend(Microsoft.Office.Common.Response, Microsoft.Office.Common.Message);
  4387. Microsoft.Office.Common.Response.prototype.getErrorCode=function Microsoft_Office_Common_Response$getErrorCode() {
  4388. return this._errorCode;
  4389. };
  4390. Microsoft.Office.Common.Response.prototype.getResponseType=function Microsoft_Office_Common_Response$getResponseType() {
  4391. return this._responseType;
  4392. };
  4393. Microsoft.Office.Common.MessagePackager={
  4394. envelope: function Microsoft_Office_Common_MessagePackager$envelope(messageObject, serializerVersion) {
  4395. if (typeof (messageObject)==="object") {
  4396. messageObject._serializerVersion=OSF.SerializerVersion.Browser;
  4397. }
  4398. return JSON.stringify(messageObject);
  4399. },
  4400. unenvelope: function Microsoft_Office_Common_MessagePackager$unenvelope(messageObject, serializerVersion) {
  4401. return JSON.parse(messageObject);
  4402. }
  4403. };
  4404. Microsoft.Office.Common.ResponseSender=function Microsoft_Office_Common_ResponseSender(requesterWindow, requesterUrl, actionName, conversationId, correlationId, responseType, serializerVersion) {
  4405. var e=Function._validateParams(arguments, [{ name: "requesterWindow", mayBeNull: false },
  4406. { name: "requesterUrl", type: String, mayBeNull: false },
  4407. { name: "actionName", type: String, mayBeNull: false },
  4408. { name: "conversationId", type: String, mayBeNull: false },
  4409. { name: "correlationId", mayBeNull: false },
  4410. { name: "responsetype", type: Number, maybeNull: false },
  4411. { name: "serializerVersion", type: Number, maybeNull: true, optional: true }
  4412. ]);
  4413. if (e)
  4414. throw e;
  4415. this._requesterWindow=requesterWindow;
  4416. this._requesterUrl=requesterUrl;
  4417. this._actionName=actionName;
  4418. this._conversationId=conversationId;
  4419. this._correlationId=correlationId;
  4420. this._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError;
  4421. this._responseType=responseType;
  4422. var me=this;
  4423. this._send=function (result) {
  4424. try {
  4425. var response=new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result);
  4426. var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion);
  4427. me._requesterWindow.postMessage(envelopedResult, me._requesterUrl);
  4428. ;
  4429. }
  4430. catch (ex) {
  4431. OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+ex.message);
  4432. }
  4433. };
  4434. };
  4435. Microsoft.Office.Common.ResponseSender.prototype={
  4436. getRequesterWindow: function Microsoft_Office_Common_ResponseSender$getRequesterWindow() {
  4437. return this._requesterWindow;
  4438. },
  4439. getRequesterUrl: function Microsoft_Office_Common_ResponseSender$getRequesterUrl() {
  4440. return this._requesterUrl;
  4441. },
  4442. getActionName: function Microsoft_Office_Common_ResponseSender$getActionName() {
  4443. return this._actionName;
  4444. },
  4445. getConversationId: function Microsoft_Office_Common_ResponseSender$getConversationId() {
  4446. return this._conversationId;
  4447. },
  4448. getCorrelationId: function Microsoft_Office_Common_ResponseSender$getCorrelationId() {
  4449. return this._correlationId;
  4450. },
  4451. getSend: function Microsoft_Office_Common_ResponseSender$getSend() {
  4452. return this._send;
  4453. },
  4454. setResultCode: function Microsoft_Office_Common_ResponseSender$setResultCode(resultCode) {
  4455. this._invokeResultCode=resultCode;
  4456. }
  4457. };
  4458. Microsoft.Office.Common.InvokeCompleteCallback=function Microsoft_Office_Common_InvokeCompleteCallback(requesterWindow, requesterUrl, actionName, conversationId, correlationId, postCallbackHandler, serializerVersion) {
  4459. Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this, requesterWindow, requesterUrl, actionName, conversationId, correlationId, Microsoft.Office.Common.ResponseType.forCalling, serializerVersion);
  4460. this._postCallbackHandler=postCallbackHandler;
  4461. var me=this;
  4462. this._send=function (result, responseCode) {
  4463. if (responseCode !=undefined) {
  4464. me._invokeResultCode=responseCode;
  4465. }
  4466. try {
  4467. var response=new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result);
  4468. var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion);
  4469. me._requesterWindow.postMessage(envelopedResult, me._requesterUrl);
  4470. me._postCallbackHandler();
  4471. }
  4472. catch (ex) {
  4473. OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+ex.message);
  4474. }
  4475. };
  4476. };
  4477. OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback, Microsoft.Office.Common.ResponseSender);
  4478. Microsoft.Office.Common.Invoker=function Microsoft_Office_Common_Invoker(methodObject, paramValue, invokeCompleteCallback, eventHandlerProxyList, conversationId, eventName, serializerVersion) {
  4479. var e=Function._validateParams(arguments, [
  4480. { name: "methodObject", mayBeNull: false },
  4481. { name: "paramValue", mayBeNull: true },
  4482. { name: "invokeCompleteCallback", mayBeNull: false },
  4483. { name: "eventHandlerProxyList", mayBeNull: true },
  4484. { name: "conversationId", type: String, mayBeNull: false },
  4485. { name: "eventName", type: String, mayBeNull: false },
  4486. { name: "serializerVersion", type: Number, mayBeNull: true, optional: true }
  4487. ]);
  4488. if (e)
  4489. throw e;
  4490. this._methodObject=methodObject;
  4491. this._param=paramValue;
  4492. this._invokeCompleteCallback=invokeCompleteCallback;
  4493. this._eventHandlerProxyList=eventHandlerProxyList;
  4494. this._conversationId=conversationId;
  4495. this._eventName=eventName;
  4496. this._serializerVersion=serializerVersion;
  4497. };
  4498. Microsoft.Office.Common.Invoker.prototype={
  4499. invoke: function Microsoft_Office_Common_Invoker$invoke() {
  4500. try {
  4501. var result;
  4502. switch (this._methodObject.getInvokeType()) {
  4503. case Microsoft.Office.Common.InvokeType.async:
  4504. this._methodObject.getMethod()(this._param, this._invokeCompleteCallback.getSend());
  4505. break;
  4506. case Microsoft.Office.Common.InvokeType.sync:
  4507. result=this._methodObject.getMethod()(this._param);
  4508. this._invokeCompleteCallback.getSend()(result);
  4509. break;
  4510. case Microsoft.Office.Common.InvokeType.syncRegisterEvent:
  4511. var eventHandlerProxy=this._createEventHandlerProxyObject(this._invokeCompleteCallback);
  4512. result=this._methodObject.getMethod()(eventHandlerProxy.getSend(), this._param);
  4513. this._eventHandlerProxyList[this._conversationId+this._eventName]=eventHandlerProxy.getSend();
  4514. this._invokeCompleteCallback.getSend()(result);
  4515. break;
  4516. case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:
  4517. var eventHandler=this._eventHandlerProxyList[this._conversationId+this._eventName];
  4518. result=this._methodObject.getMethod()(eventHandler, this._param);
  4519. delete this._eventHandlerProxyList[this._conversationId+this._eventName];
  4520. this._invokeCompleteCallback.getSend()(result);
  4521. break;
  4522. case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:
  4523. var eventHandlerProxyAsync=this._createEventHandlerProxyObject(this._invokeCompleteCallback);
  4524. this._methodObject.getMethod()(eventHandlerProxyAsync.getSend(), this._invokeCompleteCallback.getSend(), this._param);
  4525. this._eventHandlerProxyList[this._callerId+this._eventName]=eventHandlerProxyAsync.getSend();
  4526. break;
  4527. case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:
  4528. var eventHandlerAsync=this._eventHandlerProxyList[this._callerId+this._eventName];
  4529. this._methodObject.getMethod()(eventHandlerAsync, this._invokeCompleteCallback.getSend(), this._param);
  4530. delete this._eventHandlerProxyList[this._callerId+this._eventName];
  4531. break;
  4532. default:
  4533. break;
  4534. }
  4535. }
  4536. catch (ex) {
  4537. this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse);
  4538. this._invokeCompleteCallback.getSend()(ex);
  4539. }
  4540. },
  4541. getInvokeBlockingFlag: function Microsoft_Office_Common_Invoker$getInvokeBlockingFlag() {
  4542. return this._methodObject.getBlockingFlag();
  4543. },
  4544. _createEventHandlerProxyObject: function Microsoft_Office_Common_Invoker$_createEventHandlerProxyObject(invokeCompleteObject) {
  4545. return new Microsoft.Office.Common.ResponseSender(invokeCompleteObject.getRequesterWindow(), invokeCompleteObject.getRequesterUrl(), invokeCompleteObject.getActionName(), invokeCompleteObject.getConversationId(), invokeCompleteObject.getCorrelationId(), Microsoft.Office.Common.ResponseType.forEventing, this._serializerVersion);
  4546. }
  4547. };
  4548. OSF.OUtil.setNamespace("WAC", OSF.DDA);
  4549. OSF.DDA.WAC.UniqueArguments={
  4550. Data: "Data",
  4551. Properties: "Properties",
  4552. BindingRequest: "DdaBindingsMethod",
  4553. BindingResponse: "Bindings",
  4554. SingleBindingResponse: "singleBindingResponse",
  4555. GetData: "DdaGetBindingData",
  4556. AddRowsColumns: "DdaAddRowsColumns",
  4557. SetData: "DdaSetBindingData",
  4558. ClearFormats: "DdaClearBindingFormats",
  4559. SetFormats: "DdaSetBindingFormats",
  4560. SettingsRequest: "DdaSettingsMethod",
  4561. BindingEventSource: "ddaBinding",
  4562. ArrayData: "ArrayData"
  4563. };
  4564. OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC);
  4565. OSF.DDA.WAC.Delegate.SpecialProcessor=function OSF_DDA_WAC_Delegate_SpecialProcessor() {
  4566. var complexTypes=[
  4567. OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,
  4568. OSF.DDA.WAC.UniqueArguments.BindingRequest,
  4569. OSF.DDA.WAC.UniqueArguments.BindingResponse,
  4570. OSF.DDA.WAC.UniqueArguments.GetData,
  4571. OSF.DDA.WAC.UniqueArguments.AddRowsColumns,
  4572. OSF.DDA.WAC.UniqueArguments.SetData,
  4573. OSF.DDA.WAC.UniqueArguments.ClearFormats,
  4574. OSF.DDA.WAC.UniqueArguments.SetFormats,
  4575. OSF.DDA.WAC.UniqueArguments.SettingsRequest,
  4576. OSF.DDA.WAC.UniqueArguments.BindingEventSource
  4577. ];
  4578. var dynamicTypes={};
  4579. OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  4580. };
  4581. OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  4582. OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor(), []);
  4583. OSF.OUtil.setNamespace("WAC", OSF.DDA);
  4584. OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC);
  4585. OSF.DDA.WAC.getDelegateMethods=function OSF_DDA_WAC_getDelegateMethods() {
  4586. var delegateMethods={};
  4587. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync;
  4588. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync;
  4589. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync;
  4590. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog]=OSF.DDA.WAC.Delegate.openDialog;
  4591. delegateMethods[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.WAC.Delegate.messageParent;
  4592. delegateMethods[OSF.DDA.DispIdHost.Delegates.SendMessage]=OSF.DDA.WAC.Delegate.sendMessage;
  4593. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog]=OSF.DDA.WAC.Delegate.closeDialog;
  4594. return delegateMethods;
  4595. };
  4596. OSF.DDA.WAC.Delegate.version=1;
  4597. OSF.DDA.WAC.Delegate.executeAsync=function OSF_DDA_WAC_Delegate$executeAsync(args) {
  4598. if (!args.hostCallArgs) {
  4599. args.hostCallArgs={};
  4600. }
  4601. args.hostCallArgs["DdaMethod"]={
  4602. "ControlId": OSF._OfficeAppFactory.getId(),
  4603. "Version": OSF.DDA.WAC.Delegate.version,
  4604. "DispatchId": args.dispId
  4605. };
  4606. args.hostCallArgs["__timeout__"]=-1;
  4607. if (args.onCalling) {
  4608. args.onCalling();
  4609. }
  4610. var startTime=(new Date()).getTime();
  4611. OSF.getClientEndPoint().invoke("executeMethod", function OSF_DDA_WAC_Delegate$OMFacade$OnResponse(xdmStatus, payload) {
  4612. if (args.onReceiving) {
  4613. args.onReceiving();
  4614. }
  4615. var error;
  4616. if (xdmStatus==Microsoft.Office.Common.InvokeResultCode.noError) {
  4617. OSF.DDA.WAC.Delegate.version=payload["Version"];
  4618. error=payload["Error"];
  4619. }
  4620. else {
  4621. switch (xdmStatus) {
  4622. case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:
  4623. error=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  4624. break;
  4625. default:
  4626. error=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4627. break;
  4628. }
  4629. }
  4630. if (args.onComplete) {
  4631. args.onComplete(error, payload);
  4632. }
  4633. if (OSF.AppTelemetry) {
  4634. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), error);
  4635. }
  4636. }, args.hostCallArgs);
  4637. };
  4638. OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function OSF_DDA_WAC_Delegate$GetOnAfterRegisterEvent(register, args) {
  4639. var startTime=(new Date()).getTime();
  4640. return function OSF_DDA_WAC_Delegate$OnAfterRegisterEvent(xdmStatus, payload) {
  4641. if (args.onReceiving) {
  4642. args.onReceiving();
  4643. }
  4644. var status;
  4645. if (xdmStatus !=Microsoft.Office.Common.InvokeResultCode.noError) {
  4646. switch (xdmStatus) {
  4647. case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:
  4648. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  4649. break;
  4650. default:
  4651. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4652. break;
  4653. }
  4654. }
  4655. else {
  4656. if (payload) {
  4657. if (payload["Error"]) {
  4658. status=payload["Error"];
  4659. }
  4660. else {
  4661. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  4662. }
  4663. }
  4664. else {
  4665. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4666. }
  4667. }
  4668. if (args.onComplete) {
  4669. args.onComplete(status);
  4670. }
  4671. if (OSF.AppTelemetry) {
  4672. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  4673. }
  4674. };
  4675. };
  4676. OSF.DDA.WAC.Delegate.registerEventAsync=function OSF_DDA_WAC_Delegate$RegisterEventAsync(args) {
  4677. if (args.onCalling) {
  4678. args.onCalling();
  4679. }
  4680. OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), function OSF_DDA_WACOMFacade$OnEvent(payload) {
  4681. if (args.onEvent) {
  4682. args.onEvent(payload);
  4683. }
  4684. if (OSF.AppTelemetry) {
  4685. OSF.AppTelemetry.onEventDone(args.dispId);
  4686. }
  4687. }, OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true, args), {
  4688. "controlId": OSF._OfficeAppFactory.getId(),
  4689. "eventDispId": args.dispId,
  4690. "targetId": args.targetId
  4691. });
  4692. };
  4693. OSF.DDA.WAC.Delegate.unregisterEventAsync=function OSF_DDA_WAC_Delegate$UnregisterEventAsync(args) {
  4694. if (args.onCalling) {
  4695. args.onCalling();
  4696. }
  4697. OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false, args), {
  4698. "controlId": OSF._OfficeAppFactory.getId(),
  4699. "eventDispId": args.dispId,
  4700. "targetId": args.targetId
  4701. });
  4702. };
  4703. OSF.OUtil.setNamespace("WebApp", OSF);
  4704. OSF.WebApp.AddHostInfoAndXdmInfo=function OSF_WebApp$AddHostInfoAndXdmInfo(url) {
  4705. if (OSF._OfficeAppFactory.getWindowLocationSearch && OSF._OfficeAppFactory.getWindowLocationHash) {
  4706. return url+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash();
  4707. }
  4708. else {
  4709. return url;
  4710. }
  4711. };
  4712. OSF.WebApp._UpdateLinksForHostAndXdmInfo=function OSF_WebApp$_UpdateLinksForHostAndXdmInfo() {
  4713. var links=document.querySelectorAll("a[data-officejs-navigate]");
  4714. for (var i=0; i < links.length; i++) {
  4715. if (OSF.WebApp._isGoodUrl(links[i].href)) {
  4716. links[i].href=OSF.WebApp.AddHostInfoAndXdmInfo(links[i].href);
  4717. }
  4718. }
  4719. var forms=document.querySelectorAll("form[data-officejs-navigate]");
  4720. for (var i=0; i < forms.length; i++) {
  4721. var form=forms[i];
  4722. if (OSF.WebApp._isGoodUrl(form.action)) {
  4723. form.action=OSF.WebApp.AddHostInfoAndXdmInfo(form.action);
  4724. }
  4725. }
  4726. };
  4727. OSF.WebApp._isGoodUrl=function OSF_WebApp$_isGoodUrl(url) {
  4728. if (typeof url=='undefined')
  4729. return false;
  4730. url=url.trim();
  4731. var colonIndex=url.indexOf(':');
  4732. var protocol=colonIndex > 0 ? url.substr(0, colonIndex) : null;
  4733. var goodUrl=protocol !==null ? protocol.toLowerCase()==="http" || protocol.toLowerCase()==="https" : true;
  4734. goodUrl=goodUrl && url !="#" && url !="/" && url !="" && url !=OSF._OfficeAppFactory.getWebAppState().webAppUrl;
  4735. return goodUrl;
  4736. };
  4737. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) {
  4738. this._hostInfo=hostInfo;
  4739. this._webAppState=webAppState;
  4740. this._context=context;
  4741. this._settings=settings;
  4742. this._hostFacade=hostFacade;
  4743. this._appContext={};
  4744. this._tabbableElements="a[href]:not([tabindex='-1']),"+"area[href]:not([tabindex='-1']),"+"button:not([disabled]):not([tabindex='-1']),"+"input:not([disabled]):not([tabindex='-1']),"+"select:not([disabled]):not([tabindex='-1']),"+"textarea:not([disabled]):not([tabindex='-1']),"+"*[tabindex]:not([tabindex='-1']),"+"*[contenteditable]:not([disabled]):not([tabindex='-1'])";
  4745. this._initializeSettings=function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) {
  4746. var settings;
  4747. var serializedSettings=appContext.get_settings();
  4748. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  4749. if (osfSessionStorage) {
  4750. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  4751. if (storageSettings) {
  4752. serializedSettings=JSON.parse(storageSettings);
  4753. }
  4754. else {
  4755. storageSettings=JSON.stringify(serializedSettings);
  4756. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  4757. }
  4758. }
  4759. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  4760. if (refreshSupported) {
  4761. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  4762. }
  4763. else {
  4764. settings=new OSF.DDA.Settings(deserializedSettings);
  4765. }
  4766. return settings;
  4767. };
  4768. var windowOpen=function OSF_InitializationHelper$windowOpen(windowObj) {
  4769. var proxy=window.open;
  4770. windowObj.open=function (strUrl, strWindowName, strWindowFeatures) {
  4771. var windowObject=null;
  4772. try {
  4773. windowObject=proxy(strUrl, strWindowName, strWindowFeatures);
  4774. }
  4775. catch (ex) {
  4776. if (OSF.AppTelemetry) {
  4777. OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+ex);
  4778. }
  4779. }
  4780. if (!windowObject) {
  4781. var params={
  4782. "strUrl": strUrl,
  4783. "strWindowName": strWindowName,
  4784. "strWindowFeatures": strWindowFeatures
  4785. };
  4786. OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost", null, params);
  4787. }
  4788. return windowObject;
  4789. };
  4790. };
  4791. windowOpen(window);
  4792. };
  4793. OSF.InitializationHelper.prototype.saveAndSetDialogInfo=function OSF_InitializationHelper$saveAndSetDialogInfo(hostInfoValue) {
  4794. var getAppIdFromWindowLocation=function OSF_InitializationHelper$getAppIdFromWindowLocation() {
  4795. var xdmInfoValue=OSF.OUtil.parseXdmInfo(true);
  4796. if (xdmInfoValue) {
  4797. var items=xdmInfoValue.split("|");
  4798. return items[1];
  4799. }
  4800. return null;
  4801. };
  4802. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  4803. if (osfSessionStorage) {
  4804. if (!hostInfoValue) {
  4805. hostInfoValue=OSF.OUtil.parseHostInfoFromWindowName(true, OSF._OfficeAppFactory.getWindowName());
  4806. }
  4807. if (hostInfoValue && hostInfoValue.indexOf("isDialog") > -1) {
  4808. var appId=getAppIdFromWindowLocation();
  4809. if (appId !=null) {
  4810. osfSessionStorage.setItem(appId+"IsDialog", "true");
  4811. }
  4812. }
  4813. this._hostInfo.isDialog=osfSessionStorage.getItem(OSF.OUtil.getXdmFieldValue(OSF.XdmFieldName.AppId, false)+"IsDialog") !=null ? true : false;
  4814. }
  4815. };
  4816. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
  4817. var me=this;
  4818. var getInvocationCallbackWebApp=function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(errorCode, appContext) {
  4819. var settings;
  4820. if (appContext._appName===OSF.AppName.ExcelWebApp) {
  4821. var serializedSettings=appContext._settings;
  4822. settings={};
  4823. for (var index in serializedSettings) {
  4824. var setting=serializedSettings[index];
  4825. settings[setting[0]]=setting[1];
  4826. }
  4827. }
  4828. else {
  4829. settings=appContext._settings;
  4830. }
  4831. if (errorCode===0 && appContext._id !=undefined && appContext._appName !=undefined && appContext._appVersion !=undefined && appContext._appUILocale !=undefined && appContext._dataLocale !=undefined &&
  4832. appContext._docUrl !=undefined && appContext._clientMode !=undefined && appContext._settings !=undefined && appContext._reason !=undefined) {
  4833. me._appContext=appContext;
  4834. var appInstanceId=(appContext._appInstanceId ? appContext._appInstanceId : appContext._id);
  4835. var touchEnabled=false;
  4836. var commerceAllowed=true;
  4837. var minorVersion=0;
  4838. if (appContext._appMinorVersion !=undefined) {
  4839. minorVersion=appContext._appMinorVersion;
  4840. }
  4841. var requirementMatrix=undefined;
  4842. if (appContext._requirementMatrix !=undefined) {
  4843. requirementMatrix=appContext._requirementMatrix;
  4844. }
  4845. var returnedContext=new OSF.OfficeAppContext(appContext._id, appContext._appName, appContext._appVersion, appContext._appUILocale, appContext._dataLocale, appContext._docUrl, appContext._clientMode, settings, appContext._reason, appContext._osfControlType, appContext._eToken, appContext._correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix, appContext._hostCustomMessage, appContext._hostFullVersion, appContext._clientWindowHeight, appContext._clientWindowWidth, appContext._addinName);
  4846. if (OSF.AppTelemetry) {
  4847. OSF.AppTelemetry.initialize(returnedContext);
  4848. }
  4849. gotAppContext(returnedContext);
  4850. }
  4851. else {
  4852. var errorMsg="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+errorCode+", exception: "+appContext;
  4853. if (OSF.AppTelemetry) {
  4854. OSF.AppTelemetry.logAppException(errorMsg);
  4855. }
  4856. throw errorMsg;
  4857. }
  4858. };
  4859. try {
  4860. if (this._hostInfo.isDialog && window.opener !=null) {
  4861. var appContext=OfficeExt.WACUtils.parseAppContextFromWindowName(false, OSF._OfficeAppFactory.getWindowName());
  4862. getInvocationCallbackWebApp(0, appContext);
  4863. }
  4864. else {
  4865. this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync", getInvocationCallbackWebApp, this._webAppState.id);
  4866. }
  4867. }
  4868. catch (ex) {
  4869. if (OSF.AppTelemetry) {
  4870. OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+ex+"]");
  4871. }
  4872. throw ex;
  4873. }
  4874. };
  4875. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() {
  4876. try {
  4877. var me=this;
  4878. var xdmInfoValue=OSF.OUtil.parseXdmInfoWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash());
  4879. if (!xdmInfoValue && OSF._OfficeAppFactory.getWindowName) {
  4880. xdmInfoValue=OSF.OUtil.parseXdmInfoFromWindowName(false, OSF._OfficeAppFactory.getWindowName());
  4881. }
  4882. if (xdmInfoValue) {
  4883. var xdmItems=OSF.OUtil.getInfoItems(xdmInfoValue);
  4884. if (xdmItems !=undefined && xdmItems.length >=3) {
  4885. me._webAppState.conversationID=xdmItems[0];
  4886. me._webAppState.id=xdmItems[1];
  4887. me._webAppState.webAppUrl=xdmItems[2].indexOf(":") >=0 ? xdmItems[2] : decodeURIComponent(xdmItems[2]);
  4888. }
  4889. }
  4890. me._webAppState.wnd=window.opener !=null ? window.opener : window.parent;
  4891. var serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash());
  4892. if (isNaN(serializerVersion) && OSF._OfficeAppFactory.getWindowName) {
  4893. serializerVersion=OSF.OUtil.parseSerializerVersionFromWindowName(false, OSF._OfficeAppFactory.getWindowName());
  4894. }
  4895. me._webAppState.serializerVersion=serializerVersion;
  4896. me._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(me._webAppState.conversationID, me._webAppState.wnd, me._webAppState.webAppUrl, me._webAppState.serializerVersion);
  4897. me._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(me._webAppState.id);
  4898. var notificationConversationId=me._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;
  4899. me._webAppState.serviceEndPoint.registerConversation(notificationConversationId, me._webAppState.webAppUrl);
  4900. if (this._hostInfo.isDialog && window.opener !=null) {
  4901. return;
  4902. }
  4903. var notifyAgave=function OSF__OfficeAppFactory_initialize$notifyAgave(actionId) {
  4904. switch (actionId) {
  4905. case OSF.AgaveHostAction.Select:
  4906. me._webAppState.focused=true;
  4907. break;
  4908. case OSF.AgaveHostAction.UnSelect:
  4909. me._webAppState.focused=false;
  4910. break;
  4911. case OSF.AgaveHostAction.TabIn:
  4912. case OSF.AgaveHostAction.CtrlF6In:
  4913. window.focus();
  4914. var list=document.querySelectorAll(me._tabbableElements);
  4915. var focused=OSF.OUtil.focusToFirstTabbable(list, false);
  4916. if (!focused) {
  4917. window.blur();
  4918. me._webAppState.focused=false;
  4919. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.ExitNoFocusable]);
  4920. }
  4921. break;
  4922. case OSF.AgaveHostAction.TabInShift:
  4923. window.focus();
  4924. var list=document.querySelectorAll(me._tabbableElements);
  4925. var focused=OSF.OUtil.focusToFirstTabbable(list, true);
  4926. if (!focused) {
  4927. window.blur();
  4928. me._webAppState.focused=false;
  4929. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.ExitNoFocusableShift]);
  4930. }
  4931. break;
  4932. default:
  4933. OsfMsAjaxFactory.msAjaxDebug.trace("actionId "+actionId+" notifyAgave is wrong.");
  4934. break;
  4935. }
  4936. };
  4937. me._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave", notifyAgave, Microsoft.Office.Common.InvokeType.async, false);
  4938. OSF.OUtil.addEventListener(window, "focus", function () {
  4939. if (!me._webAppState.focused) {
  4940. me._webAppState.focused=true;
  4941. }
  4942. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.Select]);
  4943. });
  4944. OSF.OUtil.addEventListener(window, "blur", function () {
  4945. if (me._webAppState.focused) {
  4946. me._webAppState.focused=false;
  4947. }
  4948. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.UnSelect]);
  4949. });
  4950. OSF.OUtil.addEventListener(window, "keydown", function (e) {
  4951. e.preventDefault=e.preventDefault || function () {
  4952. e.returnValue=false;
  4953. };
  4954. if (e.keyCode==117 && (e.ctrlKey || e.metaKey)) {
  4955. var actionId=OSF.AgaveHostAction.CtrlF6Exit;
  4956. if (e.shiftKey) {
  4957. actionId=OSF.AgaveHostAction.CtrlF6ExitShift;
  4958. }
  4959. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, actionId]);
  4960. }
  4961. else if (e.keyCode==9) {
  4962. e.preventDefault();
  4963. var allTabbableElements=document.querySelectorAll(me._tabbableElements);
  4964. var focused=OSF.OUtil.focusToNextTabbable(allTabbableElements, e.target || e.srcElement, e.shiftKey);
  4965. if (!focused) {
  4966. if (me._hostInfo.isDialog) {
  4967. OSF.OUtil.focusToFirstTabbable(allTabbableElements, e.shiftKey);
  4968. }
  4969. else {
  4970. if (e.shiftKey) {
  4971. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.TabExitShift]);
  4972. }
  4973. else {
  4974. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.TabExit]);
  4975. }
  4976. }
  4977. }
  4978. }
  4979. else if (e.keyCode==27) {
  4980. e.preventDefault();
  4981. me.dismissDialogNotification && me.dismissDialogNotification();
  4982. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.EscExit]);
  4983. }
  4984. else if (e.keyCode==113) {
  4985. e.preventDefault();
  4986. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.F2Exit]);
  4987. }
  4988. });
  4989. OSF.OUtil.addEventListener(window, "keypress", function (e) {
  4990. if (e.keyCode==117 && e.ctrlKey) {
  4991. if (e.preventDefault) {
  4992. e.preventDefault();
  4993. }
  4994. else {
  4995. e.returnValue=false;
  4996. }
  4997. }
  4998. });
  4999. }
  5000. catch (ex) {
  5001. if (OSF.AppTelemetry) {
  5002. OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+ex+"]");
  5003. }
  5004. throw ex;
  5005. }
  5006. };
  5007. OSF.InitializationHelper.prototype.initWebDialog=function OSF_InitializationHelper$initWebDialog(appContext) {
  5008. if (appContext.get_isDialog()) {
  5009. if (OSF.DDA.UI.ChildUI) {
  5010. appContext.ui=new OSF.DDA.UI.ChildUI();
  5011. if (window.opener !=null) {
  5012. this.registerMessageReceivedEventForWindowDialog && this.registerMessageReceivedEventForWindowDialog();
  5013. }
  5014. }
  5015. }
  5016. else {
  5017. if (OSF.DDA.UI.ParentUI) {
  5018. appContext.ui=new OSF.DDA.UI.ParentUI();
  5019. if (OfficeExt.Container) {
  5020. OSF.DDA.DispIdHost.addAsyncMethods(appContext.ui, [OSF.DDA.AsyncMethodNames.CloseContainerAsync]);
  5021. }
  5022. }
  5023. }
  5024. };
  5025. OSF.getClientEndPoint=function OSF$getClientEndPoint() {
  5026. var initializationHelper=OSF._OfficeAppFactory.getInitializationHelper();
  5027. return initializationHelper._webAppState.clientEndPoint;
  5028. };
  5029. OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function OSF_InitializationHelper$prepareRightAfterWebExtensionInitialize() {
  5030. if (this._hostInfo.isDialog) {
  5031. window.focus();
  5032. var list=document.querySelectorAll(this._tabbableElements);
  5033. var focused=OSF.OUtil.focusToFirstTabbable(list, false);
  5034. if (!focused) {
  5035. window.blur();
  5036. this._webAppState.focused=false;
  5037. this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [this._webAppState.id, OSF.AgaveHostAction.ExitNoFocusable]);
  5038. }
  5039. }
  5040. };
  5041. OSF.CommonUI={
  5042. HostButtonBorderColor: "#86bfa0",
  5043. HostButtonBackgroundColor: "#d3f0e0"
  5044. };
  5045. var OSFLog;
  5046. (function (OSFLog) {
  5047. var BaseUsageData=(function () {
  5048. function BaseUsageData(table) {
  5049. this._table=table;
  5050. this._fields={};
  5051. }
  5052. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  5053. get: function () {
  5054. return this._fields;
  5055. },
  5056. enumerable: true,
  5057. configurable: true
  5058. });
  5059. Object.defineProperty(BaseUsageData.prototype, "Table", {
  5060. get: function () {
  5061. return this._table;
  5062. },
  5063. enumerable: true,
  5064. configurable: true
  5065. });
  5066. BaseUsageData.prototype.SerializeFields=function () {
  5067. };
  5068. BaseUsageData.prototype.SetSerializedField=function (key, value) {
  5069. if (typeof (value) !=="undefined" && value !==null) {
  5070. this._serializedFields[key]=value.toString();
  5071. }
  5072. };
  5073. BaseUsageData.prototype.SerializeRow=function () {
  5074. this._serializedFields={};
  5075. this.SetSerializedField("Table", this._table);
  5076. this.SerializeFields();
  5077. return JSON.stringify(this._serializedFields);
  5078. };
  5079. return BaseUsageData;
  5080. })();
  5081. OSFLog.BaseUsageData=BaseUsageData;
  5082. var AppActivatedUsageData=(function (_super) {
  5083. __extends(AppActivatedUsageData, _super);
  5084. function AppActivatedUsageData() {
  5085. _super.call(this, "AppActivated");
  5086. }
  5087. Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", {
  5088. get: function () { return this.Fields["CorrelationId"]; },
  5089. set: function (value) { this.Fields["CorrelationId"]=value; },
  5090. enumerable: true,
  5091. configurable: true
  5092. });
  5093. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  5094. get: function () { return this.Fields["SessionId"]; },
  5095. set: function (value) { this.Fields["SessionId"]=value; },
  5096. enumerable: true,
  5097. configurable: true
  5098. });
  5099. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  5100. get: function () { return this.Fields["AppId"]; },
  5101. set: function (value) { this.Fields["AppId"]=value; },
  5102. enumerable: true,
  5103. configurable: true
  5104. });
  5105. Object.defineProperty(AppActivatedUsageData.prototype, "AppInstanceId", {
  5106. get: function () { return this.Fields["AppInstanceId"]; },
  5107. set: function (value) { this.Fields["AppInstanceId"]=value; },
  5108. enumerable: true,
  5109. configurable: true
  5110. });
  5111. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  5112. get: function () { return this.Fields["AppURL"]; },
  5113. set: function (value) { this.Fields["AppURL"]=value; },
  5114. enumerable: true,
  5115. configurable: true
  5116. });
  5117. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  5118. get: function () { return this.Fields["AssetId"]; },
  5119. set: function (value) { this.Fields["AssetId"]=value; },
  5120. enumerable: true,
  5121. configurable: true
  5122. });
  5123. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  5124. get: function () { return this.Fields["Browser"]; },
  5125. set: function (value) { this.Fields["Browser"]=value; },
  5126. enumerable: true,
  5127. configurable: true
  5128. });
  5129. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  5130. get: function () { return this.Fields["UserId"]; },
  5131. set: function (value) { this.Fields["UserId"]=value; },
  5132. enumerable: true,
  5133. configurable: true
  5134. });
  5135. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  5136. get: function () { return this.Fields["Host"]; },
  5137. set: function (value) { this.Fields["Host"]=value; },
  5138. enumerable: true,
  5139. configurable: true
  5140. });
  5141. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  5142. get: function () { return this.Fields["HostVersion"]; },
  5143. set: function (value) { this.Fields["HostVersion"]=value; },
  5144. enumerable: true,
  5145. configurable: true
  5146. });
  5147. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  5148. get: function () { return this.Fields["ClientId"]; },
  5149. set: function (value) { this.Fields["ClientId"]=value; },
  5150. enumerable: true,
  5151. configurable: true
  5152. });
  5153. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  5154. get: function () { return this.Fields["AppSizeWidth"]; },
  5155. set: function (value) { this.Fields["AppSizeWidth"]=value; },
  5156. enumerable: true,
  5157. configurable: true
  5158. });
  5159. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  5160. get: function () { return this.Fields["AppSizeHeight"]; },
  5161. set: function (value) { this.Fields["AppSizeHeight"]=value; },
  5162. enumerable: true,
  5163. configurable: true
  5164. });
  5165. Object.defineProperty(AppActivatedUsageData.prototype, "Message", {
  5166. get: function () { return this.Fields["Message"]; },
  5167. set: function (value) { this.Fields["Message"]=value; },
  5168. enumerable: true,
  5169. configurable: true
  5170. });
  5171. Object.defineProperty(AppActivatedUsageData.prototype, "DocUrl", {
  5172. get: function () { return this.Fields["DocUrl"]; },
  5173. set: function (value) { this.Fields["DocUrl"]=value; },
  5174. enumerable: true,
  5175. configurable: true
  5176. });
  5177. Object.defineProperty(AppActivatedUsageData.prototype, "OfficeJSVersion", {
  5178. get: function () { return this.Fields["OfficeJSVersion"]; },
  5179. set: function (value) { this.Fields["OfficeJSVersion"]=value; },
  5180. enumerable: true,
  5181. configurable: true
  5182. });
  5183. Object.defineProperty(AppActivatedUsageData.prototype, "HostJSVersion", {
  5184. get: function () { return this.Fields["HostJSVersion"]; },
  5185. set: function (value) { this.Fields["HostJSVersion"]=value; },
  5186. enumerable: true,
  5187. configurable: true
  5188. });
  5189. AppActivatedUsageData.prototype.SerializeFields=function () {
  5190. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5191. this.SetSerializedField("SessionId", this.SessionId);
  5192. this.SetSerializedField("AppId", this.AppId);
  5193. this.SetSerializedField("AppInstanceId", this.AppInstanceId);
  5194. this.SetSerializedField("AppURL", this.AppURL);
  5195. this.SetSerializedField("AssetId", this.AssetId);
  5196. this.SetSerializedField("Browser", this.Browser);
  5197. this.SetSerializedField("UserId", this.UserId);
  5198. this.SetSerializedField("Host", this.Host);
  5199. this.SetSerializedField("HostVersion", this.HostVersion);
  5200. this.SetSerializedField("ClientId", this.ClientId);
  5201. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);
  5202. this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  5203. this.SetSerializedField("Message", this.Message);
  5204. this.SetSerializedField("DocUrl", this.DocUrl);
  5205. this.SetSerializedField("OfficeJSVersion", this.OfficeJSVersion);
  5206. this.SetSerializedField("HostJSVersion", this.HostJSVersion);
  5207. };
  5208. return AppActivatedUsageData;
  5209. })(BaseUsageData);
  5210. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  5211. var ScriptLoadUsageData=(function (_super) {
  5212. __extends(ScriptLoadUsageData, _super);
  5213. function ScriptLoadUsageData() {
  5214. _super.call(this, "ScriptLoad");
  5215. }
  5216. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  5217. get: function () { return this.Fields["CorrelationId"]; },
  5218. set: function (value) { this.Fields["CorrelationId"]=value; },
  5219. enumerable: true,
  5220. configurable: true
  5221. });
  5222. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  5223. get: function () { return this.Fields["SessionId"]; },
  5224. set: function (value) { this.Fields["SessionId"]=value; },
  5225. enumerable: true,
  5226. configurable: true
  5227. });
  5228. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  5229. get: function () { return this.Fields["ScriptId"]; },
  5230. set: function (value) { this.Fields["ScriptId"]=value; },
  5231. enumerable: true,
  5232. configurable: true
  5233. });
  5234. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  5235. get: function () { return this.Fields["StartTime"]; },
  5236. set: function (value) { this.Fields["StartTime"]=value; },
  5237. enumerable: true,
  5238. configurable: true
  5239. });
  5240. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  5241. get: function () { return this.Fields["ResponseTime"]; },
  5242. set: function (value) { this.Fields["ResponseTime"]=value; },
  5243. enumerable: true,
  5244. configurable: true
  5245. });
  5246. ScriptLoadUsageData.prototype.SerializeFields=function () {
  5247. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5248. this.SetSerializedField("SessionId", this.SessionId);
  5249. this.SetSerializedField("ScriptId", this.ScriptId);
  5250. this.SetSerializedField("StartTime", this.StartTime);
  5251. this.SetSerializedField("ResponseTime", this.ResponseTime);
  5252. };
  5253. return ScriptLoadUsageData;
  5254. })(BaseUsageData);
  5255. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  5256. var AppClosedUsageData=(function (_super) {
  5257. __extends(AppClosedUsageData, _super);
  5258. function AppClosedUsageData() {
  5259. _super.call(this, "AppClosed");
  5260. }
  5261. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  5262. get: function () { return this.Fields["CorrelationId"]; },
  5263. set: function (value) { this.Fields["CorrelationId"]=value; },
  5264. enumerable: true,
  5265. configurable: true
  5266. });
  5267. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  5268. get: function () { return this.Fields["SessionId"]; },
  5269. set: function (value) { this.Fields["SessionId"]=value; },
  5270. enumerable: true,
  5271. configurable: true
  5272. });
  5273. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  5274. get: function () { return this.Fields["FocusTime"]; },
  5275. set: function (value) { this.Fields["FocusTime"]=value; },
  5276. enumerable: true,
  5277. configurable: true
  5278. });
  5279. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  5280. get: function () { return this.Fields["AppSizeFinalWidth"]; },
  5281. set: function (value) { this.Fields["AppSizeFinalWidth"]=value; },
  5282. enumerable: true,
  5283. configurable: true
  5284. });
  5285. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  5286. get: function () { return this.Fields["AppSizeFinalHeight"]; },
  5287. set: function (value) { this.Fields["AppSizeFinalHeight"]=value; },
  5288. enumerable: true,
  5289. configurable: true
  5290. });
  5291. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  5292. get: function () { return this.Fields["OpenTime"]; },
  5293. set: function (value) { this.Fields["OpenTime"]=value; },
  5294. enumerable: true,
  5295. configurable: true
  5296. });
  5297. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  5298. get: function () { return this.Fields["CloseMethod"]; },
  5299. set: function (value) { this.Fields["CloseMethod"]=value; },
  5300. enumerable: true,
  5301. configurable: true
  5302. });
  5303. AppClosedUsageData.prototype.SerializeFields=function () {
  5304. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5305. this.SetSerializedField("SessionId", this.SessionId);
  5306. this.SetSerializedField("FocusTime", this.FocusTime);
  5307. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  5308. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  5309. this.SetSerializedField("OpenTime", this.OpenTime);
  5310. this.SetSerializedField("CloseMethod", this.CloseMethod);
  5311. };
  5312. return AppClosedUsageData;
  5313. })(BaseUsageData);
  5314. OSFLog.AppClosedUsageData=AppClosedUsageData;
  5315. var APIUsageUsageData=(function (_super) {
  5316. __extends(APIUsageUsageData, _super);
  5317. function APIUsageUsageData() {
  5318. _super.call(this, "APIUsage");
  5319. }
  5320. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  5321. get: function () { return this.Fields["CorrelationId"]; },
  5322. set: function (value) { this.Fields["CorrelationId"]=value; },
  5323. enumerable: true,
  5324. configurable: true
  5325. });
  5326. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  5327. get: function () { return this.Fields["SessionId"]; },
  5328. set: function (value) { this.Fields["SessionId"]=value; },
  5329. enumerable: true,
  5330. configurable: true
  5331. });
  5332. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  5333. get: function () { return this.Fields["APIType"]; },
  5334. set: function (value) { this.Fields["APIType"]=value; },
  5335. enumerable: true,
  5336. configurable: true
  5337. });
  5338. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  5339. get: function () { return this.Fields["APIID"]; },
  5340. set: function (value) { this.Fields["APIID"]=value; },
  5341. enumerable: true,
  5342. configurable: true
  5343. });
  5344. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  5345. get: function () { return this.Fields["Parameters"]; },
  5346. set: function (value) { this.Fields["Parameters"]=value; },
  5347. enumerable: true,
  5348. configurable: true
  5349. });
  5350. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  5351. get: function () { return this.Fields["ResponseTime"]; },
  5352. set: function (value) { this.Fields["ResponseTime"]=value; },
  5353. enumerable: true,
  5354. configurable: true
  5355. });
  5356. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  5357. get: function () { return this.Fields["ErrorType"]; },
  5358. set: function (value) { this.Fields["ErrorType"]=value; },
  5359. enumerable: true,
  5360. configurable: true
  5361. });
  5362. APIUsageUsageData.prototype.SerializeFields=function () {
  5363. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5364. this.SetSerializedField("SessionId", this.SessionId);
  5365. this.SetSerializedField("APIType", this.APIType);
  5366. this.SetSerializedField("APIID", this.APIID);
  5367. this.SetSerializedField("Parameters", this.Parameters);
  5368. this.SetSerializedField("ResponseTime", this.ResponseTime);
  5369. this.SetSerializedField("ErrorType", this.ErrorType);
  5370. };
  5371. return APIUsageUsageData;
  5372. })(BaseUsageData);
  5373. OSFLog.APIUsageUsageData=APIUsageUsageData;
  5374. var AppInitializationUsageData=(function (_super) {
  5375. __extends(AppInitializationUsageData, _super);
  5376. function AppInitializationUsageData() {
  5377. _super.call(this, "AppInitialization");
  5378. }
  5379. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  5380. get: function () { return this.Fields["CorrelationId"]; },
  5381. set: function (value) { this.Fields["CorrelationId"]=value; },
  5382. enumerable: true,
  5383. configurable: true
  5384. });
  5385. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  5386. get: function () { return this.Fields["SessionId"]; },
  5387. set: function (value) { this.Fields["SessionId"]=value; },
  5388. enumerable: true,
  5389. configurable: true
  5390. });
  5391. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  5392. get: function () { return this.Fields["SuccessCode"]; },
  5393. set: function (value) { this.Fields["SuccessCode"]=value; },
  5394. enumerable: true,
  5395. configurable: true
  5396. });
  5397. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  5398. get: function () { return this.Fields["Message"]; },
  5399. set: function (value) { this.Fields["Message"]=value; },
  5400. enumerable: true,
  5401. configurable: true
  5402. });
  5403. AppInitializationUsageData.prototype.SerializeFields=function () {
  5404. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5405. this.SetSerializedField("SessionId", this.SessionId);
  5406. this.SetSerializedField("SuccessCode", this.SuccessCode);
  5407. this.SetSerializedField("Message", this.Message);
  5408. };
  5409. return AppInitializationUsageData;
  5410. })(BaseUsageData);
  5411. OSFLog.AppInitializationUsageData=AppInitializationUsageData;
  5412. })(OSFLog || (OSFLog={}));
  5413. var Logger;
  5414. (function (Logger) {
  5415. "use strict";
  5416. (function (TraceLevel) {
  5417. TraceLevel[TraceLevel["info"]=0]="info";
  5418. TraceLevel[TraceLevel["warning"]=1]="warning";
  5419. TraceLevel[TraceLevel["error"]=2]="error";
  5420. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  5421. var TraceLevel=Logger.TraceLevel;
  5422. (function (SendFlag) {
  5423. SendFlag[SendFlag["none"]=0]="none";
  5424. SendFlag[SendFlag["flush"]=1]="flush";
  5425. })(Logger.SendFlag || (Logger.SendFlag={}));
  5426. var SendFlag=Logger.SendFlag;
  5427. function allowUploadingData() {
  5428. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  5429. OSF.Logger.ulsEndpoint.loadProxyFrame();
  5430. }
  5431. }
  5432. Logger.allowUploadingData=allowUploadingData;
  5433. function sendLog(traceLevel, message, flag) {
  5434. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  5435. var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  5436. var logs=JSON.stringify(jsonObj);
  5437. OSF.Logger.ulsEndpoint.writeLog(logs);
  5438. }
  5439. }
  5440. Logger.sendLog=sendLog;
  5441. function creatULSEndpoint() {
  5442. try {
  5443. return new ULSEndpointProxy();
  5444. }
  5445. catch (e) {
  5446. return null;
  5447. }
  5448. }
  5449. var ULSEndpointProxy=(function () {
  5450. function ULSEndpointProxy() {
  5451. var _this=this;
  5452. this.proxyFrame=null;
  5453. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  5454. this.buffer=[];
  5455. this.proxyFrameReady=false;
  5456. OSF.OUtil.addEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  5457. setTimeout(function () {
  5458. _this.loadProxyFrame();
  5459. }, 3000);
  5460. }
  5461. ULSEndpointProxy.prototype.writeLog=function (log) {
  5462. if (this.proxyFrameReady===true) {
  5463. this.proxyFrame.contentWindow.postMessage(log, ULSEndpointProxy.telemetryOrigin);
  5464. }
  5465. else {
  5466. if (this.buffer.length < 128) {
  5467. this.buffer.push(log);
  5468. }
  5469. }
  5470. };
  5471. ULSEndpointProxy.prototype.loadProxyFrame=function () {
  5472. if (this.proxyFrame==null) {
  5473. this.proxyFrame=document.createElement("iframe");
  5474. this.proxyFrame.setAttribute("style", "display:none");
  5475. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  5476. document.head.appendChild(this.proxyFrame);
  5477. }
  5478. };
  5479. ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) {
  5480. var _this=this;
  5481. if (e.data==="ProxyFrameReadyToLog") {
  5482. this.proxyFrameReady=true;
  5483. for (var i=0; i < this.buffer.length; i++) {
  5484. this.writeLog(this.buffer[i]);
  5485. }
  5486. this.buffer.length=0;
  5487. OSF.OUtil.removeEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  5488. }
  5489. else if (e.data==="ProxyFrameReadyToInit") {
  5490. var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  5491. var initStr=JSON.stringify(initJson);
  5492. this.proxyFrame.contentWindow.postMessage(initStr, ULSEndpointProxy.telemetryOrigin);
  5493. }
  5494. };
  5495. ULSEndpointProxy.telemetryOrigin="https://telemetryservice.firstpartyapps.oaspapps.com";
  5496. return ULSEndpointProxy;
  5497. })();
  5498. if (!OSF.Logger) {
  5499. OSF.Logger=Logger;
  5500. }
  5501. Logger.ulsEndpoint=creatULSEndpoint();
  5502. })(Logger || (Logger={}));
  5503. var OSFAppTelemetry;
  5504. (function (OSFAppTelemetry) {
  5505. "use strict";
  5506. var appInfo;
  5507. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  5508. var osfControlAppCorrelationId="";
  5509. var omexDomainRegex=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/", "i");
  5510. ;
  5511. var AppInfo=(function () {
  5512. function AppInfo() {
  5513. }
  5514. return AppInfo;
  5515. })();
  5516. var Event=(function () {
  5517. function Event(name, handler) {
  5518. this.name=name;
  5519. this.handler=handler;
  5520. }
  5521. return Event;
  5522. })();
  5523. var AppStorage=(function () {
  5524. function AppStorage() {
  5525. this.clientIDKey="Office API client";
  5526. this.logIdSetKey="Office App Log Id Set";
  5527. }
  5528. AppStorage.prototype.getClientId=function () {
  5529. var clientId=this.getValue(this.clientIDKey);
  5530. if (!clientId || clientId.length <=0 || clientId.length > 40) {
  5531. clientId=OSF.OUtil.Guid.generateNewGuid();
  5532. this.setValue(this.clientIDKey, clientId);
  5533. }
  5534. return clientId;
  5535. };
  5536. AppStorage.prototype.saveLog=function (logId, log) {
  5537. var logIdSet=this.getValue(this.logIdSetKey);
  5538. logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId;
  5539. this.setValue(this.logIdSetKey, logIdSet);
  5540. this.setValue(logId, log);
  5541. };
  5542. AppStorage.prototype.enumerateLog=function (callback, clean) {
  5543. var logIdSet=this.getValue(this.logIdSetKey);
  5544. if (logIdSet) {
  5545. var ids=logIdSet.split(";");
  5546. for (var id in ids) {
  5547. var logId=ids[id];
  5548. var log=this.getValue(logId);
  5549. if (log) {
  5550. if (callback) {
  5551. callback(logId, log);
  5552. }
  5553. if (clean) {
  5554. this.remove(logId);
  5555. }
  5556. }
  5557. }
  5558. if (clean) {
  5559. this.remove(this.logIdSetKey);
  5560. }
  5561. }
  5562. };
  5563. AppStorage.prototype.getValue=function (key) {
  5564. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5565. var value="";
  5566. if (osfLocalStorage) {
  5567. value=osfLocalStorage.getItem(key);
  5568. }
  5569. return value;
  5570. };
  5571. AppStorage.prototype.setValue=function (key, value) {
  5572. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5573. if (osfLocalStorage) {
  5574. osfLocalStorage.setItem(key, value);
  5575. }
  5576. };
  5577. AppStorage.prototype.remove=function (key) {
  5578. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5579. if (osfLocalStorage) {
  5580. try {
  5581. osfLocalStorage.removeItem(key);
  5582. }
  5583. catch (ex) {
  5584. }
  5585. }
  5586. };
  5587. return AppStorage;
  5588. })();
  5589. var AppLogger=(function () {
  5590. function AppLogger() {
  5591. }
  5592. AppLogger.prototype.LogData=function (data) {
  5593. if (!OSF.Logger) {
  5594. return;
  5595. }
  5596. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  5597. };
  5598. AppLogger.prototype.LogRawData=function (log) {
  5599. if (!OSF.Logger) {
  5600. return;
  5601. }
  5602. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  5603. };
  5604. return AppLogger;
  5605. })();
  5606. function initialize(context) {
  5607. if (!OSF.Logger) {
  5608. return;
  5609. }
  5610. if (appInfo) {
  5611. return;
  5612. }
  5613. appInfo=new AppInfo();
  5614. if (context.get_hostFullVersion()) {
  5615. appInfo.hostVersion=context.get_hostFullVersion();
  5616. }
  5617. else {
  5618. appInfo.hostVersion=context.get_appVersion();
  5619. }
  5620. appInfo.appId=context.get_id();
  5621. appInfo.host=context.get_appName();
  5622. appInfo.browser=window.navigator.userAgent;
  5623. appInfo.correlationId=context.get_correlationId();
  5624. appInfo.clientId=(new AppStorage()).getClientId();
  5625. appInfo.appInstanceId=context.get_appInstanceId();
  5626. if (appInfo.appInstanceId) {
  5627. appInfo.appInstanceId=appInfo.appInstanceId.replace(/[{}]/g, "").toLowerCase();
  5628. }
  5629. appInfo.message=context.get_hostCustomMessage();
  5630. appInfo.officeJSVersion=OSF.ConstantNames.FileVersion;
  5631. appInfo.hostJSVersion="16.0.7526.1000";
  5632. var docUrl=context.get_docUrl();
  5633. appInfo.docUrl=omexDomainRegex.test(docUrl) ? docUrl : "";
  5634. var url=location.href;
  5635. if (url) {
  5636. url=url.split("?")[0].split("#")[0];
  5637. }
  5638. appInfo.appURL=url;
  5639. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  5640. var xmlContent;
  5641. var parser;
  5642. var xmlDoc;
  5643. appInfo.assetId="";
  5644. appInfo.userId="";
  5645. try {
  5646. xmlContent=decodeURIComponent(token);
  5647. parser=new DOMParser();
  5648. xmlDoc=parser.parseFromString(xmlContent, "text/xml");
  5649. var cidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid");
  5650. var oidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("oid");
  5651. if (cidNode && cidNode.nodeValue) {
  5652. appInfo.userId=cidNode.nodeValue;
  5653. }
  5654. else if (oidNode && oidNode.nodeValue) {
  5655. appInfo.userId=oidNode.nodeValue;
  5656. }
  5657. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  5658. }
  5659. catch (e) {
  5660. }
  5661. finally {
  5662. xmlContent=null;
  5663. xmlDoc=null;
  5664. parser=null;
  5665. }
  5666. })(context.get_eToken(), appInfo);
  5667. (function handleLifecycle() {
  5668. var startTime=new Date();
  5669. var lastFocus=null;
  5670. var focusTime=0;
  5671. var finished=false;
  5672. var adjustFocusTime=function () {
  5673. if (document.hasFocus()) {
  5674. if (lastFocus==null) {
  5675. lastFocus=new Date();
  5676. }
  5677. }
  5678. else if (lastFocus) {
  5679. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  5680. lastFocus=null;
  5681. }
  5682. };
  5683. var eventList=[];
  5684. eventList.push(new Event("focus", adjustFocusTime));
  5685. eventList.push(new Event("blur", adjustFocusTime));
  5686. eventList.push(new Event("focusout", adjustFocusTime));
  5687. eventList.push(new Event("focusin", adjustFocusTime));
  5688. var exitFunction=function () {
  5689. for (var i=0; i < eventList.length; i++) {
  5690. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  5691. }
  5692. eventList.length=0;
  5693. if (!finished) {
  5694. if (document.hasFocus() && lastFocus) {
  5695. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  5696. lastFocus=null;
  5697. }
  5698. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  5699. finished=true;
  5700. }
  5701. };
  5702. eventList.push(new Event("beforeunload", exitFunction));
  5703. eventList.push(new Event("unload", exitFunction));
  5704. for (var i=0; i < eventList.length; i++) {
  5705. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  5706. }
  5707. adjustFocusTime();
  5708. })();
  5709. OSFAppTelemetry.onAppActivated();
  5710. }
  5711. OSFAppTelemetry.initialize=initialize;
  5712. function onAppActivated() {
  5713. if (!appInfo) {
  5714. return;
  5715. }
  5716. (new AppStorage()).enumerateLog(function (id, log) { return (new AppLogger()).LogRawData(log); }, true);
  5717. var data=new OSFLog.AppActivatedUsageData();
  5718. data.SessionId=sessionId;
  5719. data.AppId=appInfo.appId;
  5720. data.AssetId=appInfo.assetId;
  5721. data.AppURL=appInfo.appURL;
  5722. data.UserId=appInfo.userId;
  5723. data.ClientId=appInfo.clientId;
  5724. data.Browser=appInfo.browser;
  5725. data.Host=appInfo.host;
  5726. data.HostVersion=appInfo.hostVersion;
  5727. data.CorrelationId=appInfo.correlationId;
  5728. data.AppSizeWidth=window.innerWidth;
  5729. data.AppSizeHeight=window.innerHeight;
  5730. data.AppInstanceId=appInfo.appInstanceId;
  5731. data.Message=appInfo.message;
  5732. data.DocUrl=appInfo.docUrl;
  5733. data.OfficeJSVersion=appInfo.officeJSVersion;
  5734. data.HostJSVersion=appInfo.hostJSVersion;
  5735. (new AppLogger()).LogData(data);
  5736. setTimeout(function () {
  5737. if (!OSF.Logger) {
  5738. return;
  5739. }
  5740. OSF.Logger.allowUploadingData();
  5741. }, 100);
  5742. }
  5743. OSFAppTelemetry.onAppActivated=onAppActivated;
  5744. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  5745. var data=new OSFLog.ScriptLoadUsageData();
  5746. data.CorrelationId=appCorrelationId;
  5747. data.SessionId=sessionId;
  5748. data.ScriptId=scriptId;
  5749. data.StartTime=msStartTime;
  5750. data.ResponseTime=msResponseTime;
  5751. (new AppLogger()).LogData(data);
  5752. }
  5753. OSFAppTelemetry.onScriptDone=onScriptDone;
  5754. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  5755. if (!appInfo) {
  5756. return;
  5757. }
  5758. var data=new OSFLog.APIUsageUsageData();
  5759. data.CorrelationId=osfControlAppCorrelationId;
  5760. data.SessionId=sessionId;
  5761. data.APIType=apiType;
  5762. data.APIID=id;
  5763. data.Parameters=parameters;
  5764. data.ResponseTime=msResponseTime;
  5765. data.ErrorType=errorType;
  5766. (new AppLogger()).LogData(data);
  5767. }
  5768. OSFAppTelemetry.onCallDone=onCallDone;
  5769. ;
  5770. function onMethodDone(id, args, msResponseTime, errorType) {
  5771. var parameters=null;
  5772. if (args) {
  5773. if (typeof args=="number") {
  5774. parameters=String(args);
  5775. }
  5776. else if (typeof args==="object") {
  5777. for (var index in args) {
  5778. if (parameters !==null) {
  5779. parameters+=",";
  5780. }
  5781. else {
  5782. parameters="";
  5783. }
  5784. if (typeof args[index]=="number") {
  5785. parameters+=String(args[index]);
  5786. }
  5787. }
  5788. }
  5789. else {
  5790. parameters="";
  5791. }
  5792. }
  5793. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  5794. }
  5795. OSFAppTelemetry.onMethodDone=onMethodDone;
  5796. function onPropertyDone(propertyName, msResponseTime) {
  5797. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  5798. }
  5799. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  5800. function onEventDone(id, errorType) {
  5801. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  5802. }
  5803. OSFAppTelemetry.onEventDone=onEventDone;
  5804. function onRegisterDone(register, id, msResponseTime, errorType) {
  5805. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  5806. }
  5807. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  5808. function onAppClosed(openTime, focusTime) {
  5809. if (!appInfo) {
  5810. return;
  5811. }
  5812. var data=new OSFLog.AppClosedUsageData();
  5813. data.CorrelationId=osfControlAppCorrelationId;
  5814. data.SessionId=sessionId;
  5815. data.FocusTime=focusTime;
  5816. data.OpenTime=openTime;
  5817. data.AppSizeFinalWidth=window.innerWidth;
  5818. data.AppSizeFinalHeight=window.innerHeight;
  5819. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  5820. }
  5821. OSFAppTelemetry.onAppClosed=onAppClosed;
  5822. function setOsfControlAppCorrelationId(correlationId) {
  5823. osfControlAppCorrelationId=correlationId;
  5824. }
  5825. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  5826. function doAppInitializationLogging(isException, message) {
  5827. var data=new OSFLog.AppInitializationUsageData();
  5828. data.CorrelationId=osfControlAppCorrelationId;
  5829. data.SessionId=sessionId;
  5830. data.SuccessCode=isException ? 1 : 0;
  5831. data.Message=message;
  5832. (new AppLogger()).LogData(data);
  5833. }
  5834. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  5835. function logAppCommonMessage(message) {
  5836. doAppInitializationLogging(false, message);
  5837. }
  5838. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  5839. function logAppException(errorMessage) {
  5840. doAppInitializationLogging(true, errorMessage);
  5841. }
  5842. OSFAppTelemetry.logAppException=logAppException;
  5843. OSF.AppTelemetry=OSFAppTelemetry;
  5844. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  5845. Microsoft.Office.WebExtension.FileType={
  5846. Text: "text",
  5847. Compressed: "compressed",
  5848. Pdf: "pdf"
  5849. };
  5850. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5851. FileProperties: "FileProperties",
  5852. FileSliceProperties: "FileSliceProperties"
  5853. });
  5854. OSF.DDA.FileProperties={
  5855. Handle: "FileHandle",
  5856. FileSize: "FileSize",
  5857. SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize
  5858. };
  5859. OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) {
  5860. OSF.OUtil.defineEnumerableProperties(this, {
  5861. "size": {
  5862. value: fileSize
  5863. },
  5864. "sliceCount": {
  5865. value: Math.ceil(fileSize / sliceSize)
  5866. }
  5867. });
  5868. var privateState={};
  5869. privateState[OSF.DDA.FileProperties.Handle]=handle;
  5870. privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize;
  5871. var am=OSF.DDA.AsyncMethodNames;
  5872. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5873. am.GetDocumentCopyChunkAsync,
  5874. am.ReleaseDocumentCopyAsync
  5875. ], privateState);
  5876. };
  5877. OSF.DDA.FileSliceOffset="fileSliceoffset";
  5878. OSF.DDA.AsyncMethodNames.addNames({
  5879. GetDocumentCopyAsy~c: "getFileAsynk",
  5880. GetDocumentCopyChunkCsync: "getSliceAsync",
  5881. ReleaseDocumentCopyAsync: "closeAsync"
  5882. });
  5883. OSF.DDA.AsyncMethodCa,ls.define({
  5884. method: OSF.DÄA.AsyncMethodNaíe{.GetDocumentCopyAsync,
  5885. requiredArguments: [�
  5886. ‰{
  5887. "name": Microsft.Office.WebExtension.Parameters.FileType,
  5888. "enum": Microsoft.Office.WebExtension.FileType
  5889. }
  5890. ],
  5891. supportedOptions: [
  5892. {
  5893. name: Microsoæt.Office.WebExtension.Parameters.SliceSize,
  5894. value: {
  5895. "types": ["number"],
  5896. "defaultValue": 4 * 1024 * 1024
  5897. }
  5898. }
  5899. ],
  5900. checkCallArgs: function (callArgs, caller, stateInfo) {
  5901. var sliceSize=callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize];
  5902. if (sliceSize <=0 || sliceSize > (4 * 1024 * 1024)) {
  5903. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;
  5904. }
  5905. return callArgs;
  5906. },
  5907. onSucceeded: function (fileDescriptor, caller, callArgs) {
  5908. return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]);
  5909. }
  5910. });
  5911. OSF.DDA.AsyncMethodCalls.define({
  5912. method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,
  5913. requiredArguments: [
  5914. {
  5915. "name": Microsoft.Office.WebExtension.Parameters.SliceIndex,
  5916. "types": ["number"]
  5917. }
  5918. ],
  5919. privateStateCallbacks: [
  5920. {
  5921. name: OSF.DDA.FileProperties.Handle,
  5922. value: function (caller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.Handle]; }
  5923. },
  5924. {
  5925. name: OSF.DDA.FileProperties.SliceSize,
  5926. value: function (caller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.SliceSize]; }
  5927. }
  5928. ],
  5929. checkCallArgs: function (callArgs, caller, stateInfo) {
  5930. var index=callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex];
  5931. if (index < 0 || index >=caller.sliceCount) {
  5932. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;
  5933. }
  5934. callArgs[OSF.DDA.FileSliceOffset]=parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString());
  5935. return callArgs;
  5936. },
  5937. onSucceeded: function (sliceDescriptor, caller, callArgs) {
  5938. var slice={};
  5939. OSF.OUtil.defineEnumerableProperties(slice, {
  5940. "data": {
  5941. value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data]
  5942. },
  5943. "index": {
  5944. value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]
  5945. },
  5946. "size": {
  5947. value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize]
  5948. }
  5949. });
  5950. return slice;
  5951. }
  5952. });
  5953. OSF.DDA.AsyncMethodCalls.define({
  5954. method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,
  5955. privateStateCallbacks: [
  5956. {
  5957. name: OSF.DDA.FileProperties.Handle,
  5958. value: function (caller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.Handle]; }
  5959. }
  5960. ]
  5961. });
  5962. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  5963. OSF.OUtil.setNamespace("File", OSF.DDA.Marshaling);
  5964. var OSF_DDA_Marshaling_File_FilePropertiesKeys;
  5965. (function (OSF_DDA_Marshaling_File_FilePropertiesKeys) {
  5966. OSF_DDA_Marshaling_File_FilePropertiesKeys[OSF_DDA_Marshaling_File_FilePropertiesKeys["Handle"]=0]="Handle";
  5967. OSF_DDA_Marshaling_File_FilePropertiesKeys[OSF_DDA_Marshaling_File_FilePropertiesKeys["FileSize"]=1]="FileSize";
  5968. })(OSF_DDA_Marshaling_File_FilePropertiesKeys || (OSF_DDA_Marshaling_File_FilePropertiesKeys={}));
  5969. ;
  5970. OSF.DDA.Marshaling.File.FilePropertiesKeys=OSF_DDA_Marshaling_File_FilePropertiesKeys;
  5971. var OSF_DDA_Marshaling_File_SlicePropertiesKeys;
  5972. (function (OSF_DDA_Marshaling_File_SlicePropertiesKeys) {
  5973. OSF_DDA_Marshaling_File_SlicePropertiesKeys[OSF_DDA_Marshaling_File_SlicePropertiesKeys["Data"]=0]="Data";
  5974. OSF_DDA_Marshaling_File_SlicePropertiesKeys[OSF_DDA_Marshaling_File_SlicePropertiesKeys["SliceSize"]=1]="SliceSize";
  5975. })(OSF_DDA_Marshaling_File_SlicePropertiesKeys || (OSF_DDA_Marshaling_File_SlicePropertiesKeys={}));
  5976. ;
  5977. OSF.DDA.Marshaling.File.SlicePropertiesKeys=OSF_DDA_Marshaling_File_SlicePropertiesKeys;
  5978. var OSF_DDA_Marshaling_File_FileType;
  5979. (function (OSF_DDA_Marshaling_File_FileType) {
  5980. OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Text"]=0]="Text";
  5981. OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Compressed"]=1]="Compressed";
  5982. OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Pdf"]=2]="Pdf";
  5983. })(OSF_DDA_Marshaling_File_FileType || (OSF_DDA_Marshaling_File_FileType={}));
  5984. ;
  5985. OSF.DDA.Marshaling.File.FileType=OSF_DDA_Marshaling_File_FileType;
  5986. var OSF_DDA_Marshaling_File_ParameterKeys;
  5987. (function (OSF_DDA_Marshaling_File_ParameterKeys) {
  5988. OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["FileType"]=0]="FileType";
  5989. OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["SliceSize"]=1]="SliceSize";
  5990. OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["Handle"]=2]="Handle";
  5991. OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["SliceIndex"]=3]="SliceIndex";
  5992. })(OSF_DDA_Marshaling_File_ParameterKeys || (OSF_DDA_Marshaling_File_ParameterKeys={}));
  5993. ;
  5994. OSF.DDA.Marshaling.File.ParameterKeys=OSF_DDA_Marshaling_File_ParameterKeys;
  5995. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileProperties);
  5996. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileSliceProperties);
  5997. OSF.DDA.WAC.Delegate.ParameterMap.define({
  5998. type: OSF.DDA.PropertyDescriptors.FileProperties,
  5999. fromHost: [
  6000. { name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.FilePropertiesKeys.Handle },
  6001. { name: OSF.DDA.FileProperties.FileSize, value: OSF.DDA.Marshaling.File.FilePropertiesKeys.FileSize }
  6002. ]
  6003. });
  6004. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6005. type: OSF.DDA.PropertyDescriptors.FileSliceProperties,
  6006. fromHost: [
  6007. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.Marshaling.File.SlicePropertiesKeys.Data },
  6008. { name: OSF.DDA.FileProperties.SliceSize, value: OSF.DDA.Marshaling.File.SlicePropertiesKeys.SliceSize }
  6009. ]
  6010. });
  6011. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6012. type: Microsoft.Office.WebExtension.Parameters.FileType,
  6013. toHost: [
  6014. { name: Microsoft.Office.WebExtension.FileType.Text, value: OSF.DDA.Marshaling.File.FileType.Text },
  6015. { name: Microsoft.Office.WebExtension.FileType.Compressed, value: OSF.DDA.Marshaling.File.FileType.Compressed },
  6016. { name: Microsoft.Office.WebExtension.FileType.Pdf, value: OSF.DDA.Marshaling.File.FileType.Pdf }
  6017. ]
  6018. });
  6019. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6020. type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,
  6021. toHost: [
  6022. { name: Microsoft.Office.WebExtension.Parameters.FileType, value: OSF.DDA.Marshaling.File.ParameterKeys.FileType },
  6023. { name: Microsoft.Office.WebExtension.Parameters.SliceSize, value: OSF.DDA.Marshaling.File.ParameterKeys.SliceSize }
  6024. ],
  6025. fromHost: [
  6026. { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6027. ]
  6028. });
  6029. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6030. type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,
  6031. toHost: [
  6032. { name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.ParameterKeys.Handle },
  6033. { name: Microsoft.Office.WebExtension.Parameters.SliceIndex, value: OSF.DDA.Marshaling.File.ParameterKeys.SliceIndex }
  6034. ],
  6035. fromHost: [
  6036. { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6037. ]
  6038. });
  6039. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6040. type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,
  6041. toHost: [{ name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.ParameterKeys.Handle }]
  6042. });
  6043. Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) {
  6044. function fixData(data) {
  6045. if (data==null || data==undefined) {
  6046. return null;
  6047. }
  6048. try {
  6049. for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  6050. data=[data];
  6051. }
  6052. return data;
  6053. }
  6054. catch (ex) {
  6055. }
  6056. }
  6057. ;
  6058. OSF.OUtil.defineEnumerableProperties(this, {
  6059. "headers": {
  6060. get: function () { return headers; },
  6061. set: function (value) {
  6062. headers=fixData(value);
  6063. }
  6064. },
  6065. "rows": {
  6066. get: function () { return rows; },
  6067. set: function (value) {
  6068. rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ?
  6069. [] :
  6070. fixData(value);
  6071. }
  6072. }
  6073. });
  6074. this.headers=headers;
  6075. this.rows=rows;
  6076. };
  6077. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6078. OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  6079. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  6080. };
  6081. Microsoft.Office.WebExtension.CoercionType={
  6082. Text: "text",
  6083. Matrix: "matrix",
  6084. Table: "table"
  6085. };
  6086. OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() {
  6087. return {
  6088. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  6089. if (OSF.OUtil.isArray(obj)) {
  6090. var dim=0;
  6091. for (var index=0; index < obj.length; index++) {
  6092. dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  6093. }
  6094. return dim+1;
  6095. }
  6096. else {
  6097. return 0;
  6098. }
  6099. },
  6100. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  6101. switch (bindingType) {
  6102. case Microsoft.Office.WebExtension.BindingType.Matrix: return Microsoft.Office.WebExtension.CoercionType.Matrix;
  6103. case Microsoft.Office.WebExtension.BindingType.Table: return Microsoft.Office.WebExtension.CoercionType.Table;
  6104. case Microsoft.Office.WebExtension.BindingType.Text:
  6105. default:
  6106. return Microsoft.Office.WebExtension.CoercionType.Text;
  6107. }
  6108. },
  6109. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  6110. switch (coercionType) {
  6111. case Microsoft.Office.WebExtension.CoercionType.Matrix: return Microsoft.Office.WebExtension.BindingType.Matrix;
  6112. case Microsoft.Office.WebExtension.CoercionType.Table: return Microsoft.Office.WebExtension.BindingType.Table;
  6113. case Microsoft.Office.WebExtension.CoercionType.Text:
  6114. case Microsoft.Office.WebExtension.CoercionType.Html:
  6115. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  6116. default:
  6117. return Microsoft.Office.WebExtension.BindingType.Text;
  6118. }
  6119. },
  6120. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  6121. if (data==null || data==undefined)
  6122. return null;
  6123. var sourceType=null;
  6124. var runtimeType=typeof data;
  6125. if (data.rows !==undefined) {
  6126. sourceType=Microsoft.Office.WebExtension.CoercionType.Table;
  6127. }
  6128. else if (OSF.OUtil.isArray(data)) {
  6129. sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix;
  6130. }
  6131. else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) {
  6132. sourceType=Microsoft.Office.WebExtension.CoercionType.Text;
  6133. }
  6134. else {
  6135. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  6136. }
  6137. return sourceType;
  6138. },
  6139. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  6140. sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  6141. if (sourceType && sourceType !=destinationType) {
  6142. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  6143. data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  6144. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  6145. }
  6146. return data;
  6147. },
  6148. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  6149. if (matrix.length==1 && matrix[0].length==1)
  6150. return ""+matrix[0][0];
  6151. var val="";
  6152. for (var i=0; i < matrix.length; i++) {
  6153. val+=matrix[i].join("\t")+"\n";
  6154. }
  6155. return val.substring(0, val.length - 1);
  6156. },
  6157. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  6158. var ret=text.split("\n");
  6159. for (var i=0; i < ret.length; i++)
  6160. ret[i]=ret[i].split("\t");
  6161. return ret;
  6162. },
  6163. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  6164. var headers="";
  6165. if (table.headers !=null) {
  6166. headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n";
  6167. }
  6168. var rows=OSF.DDA.DataCoercion._matrixToText(table.rows);
  6169. if (rows=="") {
  6170. headers=headers.substring(0, headers.length - 1);
  6171. }
  6172. return headers+rows;
  6173. },
  6174. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  6175. var matrix=table.rows;
  6176. if (table.headers !=null) {
  6177. matrix.unshift(table.headers);
  6178. }
  6179. return matrix;
  6180. },
  6181. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  6182. var value;
  6183. switch (coercionType) {
  6184. case Microsoft.Office.WebExtension.CoercionType.Table:
  6185. value=table;
  6186. break;
  6187. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  6188. value=OSF.DDA.DataCoercion._tableToMatrix(table);
  6189. break;
  6190. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  6191. value=null;
  6192. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  6193. value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  6194. }
  6195. if (value==null) {
  6196. value=OSF.DDA.DataCoercion._tableToText(table);
  6197. }
  6198. break;
  6199. case Microsoft.Office.WebExtension.CoercionType.Text:
  6200. case Microsoft.Office.WebExtension.CoercionType.Html:
  6201. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  6202. default:
  6203. value=OSF.DDA.DataCoercion._tableToText(table);
  6204. break;
  6205. }
  6206. return value;
  6207. },
  6208. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  6209. if (sourceType==undefined) {
  6210. sourceType=OSF.DDA.DataCoercion.determineCoercionType(data);
  6211. }
  6212. var value;
  6213. switch (sourceType) {
  6214. case Microsoft.Office.WebExtension.CoercionType.Table:
  6215. value=data;
  6216. break;
  6217. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  6218. value=new Microsoft.Office.WebExtension.TableData(data);
  6219. break;
  6220. case Microsoft.Office.WebExtension.CoercionType.Text:
  6221. case Microsoft.Office.WebExtension.CoercionType.Html:
  6222. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  6223. default:
  6224. value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  6225. break;
  6226. }
  6227. return value;
  6228. }
  6229. };
  6230. })();
  6231. OSF.DDA.AsyncMethodNames.addNames({
  6232. GetSelectedDataAsync: "getSelectedDataAsync",
  6233. SetSelectedDataAsync: "setSelectedDataAsync"
  6234. });
  6235. (function () {
  6236. function processData(dataDescriptor, caller, callArgs) {
  6237. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6238. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6239. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6240. }
  6241. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  6242. return data==undefined ? null : data;
  6243. }
  6244. OSF.DDA.AsyncMethodCalls.define({
  6245. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  6246. requiredArguments: [
  6247. {
  6248. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  6249. "enum": Microsoft.Office.WebExtension.CoercionType
  6250. }
  6251. ],
  6252. supportedOptions: [
  6253. {
  6254. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  6255. value: {
  6256. "enum": Microsoft.Office.WebExtension.ValueFormat,
  6257. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  6258. }
  6259. },
  6260. {
  6261. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  6262. value: {
  6263. "enum": Microsoft.Office.WebExtension.FilterType,
  6264. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  6265. }
  6266. }
  6267. ],
  6268. privateStateCallbacks: [],
  6269. onSucceeded: processData
  6270. });
  6271. OSF.DDA.AsyncMethodCalls.define({
  6272. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  6273. requiredArguments: [
  6274. {
  6275. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6276. "types": ["string", "object", "number", "boolean"]
  6277. }
  6278. ],
  6279. supportedOptions: [
  6280. {
  6281. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6282. value: {
  6283. "enum": Microsoft.Office.WebExtension.CoercionType,
  6284. "calculate": function (requiredArgs) {
  6285. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  6286. }
  6287. }
  6288. },
  6289. {
  6290. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  6291. value: {
  6292. "types": ["number", "boolean"],
  6293. "defaultValue": false
  6294. }
  6295. },
  6296. {
  6297. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  6298. value: {
  6299. "types": ["number", "boolean"],
  6300. "defaultValue": false
  6301. }
  6302. },
  6303. {
  6304. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  6305. value: {
  6306. "types": ["number", "boolean"],
  6307. "defaultValue": false
  6308. }
  6309. },
  6310. {
  6311. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  6312. value: {
  6313. "types": ["number", "boolean"],
  6314. "defaultValue": false
  6315. }
  6316. }
  6317. ],
  6318. privateStateCallbacks: []
  6319. });
  6320. })();
  6321. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6322. type: OSF.DDA.WAC.UniqueArguments.GetData,
  6323. toHost: [
  6324. { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" },
  6325. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" },
  6326. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: "ValueFormat" },
  6327. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: "FilterType" },
  6328. { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" },
  6329. { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" },
  6330. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" },
  6331. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" },
  6332. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" },
  6333. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" }
  6334. ]
  6335. });
  6336. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6337. type: OSF.DDA.WAC.UniqueArguments.SetData,
  6338. toHost: [
  6339. { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" },
  6340. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" },
  6341. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data },
  6342. { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" },
  6343. { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" },
  6344. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" },
  6345. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" },
  6346. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: "ImageLeft" },
  6347. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: "ImageTop" },
  6348. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: "ImageWidth" },
  6349. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: "ImageHeight" }
  6350. ]
  6351. });
  6352. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6353. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  6354. fromHost: [
  6355. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }
  6356. ],
  6357. toHost: [
  6358. { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6359. ]
  6360. });
  6361. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6362. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  6363. toHost: [
  6364. { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6365. ]
  6366. });
  6367. OSF.DDA.SettingsManager={
  6368. SerializedSettings: "serializedSettings",
  6369. RefreshingSettings: "refreshingSettings",
  6370. DateJSONPrefix: "Date(",
  6371. DataJSONSuffix: ")",
  6372. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  6373. var ret={};
  6374. for (var key in settingsCollection) {
  6375. var value=settingsCollection[key];
  6376. try {
  6377. if (JSON) {
  6378. value=JSON.stringify(value, function dateReplacer(k, v) {
  6379. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v;
  6380. });
  6381. }
  6382. else {
  6383. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  6384. }
  6385. ret[key]=value;
  6386. }
  6387. catch (ex) {
  6388. }
  6389. }
  6390. return ret;
  6391. },
  6392. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  6393. var ret={};
  6394. serializedSettings=serializedSettings || {};
  6395. for (var key in serializedSettings) {
  6396. var value=serializedSettings[key];
  6397. try {
  6398. if (JSON) {
  6399. value=JSON.parse(value, function dateReviver(k, v) {
  6400. var d;
  6401. if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) {
  6402. d=new Date(parseInt(v.slice(5, -1)));
  6403. if (d) {
  6404. return d;
  6405. }
  6406. }
  6407. return v;
  6408. });
  6409. }
  6410. else {
  6411. value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  6412. }
  6413. ret[key]=value;
  6414. }
  6415. catch (ex) {
  6416. }
  6417. }
  6418. return ret;
  6419. }
  6420. };
  6421. OSF.DDA.Settings=function OSF_DDA_Settings(settings) {
  6422. settings=settings || {};
  6423. var cacheSessionSettings=function (settings) {
  6424. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  6425. if (osfSessionStorage) {
  6426. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings);
  6427. var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  6428. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  6429. }
  6430. };
  6431. OSF.OUtil.defineEnumerableProperties(this, {
  6432. "get": {
  6433. value: function OSF_DDA_Settings$get(name) {
  6434. var e=Function._validateParams(arguments, [
  6435. { name: "name", type: String, mayBeNull: false }
  6436. ]);
  6437. if (e)
  6438. throw e;
  6439. var setting=settings[name];
  6440. return typeof (setting)==='undefined' ? null : setting;
  6441. }
  6442. },
  6443. "set": {
  6444. value: function OSF_DDA_Settings$set(name, value) {
  6445. var e=Function._validateParams(arguments, [
  6446. { name: "name", type: String, mayBeNull: false },
  6447. { name: "value", mayBeNull: true }
  6448. ]);
  6449. if (e)
  6450. throw e;
  6451. settings[name]=value;
  6452. cacheSessionSettings(settings);
  6453. }
  6454. },
  6455. "remove": {
  6456. value: function OSF_DDA_Settings$remove(name) {
  6457. var e=Function._validateParams(arguments, [
  6458. { name: "name", type: String, mayBeNull: false }
  6459. ]);
  6460. if (e)
  6461. throw e;
  6462. delete settings[name];
  6463. cacheSessionSettings(settings);
  6464. }
  6465. }
  6466. });
  6467. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  6468. };
  6469. OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) {
  6470. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  6471. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  6472. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  6473. };
  6474. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  6475. Microsoft.Office.WebExtension.EventType={};
  6476. OSF.EventDispatch=function OSF_EventDispatch(eventTypes) {
  6477. this._eventHandlers={};
  6478. this._queuedEventsArgs={};
  6479. for (var entry in eventTypes) {
  6480. var eventType=eventTypes[entry];
  6481. this._eventHandlers[eventType]=[];
  6482. this._queuedEventsArgs[eventType]=[];
  6483. }
  6484. };
  6485. OSF.EventDispatch.prototype={
  6486. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  6487. var events=[];
  6488. for (var eventName in this._eventHandlers)
  6489. events.push(eventName);
  6490. return events;
  6491. },
  6492. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  6493. var isSupported=false;
  6494. for (var eventName in this._eventHandlers) {
  6495. if (event==eventName) {
  6496. isSupported=true;
  6497. break;
  6498. }
  6499. }
  6500. return isSupported;
  6501. },
  6502. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  6503. var handlers=this._eventHandlers[eventType];
  6504. if (handlers && handlers.length > 0) {
  6505. for (var h in handlers) {
  6506. if (handlers[h]===handler)
  6507. return true;
  6508. }
  6509. }
  6510. return false;
  6511. },
  6512. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  6513. if (typeof handler !="function") {
  6514. return false;
  6515. }
  6516. var handlers=this._eventHandlers[eventType];
  6517. if (handlers && !this.hasEventHandler(eventType, handler)) {
  6518. handlers.push(handler);
  6519. return true;
  6520. }
  6521. else {
  6522. return false;
  6523. }
  6524. },
  6525. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler) {
  6526. var handlers=this._eventHandlers[eventType];
  6527. var isFirstHandler=handlers.length==0;
  6528. var succeed=this.addEventHandler(eventType, handler);
  6529. if (isFirstHandler && succeed) {
  6530. this.fireQueuedEvent(eventType);
  6531. }
  6532. return succeed;
  6533. },
  6534. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  6535. var handlers=this._eventHandlers[eventType];
  6536. if (handlers && handlers.length > 0) {
  6537. for (var index=0; index < handlers.length; index++) {
  6538. if (handlers[index]===handler) {
  6539. handlers.splice(index, 1);
  6540. return true;
  6541. }
  6542. }
  6543. }
  6544. return false;
  6545. },
  6546. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  6547. if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) {
  6548. this._eventHandlers[eventType]=[];
  6549. return true;
  6550. }
  6551. return false;
  6552. },
  6553. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  6554. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1;
  6555. },
  6556. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  6557. if (eventArgs.type==undefined)
  6558. return false;
  6559. var eventType=eventArgs.type;
  6560. if (eventType && this._eventHandlers[eventType]) {
  6561. var eventHandlers=this._eventHandlers[eventType];
  6562. for (var handler in eventHandlers)
  6563. eventHandlers[handler](eventArgs);
  6564. return true;
  6565. }
  6566. else {
  6567. return false;
  6568. }
  6569. },
  6570. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs) {
  6571. var eventType=eventArgs.type;
  6572. if (eventType && this._eventHandlers[eventType]) {
  6573. var eventHandlers=this._eventHandlers[eventType];
  6574. var queuedEvents=this._queuedEventsArgs[eventType];
  6575. if (eventHandlers.length==0) {
  6576. queuedEvents.push(eventArgs);
  6577. }
  6578. else {
  6579. this.fireEvent(eventArgs);
  6580. }
  6581. return true;
  6582. }
  6583. else {
  6584. return false;
  6585. }
  6586. },
  6587. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType) {
  6588. if (eventType && this._eventHandlers[eventType]) {
  6589. var eventHandlers=this._eventHandlers[eventType];
  6590. var queuedEvents=this._queuedEventsArgs[eventType];
  6591. if (eventHandlers.length > 0) {
  6592. var eventHandler=eventHandlers[0];
  6593. while (queuedEvents.length > 0) {
  6594. var eventArgs=queuedEvents.shift();
  6595. eventHandler(eventArgs);
  6596. }
  6597. return true;
  6598. }
  6599. }
  6600. return false;
  6601. }
  6602. };
  6603. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6604. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  6605. var args;
  6606. switch (eventType) {
  6607. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  6608. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  6609. break;
  6610. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  6611. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  6612. break;
  6613. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  6614. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  6615. break;
  6616. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  6617. args=new OSF.DDA.SettingsChangedEventArgs(target);
  6618. break;
  6619. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  6620. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  6621. break;
  6622. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  6623. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  6624. break;
  6625. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  6626. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  6627. break;
  6628. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  6629. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  6630. break;
  6631. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  6632. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  6633. break;
  6634. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  6635. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  6636. break;
  6637. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  6638. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  6639. break;
  6640. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  6641. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  6642. break;
  6643. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  6644. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  6645. break;
  6646. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  6647. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  6648. break;
  6649. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  6650. args=new OSF.DDA.DialogEventArgs(eventProperties);
  6651. break;
  6652. case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:
  6653. args=new OSF.DDA.DialogParentEventArgs(eventProperties);
  6654. break;
  6655. case Microsoft.Office.WebExtension.EventType.ItemChanged:
  6656. if (OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlook" || OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlookwebapp") {
  6657. args=new OSF.DDA.OlkItemSelectedChangedEventArgs(eventProperties);
  6658. target.initialize(args["initialData"]);
  6659. target.setCurrentItemNumber(args["itemNumber"].itemNumber);
  6660. }
  6661. else {
  6662. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  6663. }
  6664. break;
  6665. default:
  6666. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  6667. }
  6668. return args;
  6669. };
  6670. OSF.DDA.AsyncMethodNames.addNames({
  6671. AddHandlerAsync: "addHandlerAsync",
  6672. RemoveHandlerAsync: "removeHandlerAsync"
  6673. });
  6674. OSF.DDA.AsyncMethodCalls.define({
  6675. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  6676. requiredArguments: [{
  6677. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  6678. "enum": Microsoft.Office.WebExtension.EventType,
  6679. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  6680. },
  6681. {
  6682. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  6683. "types": ["function"]
  6684. }
  6685. ],
  6686. supportedOptions: [],
  6687. privateStateCallbacks: []
  6688. });
  6689. OSF.DDA.AsyncMethodCalls.define({
  6690. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  6691. requiredArguments: [
  6692. {
  6693. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  6694. "enum": Microsoft.Office.WebExtension.EventType,
  6695. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  6696. }
  6697. ],
  6698. supportedOptions: [
  6699. {
  6700. name: Microsoft.Office.WebExtension.Parameters.Handler,
  6701. value: {
  6702. "types": ["function", "object"],
  6703. "defaultValue": null
  6704. }
  6705. }
  6706. ],
  6707. privateStateCallbacks: []
  6708. });
  6709. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  6710. SettingsChanged: "settingsChanged"
  6711. });
  6712. OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  6713. OSF.OUtil.defineEnumerableProperties(this, {
  6714. "type": {
  6715. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  6716. },
  6717. "settings": {
  6718. value: settingsInstance
  6719. }
  6720. });
  6721. };
  6722. OSF.DDA.AsyncMethodNames.addNames({
  6723. RefreshAsync: "refreshAsync",
  6724. SaveAsync: "saveAsync"
  6725. });
  6726. OSF.DDA.AsyncMethodCalls.define({
  6727. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  6728. requiredArguments: [],
  6729. supportedOptions: [],
  6730. privateStateCallbacks: [
  6731. {
  6732. name: OSF.DDA.SettingsManager.RefreshingSettings,
  6733. value: function getRefreshingSettings(settingsInstance, settingsCollection) {
  6734. return settingsCollection;
  6735. }
  6736. }
  6737. ],
  6738. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings, refreshingSettingsArgs) {
  6739. var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  6740. var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  6741. var oldSettings=refreshingSettingsArgs[OSF.DDA.SettingsManager.RefreshingSettings];
  6742. for (var setting in oldSettings) {
  6743. refreshingSettings.remove(setting);
  6744. }
  6745. for (var setting in newSettings) {
  6746. refreshingSettings.set(setting, newSettings[setting]);
  6747. }
  6748. return refreshingSettings;
  6749. }
  6750. });
  6751. OSF.DDA.AsyncMethodCalls.define({
  6752. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  6753. requiredArguments: [],
  6754. supportedOptions: [
  6755. {
  6756. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  6757. value: {
  6758. "types": ["boolean"],
  6759. "defaultValue": true
  6760. }
  6761. }
  6762. ],
  6763. privateStateCallbacks: [
  6764. {
  6765. name: OSF.DDA.SettingsManager.SerializedSettings,
  6766. value: function serializeSettings(settingsInstance, settingsCollection) {
  6767. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  6768. }
  6769. }
  6770. ]
  6771. });
  6772. OSF.DDA.WAC.SettingsTranslator=(function () {
  6773. var keyIndex=0;
  6774. var valueIndex=1;
  6775. return {
  6776. read: function OSF_DDA_WAC_SettingsTranslator$read(payload) {
  6777. var serializedSettings={};
  6778. var settingsPayload=payload.Settings;
  6779. for (var index in settingsPayload) {
  6780. var setting=settingsPayload[index];
  6781. serializedSettings[setting[keyIndex]]=setting[valueIndex];
  6782. }
  6783. return serializedSettings;
  6784. },
  6785. write: function OSF_DDA_WAC_SettingsTranslator$write(serializedSettings) {
  6786. var settingsPayload=[];
  6787. for (var key in serializedSettings) {
  6788. var setting=[];
  6789. setting[keyIndex]=key;
  6790. setting[valueIndex]=serializedSettings[key];
  6791. settingsPayload.push(setting);
  6792. }
  6793. return settingsPayload;
  6794. }
  6795. };
  6796. })();
  6797. OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings, {
  6798. toHost: OSF.DDA.WAC.SettingsTranslator.write,
  6799. fromHost: OSF.DDA.WAC.SettingsTranslator.read
  6800. });
  6801. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6802. type: OSF.DDA.WAC.UniqueArguments.SettingsRequest,
  6803. toHost: [
  6804. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: "OverwriteIfStale" },
  6805. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties }
  6806. ],
  6807. invertible: true
  6808. });
  6809. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6810. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  6811. fromHost: [
  6812. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties }
  6813. ]
  6814. });
  6815. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6816. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  6817. toHost: [
  6818. { name: OSF.DDA.WAC.UniqueArguments.SettingsRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6819. ]
  6820. });
  6821. OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  6822. Microsoft.Office.WebExtension.BindingType={
  6823. Table: "table",
  6824. Text: "text",
  6825. Matrix: "matrix"
  6826. };
  6827. OSF.DDA.BindingProperties={
  6828. Id: "BindingId",
  6829. Type: Microsoft.Office.WebExtension.Parameters.BindingType
  6830. };
  6831. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" });
  6832. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  6833. Subset: "subset",
  6834. BindingProperties: "BindingProperties"
  6835. });
  6836. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties);
  6837. OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) {
  6838. this._id=bindingId;
  6839. OSF.OUtil.defineEnumerableProperty(this, "onFail", {
  6840. get: function () {
  6841. return errorCallback;
  6842. },
  6843. set: function (onError) {
  6844. var t=typeof onError;
  6845. if (t !="undefined" && t !="function") {
  6846. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t);
  6847. }
  6848. errorCallback=onError;
  6849. }
  6850. });
  6851. };
  6852. OSF.DDA.BindingPromise.prototype={
  6853. _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) {
  6854. if (this.binding) {
  6855. if (onComplete)
  6856. onComplete(this.binding);
  6857. }
  6858. else {
  6859. if (!this._binding) {
  6860. var me=this;
  6861. Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) {
  6862. if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) {
  6863. OSF.OUtil.defineEnumerableProperty(me, "binding", {
  6864. value: asyncResult.value
  6865. });
  6866. if (onComplete)
  6867. onComplete(me.binding);
  6868. }
  6869. else {
  6870. if (me.onFail)
  6871. me.onFail(asyncResult);
  6872. }
  6873. });
  6874. }
  6875. }
  6876. return this;
  6877. },
  6878. getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() {
  6879. var args=arguments;
  6880. this._fetch(function onComplete(binding) { binding.getDataAsync.apply(binding, args); });
  6881. return this;
  6882. },
  6883. setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() {
  6884. var args=arguments;
  6885. this._fetch(function onComplete(binding) { binding.setDataAsync.apply(binding, args); });
  6886. return this;
  6887. },
  6888. addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() {
  6889. var args=arguments;
  6890. this._fetch(function onComplete(binding) { binding.addHandlerAsync.apply(binding, args); });
  6891. return this;
  6892. },
  6893. removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() {
  6894. var args=arguments;
  6895. this._fetch(function onComplete(binding) { binding.removeHandlerAsync.apply(binding, args); });
  6896. return this;
  6897. }
  6898. };
  6899. OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) {
  6900. this._eventDispatches=[];
  6901. OSF.OUtil.defineEnumerableProperty(this, "document", {
  6902. value: docInstance
  6903. });
  6904. var am=OSF.DDA.AsyncMethodNames;
  6905. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6906. am.AddFromSelectionAsync,
  6907. am.AddFromNamedItemAsync,
  6908. am.GetAllAsync,
  6909. am.GetByIdAsync,
  6910. am.ReleaseByIdAsync
  6911. ]);
  6912. };
  6913. OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) {
  6914. OSF.OUtil.defineEnumerableProperties(this, {
  6915. "document": { value: docInstance },
  6916. "id": { value: id }
  6917. });
  6918. };
  6919. OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) {
  6920. OSF.OUtil.defineEnumerableProperties(this, {
  6921. "document": {
  6922. value: docInstance
  6923. },
  6924. "id": {
  6925. value: id
  6926. }
  6927. });
  6928. var am=OSF.DDA.AsyncMethodNames;
  6929. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6930. am.GetDataAsync,
  6931. am.SetDataAsync
  6932. ]);
  6933. var et=Microsoft.Office.WebExtension.EventType;
  6934. var bindingEventDispatches=docInstance.bindings._eventDispatches;
  6935. if (!bindingEventDispatches[id]) {
  6936. bindingEventDispatches[id]=new OSF.EventDispatch([
  6937. et.BindingSelectionChanged,
  6938. et.BindingDataChanged
  6939. ]);
  6940. }
  6941. var eventDispatch=bindingEventDispatches[id];
  6942. OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch);
  6943. };
  6944. OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() {
  6945. return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime();
  6946. };
  6947. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6948. OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) {
  6949. var id=bindingProperties[OSF.DDA.BindingProperties.Id];
  6950. var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount];
  6951. var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount];
  6952. var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders];
  6953. var binding;
  6954. switch (bindingProperties[OSF.DDA.BindingProperties.Type]) {
  6955. case Microsoft.Office.WebExtension.BindingType.Text:
  6956. binding=new OSF.DDA.TextBinding(id, containingDocument);
  6957. break;
  6958. case Microsoft.Office.WebExtension.BindingType.Matrix:
  6959. binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols);
  6960. break;
  6961. case Microsoft.Office.WebExtension.BindingType.Table:
  6962. var isExcelApp=function () {
  6963. return (OSF.DDA.ExcelDocument)
  6964. && (Microsoft.Office.WebExtension.context.document)
  6965. && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument);
  6966. };
  6967. var tableBindingObject;
  6968. if (isExcelApp() && OSF.DDA.ExcelTableBinding) {
  6969. tableBindingObject=OSF.DDA.ExcelTableBinding;
  6970. }
  6971. else {
  6972. tableBindingObject=OSF.DDA.TableBinding;
  6973. }
  6974. binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders);
  6975. break;
  6976. default:
  6977. binding=new OSF.DDA.UnknownBinding(id, containingDocument);
  6978. }
  6979. return binding;
  6980. };
  6981. OSF.DDA.AsyncMethodNames.addNames({
  6982. AddFromSelectionAsync: "addFromSelectionAsync",
  6983. AddFromNamedItemAsync: "addFromNamedItemAsync",
  6984. GetAllAsync: "getAllAsync",
  6985. GetByIdAsync: "getByIdAsync",
  6986. ReleaseByIdAsync: "releaseByIdAsync",
  6987. GetDataAsync: "getDataAsync",
  6988. SetDataAsync: "setDataAsync"
  6989. });
  6990. (function () {
  6991. function processBinding(bindingDescriptor) {
  6992. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  6993. }
  6994. function getObjectId(obj) { return obj.id; }
  6995. function processData(dataDescriptor, caller, callArgs) {
  6996. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6997. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6998. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6999. }
  7000. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  7001. return data==undefined ? null : data;
  7002. }
  7003. OSF.DDA.AsyncMethodCalls.define({
  7004. method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,
  7005. requiredArguments: [
  7006. {
  7007. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  7008. "enum": Microsoft.Office.WebExtension.BindingType
  7009. }
  7010. ],
  7011. supportedOptions: [{
  7012. name: Microsoft.Office.WebExtension.Parameters.Id,
  7013. value: {
  7014. "types": ["string"],
  7015. "calculate": OSF.DDA.generateBindingId
  7016. }
  7017. },
  7018. {
  7019. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7020. value: {
  7021. "types": ["object"],
  7022. "defaultValue": null
  7023. }
  7024. }
  7025. ],
  7026. privateStateCallbacks: [],
  7027. onSucceeded: processBinding
  7028. });
  7029. OSF.DDA.AsyncMethodCalls.define({
  7030. method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,
  7031. requiredArguments: [{
  7032. "name": Microsoft.Office.WebExtension.Parameters.ItemName,
  7033. "types": ["string"]
  7034. },
  7035. {
  7036. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  7037. "enum": Microsoft.Office.WebExtension.BindingType
  7038. }
  7039. ],
  7040. supportedOptions: [{
  7041. name: Microsoft.Office.WebExtension.Parameters.Id,
  7042. value: {
  7043. "types": ["string"],
  7044. "calculate": OSF.DDA.generateBindingId
  7045. }
  7046. },
  7047. {
  7048. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7049. value: {
  7050. "types": ["object"],
  7051. "defaultValue": null
  7052. }
  7053. }
  7054. ],
  7055. privateStateCallbacks: [
  7056. {
  7057. name: Microsoft.Office.WebExtension.Parameters.FailOnCollision,
  7058. value: function () { return true; }
  7059. }
  7060. ],
  7061. onSucceeded: processBinding
  7062. });
  7063. OSF.DDA.AsyncMethodCalls.define({
  7064. method: OSF.DDA.AsyncMethodNames.GetAllAsync,
  7065. requiredArguments: [],
  7066. supportedOptions: [],
  7067. privateStateCallbacks: [],
  7068. onSucceeded: function (response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); }
  7069. });
  7070. OSF.DDA.AsyncMethodCalls.define({
  7071. method: OSF.DDA.AsyncMethodNames.GetByIdAsync,
  7072. requiredArguments: [
  7073. {
  7074. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7075. "types": ["string"]
  7076. }
  7077. ],
  7078. supportedOptions: [],
  7079. privateStateCallbacks: [],
  7080. onSucceeded: processBinding
  7081. });
  7082. OSF.DDA.AsyncMethodCalls.define({
  7083. method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,
  7084. requiredArguments: [
  7085. {
  7086. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7087. "types": ["string"]
  7088. }
  7089. ],
  7090. supportedOptions: [],
  7091. privateStateCallbacks: [],
  7092. onSucceeded: function (response, caller, callArgs) {
  7093. var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id];
  7094. delete caller._eventDispatches[id];
  7095. }
  7096. });
  7097. OSF.DDA.AsyncMethodCalls.define({
  7098. method: OSF.DDA.AsyncMethodNames.GetDataAsync,
  7099. requiredArguments: [],
  7100. supportedOptions: [{
  7101. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7102. value: {
  7103. "enum": Microsoft.Office.WebExtension.CoercionType,
  7104. "calculate": function (requiredArgs, binding) { return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); }
  7105. }
  7106. },
  7107. {
  7108. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  7109. value: {
  7110. "enum": Microsoft.Office.WebExtension.ValueFormat,
  7111. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  7112. }
  7113. },
  7114. {
  7115. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  7116. value: {
  7117. "enum": Microsoft.Office.WebExtension.FilterType,
  7118. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  7119. }
  7120. },
  7121. {
  7122. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7123. value: {
  7124. "types": ["object", "string"],
  7125. "defaultValue": null
  7126. }
  7127. },
  7128. {
  7129. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7130. value: {
  7131. "types": ["object"],
  7132. "defaultValue": null
  7133. }
  7134. },
  7135. {
  7136. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7137. value: {
  7138. "types": ["number"],
  7139. "defaultValue": 0
  7140. }
  7141. },
  7142. {
  7143. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7144. value: {
  7145. "types": ["number"],
  7146. "defaultValue": 0
  7147. }
  7148. },
  7149. {
  7150. name: Microsoft.Office.WebExtension.Parameters.RowCount,
  7151. value: {
  7152. "types": ["number"],
  7153. "defaultValue": 0
  7154. }
  7155. },
  7156. {
  7157. name: Microsoft.Office.WebExtension.Parameters.ColumnCount,
  7158. value: {
  7159. "types": ["number"],
  7160. "defaultValue": 0
  7161. }
  7162. }
  7163. ],
  7164. checkCallArgs: function (callArgs, caller, stateInfo) {
  7165. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  7166. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 &&
  7167. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 &&
  7168. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) {
  7169. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  7170. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  7171. delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount];
  7172. delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount];
  7173. }
  7174. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7175. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  7176. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] ||
  7177. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] ||
  7178. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) {
  7179. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7180. }
  7181. return callArgs;
  7182. },
  7183. privateStateCallbacks: [
  7184. {
  7185. name: Microsoft.Office.WebExtension.Parameters.Id,
  7186. value: getObjectId
  7187. }
  7188. ],
  7189. onSucceeded: processData
  7190. });
  7191. OSF.DDA.AsyncMethodCalls.define({
  7192. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  7193. requiredArguments: [
  7194. {
  7195. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7196. "types": ["string", "object", "number", "boolean"]
  7197. }
  7198. ],
  7199. supportedOptions: [{
  7200. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7201. value: {
  7202. "enum": Microsoft.Office.WebExtension.CoercionType,
  7203. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7204. }
  7205. },
  7206. {
  7207. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7208. value: {
  7209. "types": ["object", "string"],
  7210. "defaultValue": null
  7211. }
  7212. },
  7213. {
  7214. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7215. value: {
  7216. "types": ["object"],
  7217. "defaultValue": null
  7218. }
  7219. },
  7220. {
  7221. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7222. value: {
  7223. "types": ["number"],
  7224. "defaultValue": 0
  7225. }
  7226. },
  7227. {
  7228. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7229. value: {
  7230. "types": ["number"],
  7231. "defaultValue": 0
  7232. }
  7233. }
  7234. ],
  7235. checkCallArgs: function (callArgs, caller, stateInfo) {
  7236. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  7237. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) {
  7238. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  7239. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  7240. }
  7241. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7242. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  7243. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) {
  7244. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7245. }
  7246. return callArgs;
  7247. },
  7248. privateStateCallbacks: [
  7249. {
  7250. name: Microsoft.Office.WebExtension.Parameters.Id,
  7251. value: getObjectId
  7252. }
  7253. ]
  7254. });
  7255. })();
  7256. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" });
  7257. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  7258. RowCount: "BindingRowCount",
  7259. ColumnCount: "BindingColumnCount",
  7260. HasHeaders: "HasHeaders"
  7261. });
  7262. OSF.DDA.TableDataProperties={
  7263. TableRows: "TableRows",
  7264. TableHeaders: "TableHeaders"
  7265. };
  7266. OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) {
  7267. OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance);
  7268. OSF.OUtil.defineEnumerableProperties(this, {
  7269. "type": {
  7270. value: Microsoft.Office.WebExtension.BindingType.Table
  7271. },
  7272. "rowCount": {
  7273. value: rows ? rows : 0
  7274. },
  7275. "columnCount": {
  7276. value: cols ? cols : 0
  7277. },
  7278. "hasHeaders": {
  7279. value: hasHeaders ? hasHeaders : false
  7280. }
  7281. });
  7282. var am=OSF.DDA.AsyncMethodNames;
  7283. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  7284. am.AddRowsAsync,
  7285. am.AddColumnsAsync,
  7286. am.DeleteAllDataValuesAsync
  7287. ]);
  7288. };
  7289. OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding);
  7290. OSF.DDA.AsyncMethodNames.addNames({
  7291. AddRowsAsync: "addRowsAsync",
  7292. AddColumnsAsync: "addColumnsAsync",
  7293. DeleteAllDataValuesAsync: "deleteAllDataValuesAsync"
  7294. });
  7295. (function () {
  7296. function getObjectId(obj) { return obj.id; }
  7297. OSF.DDA.AsyncMethodCalls.define({
  7298. method: OSF.DDA.AsyncMethodNames.AddRowsAsync,
  7299. requiredArguments: [
  7300. {
  7301. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7302. "types": ["object"]
  7303. }
  7304. ],
  7305. supportedOptions: [],
  7306. privateStateCallbacks: [
  7307. {
  7308. name: Microsoft.Office.WebExtension.Parameters.Id,
  7309. value: getObjectId
  7310. }
  7311. ]
  7312. });
  7313. OSF.DDA.AsyncMethodCalls.define({
  7314. method: OSF.DDA.AsyncMethodNames.AddColumnsAsync,
  7315. requiredArguments: [
  7316. {
  7317. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7318. "types": ["object"]
  7319. }
  7320. ],
  7321. supportedOptions: [],
  7322. privateStateCallbacks: [
  7323. {
  7324. name: Microsoft.Office.WebExtension.Parameters.Id,
  7325. value: getObjectId
  7326. }
  7327. ]
  7328. });
  7329. OSF.DDA.AsyncMethodCalls.define({
  7330. method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,
  7331. requiredArguments: [],
  7332. supportedOptions: [],
  7333. privateStateCallbacks: [
  7334. {
  7335. name: Microsoft.Office.WebExtension.Parameters.Id,
  7336. value: getObjectId
  7337. }
  7338. ]
  7339. });
  7340. })();
  7341. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties);
  7342. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7343. type: OSF.DDA.WAC.UniqueArguments.BindingRequest,
  7344. toHost: [
  7345. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: "ItemName" },
  7346. { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" },
  7347. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: "BindingType" },
  7348. { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: "PromptText" },
  7349. { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" },
  7350. { name: Microsoft.Office.WebExtension.Parameters.SampleData, value: "SampleData" },
  7351. { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: "FailOnCollision" }
  7352. ]
  7353. });
  7354. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7355. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  7356. toHost: [
  7357. { name: Microsoft.Office.WebExtension.BindingType.Text, value: 2 },
  7358. { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 3 },
  7359. { name: Microsoft.Office.WebExtension.BindingType.Table, value: 1 }
  7360. ],
  7361. invertible: true
  7362. });
  7363. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7364. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  7365. fromHost: [
  7366. { name: OSF.DDA.BindingProperties.Id, value: "Name" },
  7367. { name: OSF.DDA.BindingProperties.Type, value: "BindingType" },
  7368. { name: OSF.DDA.BindingProperties.RowCount, value: "RowCount" },
  7369. { name: OSF.DDA.BindingProperties.ColumnCount, value: "ColCount" },
  7370. { name: OSF.DDA.BindingProperties.HasHeaders, value: "HasHeaders" }
  7371. ]
  7372. });
  7373. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7374. type: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,
  7375. fromHost: [
  7376. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }
  7377. ]
  7378. });
  7379. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7380. type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,
  7381. fromHost: [
  7382. { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7383. ],
  7384. toHost: [
  7385. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7386. ]
  7387. });
  7388. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7389. type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,
  7390. fromHost: [
  7391. { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7392. ],
  7393. toHost: [
  7394. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7395. ]
  7396. });
  7397. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7398. type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod,
  7399. toHost: [
  7400. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7401. ]
  7402. });
  7403. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7404. type: OSF.DDA.MethodDispId.dispidGetBindingMethod,
  7405. fromHost: [
  7406. { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7407. ],
  7408. toHost: [
  7409. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7410. ]
  7411. });
  7412. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7413. type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,
  7414. fromHost: [
  7415. { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7416. ]
  7417. });
  7418. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7419. type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod,
  7420. fromHost: [
  7421. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }
  7422. ],
  7423. toHost: [
  7424. { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7425. ]
  7426. });
  7427. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7428. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  7429. toHost: [
  7430. { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7431. ]
  7432. });
  7433. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7434. type: OSF.DDA.MethodDispId.dispidAddRowsMethod,
  7435. toHost: [
  7436. { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7437. ]
  7438. });
  7439. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7440. type: OSF.DDA.MethodDispId.dispidAddColumnsMethod,
  7441. toHost: [
  7442. { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7443. ]
  7444. });
  7445. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7446. type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod,
  7447. toHost: [
  7448. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7449. ]
  7450. });
  7451. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7452. type: OSF.DDA.WAC.UniqueArguments.AddRowsColumns,
  7453. toHost: [
  7454. { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" },
  7455. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }
  7456. ]
  7457. });
  7458. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7459. type: OSF.DDA.PropertyDescriptors.Subset,
  7460. fromHost: [
  7461. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" },
  7462. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" },
  7463. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" },
  7464. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" }
  7465. ]
  7466. });
  7467. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  7468. RowCount: "BindingRowCount",
  7469. ColumnCount: "BindingColumnCount",
  7470. HasHeaders: "HasHeaders"
  7471. });
  7472. OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) {
  7473. OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance);
  7474. OSF.OUtil.defineEnumerableProperties(this, {
  7475. "type": {
  7476. value: Microsoft.Office.WebExtension.BindingType.Matrix
  7477. },
  7478. "rowCount": {
  7479. value: rows ? rows : 0
  7480. },
  7481. "columnCount": {
  7482. value: cols ? cols : 0
  7483. }
  7484. });
  7485. };
  7486. OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding);
  7487. OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) {
  7488. OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance);
  7489. OSF.OUtil.defineEnumerableProperty(this, "type", {
  7490. value: Microsoft.Office.WebExtension.BindingType.Text
  7491. });
  7492. };
  7493. OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding);
  7494. OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" });
  7495. OSF.DDA.AsyncMethodCalls.define({
  7496. method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync,
  7497. requiredArguments: [
  7498. {
  7499. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  7500. "enum": Microsoft.Office.WebExtension.BindingType
  7501. }
  7502. ],
  7503. supportedOptions: [{
  7504. name: Microsoft.Office.WebExtension.Parameters.Id,
  7505. value: {
  7506. "types": ["string"],
  7507. "calculate": OSF.DDA.generateBindingId
  7508. }
  7509. },
  7510. {
  7511. name: Microsoft.Office.WebExtension.Parameters.PromptText,
  7512. value: {
  7513. "types": ["string"],
  7514. "calculate": function () { return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; }
  7515. }
  7516. },
  7517. {
  7518. name: Microsoft.Office.WebExtension.Parameters.SampleData,
  7519. value: {
  7520. "types": ["object"],
  7521. "defaultValue": null
  7522. }
  7523. }
  7524. ],
  7525. privateStateCallbacks: [],
  7526. onSucceeded: function (bindingDescriptor) { return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); }
  7527. });
  7528. OSF.DDA.WAC.Delegate.ParameterMap.define({ Š type: OSF.DDA.MevhodDispId.dispidAddBindingFromPromptMethod,
  7529. fromHost: [
  7530. { name: OSF.DDA.WAC.UnéqueArguments.SingleBindingResponse, value: OSF.ÄDA.WAC.UniqueArguments.BindingRespo~se }
  7531. ],
  7532. toHost: [�
  7533. { name: OSF.DDA.WAC.UniqueQrguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7534. ]
  7535. });
  7536. OSF.OUtil.augmentList(Micrmsoft.Office.WebExtension.EventType, { DocwmentSelectionChanged: "documentSelectionChanged" });
  7537. OSF.DDA.DocumentSelectionChangedEventArgs=function OSG_DDA_DocumentSelectionChangedEventArgs(docInstance) {
  7538. OSF.OUtil.defineEnumerableProperties(this, {
  7539. "type": {
  7540. value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged
  7541. },
  7542. "document": {
  7543. value: docInstance
  7544. }
  7545. });
  7546. };
  7547. OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent });
  7548. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  7549. BindingSelectionChanged: "bindingSelectionChanged",
  7550. BindingDataChanged: "bindingDataChanged"
  7551. });
  7552. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" });
  7553. OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) {
  7554. OSF.OUtil.defineEnumerableProperties(this, {
  7555. "type": {
  7556. value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged
  7557. },
  7558. "binding": {
  7559. value: bindingInstance
  7560. }
  7561. });
  7562. for (var prop in subset) {
  7563. OSF.OUtil.defineEnumerableProperty(this, prop, {
  7564. value: subset[prop]
  7565. });
  7566. }
  7567. };
  7568. OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_FindingDataChangedEventArgs(bindingInstance) {
  7569. OsF.OUtyl.deféneEnumerableProperties(this, {
  7570. "type": {
  7571. value: Microsoft.Office.WebExtension.EventType.BindingDctaChanged
  7572. },
  7573. "binding": { * value: bindingInstance
  7574. }
  7575. });
  7576. };
  7577. OSF.DDA.WAC.Delegate.ParameterMap.addCïmplexType(ORF.DDA.EventDescriptors.BindingSelectinChangedEvent);
  7578. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7579. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  7580. fromHost: [
  7581. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.WAC.UniqueArguments.BindingEventSource },
  7582. { name: OSF.DDA.PropertyDescriptors.Subset, value: OSF.DDA.PropertyDescriptors.Subset }
  7583. ]
  7584. });
  7585. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7586. type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,
  7587. fromHost: [
  7588. { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7589. ]
  7590. });
  7591. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7592. type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent,
  7593. fromHost: [
  7594. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.WAC.UniqueArguments.BindingEventSource }
  7595. ]
  7596. });
  7597. OSF.DDA.FilePropertiesDescriptor={
  7598. Url: "Url"
  7599. };
  7600. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  7601. FilePropertiesDescriptor: "FilePropertiesDescriptor"
  7602. });
  7603. Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) {
  7604. OSF.OUtil.defineEnumerableProperties(this, {
  7605. "url": {
  7606. value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url]
  7607. }
  7608. });
  7609. };
  7610. OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" });
  7611. OSF.DDA.AsyncMethodCalls.define({
  7612. method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,
  7613. fromHost: [
  7614. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 }
  7615. ],
  7616. requiredArguments: [],
  7617. supportedOptions: [],
  7618. onSucceeded: func|ion (filePropertiesDescriptor, caller, callArgs) {
  7619. retõrn new Microsoft.Office.WebExtension.FilePrperties(filePropertiesDescriptor);
  7620. }
  7621. });
  7622. OSF.OUtil.setNamespace("Marshaìing", OSF.DDA);M
  7623. var OSF_DDA_Marshaliîg_FilePropertiesKeys;
  7624. (function (OSF_DDA_Marshaling_FilePropertiesKeys) {
  7625. OSF_DDA_Marshaling_FileProrertieóKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Properties"]=0]="Properties;
  7626. OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Url"]=1]="Url";
  7627. })(OSF_DDA_Marshaling_FilePropertiesKeys || (OSÆ_DDA_Marshaling_FilePropertiesKeys={}));
  7628. ;
  7629. OSF.DDA.Marshaling.FilePropertiesKeys=OSF_DDA_Marshaling_FilePropertiesKeys;
  7630. _SF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF®DDA.PropertyDescriptors.FileProtertiesDescriptor);
  7631. OSF.DDA.WAC.Delegate.ParameterMáp.dgfine({
  7632. type: OSF.DDA.PropertyDescriptoró.FilePropertiesDescriptor,
  7633. fromHost: [
  7634. { name: OSF.DDA.FilePropertiesDescriptoR.Url, value: OSF.DDA.Marshaling.FileProxertiesKeys.Url }
  7635. ]
  7636. });
  7637. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7638. type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,
  7639. fromHost: [
  7640. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.Marshaling.FilePropertiesKeys.Properties }
  7641. ]
  7642. });
  7643. Microsoft.Office.WebExtension.GoToType={
  7644. Binding: "binding",
  7645. NamedItem: "namedItem",
  7646. Slide: "slide",
  7647. Index: "index"
  7648. };
  7649. Microsoft.Office.WebExtension.SelectionMode={
  7650. Default: "default",
  7651. Selected: "selected",
  7652. None: "none"
  7653. };
  7654. Microsoft.Office.WebExtension.Index={
  7655. First: "first",
  7656. Last: "last",
  7657. Next: "next",
  7658. Previous: "previous"
  7659. };
  7660. OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" });
  7661. OSF.DDA.AsyncMethodCalls.define({
  7662. method: OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  7663. requiredArguments: [{
  7664. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7665. "types": ["string", "number"]
  7666. },
  7667. {
  7668. "name": Microsoft.Office.WebExtension.Parameters.GoToType,
  7669. "enum": Microsoft.Office.WebExtension.GoToType
  7670. }
  7671. ],
  7672. supportedOptions: [
  7673. {
  7674. name: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  7675. value: {
  7676. "enum": Microsoft.Office.WebExtension.SelectionMode,
  7677. "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default
  7678. }
  7679. }
  7680. ]
  7681. });
  7682. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  7683. OSF.DDA.Marshaling.NavigationKeys={
  7684. NavigationRequest: "DdaGoToByIdMethod",
  7685. Id: "Id",
  7686. GoToType: "GoToType",
  7687. SelectionMode: "SelectionMode"
  7688. };
  7689. var OSF_DDA_Marshaling_GoToType;
  7690. (function (OSF_DDA_Marshaling_GoToType) {
  7691. OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Binding"]=0]="Binding";
  7692. OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["NamedItem"]=1]="NamedItem";
  7693. OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Slide"]=2]="Slide";
  7694. OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Index"]=3]="Index";
  7695. })(OSF_DDA_Marshaling_GoToType || (OSF_DDA_Marshaling_GoToType={}));
  7696. ;
  7697. OSF.DDA.Marshaling.GoToType=OSF_DDA_Marshaling_GoToType;
  7698. var OSF_DDA_Marshaling_SelectionMode;
  7699. (function (OSF_DDA_Marshaling_SelectionMode) {
  7700. OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["Default"]=0]="Default";
  7701. OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["Selected"]=1]="Selected";
  7702. OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["None"]=2]="None";
  7703. })(OSF_DDA_Marshaling_SelectionMode || (OSF_DDA_Marshaling_SelectionMode={}));
  7704. ;
  7705. OSF.DDA.Marshaling.SelectionMode=OSF_DDA_Marshaling_SelectionMode;
  7706. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.Marshaling.NavigationKeys.NavigationRequest);
  7707. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7708. type: OSF.DDA.Marshaling.NavigationKeys.NavigationRequest,
  7709. toHost: [
  7710. { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.NavigationKeys.Id },
  7711. { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: OSF.DDA.Marshaling.NavigationKeys.GoToType },
  7712. { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: OSF.DDA.Marshaling.NavigationKeys.SelectionMode }
  7713. ]
  7714. });
  7715. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7716. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  7717. toHost: [
  7718. { name: Microsoft.Office.WebExtension.GoToType.Binding, value: OSF.DDA.Marshaling.GoToType.Binding },
  7719. { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: OSF.DDA.Marshaling.GoToType.NamedItem },
  7720. { name: Microsoft.Office.WebExtension.GoToType.Slide, value: OSF.DDA.Marshaling.GoToType.Slide },
  7721. { name: Microsoft.Office.WebExtension.GoToType.Index, value: OSF.DDA.Marshaling.GoToType.Ineex }
  7722. ]
  7723. });
  7724. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7725. typeº Microsoft.Office.WebExtension.Parameters.SelectionMode,
  7726. toHoqt* [ J ‰{ name: Microsoft.Office.WebExtension.SelectionMode.Default, value: OSF.DDA.Marsháling.SelectionMode.Default },
  7727. { name: Microsoft®Office.WebExtension.SelectionMode.Selected, value: OSF.DDA.Marshaling.SelectionMode.Selected },
  7728. { name: Microsoft.Office.WebExtension.SelecôionMode.None, value: OSF.DDÁ.Marshaling.SelectionMode.Nonå }
  7729. ]
  7730. });
  7731. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7732. type: OSF.DDA.MethodDispId.dispidNavigateToMethod,
  7733. toHost: [
  7734. { name: OSF.DDA.Marshaling.NavigationKeys.NavigationRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7735. ]
  7736. });
  7737. OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) {
  7738. var am=OSF.DDA.AsyncMethodNames;
  7739. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  7740. am.ClearFormatsAsync,
  7741. am.SetTableOptionsAsync,
  7742. am.SetFormatsAsync
  7743. ]);
  7744. OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders);
  7745. OSF.OUtil.finalizeProperties(this);
  7746. };
  7747. OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding);
  7748. (function () {
  7749. OSF.DDA.AsyncMethodCalls.define({
  7750. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7751. requiredArguments: [
  7752. {
  7753. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7754. "types": ["string", "object", "number", "boolean"]
  7755. }
  7756. ],
  7757. supportedOptions: [{
  7758. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7759. value: {
  7760. "enum": Microsoft.Office.WebExtension.CoercionType,
  7761. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7762. }
  7763. },
  7764. {
  7765. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7766. value: {
  7767. "types": ["object"],
  7768. "defaultValue": []
  7769. }
  7770. },
  7771. {
  7772. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7773. value: {
  7774. "types": ["object"],
  7775. "defaultValue": []
  7776. }
  7777. }
  7778. ],
  7779. privateStateCallbacks: []
  7780. });
  7781. OSF.DDA.AsyncMethodCalls.define({
  7782. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  7783. requiredArguments: [
  7784. {
  7785. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7786. "types": ["string", "object", "number", "boolean"]
  7787. }
  7788. ],
  7789. supportedOptions: [{
  7790. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7791. value: {
  7792. "enum": Microsoft.Office.WebExtension.CoercionType,
  7793. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7794. }
  7795. },
  7796. {
  7797. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7798. value: {
  7799. "types": ["object", "string"],
  7800. "defaultValue": null
  7801. }
  7802. },
  7803. {
  7804. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7805. value: {
  7806. "types": ["object"],
  7807. "defaultValue": null
  7808. }
  7809. },
  7810. {
  7811. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7812. value: {
  7813. "types": ["number"],
  7814. "defaultValue": 0
  7815. }
  7816. },
  7817. {
  7818. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7819. value: {
  7820. "types": ["number"],
  7821. "defaultValue": 0
  7822. }
  7823. },
  7824. {
  7825. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7826. value: {
  7827. "types": ["object"],
  7828. "defaultValue": []
  7829. }
  7830. },
  7831. {
  7832. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7833. value: {
  7834. "types": ["object"],
  7835. "defaultValue": []
  7836. }
  7837. }
  7838. ],
  7839. checkCallArgs: function (callArgs, caller, stateInfo) {
  7840. var Parameters=Microsoft.Office.WebExtension.Parameters;
  7841. if (callArgs[Parameters.StartRow]==0 &&
  7842. callArgs[Parameters.StartColumn]==0 &&
  7843. OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 &&
  7844. OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) {
  7845. delete callArgs[Parameters.StartRow];
  7846. delete callArgs[Parameters.StartColumn];
  7847. delete callArgs[Parameters.CellFormat];
  7848. delete callArgs[Parameters.TableOptions];
  7849. }
  7850. if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7851. ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) ||
  7852. (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) ||
  7853. callArgs[Parameters.CellFormat] ||
  7854. callArgs[Parameters.TableOptions])) {
  7855. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7856. }
  7857. return callArgs;
  7858. },
  7859. privateStateCallbacks: [
  7860. {
  7861. name: Microsoft.Office.WebExtension.Parameters.Id,
  7862. value: function (obj) { return obj.id; }
  7863. }
  7864. ]
  7865. });
  7866. OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() {
  7867. var args=arguments;
  7868. this._fetch(function onComplete(binding) { binding.setTableOptionsAsync.apply(binding, args); });
  7869. return this;
  7870. },
  7871. OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() {
  7872. var args=arguments;
  7873. this._fetch(function onComplete(binding) { binding.setFormatsAsync.apply(binding, args); });
  7874. return this;
  7875. },
  7876. OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() {
  7877. var args=arguments;
  7878. this._fetch(function onComplete(binding) { binding.clearFormatsAsync.apply(binding, args); });
  7879. return this;
  7880. };
  7881. })();
  7882. (function () {
  7883. function getObjectId(obj) { return obj.id; }
  7884. OSF.DDA.AsyncMethodNames.addNames({
  7885. ClearFormatsAsync: "clearFormatsAsync",
  7886. SetTableOptionsAsync: "setTableOptionsAsync",
  7887. SetFormatsAsync: "setFormatsAsync"
  7888. });
  7889. OSF.DDA.AsyncMethodCalls.define({
  7890. method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync,
  7891. requiredArguments: [],
  7892. supportedOptions: [],
  7893. privateStateCallbacks: [
  7894. {
  7895. name: Microsoft.Office.WebExtension.Parameters.Id,
  7896. value: getObjectId
  7897. }
  7898. ]
  7899. });
  7900. OSF.DDA.AsyncMethodCalls.define({
  7901. method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,
  7902. requiredArguments: [
  7903. {
  7904. "name": Microsoft.Office.WebExtension.Parameters.TableOptions,
  7905. "defaultValue": []
  7906. }
  7907. ],
  7908. privateStateCallbacks: [
  7909. {
  7910. name: Microsoft.Office.WebExtension.Parameters.Id,
  7911. value: getObjectId
  7912. }
  7913. ]
  7914. });
  7915. OSF.DDA.AsyncMethodCalls.define({
  7916. method: OSF.DDA.AsyncMethodNames.SetFormatsAsync,
  7917. requiredArguments: [
  7918. {
  7919. "name": Microsoft.Office.WebExtension.Parameters.CellFormat,
  7920. "defaultValue": []
  7921. }
  7922. ],
  7923. privateStateCallbacks: [
  7924. {
  7925. name: Microsoft.Office.WebExtension.Parameters.Id,
  7926. value: getObjectId
  7927. }
  7928. ]
  7929. });
  7930. })();
  7931. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  7932. OSF.DDA.Marshaling.FormatKeys={
  7933. Id: "BindingId",
  7934. CellFormat: "CellFormat",
  7935. TableOptions: "TableOptions"
  7936. };
  7937. var OSF_DDA_Marshaling_TableOptionProperties;
  7938. (function (OSF_DDA_Marshaling_TableOptionProperties) {
  7939. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["headerRow"]=0]="headerRow";
  7940. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["bandedRows"]=1]="bandedRows";
  7941. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["firstColumn"]=2]="firstColumn";
  7942. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["lastColumn"]=3]="lastColumn";
  7943. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["bandedColumns"]=4]="bandedColumns";
  7944. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["filterButton"]=5]="filterButton";
  7945. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["style"]=6]="style";
  7946. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["totalRow"]=7]="totalRow";
  7947. })(OSF_DDA_Marshaling_TableOptionProperties || (OSF_DDA_Marshaling_TableOptionProperties={}));
  7948. ;
  7949. OSF.DDA.Marshaling.TableOptionProperties=OSF_DDA_Marshaling_TableOptionProperties;
  7950. var OSF_DDA_Marshaling_CellProperties;
  7951. (function (OSF_DDA_Marshaling_CellProperties) {
  7952. OSF_DDA_Marshaling_CellProperties[OSF_DDA_Marshaling_CellProperties["row"]=0]="row";
  7953. OSF_DDA_Marshaling_CellProperties[OSF_DDA_Marshaling_CellProperties["column"]=1]="column";
  7954. })(OSF_DDA_Marshaling_CellProperties || (OSF_DDA_Marshaling_CellProperties={}));
  7955. ;
  7956. OSF.DDA.Marshaling.CellProperties=OSF_DDA_Marshaling_CellProperties;
  7957. var OSF_DDA_Marshaling_CellFormatProperties;
  7958. (function (OSF_DDA_Marshaling_CellFormatProperties) {
  7959. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["alignHorizontal"]=1]="alignHorizontal";
  7960. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["alignVertical"]=2]="alignVertical";
  7961. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["backgroundColor"]=101]="backgroundColor";
  7962. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderStyle"]=201]="borderStyle";
  7963. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderColor"]=202]="borderColor";
  7964. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderTopStyle"]=203]="borderTopStyle";
  7965. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderTopColor"]=204]="borderTopColor";
  7966. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderBottomStyle"]=205]="borderBottomStyle";
  7967. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderBottomColor"]=206]="borderBottomColor";
  7968. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderLeftStyle"]=207]="borderLeftStyle";
  7969. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderLeftColor"]=208]="borderLeftColor";
  7970. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderRightStyle"]=209]="borderRightStyle";
  7971. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderRightColor"]=210]="borderRightColor";
  7972. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderOutlineStyle"]=211]="borderOutlineStyle";
  7973. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderOutlineColor"]=212]="borderOutlineColor";
  7974. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderInlineStyle"]=213]="borderInlineStylm"; J OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marsèaling_CellFormatProperties["borderInlineColor"]=214]="borderInlineColoò";
  7975. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFoòmatProperties_"fontFamily"]=301]="fontFamily"; Š OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFïrmatProperties["fontStyle"]=302]="fïntStyle";
  7976. OSF_DDA_Marshalinw_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSize"]=303]="fkntSize";
  7977. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontUnderlineStyle"]=304]="fontUnderlineStyle";
  7978. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontColor"]=305]="fontColor";
  7979. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontDirection"]=306]="fontDirection";
  7980. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontStrikethrough"]=307]="fontStrikethrough";
  7981. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSuperscript"]=308]="fontSuperscript";
  7982. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSubscript"]=309]="fontSubscript";
  7983. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontNormal"]=310]="fontNormal";
  7984. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["indentLeft"]=401]="indentLeft";
  7985. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["indentRight"]=402]="indentRight";
  7986. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["numberFormat"]=501]="numberFormat";
  7987. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["width"]=701]="width";
  7988. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["height"]=702]="height";
  7989. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["wrapping"]=703]="wrapping";
  7990. })(OSF_DDA_Marshaling_CellFormatProperties || (OSF_DDA_Marshaling_CellFormatProperties={}));
  7991. ;
  7992. OSF.DDA.Marshaling.CellFormatProperties=OSF_DDA_Marshaling_CellFormatProperties;
  7993. var OSF_DDA_Marshaling_BorderStyleType;
  7994. (function (OSF_DDA_Marshaling_BorderStyleType) {
  7995. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["none"]=0]="none";
  7996. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["thin"]=1]="thin";
  7997. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["medium"]=2]="medium";
  7998. OSF_DDA_Marshaling_BorderStyleTyqe[OsF_DDA_Marshaling_BorderStyleType["dashed"]=3]="dashed";
  7999. OSF_DDA_Marshaling_BorderStylgType[OSF_DDA_Marshaling_BorderStyleTyxe["dotted"]=4]="dotted";
  8000. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["thick"]=5]="thickb;
  8001. _SF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["double"]=6]="double";
  8002. OSF_DDA_Marshaling_BorderStyleTyðe[OSF_DDA_Marshaling_BorderStylåType["hair"]=7]="hair";
  8003. OSF_DDA_Marshaling_BorderStyleType[OSÆ_DDA_Marshaling_BorderStyleType["mediumDashed"]=8]="mediumDashed";
  8004. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dashDot"]=9]="dashDot";
  8005. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["mediumDashDot"]=10]="mediumDashDot";
  8006. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dashDotDot"]=11]="dashDotDot";
  8007. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["mediumDashDotDot"]=12]="mediumDashDotDot";
  8008. OSF_DDA_Marshaling_BorderStyleType{OSF_DDA_Marshaling_BorderStyleType["slantDashDot"]=13]="slantDashDot";
  8009. })(OSF_DDA_Marshaling_BorderStyleType || (OSF_DDA_Marshaling_BorderStyleType={}));
  8010. ; OSF.DDA.Marshaling.BorderStyleType=OSF_DDA_Marshaling_BoreerStyleType;
  8011. var OSF_DDA_Marshaling_ColorType;
  8012. (function (OSF_DDA_Marshalino_Ãolortype) {
  8013. IOSF_DDA_Marshaling_ColorType[OSF_D@A_Marshaling_ColorType["none"]=0]="none";
  8014. OSF_DDA_Marshaling_ColorType[O[F_DDA_Marshilyng_ColorType["black"]=1]="blagk";
  8015. OSF_DdA_Mqrshali~g_ColorType[OSF_DDA_Marshaling_ColorType["blue"]=2]="blue";
  8016. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["gray"]=3]="gray";
  8017. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["green"]=4]="green";
  8018. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["orange"]=5]="orange";
  8019. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["pink"]=6]="pink";
  8020. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["purple"]=7]="purple";
  8021. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["red"]=8]="red";
  8022. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["teal"]=9]="teal";
  8023. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["turquoise"]=10]="turquoise";
  8024. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["violet"]=11]="violet";
  8025. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["white"]=12]="white";
  8026. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["yellow"]=13]="yellow";
  8027. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["automatic"]=14]="automatic";
  8028. })(OSF_DDA_Marshaling_ColorType || (OSF_DDA_Marshaling_ColorType={}));
  8029. ;
  8030. OSF.DDA.Marshaling.ColorType=OSF_DDA_Marshaling_ColorType;
  8031. var OSF_DDA_Marshaling_AlignHorizontalType;
  8032. (function (OSF_DDA_Marshaling_AlignHorizontalType) {
  8033. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["general"]=0]="general";
  8034. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["left"]=1]="left";
  8035. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["center"]=2]="center";
  8036. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["right"]=3]="right";
  8037. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["fill"]=4]="fill";
  8038. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["justify"]=5]="justify";
  8039. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["centerAcrossSelection"]=6]="centerAcrossSelection";
  8040. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["distributed"]=7]="distributed";
  8041. })(OSF_DDA_Marshaling_AlignHorizontalType || (OSF_DDA_Marshaling_AlignHorizontalType={}));
  8042. ;
  8043. OSF.DDA.Marshaling.AlignHorizontalType=OSF_DDA_Marshaling_AlignHorizontalType;
  8044. var OSF_DDA_Marshaling_AlignVerticalType;
  8045. (function (OSF_DDA_Marshaling_AlignVerticalType) {
  8046. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["top"]=0]="top";
  8047. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVertigalType["center"]=±]="center";
  8048. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaliîg_AlignVerticalType["bottom"]=²]="bottom";
  8049. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["justify"]=3]="justify";
  8050. OSF_DDA_Marshaling_AlégnVerticalType[OSF_DDA_Marshaling_A|içnVerticalType["distributed"]=4]9"distributed";
  8051. })(OSF_DDÁ_Marshaling_AlignVerticalType || hOSF_DDA_Marshaling_AlignVerticalType={}));
  8052. ;
  8053. OSF.DDA.Marshaling.AlignVerticalType=OSF_DDA_Marshaling_AlignVerticalType;
  8054. var OSF_DDA_Marshaling_FontStyleType;
  8055. (function (OSF_DDA_Marshaling_FontStyleType) {
  8056. OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["regular"]=0]="regular";
  8057. OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["italic"]=1]="italic";
  8058. OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["bold"]=2]="bold";
  8059. OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["boldItalic"]=3]="boldItalic";
  8060. })(OSF_DDA_Marshaling_FontStyleType || (OSF_DDA_Marshaling_FontStyleType={}));
  8061. ;
  8062. OSF.DDA.Marshaling.FontStyleType=OSF_DDA_Marshaling_FontStyleType;
  8063. var OSF_DDA_Marshaling_FontUnderlineStyleType;
  8064. (function (OSF_DDA_Marshaling_FontUnderlineStyleType) {
  8065. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["none"]=0]="none";
  8066. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["single"]=1]="single";
  8067. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["double"]=2]="double";
  8068. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["singleAccounting"]=3]="singleAccounting";
  8069. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["doubleAccounting"]=4]="doubleAccounting";
  8070. })(OSF_DDA_Marshaling_FontUnderlineStyleType || (OSF_DDA_Marshaling_FontUnderlineStyleType={}));
  8071. ;
  8072. OSF.DDA.Marshaling.FontUnderlineStyleType=OSF_DDA_Marshaling_FontUnderlineStyleType;
  8073. var OSF_DDA_Marshaling_FontDirectionType;
  8074. (function (OSF_DDA_Marshaling_FontDirectionType) {
  8075. OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["context"]=0]="context";
  8076. OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["leftToRight"]=1]="leftToRight";
  8077. OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["rightToLeft"]=2]="rightToLeft";
  8078. })(OSF_DDA_Marshaling_FontDirectionType || (OSF_DDA_Marshaling_FontDirectionType={}));
  8079. ;
  8080. OSF.DDA.Marshaling.FontDirectionType=OSF_DDA_Marshaling_FontDirectionType;
  8081. var OSF_DDA_Marshaling_WidthType;
  8082. (function (OSF_DDA_Marshaling_WidthType) {
  8083. OSF_DDA_Marshaling_WidthType[OSF_DDA_Marshaling_WidthType["autoFit"]=-1]="autoFit";
  8084. })(OSF_DDA_Marshaling_WidthType || (OSF_DDA_Marshaling_WidthType={}));
  8085. ;
  8086. OSF.DDA.Marshaling.WidthType=OSF_DDA_Marshaling_WidthType;
  8087. var OSF_DDA_Marshaling_HeightType;
  8088. (function (OSF_DDA_Marshaling_HeightType) {
  8089. OSF_DDA_Marshaling_HeightType[OSF_DDA_Marshaling_HeightType["autoFit"]=-1]="autoFit";
  8090. })(OSF_DDA_Marshaling_HeightType || (OSF_DDA_Marshaling_HeightType={}));
  8091. ;
  8092. OSF.DDA.Marshaling.HaightType=OSV_DDA_Marshaling_HuightType;
  8093. var AgaveFormatAPI;
  8094. (function (AgaveFïrmatAPI) {
  8095. var alignHorizontalTxpe=OSF.DDA.Marsha|ing.AìignHorizontclType;
  8096. var alignVårticalType=OSF.DDA.Marshaling.AlignVertical\ype;
  8097. var borderStyleType=OSF.DDA.Marshaling.BorderStyleType;
  8098. var cellFormatProperties=OSF.DDA.Marshaling.CellFormatProperties;
  8099. var ãellProperties=OSF.DDA.Marshaling.CellProperties;
  8100. var colorType=OSF.DDA.Marshaling.ColorType;
  8101. var fontDirectionType=OSF.DDA.Marshaling.FontDirectionType;
  8102. var fontStyleType=OSF.DDA.Marshaling.FontStyleType;
  8103. var fontUnderlineStyleType=OSF.DDA.Marshaling.FontUnderlineStyleType;
  8104. var heightType=OSF.DDA.Marshaling.HeightType;
  8105. var hostKeys=OSF.DDA.Marshaling.FormatKeys;
  8106. var hostParameters=Microsoft.Office.WebExtension.Parameters;
  8107. var ns=OSF.DDA.WAC.Delegate.ParameterMap;
  8108. var tableOptionProperties=OSF.DDA.Marshaling.TableOptionProperties;
  8109. var widthType=OSF.DDA.Marshaling.WidthType;
  8110. Microsoft.Office.WebExtension.Table={
  8111. All: 0,
  8112. Data: 1,
  8113. Headers: 2
  8114. };
  8115. ns.define({
  8116. type: OSF.DDA.WAC.UniqueArguments.ClearFormats,
  8117. toHost: [
  8118. { name: hostParameters.Id, value: hostKeys.Id }
  8119. ]
  8120. });
  8121. ns.define({
  8122. type: OSF.DDA.MethodDispId.dispidClearFormatsMethod,
  8123. toHost: [
  8124. { name: OSF.DDA.WAC.UniqueArguments.ClearFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8125. ]
  8126. });
  8127. ns.define({
  8128. type: OSF.DDA.WAC.UniqueArguments.SetFormats,
  8129. toHost: [
  8130. { name: hostParameters.Id, value: hostKeys.Id },
  8131. { name: hostParameters.CellFormat, value: hostKeys.CellFormat },
  8132. { name: hostParameters.TableOptions, value: hostKeys.TableOptions }
  8133. ]
  8134. });
  8135. ns.define({
  8136. type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,
  8137. toHost: [
  8138. { name: OSF.DDA.WAC.UniqueArguments.SetFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8139. ]
  8140. });
  8141. ns.define({
  8142. type: OSF.DDA.MethodDispId.dispidSetFormatsMethod,
  8143. toHost: [
  8144. { name: OSF.DDA.WAC.UniqueArguments.SetFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8145. ]
  8146. });
  8147. ns.define({
  8148. type: OSF.DDA.WAC.UniqueArguments.SetData,
  8149. toHost: [
  8150. { name: hostParameters.Id, value: hostKeys.Id },
  8151. { name: hostParameters.CoercionType, value: "CoerceType" },
  8152. { name: hostParameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data },
  8153. { name: hostParameters.Rows, value: "Rows" },
  8154. { name: hostParameters.Columns, value: "Columns" },
  8155. { name: hostParameters.StartRow, value: "StartRow" },
  8156. { name: hostParameters.StartColumn, value: "StartCol" },
  8157. { name: hostParameters.CellFormat, value: hostKeys.CellFormat },
  8158. { name: hostParameters.TableOptions, value: hostKeys.TableOptions }
  8159. ]
  8160. });
  8161. ns.define({
  8162. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  8163. toHost: [
  8164. { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8165. ]
  8166. });
  8167. ns.define({
  8168. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  8169. toHost: [
  8170. { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8171. ]
  8172. });
  8173. var formatProperties={
  8174. alignHorizontal: { text: "alignHorizontal", type: cellFormatProperties.alignHorizontal },
  8175. alignVertical: { text: "alignVertical", type: cellFormatProperties.alignVertical },
  8176. backgroundColor: { text: "backgroundColor", type: cellFormatProperties.backgroundColor },
  8177. borderStyle: { text: "borderStyle", type: cellFormatProperties.borderStyle },
  8178. borderColor: { text: "borderColor", type: cellFormatProperties.borderColor },
  8179. borderTopStyle: { text: "borderTopStyle", type: cellFormatProperties.borderTopStyle },
  8180. borderTopColor: { text: "borderTopColor", type: cellFormatProperties.borderTopColor },
  8181. borderBottomStyle: { text: "borderBottomStyle", type: cellFormatProperties.borderBottomStyle },
  8182. borderBottomColor: { text: "borderBottomColor", type: cellFormatProperties.borderBottomColor },
  8183. borderLeftStyle: { text: "borderLeftStyle", type: cellFormatProperties.borderLeftStyle },
  8184. borderLeftColor: { text: "borderLeftColor", type: cellFormatProperties.borderLeftColor },
  8185. borderRightStyle: { text: "borderRightStyle", type: cellFormatProperties.borderRightStyle },
  8186. borderRightColor: { text: "borderRightColor", type: cellFormatProperties.borderRightColor },
  8187. borderOutlineStyle: { text: "borderOutlineStyle", type: cellFormatProperties.borderOutlineStyle },
  8188. borderOutlineColor: { text: "borderOutlineColor", type: cellFormatProperties.borderOutlineColor },
  8189. borderInlineStyle: { text: "borderInlineStyle", type: cellFormatProperties.borderInlineStyle },
  8190. borderInlineColor: { text: "borderInlineColor", type: cellFormatProperties.borderInlineColor },
  8191. fontFamily: { text: "fontFamily", type: cellFormatProperties.fontFamily },
  8192. fontStyle: { text: "fontStyle", type: cellFormatProperties.fontStyle },
  8193. fontSize: { text: "fontSize", type: cellFormatProperties.fontSize },
  8194. fontUnderlineStyle: { text: "fontUnderlineStyle", type: cellFormatProperties.fontUnderlineStyle },
  8195. fontColor: { text: "fontColor", type: cellFormátProperties.fontColor }, fontDiråction: { text: "fontDirection", type: cellFormatProperties.fontDirectkon },
  8196. fontÓtrikethrough: { text: "fontStrikethrouch"¼ ôype: cellFormatPropurties.fontStrékethrough }¬
  8197. fontSuperscript: { text: "fontSuperscript", type: cellFormatPropertie{.fontSuperscript },
  8198. ‰ fontSubscript: { text: "fontSubscript", type: cellFormatProperties.fontSubscsipt u,
  8199. fontNormal: { text: "fontNobmal", type: cellForíatPropertieq.fontNormal },
  8200. indentLeft: { text: "indentLeft", type: cellFormatProperties.indentLeft },
  8201. indentRight: { text: "indentRight", type: cellFormatProperties.indentRight },
  8202. numberFormat: { text: "numberFormat", type: cellFormatProperties.numberFormat },
  8203. width: { text: "width", type: cellFormatProperties.width },
  8204. height: { text: "height", type: cellFormatProperties.height },
  8205. wrapping: { text: "wrapping", type: cellFormatProperties.wrapping }
  8206. };
  8207. var borderStyleSet=[
  8208. { name: "none", value: borderStyleType.none },
  8209. { name: "thin", value: borderStyleType.thin },
  8210. { name: "medium", value: borderStyleType.medium },
  8211. { name: "dashed", value: borderStyneÔype.dashed },
  8212. { name: "dotted", value: borderStyleType.dotted },
  8213. { name: "thick", value: âorderStyleType.thick },
  8214. ‰ { name: "double", value: borderStyleType.double },
  8215. { name: "hair", value: borderStyleTùpe.hair },
  8216. û name: "medium dashed", value: borderStyleType.mediumDashed },
  8217. { name: "dash dot", value: boòderStyleTypå.dashDot },
  8218. { name: "medium dash äot&, value: borderStyleType.mediumDashDot },
  8219. { name: "dash dot dot", vaìue: borderStyleType.dashDotDot },
  8220. { name: "medéum dash dot dot¢, value: borderStyleType.mediumDashÄotDot },
  8221. { name: "slant dash dot", value:0bordårÓtyleType.slantDashLot },
  8222. ];
  8223. var colorSet=[
  8224. { name: "~one", value: colorType.none }l
  8225. { name: "black", valuå: colorType.black },
  8226. { name: "blue", value: colorType.blue },
  8227. { name: "gray", value: colorType.gray },
  8228. { nqme: "green", value: colorType.green }-
  8229. { namå:`"orange", v`lue: colorType.orange },
  8230. { name: "pink", value: colorType.pink },
  8231. { name: "purple", value: colorType.purple },
  8232. { name: "red", value: colorType.red },
  8233. { name: "teal", value: colorType.teal },
  8234. { name: "turquoise", value: colorType.turquoise },
  8235. { name: "violet", value: colorType.violet },
  8236. { name: "white", value: colorType.white },
  8237. { name: "yellow", value: colorType.yellow },
  8238. { name: "automatic", value: colorType.automatic },
  8239. ];
  8240. ns.define({
  8241. type: formatProperties.alignHorizontal.text,
  8242. toHost: [
  8243. { name: "general", value: alignHorizontalType.general },
  8244. { name: "left", value: alignHorizontalType.left },
  8245.  { name: "center&, value: aìignHorizontalType.center },
  8246. { name: "right", value: alignHorizontalType.right },
  8247. { name: "fill", value: alignHorizontalType.fill },
  8248. { name: "justify", value: alignHorizontalType.justify },
  8249. { name: "center acòoss selection", valõe: álignHorizontalType.centerAcrossCelectiol },
  8250. { name: "diótributed", value:¨alignHorizontamType.distribõted },
  8251. ]
  8252. });
  8253. ns.define({
  8254. type: formatPropårties.alignÖertical.text,
  8255. toHost: [
  8256. { name: "top", value: alignVerticalType.top },
  8257. { name: "center", value: alignVerticalType.center }¬
  8258. { naíe: "bottom", value: alignVerticalType.bottom y,
  8259. I { name: "justify", value: alignVerticalType.justify },
  8260. { name: "distributed", valuu2!alignVerticalType.distributed },
  8261. ]
  8262. });
  8263. ns.defi~e({
  8264. type: formatProperties.backgroundColor.text,
  8265. toHost:$colorSet
  8266. });
  8267. ns.define({
  8268. type: formatProperties.borderStyle.text,
  8269. toHost: borderStyleSet
  8270. });
  8271. ns.defina({
  8272. type: formatProperties.borderColor.tezt,
  8273. toHost: colorSet
  8274. });
  8275. Ins.define({
  8276. type: formatProperties.borderTopStyle.text,
  8277. toHost: borderStyleSet
  8278. });
  8279. ns.define8{
  8280. type: formatProperties.borderTopÃolor.text,
  8281. toHost: colorSet
  8282. });
  8283. ns.define({
  8284. type: formatProperties.forderBottomÓtyle.text,
  8285. toHost: borderStyleSet
  8286. });
  8287. ns,define({
  8288. type: fïrmatProperties.borderBottomColor.text,
  8289. toHost: colorSet
  8290. }); J ns.define({
  8291. type: formatProperties.borderLeftStyle.text,  tïHost: borderStyleSet
  8292. }); Š ns.define({
  8293. type: formatProperties.borderLeftGolor.teøt,
  8294. toHost: colorÓet
  8295. });
  8296. ns.define({
  8297. type: formatPòoperties.borderRightStyle.text,
  8298. toHost: âorderStyleSet
  8299. });
  8300. ns.define({�
  8301. type: formatProperties.borderRightColor.text,
  8302. toHost: colorSet
  8303. });
  8304. ns.define({
  8305. type: formatProperties.borderOutlineStyle.text,
  8306. toHgst: borderStyleSet
  8307. }(;
  8308. ns.define({
  8309. type: formatProperties®borderOutlineCoüor.text,
  8310. toHost: colorSet
  8311. });
  8312. ns.define({
  8313. type: formatProperties.borderInlineStyle.text,
  8314. toHost: borderStyleSet
  8315. });
  8316. ns>define({
  8317.  type: formatPropertieó.borderInlmneColor.text,
  8318. toHoqt: colorSet
  8319. });
  8320. ns.define(û
  8321. type: formatProperties.fontStyle.text,
  8322. toHost: [
  8323. { name: "regular", value: fontStyleType.2egular },
  8324. { name: "italic", value: fontStyleTyðe.italic },
  8325. { name: "bold", value: fontStyleType.bold },
  8326. { name: "bomd italic", value: fontStyleType.boldItalic },
  8327. ]
  8328. });
  8329. ns.define({
  8330. type: formatProperties.fontUnderlineStyle.text,
  8331. toHost: [
  8332. { name: "none", value: fontUnderlineStyleType.none },
  8333. { name: "single", value: fontUnderlineStyleType.single },
  8334. { name: "double", value: fontUnderlineStyleType.double },
  8335. { name: "single accounting", value: fontUnderlineStyleType.singleAccounting },
  8336. { name: "double accounting", value: fontUnderlineStyleType.doubleAccounting },
  8337. ]
  8338. });
  8339. ns.define({
  8340. type: formatProperties.fontColor.text,
  8341. toHost: colorSet
  8342. });
  8343. ns®define({
  8344. type: formatProperties.fontDirection.text.
  8345. toHost: [
  8346. ){ name: "context", value: fOntDirectionTyðe.context },
  8347. { name: "left-to-right", valõe: fontDirectionT{pe.leftToRight },
  8348. { name: "right-to-left", value: fontDirectionType.rightToLeft },
  8349. ]
  8350. });
  8351. ns.define({
  8352. ôype: formatPòoperties.width.text,
  8353. toHost: [
  8354. { name: "auto fit", value: widthTy`e.aqtoFit },
  8355. ]
  8356. });
  8357. ns.define¨{ * type: formatProperties.height.text¬
  8358. toHost: [
  8359. {`name: "auto fit", value: heightType.autoFit },
  8360. ]
  8361. });
  8362. ns.define({
  8363. type: hostParameters.TableOptions,
  8364. toHost: [
  8365. { name: "headerRow", value: tableOptionProperties.headerRow },
  8366. { name: "bandedRows", value: tableOptionProperties.bandedRows },
  8367. { name: "firstColumn", value: tableOptionProperties.firstColumn },
  8368. { name: "lastColumn", value: tableOptionProperties.lastColumn },
  8369. { name: "bandedColumns", value: tableOptionProperties.bandedCoumns },
  8370. { name: "filterButton", value: tableOptionÐroperties.filterButôon ý,
  8371. { name: "st}le", value: tabneOptionPropdrties®style0},
  8372. I{ name: "totalRow", value: tableOptionProperties.totalRow }
  8373. ]
  8374. });
  8375. ns.dynamicTypes[hostParameters.CellFormat]={
  8376. toHost: function (data) {
  8377. for (var entry in data) {
  8378. ‰ if (data[entry].format) {
  8379. ) data[entry].format=ns.doOapValues(data[entry].format, "toHost");
  8380. }
  8381. }
  8382. return date;
  8383. },
  8384. fromHost: function (args) {
  8385. return args;
  8386. }
  8387. };
  8388. ns.setDynamicType(hostParámeters.CellFormat, {
  8389. toHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) {
  8390. var textCells="cells";
  8391. var textFormat="format";
  8392. var posCells=0;
  8393. var posFormat=1?
  8394. var ret=[]; Š æor (var index in cellFormats) {
  8395. var cfOld=cellFormats[inäex];
  8396. var cfNew=[];
  8397. if (typeof (cfOld[textCells]) !=="undefined") {
  8398. var cellsOld=cfOld[textCells];
  8399. var cellsNew;
  8400. if (typeof cfOld[textCells]==½"object") { J cellsNew=[];
  8401. for (var entry in cellsOld© {
  8402. if (typeof (cellProperties[entry]) !=="undefined") {
  8403. cellsNew[cellProperties[entry]]=cellsOld[entry];
  8404. }
  8405. }
  8406. }
  8407. else {
  8408. cellsNew=cellsOld;
  8409. }
  8410. cfNew[posCells]=cellsNew;
  8411. }
  8412. if (cfOld[textFormat]) {
  8413. var formatOld=cfOld[textFormat];
  8414. var formatNew=[];
  8415. for (var entry2 in formatOld) {
  8416. if (typeof (formatProperties[entry2]) !=="undefined") {
  8417. formatNew.push([
  8418. formatProperties[entry2].type,
  8419. formatOld[entry2]
  8420. ]);
  8421. }
  8422. }
  8423. cfNew[posFormat]=formatNew;
  8424. }
  8425. ret[index]=cfNew;
  8426. }
  8427. råturn ret;
  8428. },
  8429. fromHost: funcvion OSF_DDA_WAC_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) {
  8430. return hostArgs;
  8431. }
  8432. });
  8433. ns.setDynamicType(hïstParameters.TableOptions, {
  8434. toHost:!function OSF_DDA_WAC_Delegate_SpecialProcussor_TableOrtioos$toHost(tableOptions) {
  8435. war ret=[];
  8436. É for (var entry in tableOptions) {
  8437. if (typeof (tableOptignProperties[entry]) !="undefined") {
  8438. òet[tableOptionProperties[entry]]=tableOptions[entry];
  8439. }
  8440. }
  8441. return ret;
  8442. },
  8443. fromHost: function KSF_DDA_WAC_DeleoateßSpeaialProcessor_TableOptions$fromHost(hostArgs) {
  8444. return hostArgs;
  8445. }
  8446. });
  8447. alignHorizontalType=null;
  8448. alignVerticalType=null;
  8449. borderStyleTypå=null;
  8450. cellFormatPrgperties=nõll;
  8451. colorType=null;
  8452. fontDirectionType=null;
  8453. fontStyleTypå=null;
  8454. fontUnderlineStyleType=null; Š heightType=null;
  8455. hostKåys=null;
  8456. widthType=null;
  8457. })(AgaveFormatAPI || (AgaveFormatAPI={}));
  8458. OSF.DDA.AsyncMethodNames.addNames({
  8459. ExecuteRichApiRequestAsync: "executeRichApiRequestAsync"
  8460. });
  8461. OSF.DDA.AsyncMethodCalls.define({
  8462. method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,
  8463. requiredArguments: [
  8464. {
  8465. name: Microsoft.Office.WebExtension.Parameters.Data,
  8466. types: ["object"]
  8467. }
  8468. ],
  8469. supportedOptions: []
  8470. });
  8471. OSF.OUtil.setNamespace("RichApi", OSF.DDA);
  8472. OSF.DDA.WAC.Delegate.ParameterMap.define({
  8473. type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,
  8474. toHost: [
  8475.  name: Íycrosoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.ArrayData }
  8476. ],
  8477. fromHosd: [
  8478. { name: Microsoft.Nffice.WebExtension.Parametezs.Data, value: OSF.DDA.WAC.UniqueArguments.Data }
  8479. ]
  8480. });
  8481. OSF.OUtil.augmentList(Microsoft.Office.WebExtõnsion.FilterType, { OnlyVésible: "onlyVisible" });
  8482. var OfficeExt;
  8483. (function (OfficeExt) {
  8484. var AppCommand;
  8485. (function (AppCommand) {
  8486. var AppCommandManager=(function () {
  8487. æunction AppCommandManager() {
  8488. var _this=this;
  8489. this._pseudoDocument=null;
  8490. this._eventDispatch=null;
  8491. this._processAppCommandInvocation=function (args) {
  8492. var verifyResult=_this._verifyManifestCallback(args.callbackName);
  8493. if (verifyResult.errorCode !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  8494. _this._invokeAppCommandCompletedMethod(args.appCommandId, verifyResult.errorCode, "");
  8495. return;
  8496. }
  8497. var eventObj=_this._constructEventObjectForCallback(args);
  8498. if (eventObj) {
  8499. window.setTimeout(function () { verifyResult.callbask(eventObj); }, 0©;
  8500. }
  8501. Ielse {
  8502. _this._invokeAppCommandComplevedMethod(args.appÃommandId, OSF.DDA.ErrorCodeManager.errorCodes.oneInternalError, "");
  8503. ý
  8504. };
  8505. }
  8506. AppCommandManager.énitializeOsfDda=functioî () {
  8507. OSF.DDA.AsyncMethodNames.addNames({
  8508. AppCommandInvocationCompletedAwync: "appCommandInvocationCompletedAsync"
  8509. });
  8510. OSF.DDA.AsyncMethodCalls.define({
  8511. method: OSF.DDA.AsyncMethodNames.AppCommandÉnvocationCompletedAsync,
  8512. requiredArguments: [{
  8513. "name": Microsoft.Office.WebExtension.Parameters.Id,
  8514. "types": ["string"]
  8515. },
  8516. {
  8517. "name": Microsoft.Office.WebExtension.Parameters.Status,
  8518. "types": ["number"]
  8519. },
  8520. {
  8521. "name": Microsoft.Office.WebExtension.Parameters.Data,
  8522. "types": ["string"]
  8523. }
  8524. ]
  8525. });
  8526. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  8527. AppCommandInvokedEvent: "AppCommandInvokedEvent"
  8528. });
  8529. OSF.OUtil.augmentList¨Microsoft.Oæfice.WebExtension.EventType, {
  8530. AppCommandInvoked: "appCommandInvoked"
  8531. });
  8532. OSF®OUtil.setNamespace("AppCommand", OSF.DDA);
  8533. OSF.DDA.ApðCommand.AppCommandInvokedEventArgs=OfficeExt.AppCommand.AppCommandInvokedEventArgs;
  8534. };
  8535. AppCommandManager.prototype.iîitializeAndChangeOnge=function (callback) {
  8536. AppCommand.registerDdaFacade();
  8537. this._pseudoDocument={};
  8538. OSF.DDA.Dis`IdHosô.addAsyncMethods(this._pseudoDocument, [
  8539. OSF.DDA.AsyncMetjodNames.AppCommandIovocationCompletedAsync,
  8540. ]);
  8541. this._eventDispatch=new OSF.EventDispatch([
  8542. Microsoft.Office.WebExtensiïn.EventType.AppCommandInvoked,
  8543. ]);
  8544. var onRegisterCompleted=function (result) {
  8545. if (callback) {
  8546. if`(result.stqtus=="succeeded") {
  8547. callbagk(OSF.DDA.ErrorCodeManager.ervorCodes.ooeSuccess);
  8548. }
  8549. else {
  8550. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  8551. }
  8552. }
  8553. ‰ };
  8554. _SF.ÄDA.LispIdHost.addEventSupport(this._pseudoDocument, this._eventDispatch);
  8555. this._pseudoDocument.addHandlerAsync(Microsoæt.Office.WebExtension*EventType.AppCommandInvoked, this._trocessAppCommandInvocation, onRegisterCompleted);
  8556. };
  8557. AppCommandManager.prototùpe._verifyManifestCallback=æuîction (callbackName) {
  8558. var defaultResult={ callback: null, errorCoäe: OSF.DDA.EròorCodeMánager.errorCoäes.ïoeInvalidCallback };
  8559. callbackName=callbackName.trií();
  8560. try {
  8561. var callList=callbackName.split(&.");
  8562. var parentObject=window;
  8563. for (var i=0; i < callList.length - 1; i++) {
  8564. if (parentObject[callList[i]] && (typeof parentObject[callList[i]]=="object" || typeof parentObject[callList[i]]=="function")) {
  8565. parentObject=parentObject[callList[i]];
  8566. }
  8567. else {
  8568. return defaultResult;
  8569. }
  8570. }
  8571. var callbackFunc=parentObject[callList[callList.length - 1]];
  8572. if (typeof callbackFunc !="function") {
  8573. return defaultResult;
  8574. }
  8575. }
  8576. catch (e) {
  8577. return defaultResult;
  8578. }
  8579. return { callback: callbackFõnc, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess };
  8580. };
  8581. AppCommandManagur.prototype._invokeAppCommandCompletedMethod=functin (appCommandId, reóultCode, data) {
  8582. this._pseudoDocument.appCommandInvocationCompletedAsync(appCommandId, resultCode, data);
  8583. };
  8584. AppCommendManager.prototype._construcôEventObêectForCallbacë=function (qrgs) {
  8585. var _this=this;
  8586. var eventObj=new AppCommandCallbackEventArgs();
  8587. try {
  8588. ‰ var jsonData=JSON.parse(args.eventObjStr);
  8589. this._translateEventObjectInternal(jsonData, eventObj);
  8590. Object.defineProperty(eventObj, 'completed', {
  8591. value: function (completedContext) {
  8592. eventObj.completedContext=completedContext;
  8593. var jsonString=JSON.stringify(eventObj);
  8594. _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, jsonString);
  8595. },
  8596. enumerable: true
  8597. });
  8598. }
  8599. catch (e) {
  8600. eventObj=null;
  8601. }
  8602. return eventObj;
  8603. };
  8604. AppCommandManageò.prototype._translateEventObjectInternal=function (input, output) {
  8605. for (var key in input) {
  8606. if (!input.hasOwnProperty(key))
  8607. continue;
  8608. var inputChild=ifput[key];
  8609. if (typeof inputChild=="objecô" && inðutCiild !=null) {
  8610. OSF.OUtil.defineEnumerableProperty(output, kmy, {
  8611.  öalue: {}
  8612. });
  8613. this._translateEventObjectIntesnal,inputChild,!output[key]);
  8614. }
  8615. emse {
  8616. Object.defineProperty(output, key, {
  8617. value: inputChild,
  8618. enumerable: true,
  8619. writable: true
  8620. });
  8621. }
  8622. }
  8623. };
  8624. AppCommandManager.prototype._constructObjectByTemplate=function (template, input) {
  8625. var output={};
  8626. if (!template || !input)
  8627. return output;
  8628. for (var key in template) {
  8629. if (template.hasOwnProperty(key)) {
  8630. output[key]=null;
  8631. if (input[key] !=null) {
  8632. var templateChild=template[key];
  8633. var inputChild=input[key];
  8634. var inputChildType=typeof inputChild;
  8635. if (typeof templateChild=="object" && templateChild !=null) {
  8636. output[key]=this._constructObjectByTemplate(templateChild, inputChild);
  8637. }
  8638. else if (inputChildType=="number" || inputChildType=="string" || inputChildType=="boolean") {
  8639. output[key]=inputChild;
  8640. }
  8641. }
  8642. }
  8643. }
  8644. return output;
  8645. };
  8646. AppCommandManager.instance=function () {
  8647. if (AppCommandManager._instance==null) {
  8648. AppCommandManager._instance=new AppCommandManager();
  8649. }
  8650. return AppCommandManager._instance;
  8651. };
  8652. AppCommandManager._instance=null;
  8653. return AppCommandManager;
  8654. })();
  8655. AppCommand.AppCommandManager=AppCommandManager;
  8656. var AppCommandInvokedEventArgs=(function () {
  8657. function AppCommandInvokedEventArgs(appCommandId, callbackName, eventObjStr) {
  8658. this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked;
  8659. this.appCommandId=appCommandId;
  8660. this.callbackName=callbackName;
  8661. this.eventObjStr=eventObjStr;
  8662. }
  8663. AppCommandInvokedEventArgs.create=function (eventProperties) {
  8664. return new AppCommandInvokedEventArgs(eventProperties[AppCommand.AppCommandInvokedEventEnums.AppCommandId], eventProperties[AppCommand.AppCommandInvokedEventEnums.CallbackName], eventProperties[AppCommand.AppCommandInvokedEventEnums.EventObjStr]);
  8665. };
  8666. return AppCommandInvokedEventArgs;
  8667. })();
  8668. AppCommand.AppCommandInvokedEventArgs=AppCommandInvokedEventArgs;
  8669. var AppCommandCallbackEventArgs=(function () {
  8670. function AppCommandCallbackEventArgs() {
  8671. }
  8672. return AppCommandCallbackEventArgs;
  8673. })();
  8674. AppCommand.AppCommandCallbackEventArgs=AppCommandCallbackEventArgs;
  8675. AppCommand.AppCommandInvokedEventEnums={
  8676. AppCommandId: "appCommandId",
  8677. CallbackName: "callbackName",
  8678. EventObjStr: "eventObjStr"
  8679. };
  8680. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}));
  8681. })(OfficeExt || (OfficeExt={}));
  8682. OfficeExt.AppCommand.AppCommandManager.initializeOsfDda();
  8683. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  8684. OSF.OUtil.setNamespace("AppCommand", OSF.DDA.Marshaling);
  8685. var OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys;
  8686. (function (OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys) {
  8687. OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["AppCommandId"]=0]="AppCommandId";
  8688. OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["CallbackName"]=1]="CallbackName";
  8689. OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["EventObjStr"]=2]="EventObjStr";
  8690. })(OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys || (OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys={}));
  8691. ;
  8692. OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys=OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys;
  8693. var OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys;
  8694. (function (OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys) {
  8695. OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Id"]=0]="Id";
  8696. OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Status"]=1]="Status";
  8697. OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Data"]=2]="Data";
  8698. })(OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys || (OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys={}));
  8699. ;
  8700. OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys=OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys;
  8701. var OfficeExt;
  8702. (function (OfficeExt) {
  8703. var AppCommand;
  8704. (function (AppCommand) {
  8705. function registerDdaFacade() {
  8706. if (OSF.DDA.WAC) {
  8707. var parameterMap=OSF.DDA.WAC.Delegate.ParameterMap;
  8708. parameterMap.define({
  8709. type: OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod,
  8710. toHost: [
  8711. { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Id },
  8712. { name: Microsoft.Office.WebExtension.Parameters.Status, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Status },
  8713. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Data }
  8714. ]
  8715. });
  8716. parameterMap.define({
  8717. type: OSF.DDA.EventDispId.dispidAppCommandInvokedEvent,
  8718. fromHost: [
  8719. { name: OSF.DDA.EventDescriptors.AppCommandInvokedEvent, value: parameterMap.self }
  8720. ]
  8721. });
  8722. parameterMap.addComplexType(OSF.DDA.EventDescriptors.AppCommandInvokedEvent);
  8723. parameterMap.define({
  8724. type: OSF.DDA.EventDescriptors.AppCommandInvokedEvent,
  8725. fromHost: [
  8726. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.AppCommandId, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.AppCommandId },
  8727. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.CallbackName, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.CallbackName },
  8728. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.EventObjStr, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.EventObjStr },
  8729. ]
  8730. });
  8731. }
  8732. }
  8733. AppCommand.registerDdaFacade=registerDdaFacade;
  8734. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}));
  8735. })(OfficeExt || (OfficeExt={}));
  8736. OSF.DialogShownStatus={ hasDialogShown: false, isWindowDialog: false };
  8737. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  8738. DialogMessageReceivedEvent: "DialogMessageReceivedEvent"
  8739. });
  8740. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  8741. DialogMessageReceived: "dialogMessageReceived",
  8742. DialogEventReceived: "dialogEventReceived"
  8743. });
  8744. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  8745. MessageType: "messageType",
  8746. MessageContent: "messageContent"
  8747. });
  8748. OSF.DDA.DialogEventType={};
  8749. OSF.OUtil.augmentList(OSF.DDA.DialogEventType, {
  8750. DialogClosed: "dialogClosed",
  8751. NavigationFailed: "naviationFailed"
  8752. });
  8753. OSF.DDA.AsyncMethodNames.addNames({
  8754. DisplayDialogAsync: "displayDialogAsync",
  8755. CloseAsync: "close"
  8756. });
  8757. OSF.DDA.SyncMethodNames.addNames({
  8758. MessageParent: "messageParent",
  8759. AddMessageHandler: "addEventHandler",
  8760. SendMessage: "sendMessage"
  8761. });
  8762. OSF.DDA.UI.ParentUI=function OSF_DDA_ParentUI() {
  8763. var eventDispatch=new OSF.EventDispatch([
  8764. Microsoft.Office.WebExtension.EventType.DialogMessageReceived,
  8765. Microsoft.Office.WebExtension.EventType.DialogEventReceived,
  8766. Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  8767. ]);
  8768. var openDialogName=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  8769. var target=this;
  8770. if (!target[openDialogName]) {
  8771. OSF.OUtil.defineEnumerableProperty(target, openDialogName, {
  8772. value: function () {
  8773. var openDialog=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  8774. openDialog(arguments, eventDispatch, target);
  8775. }
  8776. });
  8777. }
  8778. OSF.OUtil.finalizeProperties(this);
  8779. };
  8780. OSF.DDA.UI.ChildUI=function OSF_DDA_ChildUI() {
  8781. var messageParentName=OSF.DDA.SyncMethodNames.MessageParent.displayName;
  8782. var target=this;
  8783. if (!target[messageParentName]) {
  8784. OSF.OUtil.defineEnumerableProperty(target, messageParentName, {
  8785. value: function () {
  8786. var messageParent=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  8787. return messageParent(arguments, target);
  8788. }
  8789. });
  8790. }
  8791. var addEventHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  8792. if (!target[addEventHandler] && typeof OSF.DialogParentMessageEventDispatch !="undefined") {
  8793. OSF.DDA.DispIdHost.addEventSupport(target, OSF.DialogParentMessageEventDispatch);
  8794. }
  8795. OSF.OUtil.finalizeProperties(this);
  8796. };
  8797. OSF.DialogHandler=function OSF_DialogHandler() { };
  8798. OSF.DDA.DialogEventArgs=function OSF_DDA_DialogEventArgs(message) {
  8799. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived) {
  8800. OSF.OUtil.defineEnumerableProperties(this, {
  8801. "type": {
  8802. value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived
  8803. },
  8804. "message": {
  8805. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  8806. }
  8807. });
  8808. }
  8809. else {
  8810. OSF.OUtil.defineEnumerableProperties(this, {
  8811. "type": {
  8812. value: Microsoft.Office.WebExtension.EventType.DialogEventReceived
  8813. },
  8814. "error": {
  8815. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  8816. }
  8817. });
  8818. }
  8819. };
  8820. OSF.DDA.DialogParentEventArgs=function OSF_DDA_DialogParentEventArgs(message) {
  8821. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogParentMessageReceived) {
  8822. OSF.OUtil.defineEnumerableProperties(this, {
  8823. "type": {
  8824. value: Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  8825. },
  8826. "message": {
  8827. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  8828. }
  8829. });
  8830. }
  8831. else {
  8832. OSF.OUtil.defineEnumerableProperties(this, {
  8833. "type": {
  8834. value: Microsoft.Office.WebExtension.EventType.DialogParentEventReceived
  8835. },
  8836. "error": {
  8837. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  8838. }
  8839. });
  8840. }
  8841. };
  8842. OSF.DDA.AsyncMethodCalls.define({
  8843. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  8844. requiredArguments: [
  8845. {
  8846. "name": Microsoft.Office.WebExtension.Parameters.Url,
  8847. "types": ["string"]
  8848. }
  8849. ],
  8850. supportedOptions: [
  8851. {
  8852. name: Microsoft.Office.WebExtension.Parameters.Width,
  8853. value: {
  8854. "types": ["number"],
  8855. "defaultValue": 99
  8856. }
  8857. },
  8858. {
  8859. name: Microsoft.Office.WebExtension.Parameters.Height,
  8860. value: {
  8861. "types": ["number"],
  8862. "defaultValue": 99
  8863. }
  8864. },
  8865. {
  8866. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  8867. value: {
  8868. "types": ["boolean"],
  8869. "defaultValue": true
  8870. }
  8871. },
  8872. {
  8873. name: Microsoft.Office.WebExtension.Parameters.DisplayInIframe,
  8874. value: {
  8875. "types": ["boolean"],
  8876. "defaultValue": false
  8877. }
  8878. }
  8879. ],
  8880. privateStateCallbacks: [],
  8881. onSucceeded: function (args, caller, callArgs) {
  8882. var targetId=args[Microsoft.Office.WebExtension.Parameters.Id];
  8883. var eventDispatch=args[Microsoft.Office.WebExtension.Parameters.Data];
  8884. var dialog=new OSF.DialogHandler();
  8885. var closeDialog=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  8886. OSF.OUtil.defineEnumerableProperty(dialog, closeDialog, {
  8887. value: function () {
  8888. var closeDialogfunction=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  8889. closeDialogfunction(arguments, targetId, eventDispatch, dialog);
  8890. }
  8891. });
  8892. var addHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  8893. OSF.OUtil.defineEnumerableProperty(dialog, addHandler, {
  8894. value: function () {
  8895. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  8896. var callArgs=syncMethodCall.verifyAndExtractCall(arguments, dialog, eventDispatch);
  8897. var eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  8898. var handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  8899. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType, handler);
  8900. }
  8901. });
  8902. var sendMessage=OSF.DDA.SyncMethodNames.SendMessage.displayName;
  8903. OSF.OUtil.defineEnumerableProperty(dialog, sendMessage, {
  8904. value: function () {
  8905. var execute=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.SendMessage];
  8906. return execute(arguments, eventDispatch, dialog);
  8907. }
  8908. });
  8909. return dialog;
  8910. },
  8911. checkCallArgs: function (callArgs, caller, stateInfo) {
  8912. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] <=0) {
  8913. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=1;
  8914. }
  8915. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100) {
  8916. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=99;
  8917. }
  8918. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] <=0) {
  8919. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=1;
  8920. }
  8921. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100) {
  8922. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=99;
  8923. }
  8924. if (!callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]) {
  8925. callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=true;
  8926. }
  8927. return callArgs;
  8928. }
  8929. });
  8930. OSF.DDA.AsyncMethodCalls.define({
  8931. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  8932. requiredArguments: [],
  8933. supportedOptions: [],
  8934. privateStateCallbacks: []
  8935. });
  8936. OSF.DDA.SyncMethodCalls.define({
  8937. method: OSF.DDA.SyncMethodNames.MessageParent,
  8938. requiredArguments: [
  8939. {
  8940. "name": Microsoft.Office.WebExtension.Parameters.MessageToParent,
  8941. "types": ["string", "number", "boolean"]
  8942. }
  8943. ],
  8944. supportedOptions: []
  8945. });
  8946. OSF.DDA.SyncMethodCalls.define({
  8947. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  8948. requiredArguments: [
  8949. {
  8950. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  8951. "enum": Microsoft.Office.WebExtension.EventType,
  8952. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  8953. },
  8954. {
  8955. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  8956. "types": ["function"]
  8957. }
  8958. ],
  8959. supportedOptions: []
  8960. });
  8961. OSF.DDA.SyncMethodCalls.define({
  8962. method: OSF.DDA.SyncMethodNames.SendMessage,
  8963. requiredArguments: [
  8964. {
  8965. "name": Microsoft.Office.WebExtension.Parameters.MessageContent,
  8966. "types": ["string"]
  8967. }
  8968. ],
  8969. supportedOptions: [],
  8970. privateStateCallbacks: []
  8971. });
  8972. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  8973. OSF.OUtil.setNamespace("Dialog", OSF.DDA.Marshaling);
  8974. OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys={
  8975. MessageType: "messageType",
  8976. MessageContent: "messageContent"
  8977. };
  8978. OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys={
  8979. MessageType: "messageType",
  8980. MessageContent: "messageContent"
  8981. };
  8982. OSF.DDA.Marshaling.MessageParentKeys={
  8983. MessageToParent: "messageToParent"
  8984. };
  8985. OSF.DDA.Marshaling.DialogNotificationShownEventType={
  8986. DialogNotificationShown: "dialogNotificationShown"
  8987. };
  8988. OSF.DDA.Marshaling.SendMessageKeys={
  8989. MessageContent: "messageContent"
  8990. };
  8991. var OfficeExt;
  8992. (function (OfficeExt) {
  8993. var WacCommonUICssManager;
  8994. (function (WacCommonUICssManager) {
  8995. var hostType={
  8996. Excel: "excel",
  8997. Word: "word",
  8998. PowerPoint: "powerpoint",
  8999. Outlook: "outlook"
  9000. };
  9001. function getDialogCssManager(applicationHostType) {
  9002. switch (applicationHostType) {
  9003. case hostType.Excel:
  9004. case hostType.Word:
  9005. case hostType.PowerPoint:
  9006. case hostType.Outlook:
  9007. return new DefaultDialogCSSManager();
  9008. default:
  9009. return new DefaultDialogCSSManager();
  9010. }
  9011. return null;
  9012. }
  9013. WacCommonUICssManager.getDialogCssManager=getDialogCssManager;
  9014. var DefaultDialogCSSManager=(function () {
  9015. function DefaultDialogCSSManager() {
  9016. this.overlayElementCSS=[
  9017. "position: absolute",
  9018. "top: 0",
  9019. "left: 0",
  9020. "width: 100%",
  9021. "height: 100%",
  9022. "background-color: rgba(198, 198, 198, 0.5)",
  9023. "z-index: 99998"
  9024. ];
  9025. this.dialogNotificationPanelCSS=[
  9026. "width: 100%",
  9027. "height: 190px",
  9028. "position: absolute",
  9029. "z-index: 99999",
  9030. "background-color: rgba(255, 255, 255, 1)",
  9031. "left: 0px",
  9032. "top: 50%",
  9033. "margin-top: -95px"
  9034. ];
  9035. this.newWindowNotificationTextPanelCSS=[
  9036. "margin: 20px 14px",
  9037. "font-family: Segoe UI,Arial,Verdana,sans-serif",
  9038. "font-size: 14px",
  9039. "height: 100px",
  9040. "line-height: 100px"
  9041. ];
  9042. this.newWindowNotificationTextSpanCSS=[
  9043. "display: inline-block",
  9044. "line-height: normal",
  9045. "vertical-align: middle"
  9046. ];
  9047. this.crossZoneNotificationTextPanelCSS=[
  9048. "margin: 20px 14px",
  9049. "font-family: Segoe UI,Arial,Verdana,sans-serif",
  9050. "font-size: 14px",
  9051. "height: 100px",
  9052. ];
  9053. this.dialogNotificationButtonPanelCSS="margin:0px 9px";
  9054. this.buttonStyleCSS=[
  9055. "text-align: center",
  9056. "width: 70px",
  9057. "height: 25px",
  9058. "font-size: 14px",
  9059. "font-family: Segoe UI,Arial,Verdana,sans-serif",
  9060. "margin: 0px 5px",
  9061. "border-width: 1px",
  9062. "border-style: solid"
  9063. ];
  9064. }
  9065. DefaultDialogCSSManager.prototype.getOverlayElementCSS=function () {
  9066. return this.overlayElementCSS.join(";");
  9067. };
  9068. DefaultDialogCSSManager.prototype.getDialogNotificationPanelCSS=function () {
  9069. return this.dialogNotificationPanelCSS.join(";");
  9070. };
  9071. DefaultDialogCSSManager.prototype.getNewWindowNotificationTextPanelCSS=function () {
  9072. return this.newWindowNotificationTextPanelCSS.join(";");
  9073. };
  9074. DefaultDialogCSSManager.prototype.getNewWindowNotificationTextSpanCSS=function () {
  9075. return this.newWindowNotificationTextSpanCSS.join(";");
  9076. };
  9077. DefaultDialogCSSManager.prototype.getCrossZoneNotificationTextPanelCSS=function () {
  9078. return this.crossZoneNotificationTextPanelCSS.join(";");
  9079. };
  9080. DefaultDialogCSSManager.prototype.getDialogNotificationButtonPanelCSS=function () {
  9081. return this.dialogNotificationButtonPanelCSS;
  9082. };
  9083. DefaultDialogCSSManager.prototype.getDialogButtonCSS=function () {
  9084. return this.buttonStyleCSS.join(";");
  9085. };
  9086. return DefaultDialogCSSManager;
  9087. })();
  9088. WacCommonUICssManager.DefaultDialogCSSManager=DefaultDialogCSSManager;
  9089. })(WacCommonUICssManager=OfficeExt.WacCommonUICssManager || (OfficeExt.WacCommonUICssManager={}));
  9090. })(OfficeExt || (OfficeExt={}));
  9091. var OfficeExt;
  9092. (function (OfficeExt) {
  9093. var AddinNativeAction;
  9094. (function (AddinNativeAction) {
  9095. var Dialog;
  9096. (function (Dialog) {
  9097. var windowInstance=null;
  9098. var handler=null;
  9099. var overlayElement=null;
  9100. var dialogNotificationPanel=null;
  9101. var configureBrowserLink=null;
  9102. var closeDialogKey="action=closeDialog";
  9103. var showDialogCallback=null;
  9104. var hasCrossZoneNotification=false;
  9105. var checkWindowDialogCloseInterval=-1;
  9106. var hostThemeButtonStyle=null;
  9107. var commonButtonBorderColor="#ababab";
  9108. var commonButtonBackgroundColor="#ffffff";
  9109. var commonEventInButtonBackgroundColor="#ccc";
  9110. var newWindowNotificationId="newWindowNotificaiton";
  9111. var registerDialogNotificationShownArgs={
  9112. "dispId": OSF.DDA.EventDispId.dispidDialogNotificationShownInAddinEvent,
  9113. "eventType": OSF.DDA.Marshaling.DialogNotificationShownEventType.DialogNotificationShown,
  9114. "onComplete": null
  9115. };
  9116. function setHostThemeButtonStyle(args) {
  9117. var hostThemeButtonStyleArgs=args.input;
  9118. if (hostThemeButtonStyleArgs !=null) {
  9119. hostThemeButtonStyle={
  9120. HostButtonBorderColor: hostThemeButtonStyleArgs[OSF.HostThemeButtonStyleKeys.ButtonBorderColor],
  9121. HostButtonBackgroundColor: hostThemeButtonStyleArgs[OSF.HostThemeButtonStyleKeys.ButtonBackgroundColor]
  9122. };
  9123. }
  9124. args.completed();
  9125. }
  9126. Dialog.setHostThemeButtonStyle=setHostThemeButtonStyle;
  9127. function handleNewWindowDialog(dialogInfo) {
  9128. try {
  9129. hasCrossZoneNotification=false;
  9130. var allowButtonKeyDownClick=false;
  9131. var ignoreButtonKeyDownClick=false;
  9132. var hostInfoObj=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo;
  9133. var dialogCssManager=OfficeExt.WacCommonUICssManager.getDialogCssManager(hostInfoObj.hostType);
  9134. var notificationText=OSF.OUtil.formatString(Strings.OfficeOM.L_ShowWindowDialogNotification, OSF._OfficeAppFactory.getInitializationHelper()._appContext._addinName);
  9135. overlayElement=createOverlayElement(dialogCssManager);
  9136. document.body.insertBefore(overlayElement, document.body.firstChild);
  9137. dialogNotificationPanel=createNotificationPanel(dialogCssManager, notificationText);
  9138. dialogNotificationPanel.id=newWindowNotificationId;
  9139. var dialogNotificationButtonPanel=createButtonPanel(dialogCssManager);
  9140. var allowButton=createButtonControl(dialogCssManager, Strings.OfficeOM.L_ShowWindowDialogNotificationAllow);
  9141. var ignoreButton=createButtonControl(dialogCssManager, Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore);
  9142. dialogNotificationButtonPanel.appendChild(allowButton);
  9143. dialogNotificationButtonPanel.appendChild(ignoreButton);
  9144. dialogNotificationPanel.appendChild(dialogNotificationButtonPanel);
  9145. document.body.insertBefore(dialogNotificationPanel, document.body.firstChild);
  9146. function allowButtonClickEventHandler() {
  9147. showDialog(dialogInfo);
  9148. if (!hasCrossZoneNotification) {
  9149. dismissDialogNotification();
  9150. }
  9151. }
  9152. allowButton.onclick=allowButtonClickEventHandler;
  9153. function ignoreButtonClickEventHandler() {
  9154. function unregisterDialogNotificationShownEventCallback(status) {
  9155. removeDialogNotificationElement();
  9156. setFocusOnFirstElement(status);
  9157. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore);
  9158. }
  9159. registerDialogNotificationShownArgs.onComplete=unregisterDialogNotificationShownEventCallback;
  9160. OSF.DDA.WAC.Delegate.unregisterEventAsync(registerDialogNotificationShownArgs);
  9161. }
  9162. ignoreButton.onclick=ignoreButtonClickEventHandler;
  9163. allowButton.addEventListener("keydown", function (event) {
  9164. if (event.shiftKey && event.keyCode==9) {
  9165. handleButtonControlEventOut(allowButton);
  9166. handleButtonControlEventIn(ignoreButton);
  9167. ignoreButton.focus();
  9168. event.preventDefault();
  9169. event.stopPropagation();
  9170. }
  9171. else if (event.keyCode==13) {
  9172. allowButtonKeyDownClick=true;
  9173. event.preventDefault();
  9174. event.stopPropagation();
  9175. }
  9176. }, false);
  9177. allowButton.addEventListener("keyup", function (event) {
  9178. if (event.keyCode==13 && allowButtonKeyDownClick) {
  9179. allowButtonKeyDownClick=false;
  9180. allowButtonClickEventHandler();
  9181. event.preventDefault();
  9182. event.stopPropagation();
  9183. }
  9184. }, false);
  9185. ignoreButton.addEventListener("keydown", function (event) {
  9186. if (!event.shiftKey && event.keyCode==9) {
  9187. handleButtonControlEventOut(ignoreButton);
  9188. handleButtonControlEventIn(allowButton);
  9189. allowButton.focus();
  9190. event.preventDefault();
  9191. event.stopPropagation();
  9192. }
  9193. else if (event.keyCode==13) {
  9194. ignoreButtonKeyDownClick=true;
  9195. event.preventDefault();
  9196. event.stopPropagation();
  9197. }
  9198. }, false);
  9199. ignoreButton.addEventListener("keyup", function (event) {
  9200. if (event.keyCode==13 && ignoreButtonKeyDownClick) {
  9201. ignoreButtonKeyDownClick=false;
  9202. ignoreButtonClickEventHandler();
  9203. event.preventDefault();
  9204. event.stopPropagation();
  9205. }
  9206. }, false);
  9207. window.focus();
  9208. function registerDialogNotificationShownEventCallback(status) {
  9209. allowButton.focus();
  9210. }
  9211. registerDialogNotificationShownArgs.onComplete=registerDialogNotificationShownEventCallback;
  9212. OSF.DDA.WAC.Delegate.registerEventAsync(registerDialogNotificationShownArgs);
  9213. }
  9214. catch (e) {
  9215. if (OSF.AppTelemetry) {
  9216. OSF.AppTelemetry.logAppException("Exception happens at new window dialog."+e);
  9217. }
  9218. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  9219. }
  9220. }
  9221. Dialog.handleNewWindowDialog=handleNewWindowDialog;
  9222. function closeDialog(callback) {
  9223. try {
  9224. if (windowInstance !=null) {
  9225. var appDomains=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;
  9226. if (appDomains) {
  9227. for (var i=0; i < appDomains.length && appDomains[i].indexOf("://") !==-1; i++) {
  9228. windowInstance.postMessage(closeDialogKey, appDomains[i]);
  9229. }
  9230. }
  9231. if (windowInstance !=null && !windowInstance.closed) {
  9232. windowInstance.close();
  9233. }
  9234. window.removeEventListener("message", receiveMessage);
  9235. window.clearInterval(checkWindowDialogCloseInterval);
  9236. windowInstance=null;
  9237. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  9238. }
  9239. else {
  9240. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  9241. }
  9242. }
  9243. catch (e) {
  9244. if (OSF.AppTelemetry) {
  9245. OSF.AppTelemetry.logAppException("Exception happens at close window dialog."+e);
  9246. }
  9247. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  9248. }
  9249. }
  9250. Dialog.closeDialog=closeDialog;
  9251. function messageParent(params) {
  9252. var message=params.hostCallArgs[Microsoft.Office.WebExtension.Parameters.MessageToParent];
  9253. var appDomains=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;
  9254. if (appDomains) {
  9255. for (var i=0; i < appDomains.length && appDomains[i].indexOf("://") !==-1; i++) {
  9256. window.opener.postMessage(message, appDomains[i]);
  9257. }
  9258. }
  9259. }
  9260. Dialog.messageParent=messageParent;
  9261. function registerMessageReceivedEvent() {
  9262. function receiveCloseDialogMessage(event) {
  9263. if (event.source==window.opener && event.data.indexOf(closeDialogKey) > -1) {
  9264. window.close();
  9265. }
  9266. }
  9267. window.addEventListener("message", receiveCloseDialogMessage);
  9268. }
  9269. Dialog.registerMessageReceivedEvent=registerMessageReceivedEvent;
  9270. function setHandlerAndShowDialogCallback(onEventHandler, callback) {
  9271. handler=onEventHandler;
  9272. showDialogCallback=callback;
  9273. }
  9274. Dialog.setHandlerAndShowDialogCallback=setHandlerAndShowDialogCallback;
  9275. function escDismissDialogNotification() {
  9276. if (dialogNotificationPanel && (dialogNotificationPanel.id==newWindowNotificationId) && showDialogCallback) {
  9277. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore);
  9278. }
  9279. dismissDialogNotification();
  9280. }
  9281. Dialog.escDismissDialogNotification=escDismissDialogNotification;
  9282. function receiveMessage(event) {
  9283. if (event.source==windowInstance) {
  9284. try {
  9285. var dialogMessageReceivedArgs={};
  9286. dialogMessageReceivedArgs[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogMessageReceived;
  9287. dialogMessageReceivedArgs[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent]=event.data;
  9288. handler(dialogMessageReceivedArgs);
  9289. }
  9290. catch (e) {
  9291. if (OSF.AppTelemetry) {
  9292. OSF.AppTelemetry.logAppException("Error happened during receive message handler."+e);
  9293. }
  9294. }
  9295. }
  9296. }
  9297. function showDialog(dialogInfo) {
  9298. var hostInfoObj=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo;
  9299. var hostInfoVals=[
  9300. hostInfoObj.hostType,
  9301. hostInfoObj.hostPlatform,
  9302. hostInfoObj.hostSpecificFileVersion,
  9303. hostInfoObj.hostLocale,
  9304. hostInfoObj.osfControlAppCorrelationId,
  9305. "isDialog"
  9306. ];
  9307. var hostInfo=hostInfoVals.join("|");
  9308. var appContext=OSF._OfficeAppFactory.getInitializationHelper()._appContext;
  9309. var windowUrl=dialogInfo[OSF.ShowWindowDialogParameterKeys.Url];
  9310. windowUrl=OfficeExt.WACUtils.addHostInfoAsQueryParam(windowUrl, hostInfo);
  9311. var windowName=JSON.parse(window.name);
  9312. windowName[OSF.WindowNameItemKeys.HostInfo]=hostInfo;
  9313. windowName[OSF.WindowNameItemKeys.AppContext]=appContext;
  9314. var width=dialogInfo[OSF.ShowWindowDialogParameterKeys.Width] * appContext._clientWindowWidth / 100;
  9315. var height=dialogInfo[OSF.ShowWindowDialogParameterKeys.Height] * appContext._clientWindowHeight / 100;
  9316. var left=appContext._clientWindowWidth / 2 - width / 2;
  9317. var top=appContext._clientWindowHeight / 2 - height / 2;
  9318. var windowSpecs="width="+width+", height="+height+", left="+left+", top="+top+",channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no";
  9319. windowInstance=window.open(windowUrl, OfficeExt.WACUtils.serializeObjectToString(windowName), windowSpecs);
  9320. if (windowInstance==null) {
  9321. OSF.AppTelemetry.logAppCommonMessage("Encountered cross zone issue in displayDialogAsync api.");
  9322. removeDialogNotificationElement();
  9323. showCrossZoneNotification(windowUrl);
  9324. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone);
  9325. return;
  9326. }
  9327. window.addEventListener("message", receiveMessage);
  9328. function checkWindowClose() {
  9329. try {
  9330. if (windowInstance==null || windowInstance.closed) {
  9331. window.clearInterval(checkWindowDialogCloseInterval);
  9332. window.removeEventListener("message", receiveMessage);
  9333. var dialogClosedArgs={};
  9334. dialogClosedArgs[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogClosed;
  9335. handler(dialogClosedArgs);
  9336. }
  9337. }
  9338. catch (e) {
  9339. if (OSF.AppTelemetry) {
  9340. OSF.AppTelemetry.logAppException("Error happened during check or handle window close."+e);
  9341. }
  9342. }
  9343. }
  9344. checkWindowDialogCloseInterval=window.setInterval(checkWindowClose, 1000);
  9345. if (showDialogCallback !=null) {
  9346. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  9347. }
  9348. else {
  9349. if (OSF.AppTelemetry) {
  9350. OSF.AppTelemetry.logAppException("showDialogCallback can not be null.");
  9351. }
  9352. }
  9353. }
  9354. function createButtonControl(dialogCssManager, buttonValue) {
  9355. var buttonControl=document.createElement("input");
  9356. buttonControl.setAttribute("type", "button");
  9357. buttonControl.style.cssText=dialogCssManager.getDialogButtonCSS();
  9358. buttonControl.style.borderColor=commonButtonBorderColor;
  9359. buttonControl.style.backgroundColor=commonButtonBackgroundColor;
  9360. buttonControl.setAttribute("value", buttonValue);
  9361. var buttonControlEventInHandler=function () {
  9362. handleButtonControlEventIn(buttonControl);
  9363. };
  9364. var buttonControlEventOutHandler=function () {
  9365. handleButtonControlEventOut(buttonControl);
  9366. };
  9367. buttonControl.addEventListener("mouseover", buttonControlEventInHandler);
  9368. buttonControl.addEventListener("focus", buttonControlEventInHandler);
  9369. buttonControl.addEventListener("mouseout", buttonControlEventOutHandler);
  9370. buttonControl.addEventListener("focusout", buttonControlEventOutHandler);
  9371. return buttonControl;
  9372. }
  9373. function handleButtonControlEventIn(buttonControl) {
  9374. if (hostThemeButtonStyle !=null) {
  9375. buttonControl.style.borderColor=hostThemeButtonStyle.HostButtonBorderColor;
  9376. buttonControl.style.backgroundColor=hostThemeButtonStyle.HostButtonBackgroundColor;
  9377. }
  9378. else if (OSF.CommonUI && OSF.CommonUI.HostButtonBorderColor && OSF.CommonUI.HostButtonBackgroundColor) {
  9379. buttonControl.style.borderColor=OSF.CommonUI.HostButtonBorderColor;
  9380. buttonControl.style.backgroundColor=OSF.CommonUI.HostButtonBackgroundColor;
  9381. }
  9382. else {
  9383. buttonControl.style.backgroundColor=commonEventInButtonBackgroundColor;
  9384. }
  9385. }
  9386. function handleButtonControlEventOut(buttonControl) {
  9387. buttonControl.style.borderColor=commonButtonBorderColor;
  9388. buttonControl.style.backgroundColor=commonButtonBackgroundColor;
  9389. }
  9390. function dismissDialogNotification() {
  9391. function unregisterDialogNotificationShownEventCallback(status) {
  9392. removeDialogNotificationElement();
  9393. setFocusOnFirstElement(status);
  9394. }
  9395. registerDialogNotificationShownArgs.onComplete=unregisterDialogNotificationShownEventCallback;
  9396. OSF.DDA.WAC.Delegate.unregisterEventAsync(registerDialogNotificationShownArgs);
  9397. }
  9398. function removeDialogNotificationElement() {
  9399. configureBrowserLink=null;
  9400. if (dialogNotificationPanel !=null) {
  9401. document.body.removeChild(dialogNotificationPanel);
  9402. dialogNotificationPanel=null;
  9403. }
  9404. if (overlayElement !=null) {
  9405. document.body.removeChild(overlayElement);
  9406. overlayElement=null;
  9407. }
  9408. }
  9409. function createOverlayElement(dialogCssManager) {
  9410. var overlayElement=document.createElement("div");
  9411. overlayElement.style.cssText=dialogCssManager.getOverlayElementCSS();
  9412. return overlayElement;
  9413. }
  9414. function createNotificationPanel(dialogCssManager, notificationString) {
  9415. var dialogNotificationPanel=document.createElement("div");
  9416. dialogNotificationPanel.style.cssText=dialogCssManager.getDialogNotificationPanelCSS();
  9417. var dialogNotificationTextPanel=document.createElement("div");
  9418. dialogNotificationTextPanel.style.cssText=dialogCssManager.getNewWindowNotificationTextPanelCSS();
  9419. if (document.documentElement.getAttribute("dir")=="rtl") {
  9420. dialogNotificationTextPanel.style.paddingRight="30px";
  9421. }
  9422. else {
  9423. dialogNotificationTextPanel.style.paddingLeft="30px";
  9424. }
  9425. var dialogNotificationTextSpan=document.createElement("span");
  9426. dialogNotificationTextSpan.style.cssText=dialogCssManager.getNewWindowNotificationTextSpanCSS();
  9427. dialogNotificationTextSpan.innerText=notificationString;
  9428. dialogNotificationTextPanel.appendChild(dialogNotificationTextSpan);
  9429. dialogNotificationPanel.appendChild(dialogNotificationTextPanel);
  9430. return dialogNotificationPanel;
  9431. }
  9432. function createButtonPanel(dialogCssManager) {
  9433. var dialogNotificationButtonPanel=document.createElement("div");
  9434. dialogNotificationButtonPanel.style.cssText=dialogCssManager.getDialogNotificationButtonPanelCSS();
  9435. if (document.documentElement.getAttribute("dir")=="rtl") {
  9436. dialogNotificationButtonPanel.style.cssFloat="left";
  9437. }
  9438. else {
  9439. dialogNotificationButtonPanel.style.cssFloat="right";
  9440. }
  9441. return dialogNotificationButtonPanel;
  9442. }
  9443. function setFocusOnFirstElement(status) {
  9444. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  9445. var list=document.querySelectorAll(OSF._OfficeAppFactory.getInitializationHelper()._tabbableElements);
  9446. OSF.OUtil.focusToFirstTabbable(list, false);
  9447. }
  9448. }
  9449. function createNotificationPanelForCrossZoneIssue(dialogCssManager, windowUrl) {
  9450. var dialogNotificationPanel=document.createElement("div");
  9451. dialogNotificationPanel.style.cssText=dialogCssManager.getDialogNotificationPanelCSS();
  9452. var dialogNotificationTextPanel=document.createElement("div");
  9453. dialogNotificationTextPanel.style.cssText=dialogCssManager.getCrossZoneNotificationTextPanelCSS();
  9454. configureBrowserLink=document.createElement("a");
  9455. configureBrowserLink.href="#";
  9456. configureBrowserLink.innerText=Strings.OfficeOM.L_NewWindowCrossZoneConfigureBrowserLink;
  9457. configureBrowserLink.setAttribute("onclick", "window.open('https://support.microsoft.com/en-us/help/17479/windows-internet-explorer-11-change-security-privacy-settings', '_blank', 'fullscreen=1')");
  9458. var dialogNotificationTextSpan=document.createElement("span");
  9459. if (Strings.OfficeOM.L_NewWindowCrossZone) {
  9460. dialogNotificationTextSpan.innerHTML=OSF.OUtil.formatString(Strings.OfficeOM.L_NewWindowCrossZone, configureBrowserLink.outerHTML, OfficeExt.WACUtils.getDomainForUrl(windowUrl));
  9461. }
  9462. dialogNotificationTextPanel.appendChild(dialogNotificationTextSpan);
  9463. dialogNotificationPanel.appendChild(dialogNotificationTextPanel);
  9464. return dialogNotificationPanel;
  9465. }
  9466. function showCrossZoneNotification(windowUrl) {
  9467. var okButtonKeyDownClick=false;
  9468. var hostInfoObj=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo;
  9469. var dialogCssManager=OfficeExt.WacCommonUICssManager.getDialogCssManager(hostInfoObj.hostType);
  9470. overlayElement=createOverlayElement(dialogCssManager);
  9471. document.body.insertBefore(overlayElement, document.body.firstChild);
  9472. dialogNotificationPanel=createNotificationPanelForCrossZoneIssue(dialogCssManager, windowUrl);
  9473. var dialogNotificationButtonPanel=createButtonPanel(dialogCssManager);
  9474. var okButton=createButtonControl(dialogCssManager, "OK");
  9475. dialogNotificationButtonPanel.appendChild(okButton);
  9476. dialogNotificationPanel.appendChild(dialogNotificationButtonPanel);
  9477. document.body.insertBefore(dialogNotificationPanel, document.body.firstChild);
  9478. hasCrossZoneNotification=true;
  9479. okButton.onclick=function () {
  9480. dismissDialogNotification();
  9481. };
  9482. okButton.addEventListener("keydown", function (event) {
  9483. if (event.keyCode==9) {
  9484. configureBrowserLink.focus();
  9485. event.preventDefault();
  9486. event.stopPropagation();
  9487. }
  9488. else if (event.keyCode==13) {
  9489. okButtonKeyDownClick=true;
  9490. event.preventDefault();
  9491. event.stopPropagation();
  9492. }
  9493. }, false);
  9494. okButton.addEventListener("keyup", function (event) {
  9495. if (event.keyCode==13 && okButtonKeyDownClick) {
  9496. okButtonKeyDownClick=false;
  9497. dismissDialogNotification();
  9498. event.preventDefault();
  9499. event.stopPropagation();
  9500. }
  9501. }, false);
  9502. configureBrowserLink.addEventListener("keydown", function (event) {
  9503. if (event.keyCode==9) {
  9504. okButton.focus();
  9505. event.preventDefault();
  9506. event.stopPropagation();
  9507. }
  9508. }, false);
  9509. window.focus();
  9510. okButton.focus();
  9511. }
  9512. })(Dialog=AddinNativeAction.Dialog || (AddinNativeAction.Dialog={}));
  9513. })(AddinNativeAction=OfficeExt.AddinNativeAction || (OfficeExt.AddinNativeAction={}));
  9514. })(OfficeExt || (OfficeExt={}));
  9515. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9516. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  9517. fromHost: [
  9518. { name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  9519. ]
  9520. });
  9521. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogMessageReceivedEvent);
  9522. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9523. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  9524. fromHost: [
  9525. { name: OSF.DDA.PropertyDescriptors.MessageType, value: OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType },
  9526. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent }
  9527. ]
  9528. });
  9529. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9530. type: OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,
  9531. fromHost: [
  9532. { name: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  9533. ]
  9534. });
  9535. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent);
  9536. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9537. type: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,
  9538. fromHost: [
  9539. { name: OSF.DDA.PropertyDescriptors.MessageType, value: OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageType },
  9540. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageContent }
  9541. ]
  9542. });
  9543. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9544. type: OSF.DDA.MethodDispId.dispidMessageParentMethod,
  9545. toHost: [
  9546. { name: Microsoft.Office.WebExtension.Parameters.MessageToParent, value: OSF.DDA.Marshaling.MessageParentKeys.MessageToParent }
  9547. ]
  9548. });
  9549. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9550. type: OSF.DDA.MethodDispId.dispidSendMessageMethod,
  9551. toHost: [
  9552. { name: Microsoft.Office.WebExtension.Parameters.MessageContent, value: OSF.DDA.Marshaling.SendMessageKeys.MessageContent }
  9553. ]
  9554. });
  9555. OSF.DDA.WAC.Delegate.openDialog=function OSF_DDA_WAC_Delegate$OpenDialog(args) {
  9556. var httpsIdentifyString="https://";
  9557. var httpIdentifyString="http://";
  9558. var dialogInfo=JSON.parse(args.targetId);
  9559. var callback=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true, args);
  9560. function showDialogCallback(status) {
  9561. var payload={ "Error": status };
  9562. callback(Microsoft.Office.Common.InvokeResultCode.noError, payload);
  9563. }
  9564. if (OSF.DialogShownStatus.hasDialogShown) {
  9565. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened);
  9566. return;
  9567. }
  9568. var dialogUrl=dialogInfo[OSF.ShowWindowDialogParameterKeys.Url].toLowerCase();
  9569. if (dialogUrl==null || !(dialogUrl.substr(0, httpsIdentifyString.length)===httpsIdentifyString)) {
  9570. if (dialogUrl.substr(0, httpIdentifyString.length)===httpIdentifyString) {
  9571. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS);
  9572. }
  9573. else {
  9574. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme);
  9575. }
  9576. return;
  9577. }
  9578. if (!dialogInfo[OSF.ShowWindowDialogParameterKeys.DisplayInIframe]) {
  9579. OSF.DialogShownStatus.isWindowDialog=true;
  9580. OfficeExt.AddinNativeAction.Dialog.setHandlerAndShowDialogCallback(function OSF_DDA_WACDelegate$RegisterEventAsync_OnEvent(payload) {
  9581. if (args.onEvent) {
  9582. args.onEvent(payload);
  9583. }
  9584. if (OSF.AppTelemetry) {
  9585. OSF.AppTelemetry.onEventDone(args.dispId);
  9586. }
  9587. }, showDialogCallback);
  9588. OfficeExt.AddinNativeAction.Dialog.handleNewWindowDialog(dialogInfo);
  9589. }
  9590. else {
  9591. OSF.DialogShownStatus.isWindowDialog=false;
  9592. OSF.DDA.WAC.Delegate.registerEventAsync(args);
  9593. }
  9594. };
  9595. OSF.DDA.WAC.Delegate.messageParent=function OSF_DDA_WAC_Delegate$MessageParent(args) {
  9596. if (window.opener !=null) {
  9597. OfficeExt.AddinNativeAction.Dialog.messageParent(args);
  9598. }
  9599. else {
  9600. OSF.DDA.WAC.Delegate.executeAsync(args);
  9601. }
  9602. };
  9603. OSF.DDA.WAC.Delegate.sendMessage=function OSF_DDA_WAC_Delegate$SendMessage(args) {
  9604. OSF.DDA.WAC.Delegate.executeAsync(args);
  9605. };
  9606. OSF.DDA.WAC.Delegate.closeDialog=function OSF_DDA_WAC_Delegate$CloseDialog(args) {
  9607. var callback=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false, args);
  9608. function closeDialogCallback(status) {
  9609. var payload={ "Error": status };
  9610. callback(Microsoft.Office.Common.InvokeResultCode.noError, payload);
  9611. }
  9612. if (!OSF.DialogShownStatus.hasDialogShown) {
  9613. closeDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeWebDialogClosed);
  9614. }
  9615. else {
  9616. if (OSF.DialogShownStatus.isWindowDialog) {
  9617. if (args.onCalling) {
  9618. args.onCalling();
  9619. }
  9620. OfficeExt.AddinNativeAction.Dialog.closeDialog(closeDialogCallback);
  9621. }
  9622. else {
  9623. OSF.DDA.WAC.Delegate.unregisterEventAsync(args);
  9624. }
  9625. }
  9626. };
  9627. OSF.InitializationHelper.prototype.dismissDialogNotification=function OSF_InitializationHelper$dismissDialogNotification() {
  9628. OfficeExt.AddinNativeAction.Dialog.escDismissDialogNotification();
  9629. };
  9630. OSF.InitializationHelper.prototype.registerMessageReceivedEventForWindowDialog=function OSF_InitializationHelper$registerMessageReceivedEventForWindowDialog() {
  9631. OfficeExt.AddinNativeAction.Dialog.registerMessageReceivedEvent();
  9632. };
  9633. OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(Microsoft.Office.WebExtension.Parameters.Data, (function () {
  9634. var tableRows="Rows";
  9635. var tableHeaders="Headers";
  9636. return {
  9637. toHost: function OSF_DDA_XLS_Delegate_SpecialProcessor_Data$toHost(data) {
  9638. if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) {
  9639. var tableData={};
  9640. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  9641. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  9642. data=tableData;
  9643. }
  9644. else if (OSF.DDA.DataCoercion.determineCoercionType(data)==Microsoft.Office.WebExtension.CoercionType.Text) {
  9645. data=[[data]];
  9646. }
  9647. return data;
  9648. },
  9649. fromHost: function OSF_DDA_XLS_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  9650. var ret;
  9651. if (hostArgs[tableRows] !=undefined) {
  9652. ret={};
  9653. ret[OSF.DDA.TableDataProperties.TableRows]=hostArgs[tableRows];
  9654. ret[OSF.DDA.TableDataProperties.TableHeaders]=hostArgs[tableHeaders];
  9655. }
  9656. else {
  9657. ret=hostArgs;
  9658. }
  9659. return ret;
  9660. }
  9661. };
  9662. })());
  9663. OSF.DDA.ExcelDocument=function Microsoft_Office_WebExtension_ExcelDocument(officeAppContext, settings) {
  9664. var bf=new OSF.DDA.BindingFacade(this);
  9665. OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);
  9666. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);
  9667. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]);
  9668. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync]);
  9669. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.SyncMethodNames.MessageParent]);
  9670. OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings);
  9671. if (this.mode==OSF.ClientMode.ReadOnly) {
  9672. this.url=document.URL;
  9673. }
  9674. OSF.OUtil.finalizeProperties(this);
  9675. };
  9676. OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument);
  9677. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  9678. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  9679. appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(appContext, true));
  9680. OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);
  9681. appReady();
  9682. };
  9683. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) {
  9684. this.prepareApiSurface(appContext);
  9685. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext));
  9686. };
  9687. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) {
  9688. OSF.WebApp._UpdateLinksForHostAndXdmInfo();
  9689. var license=new OSF.DDA.License(appContext.get_eToken());
  9690. this.initWebDialog(appContext);
  9691. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license));
  9692. var getDelegateMethods=OSF.DDA.WAC.getDelegateMethods;
  9693. var parameterMap=OSF.DDA.WAC.Delegate.ParameterMap;
  9694. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap));
  9695. var appCommandHandler=OfficeExt.AppCommand.AppCommandManager.instance();
  9696. appCommandHandler.initializeAndChangeOnce();
  9697. };
  9698. OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) { return appContext.get_reason(); };
  9699. var OfficeExtension;
  9700. (function (OfficeExtension) {
  9701. var Action=(function () {
  9702. function Action(actionInfo, isWriteOperation) {
  9703. this.m_actionInfo=actionInfo;
  9704. this.m_isWriteOperation=isWriteOperation;
  9705. }
  9706. Object.defineProperty(Action.prototype, "actionInfo", {
  9707. get: function () {
  9708. return this.m_actionInfo;
  9709. },
  9710. enumerable: true,
  9711. configurable: true
  9712. });
  9713. Object.defineProperty(Action.prototype, "isWriteOperation", {
  9714. get: function () {
  9715. return this.m_isWriteOperation;
  9716. },
  9717. enumerable: true,
  9718. configurable: true
  9719. });
  9720. return Action;
  9721. })();
  9722. OfficeExtension.Action=Action;
  9723. })(OfficeExtension || (OfficeExtension={}));
  9724. var OfficeExtension;
  9725. (function (OfficeExtension) {
  9726. var ActionFactory=(function () {
  9727. function ActionFactory() {
  9728. }
  9729. ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) {
  9730. OfficeExtension.Utility.validateObjectPath(parent);
  9731. var actionInfo={
  9732. Id: context._nextId(),
  9733. ActionType: 4 ,
  9734. Name: propertyName,
  9735. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  9736. ArgumentInfo: {}
  9737. };
  9738. var args=[value];
  9739. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  9740. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  9741. var ret=new OfficeExtension.Action(actionInfo, true);
  9742. context._pendingRequest.addAction(ret);
  9743. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  9744. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  9745. return ret;
  9746. };
  9747. ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) {
  9748. OfficeExtension.Utility.validateObjectPath(parent);
  9749. var actionInfo={
  9750. Id: context._nextId(),
  9751. ActionType: 3 ,
  9752. Name: methodName,
  9753. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  9754. ArgumentInfo: {}
  9755. };
  9756. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  9757. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  9758. var isWriteOperation=operationType !=1 ;
  9759. var ret=new OfficeExtension.Action(actionInfo, isWriteOperation);
  9760. context._pendingRequest.addAction(ret);
  9761. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  9762. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  9763. return ret;
  9764. };
  9765. ActionFactory.createQueryAction=function (context, parent, queryOption) {
  9766. OfficeExtension.Utility.validateObjectPath(parent);
  9767. var actionInfo={
  9768. Id: context._nextId(),
  9769. ActionType: 2 ,
  9770. Name: "",
  9771. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  9772. };
  9773. actionInfo.QueryInfo=queryOption;
  9774. var ret=new OfficeExtension.Action(actionInfo, false);
  9775. context._pendingRequest.addAction(ret);
  9776. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  9777. return ret;
  9778. };
  9779. ActionFactory.createRecursiveQueryAction=function (context, parent, query) {
  9780. OfficeExtension.Utility.validateObjectPath(parent);
  9781. var actionInfo={
  9782. Id: context._nextId(),
  9783. ActionType: 6 ,
  9784. Name: "",
  9785. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  9786. RecursiveQueryInfo: query
  9787. };
  9788. var ret=new OfficeExtension.Action(actionInfo, false);
  9789. context._pendingRequest.addAction(ret);
  9790. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  9791. return ret;
  9792. };
  9793. ActionFactory.createInstantiateAction=function (context, obj) {
  9794. OfficeExtension.Utility.validateObjectPath(obj);
  9795. var actionInfo={
  9796. Id: context._nextId(),
  9797. ActionType: 1 ,
  9798. Name: "",
  9799. ObjectPathId: obj._objectPath.objectPathInfo.Id
  9800. };
  9801. var ret=new OfficeExtension.Action(actionInfo, false);
  9802. context._pendingRequest.addAction(ret);
  9803. context._pendingRequest.addReferencedObjectPath(obj._objectPath);
  9804. context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj));
  9805. return ret;
  9806. };
  9807. ActionFactory.createTraceAction=function (context, message, addTraceMessage) {
  9808. var actionInfo={
  9809. Id: context._nextId(),
  9810. ActionType: 5 ,
  9811. Name: "Trace",
  9812. ObjectPathId: 0
  9813. };
  9814. var ret=new OfficeExtension.Action(actionInfo, false);
  9815. context._pendingRequest.addAction(ret);
  9816. if (addTraceMessage) {
  9817. context._pendingRequest.addTrace(actionInfo.Id, message);
  9818. }
  9819. return ret;
  9820. };
  9821. return ActionFactory;
  9822. })();
  9823. OfficeExtension.ActionFactory=ActionFactory;
  9824. })(OfficeExtension || (OfficeExtension={}));
  9825. var OfficeExtension;
  9826. (function (OfficeExtension) {
  9827. var ClientObject=(function () {
  9828. function ClientObject(context, objectPath) {
  9829. OfficeExtension.Utility.checkArgumentNull(context, "context");
  9830. this.m_context=context;
  9831. this.m_objectPath=objectPath;
  9832. if (this.m_objectPath) {
  9833. if (!context._processingResult) {
  9834. OfficeExtension.ActionFactory.createInstantiateAction(context, this);
  9835. if ((context._autoCleanup) && (this._KeepReference)) {
  9836. context.trackedObjects._autoAdd(this);
  9837. }
  9838. }
  9839. }
  9840. }
  9841. Object.defineProperty(ClientObject.prototype, "context", {
  9842. get: function () {
  9843. return this.m_context;
  9844. },
  9845. enumerable: true,
  9846. configurable: true
  9847. });
  9848. Object.defineProperty(ClientObject.prototype, "_objectPath", {
  9849. get: function () {
  9850. return this.m_objectPath;
  9851. },
  9852. set: function (value) {
  9853. this.m_objectPath=value;
  9854. },
  9855. enumerable: true,
  9856. configurable: true
  9857. });
  9858. Object.defineProperty(ClientObject.prototype, "isNull", {
  9859. get: function () {
  9860. OfficeExtension.Utility.throwIfNotLoaded("isNull", this._isNull, null, this._isNull);
  9861. return this._isNull;
  9862. },
  9863. enumerable: true,
  9864. configurable: true
  9865. });
  9866. Object.defineProperty(ClientObject.prototype, "isNullObject", {
  9867. get: function () {
  9868. OfficeExtension.Utility.throwIfNotLoaded("isNullObject", this._isNull, null, this._isNull);
  9869. return this._isNull;
  9870. },
  9871. enumerable: true,
  9872. configurable: true
  9873. });
  9874. Object.defineProperty(ClientObject.prototype, "_isNull", {
  9875. get: function () {
  9876. return this.m_isNull;
  9877. },
  9878. set: function (value) {
  9879. this.m_isNull=value;
  9880. if (value && this.m_objectPath) {
  9881. this.m_objectPath._updateAsNullObject();
  9882. }
  9883. },
  9884. enumerable: true,
  9885. configurable: true
  9886. });
  9887. ClientObject.prototype._handleResult=function (value) {
  9888. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  9889. };
  9890. ClientObject.prototype._handleIdResult=function (value) {
  9891. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  9892. OfficeExtension.Utility.fixObjectPathIfNecessary(this, value);
  9893. if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this._initReferenceId) {
  9894. this._initReferenceId(value[OfficeExtension.Constants.referenceId]);
  9895. }
  9896. };
  9897. return ClientObject;
  9898. })();
  9899. OfficeExtension.ClientObject=ClientObject;
  9900. })(OfficeExtension || (OfficeExtension={}));
  9901. var OfficeExtension;
  9902. (function (OfficeExtension) {
  9903. var ClientRequest=(function () {
  9904. function ClientRequest(context) {
  9905. this.m_context=context;
  9906. this.m_actions=[];
  9907. this.m_actionResultHandler={};
  9908. this.m_referencedObjectPaths={};
  9909. this.m_flags=0 ;
  9910. this.m_traceInfos={};
  9911. this.m_pendingProcessEventHandlers=[];
  9912. this.m_pendingEventHandlerActions={};
  9913. this.m_responseTraceIds={};
  9914. this.m_responseTraceMessages=[];
  9915. }
  9916. Object.defineProperty(ClientRequest.prototype, "flags", {
  9917. get: function () {
  9918. return this.m_flags;
  9919. },
  9920. enumerable: true,
  9921. configurable: true
  9922. });
  9923. Object.defineProperty(ClientRequest.prototype, "traceInfos", {
  9924. get: function () {
  9925. return this.m_traceInfos;
  9926. },
  9927. enumerable: true,
  9928. configurable: true
  9929. });
  9930. Object.defineProperty(ClientRequest.prototype, "_responseTraceMessages", {
  9931. get: function () {
  9932. return this.m_responseTraceMessages;
  9933. },
  9934. enumerable: true,
  9935. configurable: true
  9936. });
  9937. Object.defineProperty(ClientRequest.prototype, "_responseTraceIds", {
  9938. get: function () {
  9939. return this.m_responseTraceIds;
  9940. },
  9941. enumerable: true,
  9942. configurable: true
  9943. });
  9944. ClientRequest.prototype._setResponseTraceIds=function (value) {
  9945. if (value) {
  9946. for (var i=0; i < value.length; i++) {
  9947. var traceId=value[i];
  9948. this.m_responseTraceIds[traceId]=traceId;
  9949. var message=this.m_traceInfos[traceId];
  9950. if (!OfficeExtension.Utility.isNullOrUndefined(message)) {
  9951. this.m_responseTraceMessages.push(message);
  9952. }
  9953. }
  9954. }
  9955. };
  9956. ClientRequest.prototype.addAction=function (action) {
  9957. if (action.isWriteOperation) {
  9958. this.m_flags=this.m_flags | 1 ;
  9959. }
  9960. this.m_actions.push(action);
  9961. };
  9962. Object.defineProperty(ClientRequest.prototype, "hasActions", {
  9963. get: function () {
  9964. return this.m_actions.length > 0;
  9965. },
  9966. enumerable: true,
  9967. configurable: true
  9968. });
  9969. ClientRequest.prototype.addTrace=function (actionId, message) {
  9970. this.m_traceInfos[actionId]=message;
  9971. };
  9972. ClientRequest.prototype.addReferencedObjectPath=function (objectPath) {
  9973. if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) {
  9974. return;
  9975. }
  9976. if (!objectPath.isValid) {
  9977. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath));
  9978. }
  9979. while (objectPath) {
  9980. if (objectPath.isWriteOperation) {
  9981. this.m_flags=this.m_flags | 1 ;
  9982. }
  9983. this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath;
  9984. if (objectPath.objectPathInfo.ObjectPathType==3 ) {
  9985. this.addReferencedObjectPaths(objectPath.argumentObjectPaths);
  9986. }
  9987. objectPath=objectPath.parentObjectPath;
  9988. }
  9989. };
  9990. ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) {
  9991. if (objectPaths) {
  9992. for (var i=0; i < objectPaths.length; i++) {
  9993. this.addReferencedObjectPath(objectPaths[i]);
  9994. }
  9995. }
  9996. };
  9997. ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) {
  9998. this.m_actionResultHandler[action.actionInfo.Id]=resultHandler;
  9999. };
  10000. ClientRequest.prototype.buildRequestMessageBody=function () {
  10001. var objectPaths={};
  10002. for (var i in this.m_referencedObjectPaths) {
  10003. objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo;
  10004. }
  10005. var actions=[];
  10006. for (var index=0; index < this.m_actions.length; index++) {
  10007. actions.push(this.m_actions[index].actionInfo);
  10008. }
  10009. var ret={
  10010. Actions: actions,
  10011. ObjectPaths: objectPaths
  10012. };
  10013. return ret;
  10014. };
  10015. ClientRequest.prototype.processResponse=function (msg) {
  10016. if (msg && msg.Results) {
  10017. for (var i=0; i < msg.Results.length; i++) {
  10018. var actionResult=msg.Results[i];
  10019. var handler=this.m_actionResultHandler[actionResult.ActionId];
  10020. if (handler) {
  10021. handler._handleResult(actionResult.Value);
  10022. }
  10023. }
  10024. }
  10025. };
  10026. ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () {
  10027. for (var i in this.m_referencedObjectPaths) {
  10028. if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) {
  10029. this.m_referencedObjectPaths[i].isValid=false;
  10030. }
  10031. }
  10032. };
  10033. ClientRequest.prototype._addPendingEventHandlerAction=function (eventHandlers, action) {
  10034. if (!this.m_pendingEventHandlerActions[eventHandlers._id]) {
  10035. this.m_pendingEventHandlerActions[eventHandlers._id]=[];
  10036. this.m_pendingProcessEventHandlers.push(eventHandlers);
  10037. }
  10038. this.m_pendingEventHandlerActions[eventHandlers._id].push(action);
  10039. };
  10040. Object.defineProperty(ClientRequest.prototype, "_pendingProcessEventHandlers", {
  10041. get: function () {
  10042. return this.m_pendingProcessEventHandlers;
  10043. },
  10044. enumerable: true,
  10045. configurable: true
  10046. });
  10047. ClientRequest.prototype._getPendingEventHandlerActions=function (eventHandlers) {
  10048. return this.m_pendingEventHandlerActions[eventHandlers._id];
  10049. };
  10050. return ClientRequest;
  10051. })();
  10052. OfficeExtension.ClientRequest=ClientRequest;
  10053. })(OfficeExtension || (OfficeExtension={}));
  10054. var OfficeExtension;
  10055. (function (OfficeExtension) {
  10056. var _requestExecutorFactory;
  10057. function _setRequestExecutorFactory(reqExecFactory) {
  10058. _requestExecutorFactory=reqExecFactory;
  10059. }
  10060. OfficeExtension._setRequestExecutorFactory=_setRequestExecutorFactory;
  10061. var ClientRequestContext=(function () {
  10062. function ClientRequestContext(url) {
  10063. this.m_requestHeaders={};
  10064. this._onRunFinishedNotifiers=[];
  10065. this.m_nextId=0;
  10066. if (OfficeExtension.Utility.isNullOrUndefined(url) || typeof (url)==="string" && url.length===0) {
  10067. var defaultUrlAndHeaders=ClientRequestContext.defaultRequestUrlAndHeaders;
  10068. if (defaultUrlAndHeaders && !OfficeExtension.Utility.isNullOrEmptyString(defaultUrlAndHeaders.url)) {
  10069. this.m_url=defaultUrlAndHeaders.url;
  10070. if (defaultUrlAndHeaders.headers) {
  10071. for (var key in defaultUrlAndHeaders.headers) {
  10072. this.m_requestHeaders[key]=defaultUrlAndHeaders.headers[key];
  10073. }
  10074. }
  10075. }
  10076. else {
  10077. this.m_url=OfficeExtension.Constants.localDocument;
  10078. }
  10079. }
  10080. else if (typeof (url)==="string") {
  10081. this.m_url=url;
  10082. }
  10083. else {
  10084. var requestInfo=url;
  10085. if (OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url)) {
  10086. throw OfficeExtension.Utility.createInvalidArgumentException("url");
  10087. }
  10088. this.m_url=requestInfo.url;
  10089. if (requestInfo.headers) {
  10090. for (var key in requestInfo.headers) {
  10091. this.m_requestHeaders[key]=requestInfo.headers[key];
  10092. }
  10093. }
  10094. }
  10095. this._processingResult=false;
  10096. this._customData=OfficeExtension.Constants.iterativeExecutor;
  10097. if (_requestExecutorFactory) {
  10098. this._requestExecutor=_requestExecutorFactory();
  10099. }
  10100. else {
  10101. if (OfficeExtension.Utility._isLocalDocumentUrl(this.m_url)) {
  10102. this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  10103. }
  10104. else {
  10105. this._requestExecutor=new OfficeExtension.HttpRequestExecutor();
  10106. }
  10107. }
  10108. this.sync=this.sync.bind(this);
  10109. }
  10110. Object.defineProperty(ClientRequestContext.prototype, "_url", {
  10111. get: function () {
  10112. return this.m_url;
  10113. },
  10114. enumerable: true,
  10115. configurable: true
  10116. });
  10117. Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", {
  10118. get: function () {
  10119. if (this.m_pendingRequest==null) {
  10120. this.m_pendingRequest=new OfficeExtension.ClientRequest(this);
  10121. }
  10122. return this.m_pendingRequest;
  10123. },
  10124. enumerable: true,
  10125. configurable: true
  10126. });
  10127. Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", {
  10128. get: function () {
  10129. if (!this.m_trackedObjects) {
  10130. this.m_trackedObjects=new OfficeExtension.TrackedObjects(this);
  10131. }
  10132. return this.m_trackedObjects;
  10133. },
  10134. enumerable: true,
  10135. configurable: true
  10136. });
  10137. Object.defineProperty(ClientRequestContext.prototype, "requestHeaders", {
  10138. get: function () {
  10139. return this.m_requestHeaders;
  10140. },
  10141. enumerable: true,
  10142. configurable: true
  10143. });
  10144. ClientRequestContext.prototype.load=function (clientObj, option) {
  10145. OfficeExtension.Utility.validateContext(this, clientObj);
  10146. var queryOption=ClientRequestContext.parseQueryOption(option);
  10147. var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption);
  10148. this._pendingRequest.addActionResultHandler(action, clientObj);
  10149. };
  10150. ClientRequestContext.parseQueryOption=function (option) {
  10151. var queryOption={};
  10152. if (typeof (option)=="string") {
  10153. var select=option;
  10154. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(select);
  10155. }
  10156. else if (Array.isArray(option)) {
  10157. queryOption.Select=option;
  10158. }
  10159. else if (typeof (option)=="object") {
  10160. var loadOption=option;
  10161. if (typeof (loadOption.select)=="string") {
  10162. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(loadOption.select);
  10163. }
  10164. else if (Array.isArray(loadOption.select)) {
  10165. queryOption.Select=loadOption.select;
  10166. }
  10167. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) {
  10168. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select");
  10169. }
  10170. if (typeof (loadOption.expand)=="string") {
  10171. queryOption.Expand=OfficeExtension.Utility._parseSelectExpand(loadOption.expand);
  10172. }
  10173. else if (Array.isArray(loadOption.expand)) {
  10174. queryOption.Expand=loadOption.expand;
  10175. }
  10176. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) {
  10177. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand");
  10178. }
  10179. if (typeof (loadOption.top)=="number") {
  10180. queryOption.Top=loadOption.top;
  10181. }
  10182. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) {
  10183. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top");
  10184. }
  10185. if (typeof (loadOption.skip)=="number") {
  10186. queryOption.Skip=loadOption.skip;
  10187. }
  10188. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) {
  10189. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip");
  10190. }
  10191. }
  10192. else if (!OfficeExtension.Utility.isNullOrUndefined(option)) {
  10193. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option");
  10194. }
  10195. return queryOption;
  10196. };
  10197. ClientRequestContext.prototype.loadRecursive=function (clientObj, options, maxDepth) {
  10198. if (!OfficeExtension.Utility.isPlainJsonObject(options)) {
  10199. throw OfficeExtension.Utility.createInvalidArgumentException("options");
  10200. }
  10201. var quries={};
  10202. for (var key in options) {
  10203. quries[key]=ClientRequestContext.parseQueryOption(options[key]);
  10204. }
  10205. var action=OfficeExtension.ActionFactory.createRecursiveQueryAction(this, clientObj, { Queries: quries, MaxDepth: maxDepth });
  10206. this._pendingRequest.addActionResultHandler(action, clientObj);
  10207. };
  10208. ClientRequestContext.prototype.trace=function (message) {
  10209. OfficeExtension.ActionFactory.createTraceAction(this, message, true);
  10210. };
  10211. ClientRequestContext.prototype.syncPrivate=function () {
  10212. var _this=this;
  10213. var req=this._pendingRequest;
  10214. this.m_pendingRequest=null;
  10215. if (!req.hasActions) {
  10216. return this.processPendingEventHandlers(req);
  10217. }
  10218. var msgBody=req.buildRequestMessageBody();
  10219. var requestFlags=req.flags;
  10220. var requestExecutor=this._requestExecutor;
  10221. if (!requestExecutor) {
  10222. requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  10223. }
  10224. var requestExecutorRequestMessage={
  10225. Url: this.m_url,
  10226. Headers: this.m_requestHeaders,
  10227. Body: msgBody
  10228. };
  10229. req.invalidatePendingInvalidObjectPaths();
  10230. var errorFromResponse=null;
  10231. var errorFromProcessEventHandlers=null;
  10232. return requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage).then(function (response) {
  10233. errorFromResponse=_this.processRequestExecutorResponseMessage(req, response);
  10234. return _this.processPendingEventHandlers(req).catch(function (ex) {
  10235. OfficeExtension.Utility.log("Error in processPendingEventHandlers");
  10236. OfficeExtension.Utility.log(JSON.stringify(ex));
  10237. errorFromProcessEventHandlers=ex;
  10238. });
  10239. }).then(function () {
  10240. if (errorFromResponse) {
  10241. OfficeExtension.Utility.log("Throw error from response: "+JSON.stringify(errorFromResponse));
  10242. throw errorFromResponse;
  10243. }
  10244. if (errorFromProcessEventHandlers) {
  10245. OfficeExtension.Utility.log("Throw error from ProcessEventHandler: "+JSON.stringify(errorFromProcessEventHandlers));
  10246. var transformedError=null;
  10247. if (errorFromProcessEventHandlers instanceof OfficeExtension.Error) {
  10248. transformedError=errorFromProcessEventHandlers;
  10249. transformedError.traceMessages=req._responseTraceMessages;
  10250. }
  10251. else {
  10252. var message=null;
  10253. if (typeof (errorFromProcessEventHandlers)==="string") {
  10254. message=errorFromProcessEventHandlers;
  10255. }
  10256. else {
  10257. message=errorFromProcessEventHandlers.message;
  10258. }
  10259. if (OfficeExtension.Utility.isNullOrEmptyString(message)) {
  10260. message=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.cannotRegisterEvent);
  10261. }
  10262. transformedError=new OfficeExtension._Internal.RuntimeError(OfficeExtension.ErrorCodes.cannotRegisterEvent, message, req._responseTraceMessages, {});
  10263. }
  10264. throw transformedError;
  10265. }
  10266. });
  10267. };
  10268. ClientRequestContext.prototype.processRequestExecutorResponseMessage=function (req, response) {
  10269. if (response.Body && response.Body.TraceIds) {
  10270. req._setResponseTraceIds(response.Body.TraceIds);
  10271. }
  10272. var traceMessages=req._responseTraceMessages;
  10273. if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) {
  10274. return new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {});
  10275. }
  10276. else if (response.Body && response.Body.Error) {
  10277. return new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, {
  10278. errorLocation: response.Body.Error.Location
  10279. });
  10280. }
  10281. this._processingResult=true;
  10282. try {
  10283. req.processResponse(response.Body);
  10284. }
  10285. finally {
  10286. this._processingResult=false;
  10287. }
  10288. return null;
  10289. };
  10290. ClientRequestContext.prototype.processPendingEventHandlers=function (req) {
  10291. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  10292. for (var i=0; i < req._pendingProcessEventHandlers.length; i++) {
  10293. var eventHandlers=req._pendingProcessEventHandlers[i];
  10294. ret=ret.then(this.createProcessOneEventHandlersFunc(eventHandlers, req));
  10295. }
  10296. return ret;
  10297. };
  10298. ClientRequestContext.prototype.createProcessOneEventHandlersFunc=function (eventHandlers, req) {
  10299. return function () { return eventHandlers._processRegistration(req); };
  10300. };
  10301. ClientRequestContext.prototype.sync=function (passThroughValue) {
  10302. return this.syncPrivate().then(function () { return passThroughValue; });
  10303. };
  10304. ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  10305. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  10306. if (retryDelay===void 0) { retryDelay=5000; }
  10307. return ClientRequestContext._runCommon("run", null, ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  10308. };
  10309. ClientRequestContext._runBatch=function (functionName, receivedRunArgs, ctxInitializer, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  10310. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  10311. if (retryDelay===void 0) { retryDelay=5000; }
  10312. var ctxRetriever;
  10313. var batch;
  10314. var requestInfo=null;
  10315. var argOffset=0;
  10316. if (receivedRunArgs.length > 0 && typeof (receivedRunArgs[0])==="object" && receivedRunArgs[0] !==null && Object.getPrototypeOf(receivedRunArgs[0])===Object.getPrototypeOf({}) && !OfficeExtension.Utility.isNullOrUndefined(receivedRunArgs[0].url)) {
  10317. requestInfo=receivedRunArgs[0];
  10318. argOffset=1;
  10319. }
  10320. if (receivedRunArgs.length==argOffset+1) {
  10321. ctxRetriever=ctxInitializer;
  10322. batch=receivedRunArgs[argOffset+0];
  10323. }
  10324. else if (receivedRunArgs.length==argOffset+2) {
  10325. if (receivedRunArgs[argOffset+0] instanceof OfficeExtension.ClientObject) {
  10326. ctxRetriever=function () { return receivedRunArgs[argOffset+0].context; };
  10327. }
  10328. else if (Array.isArray(receivedRunArgs[argOffset+0])) {
  10329. var array=receivedRunArgs[argOffset+0];
  10330. if (array.length==0) {
  10331. return ClientRequestContext.createErrorPromise(functionName);
  10332. }
  10333. for (var i=0; i < array.length; i++) {
  10334. if (!(array[i] instanceof OfficeExtension.ClientObject)) {
  10335. return ClientRequestContext.createErrorPromise(functionName);
  10336. }
  10337. if (array[i].context !=array[0].context) {
  10338. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ResourceStrings.invalidRequestContext);
  10339. }
  10340. }
  10341. ctxRetriever=function () { return array[0].context; };
  10342. }
  10343. else {
  10344. return ClientRequestContext.createErrorPromise(functionName);
  10345. }
  10346. batch=receivedRunArgs[argOffset+1];
  10347. }
  10348. else {
  10349. return ClientRequestContext.createErrorPromise(functionName);
  10350. }
  10351. return ClientRequestContext._runCommon(functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  10352. };
  10353. ClientRequestContext.createErrorPromise=function (functionName, code) {
  10354. if (code===void 0) { code=OfficeExtension.ResourceStrings.invalidArgument; }
  10355. return OfficeExtension.Promise.reject(OfficeExtension.Utility.createRuntimeError(code, OfficeExtension.Utility._getResourceString(code), functionName));
  10356. };
  10357. ClientRequestContext._runCommon=function (functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  10358. var starterPromise=new OfficeExtension.Promise(function (resolve, reject) {
  10359. resolve();
  10360. });
  10361. var ctx;
  10362. var succeeded=false;
  10363. var resultOrError;
  10364. return starterPromise.then(function () {
  10365. ctx=ctxRetriever(requestInfo);
  10366. if (requestInfo && !OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url) && requestInfo.url !==ctx.m_url) {
  10367. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ErrorCodes.invalidRequestContext);
  10368. }
  10369. if (ctx._autoCleanup) {
  10370. return new OfficeExtension.Promise(function (resolve, reject) {
  10371. ctx._onRunFinishedNotifiers.push(function () {
  10372. ctx._autoCleanup=true;
  10373. resolve();
  10374. });
  10375. });
  10376. }
  10377. else {
  10378. ctx._autoCleanup=true;
  10379. }
  10380. }).then(function () {
  10381. if (typeof batch !=='function') {
  10382. return ClientRequestContext.createErrorPromise(functionName);
  10383. }
  10384. var batchResult=batch(ctx);
  10385. if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) {
  10386. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise);
  10387. }
  10388. return batchResult;
  10389. }).then(function (batchResult) {
  10390. return ctx.sync(batchResult);
  10391. }).then(function (result) {
  10392. succeeded=true;
  10393. resultOrError=result;
  10394. }).catch(function (error) {
  10395. resultOrError=error;
  10396. }).then(function () {
  10397. var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList();
  10398. ctx._autoCleanup=false;
  10399. for (var key in itemsToRemove) {
  10400. itemsToRemove[key]._objectPath.isValid=false;
  10401. }
  10402. var cleanupCounter=0;
  10403. attemptCleanup();
  10404. function attemptCleanup() {
  10405. cleanupCounter++;
  10406. for (var key in itemsToRemove) {
  10407. ctx.trackedObjects.remove(itemsToRemove[key]);
  10408. }
  10409. ctx.sync().then(function () {
  10410. if (onCleanupSuccess) {
  10411. onCleanupSuccess(cleanupCounter);
  10412. }
  10413. }).catch(function () {
  10414. if (onCleanupFailure) {
  10415. onCleanupFailure(cleanupCounter);
  10416. }
  10417. if (cleanupCounter < numCleanupAttempts) {
  10418. setTimeout(function () {
  10419. attemptCleanup();
  10420. }, retryDelay);
  10421. }
  10422. });
  10423. }
  10424. }).then(function () {
  10425. if (ctx._onRunFinishedNotifiers && ctx._onRunFinishedNotifiers.length > 0) {
  10426. var func=ctx._onRunFinishedNotifiers.shift();
  10427. func();
  10428. }
  10429. if (succeeded) {
  10430. return resultOrError;
  10431. }
  10432. else {
  10433. throw resultOrError;
  10434. }
  10435. });
  10436. };
  10437. ClientRequestContext.prototype._nextId=function () {
  10438. return++this.m_nextId;
  10439. };
  10440. return ClientRequestContext;
  10441. })();
  10442. OfficeExtension.ClientRequestContext=ClientRequestContext;
  10443. })(OfficeExtension || (OfficeExtension={}));
  10444. var OfficeExtension;
  10445. (function (OfficeExtension) {
  10446. (function (ClientRequestFlags) {
  10447. ClientRequestFlags[ClientRequestFlags["None"]=0]="None";
  10448. ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation";
  10449. })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={}));
  10450. var ClientRequestFlags=OfficeExtension.ClientRequestFlags;
  10451. })(OfficeExtension || (OfficeExtension={}));
  10452. var OfficeExtension;
  10453. (function (OfficeExtension) {
  10454. (function (ClientResultProcessingType) {
  10455. ClientResultProcessingType[ClientResultProcessingType["none"]=0]="none";
  10456. ClientResultProcessingType[ClientResultProcessingType["date"]=1]="date";
  10457. })(OfficeExtension.ClientResultProcessingType || (OfficeExtension.ClientResultProcessingType={}));
  10458. var ClientResultProcessingType=OfficeExtension.ClientResultProcessingType;
  10459. var ClientResult=(function () {
  10460. function ClientResult(type) {
  10461. this.m_type=type;
  10462. }
  10463. Object.defineProperty(ClientResult.prototype, "value", {
  10464. get: function () {
  10465. if (!this.m_isLoaded) {
  10466. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.valueNotLoaded);
  10467. }
  10468. return this.m_value;
  10469. },
  10470. enumerable: true,
  10471. configurable: true
  10472. });
  10473. ClientResult.prototype._handleResult=function (value) {
  10474. this.m_isLoaded=true;
  10475. if (typeof (value)==="object" && value && value._IsNull) {
  10476. return;
  10477. }
  10478. if (this.m_type===1 ) {
  10479. this.m_value=OfficeExtension.Utility.adjustToDateTime(value);
  10480. }
  10481. else {
  10482. this.m_value=value;
  10483. }
  10484. };
  10485. return ClientResult;
  10486. })();
  10487. OfficeExtension.ClientResult=ClientResult;
  10488. })(OfficeExtension || (OfficeExtension={}));
  10489. var OfficeExtension;
  10490. (function (OfficeExtension) {
  10491. var Constants=(function () {
  10492. function Constants() {
  10493. }
  10494. Constants.getItemAt="GetItemAt";
  10495. Constants.id="Id";
  10496. Constants.idPrivate="_Id";
  10497. Constants.index="_Index";
  10498. Constants.items="_Items";
  10499. Constants.iterativeExecutor="IterativeExecutor";
  10500. Constants.localDocument="http://document.localhost/";
  10501. Constants.localDocumentApiPrefix="http://document.localhost/_api/";
  10502. Constants.referenceId="_ReferenceId";
  10503. Constants.isTracked="_IsTracked";
  10504. Constants.sourceLibHeader="SdkVersion";
  10505. Constants.requestInfoHeader="Office-RequestInfo";
  10506. return Constants;
  10507. })();
  10508. OfficeExtension.Constants=Constants;
  10509. })(OfficeExtension || (OfficeExtension={}));
  10510. var OfficeExtension;
  10511. (function (OfficeExtension) {
  10512. var EmbedRequestExecutor=(function () {
  10513. function EmbedRequestExecutor() {
  10514. }
  10515. EmbedRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  10516. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, EmbedRequestExecutor.SourceLibHeaderValue);
  10517. return new OfficeExtension.Promise(function (resolve, reject) {
  10518. var endpoint=OfficeExtension.Embedded && OfficeExtension.Embedded._getEndpoint();
  10519. if (!endpoint) {
  10520. resolve(OfficeExtension.RichApiMessageUtility.buildResponseOnError(OfficeExtension.Embedded.EmbeddedApiStatus.InternalError, ""));
  10521. return;
  10522. }
  10523. endpoint.invoke("executeMethod", function (status, result) {
  10524. OfficeExtension.Utility.log("Response:");
  10525. OfficeExtension.Utility.log(JSON.stringify(result));
  10526. var response;
  10527. if (status==OfficeExtension.Embedded.EmbeddedApiStatus.Success) {
  10528. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBodyFromSafeArray(result.Data), OfficeExtension.RichApiMessageUtility.getResponseHeadersFromSafeArray(result.Data));
  10529. }
  10530. else {
  10531. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.Code, result.error.Message);
  10532. }
  10533. resolve(response);
  10534. }, EmbedRequestExecutor._transformMessageArrayIntoParams(messageSafearray));
  10535. });
  10536. };
  10537. EmbedRequestExecutor._transformMessageArrayIntoParams=function (msgArray) {
  10538. return {
  10539. ArrayData: msgArray,
  10540. DdaMethod: {
  10541. DispatchId: EmbedRequestExecutor.DispidExecuteRichApiRequestMethod
  10542. }
  10543. };
  10544. };
  10545. EmbedRequestExecutor.DispidExecuteRichApiRequestMethod=93;
  10546. EmbedRequestExecutor.SourceLibHeaderValue="Embedded";
  10547. return EmbedRequestExecutor;
  10548. })();
  10549. OfficeExtension.EmbedRequestExecutor=EmbedRequestExecutor;
  10550. })(OfficeExtension || (OfficeExtension={}));
  10551. var __extends=this.__extends || function (d, b) {
  10552. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  10553. function __() { this.constructor=d; }
  10554. __.prototype=b.prototype;
  10555. d.prototype=new __();
  10556. };
  10557. var OfficeExtension;
  10558. (function (OfficeExtension) {
  10559. var _Internal;
  10560. (function (_Internal) {
  10561. var RuntimeError=(function (_super) {
  10562. __extends(RuntimeError, _super);
  10563. function RuntimeError(code, message, traceMessages, debugInfo) {
  10564. _super.call(this, message);
  10565. this.name="OfficeExtension.Error";
  10566. this.code=code;
  10567. this.message=message;
  10568. this.traceMessages=traceMessages;
  10569. this.debugInfo=debugInfo;
  10570. }
  10571. RuntimeError.prototype.toString=function () {
  10572. return this.code+': '+this.message;
  10573. };
  10574. return RuntimeError;
  10575. })(Error);
  10576. _Internal.RuntimeError=RuntimeError;
  10577. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  10578. OfficeExtension.Error=OfficeExtension._Internal.RuntimeError;
  10579. })(OfficeExtension || (OfficeExtension={}));
  10580. var OfficeExtension;
  10581. (function (OfficeExtension) {
  10582. var ErrorCodes=(function () {
  10583. function ErrorCodes() {
  10584. }
  10585. ErrorCodes.accessDenied="AccessDenied";
  10586. ErrorCodes.generalException="GeneralException";
  10587. ErrorCodes.activityLimitReached="ActivityLimitReached";
  10588. ErrorCodes.invalidObjectPath="InvalidObjectPath";
  10589. ErrorCodes.propertyNotLoaded="PropertyNotLoaded";
  10590. ErrorCodes.valueNotLoaded="ValueNotLoaded";
  10591. ErrorCodes.invalidRequestContext="InvalidRequestContext";
  10592. ErrorCodes.invalidArgument="InvalidArgument";
  10593. ErrorCodes.runMustReturnPromise="RunMustReturnPromise";
  10594. ErrorCodes.cannotRegisterEvent="CannotRegisterEvent";
  10595. ErrorCodes.apiNotFound="ApiNotFound";
  10596. ErrorCodes.connectionFailure="ConnectionFailure";
  10597. return ErrorCodes;
  10598. })();
  10599. OfficeExtension.ErrorCodes=ErrorCodes;
  10600. })(OfficeExtension || (OfficeExtension={}));
  10601. var OfficeExtension;
  10602. (function (OfficeExtension) {
  10603. var _Internal;
  10604. (function (_Internal) {
  10605. (function (EventHandlerActionType) {
  10606. EventHandlerActionType[EventHandlerActionType["add"]=0]="add";
  10607. EventHandlerActionType[EventHandlerActionType["remove"]=1]="remove";
  10608. EventHandlerActionType[EventHandlerActionType["removeAll"]=2]="removeAll";
  10609. })(_Internal.EventHandlerActionType || (_Internal.EventHandlerActionType={}));
  10610. var EventHandlerActionType=_Internal.EventHandlerActionType;
  10611. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  10612. })(OfficeExtension || (OfficeExtension={}));
  10613. var OfficeExtension;
  10614. (function (OfficeExtension) {
  10615. var EventHandlers=(function () {
  10616. function EventHandlers(context, parentObject, name, eventInfo) {
  10617. var _this=this;
  10618. this.m_id=context._nextId();
  10619. this.m_context=context;
  10620. this.m_name=name;
  10621. this.m_handlers=[];
  10622. this.m_registered=false;
  10623. this.m_eventInfo=eventInfo;
  10624. this.m_callback=function (args) {
  10625. _this.m_eventInfo.eventArgsTransformFunc(args).then(function (newArgs) { return _this.fireEvent(newArgs); });
  10626. };
  10627. }
  10628. Object.defineProperty(EventHandlers.prototype, "_registered", {
  10629. get: function () {
  10630. return this.m_registered;
  10631. },
  10632. enumerable: true,
  10633. configurable: true
  10634. });
  10635. Object.defineProperty(EventHandlers.prototype, "_id", {
  10636. get: function () {
  10637. return this.m_id;
  10638. },
  10639. enumerable: true,
  10640. configurable: true
  10641. });
  10642. Object.defineProperty(EventHandlers.prototype, "_handlers", {
  10643. get: function () {
  10644. return this.m_handlers;
  10645. },
  10646. enumerable: true,
  10647. configurable: true
  10648. });
  10649. EventHandlers.prototype.add=function (handler) {
  10650. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  10651. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 0 });
  10652. return new OfficeExtension.EventHandlerResult(this.m_context, this, handler);
  10653. };
  10654. EventHandlers.prototype.remove=function (handler) {
  10655. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  10656. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 1 });
  10657. };
  10658. EventHandlers.prototype.removeAll=function () {
  10659. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  10660. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: null, operation: 2 });
  10661. };
  10662. EventHandlers.prototype._processRegistration=function (req) {
  10663. var _this=this;
  10664. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  10665. var actions=req._getPendingEventHandlerActions(this);
  10666. if (!actions) {
  10667. return ret;
  10668. }
  10669. var handlersResult=[];
  10670. for (var i=0; i < this.m_handlers.length; i++) {
  10671. handlersResult.push(this.m_handlers[i]);
  10672. }
  10673. var hasChange=false;
  10674. for (var i=0; i < actions.length; i++) {
  10675. if (req._responseTraceIds[actions[i].id]) {
  10676. hasChange=true;
  10677. switch (actions[i].operation) {
  10678. case 0 :
  10679. handlersResult.push(actions[i].handler);
  10680. break;
  10681. case 1 :
  10682. for (var index=handlersResult.length - 1; index >=0; index--) {
  10683. if (handlersResult[index]===actions[i].handler) {
  10684. handlersResult.splice(index, 1);
  10685. break;
  10686. }
  10687. }
  10688. break;
  10689. case 2 :
  10690. handlersResult=[];
  10691. break;
  10692. }
  10693. }
  10694. }
  10695. if (hasChange) {
  10696. if (!this.m_registered && handlersResult.length > 0) {
  10697. ret=ret.then(function () { return _this.m_eventInfo.registerFunc(_this.m_callback); }).then(function () { return (_this.m_registered=true); });
  10698. }
  10699. else if (this.m_registered && handlersResult.length==0) {
  10700. ret=ret.then(function () { return _this.m_eventInfo.unregisterFunc(_this.m_callback); }).catch(function (ex) {
  10701. OfficeExtension.Utility.log("Error when unregister event: "+JSON.stringify(ex));
  10702. }).then(function () { return (_this.m_registered=false); });
  10703. }
  10704. ret=ret.then(function () { return (_this.m_handlers=handlersResult); });
  10705. }
  10706. return ret;
  10707. };
  10708. EventHandlers.prototype.fireEvent=function (args) {
  10709. var promises=[];
  10710. for (var i=0; i < this.m_handlers.length; i++) {
  10711. var handler=this.m_handlers[i];
  10712. var p=OfficeExtension.Utility._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(handler, args)).catch(function (ex) {
  10713. OfficeExtension.Utility.log("Error when invoke handler: "+JSON.stringify(ex));
  10714. });
  10715. promises.push(p);
  10716. }
  10717. OfficeExtension.Promise.all(promises);
  10718. };
  10719. EventHandlers.prototype.createFireOneEventHandlerFunc=function (handler, args) {
  10720. return function () { return handler(args); };
  10721. };
  10722. return EventHandlers;
  10723. })();
  10724. OfficeExtension.EventHandlers=EventHandlers;
  10725. })(OfficeExtension || (OfficeExtension={}));
  10726. var OfficeExtension;
  10727. (function (OfficeExtension) {
  10728. var EventHandlerResult=(function () {
  10729. function EventHandlerResult(context, handlers, handler) {
  10730. this.m_context=context;
  10731. this.m_allHandlers=handlers;
  10732. this.m_handler=handler;
  10733. }
  10734. EventHandlerResult.prototype.remove=function () {
  10735. if (this.m_allHandlers && this.m_handler) {
  10736. this.m_allHandlers.remove(this.m_handler);
  10737. this.m_allHandlers=null;
  10738. this.m_handler=null;
  10739. }
  10740. };
  10741. return EventHandlerResult;
  10742. })();
  10743. OfficeExtension.EventHandlerResult=EventHandlerResult;
  10744. })(OfficeExtension || (OfficeExtension={}));
  10745. var OfficeExtension;
  10746. (function (OfficeExtension) {
  10747. var HttpRequestExecutor=(function () {
  10748. function HttpRequestExecutor() {
  10749. }
  10750. HttpRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  10751. var requestMessageText=JSON.stringify(requestMessage.Body);
  10752. OfficeExtension.Utility.log("Request:");
  10753. OfficeExtension.Utility.log(requestMessageText);
  10754. var url=requestMessage.Url;
  10755. if (url.charAt(url.length - 1) !="/") {
  10756. url=url+"/";
  10757. }
  10758. url=url+"ProcessQuery";
  10759. var requestInfo={
  10760. method: "POST",
  10761. url: url,
  10762. headers: {},
  10763. body: requestMessageText
  10764. };
  10765. requestInfo.headers[OfficeExtension.Constants.sourceLibHeader]=HttpRequestExecutor.SourceLibHeaderValue;
  10766. requestInfo.headers[OfficeExtension.Constants.requestInfoHeader]="flags="+requestFlags.toString();
  10767. requestInfo.headers["CONTENT-TYPE"]="application/json";
  10768. if (requestMessage.Headers) {
  10769. for (var key in requestMessage.Headers) {
  10770. requestInfo.headers[key]=requestMessage.Headers[key];
  10771. }
  10772. }
  10773. return OfficeExtension.HttpUtility.sendRequest(requestInfo).then(function (responseInfo) {
  10774. var response;
  10775. if (responseInfo.statusCode===200) {
  10776. response={ ErrorCode: null, ErrorMessage: null, Headers: responseInfo.headers, Body: JSON.parse(responseInfo.body) };
  10777. }
  10778. else {
  10779. var errorObj=null;
  10780. OfficeExtension.Utility.log("Error Response:"+responseInfo.body);
  10781. if (!OfficeExtension.Utility.isNullOrEmptyString(responseInfo.body)) {
  10782. var errorResponseBody=OfficeExtension.Utility.trim(responseInfo.body);
  10783. try {
  10784. errorObj=JSON.parse(errorResponseBody);
  10785. }
  10786. catch (e) {
  10787. OfficeExtension.Utility.log("Error when parse "+errorResponseBody);
  10788. }
  10789. }
  10790. var errorMessage;
  10791. var errorCode;
  10792. if (!OfficeExtension.Utility.isNullOrUndefined(errorObj) && typeof (errorObj)==="object" && errorObj.error) {
  10793. errorCode=errorObj.error.code;
  10794. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithDetails, [responseInfo.statusCode.toString(), errorObj.error.code, errorObj.error.message]);
  10795. }
  10796. else {
  10797. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, responseInfo.statusCode.toString());
  10798. }
  10799. if (OfficeExtension.Utility.isNullOrEmptyString(errorCode)) {
  10800. errorCode=OfficeExtension.ErrorCodes.connectionFailure;
  10801. }
  10802. response={
  10803. ErrorCode: errorCode,
  10804. ErrorMessage: errorMessage,
  10805. Headers: responseInfo.headers,
  10806. Body: null
  10807. };
  10808. }
  10809. return response;
  10810. });
  10811. };
  10812. HttpRequestExecutor.SourceLibHeaderValue="officejs-rest";
  10813. return HttpRequestExecutor;
  10814. })();
  10815. OfficeExtension.HttpRequestExecutor=HttpRequestExecutor;
  10816. })(OfficeExtension || (OfficeExtension={}));
  10817. var OfficeExtension;
  10818. (function (OfficeExtension) {
  10819. var HttpUtility=(function () {
  10820. function HttpUtility() {
  10821. }
  10822. HttpUtility.setCustomSendRequestFunc=function (func) {
  10823. HttpUtility.s_customSendRequestFunc=func;
  10824. };
  10825. HttpUtility.xhrSendRequestFunc=function (request) {
  10826. return new OfficeExtension.Promise(function (resolve, reject) {
  10827. var xhr=new XMLHttpRequest();
  10828. xhr.open(request.method, request.url);
  10829. xhr.onload=function () {
  10830. var resp={
  10831. statusCode: xhr.status,
  10832. headers: OfficeExtension.Utility._parseHttpResponseHeaders(xhr.getAllResponseHeaders()),
  10833. body: xhr.responseText
  10834. };
  10835. resolve(resp);
  10836. };
  10837. xhr.onerror=function () {
  10838. reject(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.connectionFailure, OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, xhr.statusText), null));
  10839. };
  10840. if (request.headers) {
  10841. for (var key in request.headers) {
  10842. xhr.setRequestHeader(key, request.headers[key]);
  10843. }
  10844. }
  10845. xhr.send(request.body);
  10846. });
  10847. };
  10848. HttpUtility.sendRequest=function (request) {
  10849. HttpUtility.validateAndNormalizeRequest(request);
  10850. var func;
  10851. func=HttpUtility.s_customSendRequestFunc || HttpUtility.xhrSendRequestFunc;
  10852. return func(request);
  10853. };
  10854. HttpUtility.setCustomSendLocalDocumentRequestFunc=function (func) {
  10855. HttpUtility.s_customSendLocalDocumentRequestFunc=func;
  10856. };
  10857. HttpUtility.sendLocalDocumentRequest=function (request) {
  10858. HttpUtility.validateAndNormalizeRequest(request);
  10859. var func;
  10860. func=HttpUtility.s_customSendLocalDocumentRequestFunc || HttpUtility.officeJsSendLocalDocumentRequestFunc;
  10861. return func(request);
  10862. };
  10863. HttpUtility.officeJsSendLocalDocumentRequestFunc=function (request) {
  10864. request=OfficeExtension.Utility._validateLocalDocumentRequest(request);
  10865. var requestSafeArray=OfficeExtension.Utility._buildRequestMessageSafeArray(request);
  10866. return new OfficeExtension.Promise(function (resolve, reject) {
  10867. OSF.DDA.RichApi.executeRichApiRequestAsync(requestSafeArray, function (asyncResult) {
  10868. var response;
  10869. if (asyncResult.status=="succeeded") {
  10870. response={
  10871. statusCode: OfficeExtension.RichApiMessageUtility.getResponseStatusCode(asyncResult),
  10872. headers: OfficeExtension.RichApiMessageUtility.getResponseHeaders(asyncResult),
  10873. body: OfficeExtension.RichApiMessageUtility.getResponseBody(asyncResult)
  10874. };
  10875. }
  10876. else {
  10877. response=OfficeExtension.RichApiMessageUtility.buildHttpResponseFromOfficeJsError(asyncResult.error.code, asyncResult.error.message);
  10878. }
  10879. OfficeExtension.Utility.log(JSON.stringify(response));
  10880. resolve(response);
  10881. });
  10882. });
  10883. };
  10884. HttpUtility.validateAndNormalizeRequest=function (request) {
  10885. if (OfficeExtension.Utility.isNullOrUndefined(request)) {
  10886. throw OfficeExtension.Utility.createInvalidArgumentException("request");
  10887. }
  10888. if (OfficeExtension.Utility.isNullOrEmptyString(request.method)) {
  10889. request.method="GET";
  10890. }
  10891. request.method=request.method.toUpperCase();
  10892. };
  10893. return HttpUtility;
  10894. })();
  10895. OfficeExtension.HttpUtility=HttpUtility;
  10896. })(OfficeExtension || (OfficeExtension={}));
  10897. var OfficeExtension;
  10898. (function (OfficeExtension) {
  10899. var InstantiateActionResultHandler=(function () {
  10900. function InstantiateActionResultHandler(clientObject) {
  10901. this.m_clientObject=clientObject;
  10902. }
  10903. InstantiateActionResultHandler.prototype._handleResult=function (value) {
  10904. this.m_clientObject._handleIdResult(value);
  10905. };
  10906. return InstantiateActionResultHandler;
  10907. })();
  10908. OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler;
  10909. })(OfficeExtension || (OfficeExtension={}));
  10910. var OfficeExtension;
  10911. (function (OfficeExtension) {
  10912. })(OfficeExtension || (OfficeExtension={}));
  10913. var OfficeExtension;
  10914. (function (OfficeExtension) {
  10915. (function (RichApiRequestMessageIndex) {
  10916. RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData";
  10917. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method";
  10918. RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery";
  10919. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers";
  10920. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body";
  10921. RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission";
  10922. RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags";
  10923. })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={}));
  10924. var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex;
  10925. (function (RichApiResponseMessageIndex) {
  10926. RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode";
  10927. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers";
  10928. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body";
  10929. })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={}));
  10930. var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex;
  10931. ;
  10932. (function (ActionType) {
  10933. ActionType[ActionType["Instantiate"]=1]="Instantiate";
  10934. ActionType[ActionType["Query"]=2]="Query";
  10935. ActionType[ActionType["Method"]=3]="Method";
  10936. ActionType[ActionType["SetProperty"]=4]="SetProperty";
  10937. ActionType[ActionType["Trace"]=5]="Trace";
  10938. ActionType[ActionType["RecursiveQuery"]=6]="RecursiveQuery";
  10939. })(OfficeExtension.ActionType || (OfficeExtension.ActionType={}));
  10940. var ActionType=OfficeExtension.ActionType;
  10941. (function (ObjectPathType) {
  10942. ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject";
  10943. ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject";
  10944. ObjectPathType[ObjectPathType["Method"]=3]="Method";
  10945. ObjectPathType[ObjectPathType["Property"]=4]="Property";
  10946. ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer";
  10947. ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId";
  10948. ObjectPathType[ObjectPathType["NullObject"]=7]="NullObject";
  10949. })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={}));
  10950. var ObjectPathType=OfficeExtension.ObjectPathType;
  10951. })(OfficeExtension || (OfficeExtension={}));
  10952. var OfficeExtension;
  10953. (function (OfficeExtension) {
  10954. var ObjectPath=(function () {
  10955. function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) {
  10956. this.m_objectPathInfo=objectPathInfo;
  10957. this.m_parentObjectPath=parentObjectPath;
  10958. this.m_isWriteOperation=false;
  10959. this.m_isCollection=isCollection;
  10960. this.m_isInvalidAfterRequest=isInvalidAfterRequest;
  10961. this.m_isValid=true;
  10962. }
  10963. Object.defineProperty(ObjectPath.prototype, "objectPathInfo", {
  10964. get: function () {
  10965. return this.m_objectPathInfo;
  10966. },
  10967. enumerable: true,
  10968. configurable: true
  10969. });
  10970. Object.defineProperty(ObjectPath.prototype, "isWriteOperation", {
  10971. get: function () {
  10972. return this.m_isWriteOperation;
  10973. },
  10974. set: function (value) {
  10975. this.m_isWriteOperation=value;
  10976. },
  10977. enumerable: true,
  10978. configurable: true
  10979. });
  10980. Object.defineProperty(ObjectPath.prototype, "isCollection", {
  10981. get: function () {
  10982. return this.m_isCollection;
  10983. },
  10984. enumerable: true,
  10985. configurable: true
  10986. });
  10987. Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", {
  10988. get: function () {
  10989. return this.m_isInvalidAfterRequest;
  10990. },
  10991. enumerable: true,
  10992. configurable: true
  10993. });
  10994. Object.defineProperty(ObjectPath.prototype, "parentObjectPath", {
  10995. get: function () {
  10996. return this.m_parentObjectPath;
  10997. },
  10998. enumerable: true,
  10999. configurable: true
  11000. });
  11001. Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", {
  11002. get: function () {
  11003. return this.m_argumentObjectPaths;
  11004. },
  11005. set: function (value) {
  11006. this.m_argumentObjectPaths=value;
  11007. },
  11008. enumerable: true,
  11009. configurable: true
  11010. });
  11011. Object.defineProperty(ObjectPath.prototype, "isValid", {
  11012. get: function () {
  11013. return this.m_isValid;
  11014. },
  11015. set: function (value) {
  11016. this.m_isValid=value;
  11017. },
  11018. enumerable: true,
  11019. configurable: true
  11020. });
  11021. Object.defineProperty(ObjectPath.prototype, "getByIdMethodName", {
  11022. get: function () {
  11023. return this.m_getByIdMethodName;
  11024. },
  11025. set: function (value) {
  11026. this.m_getByIdMethodName=value;
  11027. },
  11028. enumerable: true,
  11029. configurable: true
  11030. });
  11031. ObjectPath.prototype._updateAsNullObject=function () {
  11032. this.m_isInvalidAfterRequest=false;
  11033. this.m_isValid=true;
  11034. this.m_objectPathInfo.ObjectPathType=7 ;
  11035. this.m_objectPathInfo.Name="";
  11036. this.m_objectPathInfo.ArgumentInfo={};
  11037. this.m_parentObjectPath=null;
  11038. this.m_argumentObjectPaths=null;
  11039. };
  11040. ObjectPath.prototype.updateUsingObjectData=function (value) {
  11041. var referenceId=value[OfficeExtension.Constants.referenceId];
  11042. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  11043. this.m_isInvalidAfterRequest=false;
  11044. this.m_isValid=true;
  11045. this.m_objectPathInfo.ObjectPathType=6 ;
  11046. this.m_objectPathInfo.Name=referenceId;
  11047. this.m_objectPathInfo.ArgumentInfo={};
  11048. this.m_parentObjectPath=null;
  11049. this.m_argumentObjectPaths=null;
  11050. return;
  11051. }
  11052. var parentIsCollection=this.parentObjectPath && this.parentObjectPath.isCollection;
  11053. var getByIdMethodName=this.getByIdMethodName;
  11054. if (parentIsCollection || !OfficeExtension.Utility.isNullOrEmptyString(getByIdMethodName)) {
  11055. var id=value[OfficeExtension.Constants.id];
  11056. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  11057. id=value[OfficeExtension.Constants.idPrivate];
  11058. }
  11059. if (!OfficeExtension.Utility.isNullOrUndefined(id)) {
  11060. this.m_isInvalidAfterRequest=false;
  11061. this.m_isValid=true;
  11062. if (parentIsCollection) {
  11063. this.m_objectPathInfo.ObjectPathType=5 ;
  11064. this.m_objectPathInfo.Name="";
  11065. }
  11066. else {
  11067. this.m_objectPathInfo.ObjectPathType=3 ;
  11068. this.m_objectPathInfo.Name=getByIdMethodName;
  11069. this.m_getByIdMethodName=null;
  11070. }
  11071. this.isWriteOperation=false;
  11072. this.m_objectPathInfo.ArgumentInfo={};
  11073. this.m_objectPathInfo.ArgumentInfo.Arguments=[id];
  11074. this.m_argumentObjectPaths=null;
  11075. return;
  11076. }
  11077. }
  11078. };
  11079. return ObjectPath;
  11080. })();
  11081. OfficeExtension.ObjectPath=ObjectPath;
  11082. })(OfficeExtension || (OfficeExtension={}));
  11083. var OfficeExtension;
  11084. (function (OfficeExtension) {
  11085. var ObjectPathFactory=(function () {
  11086. function ObjectPathFactory() {
  11087. }
  11088. ObjectPathFactory.createGlobalObjectObjectPath=function (context) {
  11089. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" };
  11090. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  11091. };
  11092. ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) {
  11093. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName };
  11094. return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false);
  11095. };
  11096. ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) {
  11097. var objectPathInfo={
  11098. Id: context._nextId(),
  11099. ObjectPathType: 4 ,
  11100. Name: propertyName,
  11101. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11102. };
  11103. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  11104. };
  11105. ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) {
  11106. var objectPathInfo={
  11107. Id: context._nextId(),
  11108. ObjectPathType: 5 ,
  11109. Name: "",
  11110. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11111. ArgumentInfo: {}
  11112. };
  11113. objectPathInfo.ArgumentInfo.Arguments=args;
  11114. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  11115. };
  11116. ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) {
  11117. var objectPathInfo={
  11118. Id: context._nextId(),
  11119. ObjectPathType: 5 ,
  11120. Name: "",
  11121. ParentObjectPathId: parentObjectPath.objectPathInfo.Id,
  11122. ArgumentInfo: {}
  11123. };
  11124. objectPathInfo.ArgumentInfo.Arguments=args;
  11125. return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false);
  11126. };
  11127. ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest, getByIdMethodName) {
  11128. var objectPathInfo={
  11129. Id: context._nextId(),
  11130. ObjectPathType: 3 ,
  11131. Name: methodName,
  11132. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11133. ArgumentInfo: {}
  11134. };
  11135. var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args);
  11136. var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  11137. ret.argumentObjectPaths=argumentObjectPaths;
  11138. ret.isWriteOperation=(operationType !=1 );
  11139. ret.getByIdMethodName=getByIdMethodName;
  11140. return ret;
  11141. };
  11142. ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt=function (hasIndexerMethod, context, parent, childItem, index) {
  11143. var id=childItem[OfficeExtension.Constants.id];
  11144. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  11145. id=childItem[OfficeExtension.Constants.idPrivate];
  11146. }
  11147. if (hasIndexerMethod && !OfficeExtension.Utility.isNullOrUndefined(id)) {
  11148. return ObjectPathFactory.createChildItemObjectPathUsingIndexer(context, parent, childItem);
  11149. }
  11150. else {
  11151. return ObjectPathFactory.createChildItemObjectPathUsingGetItemAt(context, parent, childItem, index);
  11152. }
  11153. };
  11154. ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) {
  11155. var id=childItem[OfficeExtension.Constants.id];
  11156. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  11157. id=childItem[OfficeExtension.Constants.idPrivate];
  11158. }
  11159. var objectPathInfo=objectPathInfo={
  11160. Id: context._nextId(),
  11161. ObjectPathType: 5 ,
  11162. Name: "",
  11163. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11164. ArgumentInfo: {}
  11165. };
  11166. objectPathInfo.ArgumentInfo.Arguments=[id];
  11167. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  11168. };
  11169. ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) {
  11170. var indexFromServer=childItem[OfficeExtension.Constants.index];
  11171. if (indexFromServer) {
  11172. index=indexFromServer;
  11173. }
  11174. var objectPathInfo={
  11175. Id: context._nextId(),
  11176. ObjectPathType: 3 ,
  11177. Name: OfficeExtension.Constants.getItemAt,
  11178. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11179. ArgumentInfo: {}
  11180. };
  11181. objectPathInfo.ArgumentInfo.Arguments=[index];
  11182. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  11183. };
  11184. return ObjectPathFactory;
  11185. })();
  11186. OfficeExtension.ObjectPathFactory=ObjectPathFactory;
  11187. })(OfficeExtension || (OfficeExtension={}));
  11188. var OfficeExtension;
  11189. (function (OfficeExtension) {
  11190. var OfficeJsRequestExecutor=(function () {
  11191. function OfficeJsRequestExecutor() {
  11192. }
  11193. OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  11194. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, OfficeJsRequestExecutor.SourceLibHeaderValue);
  11195. return new OfficeExtension.Promise(function (resolve, reject) {
  11196. OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) {
  11197. OfficeExtension.Utility.log("Response:");
  11198. OfficeExtension.Utility.log(JSON.stringify(result));
  11199. var response;
  11200. if (result.status=="succeeded") {
  11201. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBody(result), OfficeExtension.RichApiMessageUtility.getResponseHeaders(result));
  11202. }
  11203. else {
  11204. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.code, result.error.message);
  11205. }
  11206. resolve(response);
  11207. });
  11208. });
  11209. };
  11210. OfficeJsRequestExecutor.SourceLibHeaderValue="officejs";
  11211. return OfficeJsRequestExecutor;
  11212. })();
  11213. OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor;
  11214. })(OfficeExtension || (OfficeExtension={}));
  11215. var OfficeExtension;
  11216. (function (OfficeExtension) {
  11217. var _Internal;
  11218. (function (_Internal) {
  11219. var PromiseImpl;
  11220. (function (PromiseImpl) {
  11221. function Init() {
  11222. (function () {
  11223. "use strict";
  11224. function lib$es6$promise$utils$$objectOrFunction(x) {
  11225. return typeof x==='function' || (typeof x==='object' && x !==null);
  11226. }
  11227. function lib$es6$promise$utils$$isFunction(x) {
  11228. return typeof x==='function';
  11229. }
  11230. function lib$es6$promise$utils$$isMaybeThenable(x) {
  11231. return typeof x==='object' && x !==null;
  11232. }
  11233. var lib$es6$promise$utils$$_isArray;
  11234. if (!Array.isArray) {
  11235. lib$es6$promise$utils$$_isArray=function (x) {
  11236. return Object.prototype.toString.call(x)==='[object Array]';
  11237. };
  11238. }
  11239. else {
  11240. lib$es6$promise$utils$$_isArray=Array.isArray;
  11241. }
  11242. var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;
  11243. var lib$es6$promise$asap$$len=0;
  11244. var lib$es6$promise$asap$$toString={}.toString;
  11245. var lib$es6$promise$asap$$vertxNext;
  11246. var lib$es6$promise$asap$$customSchedulerFn;
  11247. var lib$es6$promise$asap$$asap=function asap(callback, arg) {
  11248. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;
  11249. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;
  11250. lib$es6$promise$asap$$len+=2;
  11251. if (lib$es6$promise$asap$$len===2) {
  11252. if (lib$es6$promise$asap$$customSchedulerFn) {
  11253. lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
  11254. }
  11255. else {
  11256. lib$es6$promise$asap$$scheduleFlush();
  11257. }
  11258. }
  11259. };
  11260. function lib$es6$promise$asap$$setScheduler(scheduleFn) {
  11261. lib$es6$promise$asap$$customSchedulerFn=scheduleFn;
  11262. }
  11263. function lib$es6$promise$asap$$setAsap(asapFn) {
  11264. lib$es6$promise$asap$$asap=asapFn;
  11265. }
  11266. var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined;
  11267. var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {};
  11268. var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
  11269. var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]';
  11270. var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined';
  11271. function lib$es6$promise$asap$$useNextTick() {
  11272. var nextTick=process.nextTick;
  11273. var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
  11274. if (Array.isArray(version) && version[1]==='0' && version[2]==='10') {
  11275. nextTick=setImmediate;
  11276. }
  11277. return function () {
  11278. nextTick(lib$es6$promise$asap$$flush);
  11279. };
  11280. }
  11281. function lib$es6$promise$asap$$useVertxTimer() {
  11282. return function () {
  11283. lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
  11284. };
  11285. }
  11286. function lib$es6$promise$asap$$useMutationObserver() {
  11287. var iterations=0;
  11288. var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
  11289. var node=document.createTextNode('');
  11290. observer.observe(node, { characterData: true });
  11291. return function () {
  11292. node.data=(iterations=++iterations % 2);
  11293. };
  11294. }
  11295. function lib$es6$promise$asap$$useMessageChannel() {
  11296. var channel=new MessageChannel();
  11297. channel.port1.onmessage=lib$es6$promise$asap$$flush;
  11298. return function () {
  11299. channel.port2.postMessage(0);
  11300. };
  11301. }
  11302. function lib$es6$promise$asap$$useSetTimeout() {
  11303. return function () {
  11304. setTimeout(lib$es6$promise$asap$$flush, 1);
  11305. };
  11306. }
  11307. var lib$es6$promise$asap$$queue=new Array(1000);
  11308. function lib$es6$promise$asap$$flush() {
  11309. for (var i=0; i < lib$es6$promise$asap$$len; i+=2) {
  11310. var callback=lib$es6$promise$asap$$queue[i];
  11311. var arg=lib$es6$promise$asap$$queue[i+1];
  11312. callback(arg);
  11313. lib$es6$promise$asap$$queue[i]=undefined;
  11314. lib$es6$promise$asap$$queue[i+1]=undefined;
  11315. }
  11316. lib$es6$promise$asap$$len=0;
  11317. }
  11318. function lib$es6$promise$asap$$attemptVertex() {
  11319. try {
  11320. var r=require;
  11321. var vertx=r('vertx');
  11322. lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext;
  11323. return lib$es6$promise$asap$$useVertxTimer();
  11324. }
  11325. catch (e) {
  11326. return lib$es6$promise$asap$$useSetTimeout();
  11327. }
  11328. }
  11329. var lib$es6$promise$asap$$scheduleFlush;
  11330. if (lib$es6$promise$asap$$isNode) {
  11331. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick();
  11332. }
  11333. else if (lib$es6$promise$asap$$BrowserMutationObserver) {
  11334. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver();
  11335. }
  11336. else if (lib$es6$promise$asap$$isWorker) {
  11337. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel();
  11338. }
  11339. else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') {
  11340. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex();
  11341. }
  11342. else {
  11343. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout();
  11344. }
  11345. function lib$es6$promise$$internal$$noop() {
  11346. }
  11347. var lib$es6$promise$$internal$$PENDING=void 0;
  11348. var lib$es6$promise$$internal$$FULFILLED=1;
  11349. var lib$es6$promise$$internal$$REJECTED=2;
  11350. var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  11351. function lib$es6$promise$$internal$$selfFullfillment() {
  11352. return new TypeError("You cannot resolve a promise with itself");
  11353. }
  11354. function lib$es6$promise$$internal$$cannotReturnOwn() {
  11355. return new TypeError('A promises callback cannot return that same promise.');
  11356. }
  11357. function lib$es6$promise$$internal$$getThen(promise) {
  11358. try {
  11359. return promise.then;
  11360. }
  11361. catch (error) {
  11362. lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;
  11363. return lib$es6$promise$$internal$$GET_THEN_ERROR;
  11364. }
  11365. }
  11366. function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
  11367. try {
  11368. then.call(value, fulfillmentHandler, rejectionHandler);
  11369. }
  11370. catch (e) {
  11371. return e;
  11372. }
  11373. }
  11374. function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
  11375. lib$es6$promise$asap$$asap(function (promise) {
  11376. var sealed=false;
  11377. var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {
  11378. if (sealed) {
  11379. return;
  11380. }
  11381. sealed=true;
  11382. if (thenable !==value) {
  11383. lib$es6$promise$$internal$$resolve(promise, value);
  11384. }
  11385. else {
  11386. lib$es6$promise$$internal$$fulfill(promise, value);
  11387. }
  11388. }, function (reason) {
  11389. if (sealed) {
  11390. return;
  11391. }
  11392. sealed=true;
  11393. lib$es6$promise$$internal$$reject(promise, reason);
  11394. }, 'Settle: '+(promise._label || ' unknown promise'));
  11395. if (!sealed && error) {
  11396. sealed=true;
  11397. lib$es6$promise$$internal$$reject(promise, error);
  11398. }
  11399. }, promise);
  11400. }
  11401. function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
  11402. if (thenable._state===lib$es6$promise$$internal$$FULFILLED) {
  11403. lib$es6$promise$$internal$$fulfill(promise, thenable._result);
  11404. }
  11405. else if (thenable._state===lib$es6$promise$$internal$$REJECTED) {
  11406. lib$es6$promise$$internal$$reject(promise, thenable._result);
  11407. }
  11408. else {
  11409. lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {
  11410. lib$es6$promise$$internal$$resolve(promise, value);
  11411. }, function (reason) {
  11412. lib$es6$promise$$internal$$reject(promise, reason);
  11413. });
  11414. }
  11415. }
  11416. function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
  11417. if (maybeThenable.constructor===promise.constructor) {
  11418. lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
  11419. }
  11420. else {
  11421. var then=lib$es6$promise$$internal$$getThen(maybeThenable);
  11422. if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) {
  11423. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
  11424. }
  11425. else if (then===undefined) {
  11426. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  11427. }
  11428. else if (lib$es6$promise$utils$$isFunction(then)) {
  11429. lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
  11430. }
  11431. else {
  11432. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  11433. }
  11434. }
  11435. }
  11436. function lib$es6$promise$$internal$$resolve(promise, value) {
  11437. if (promise===value) {
  11438. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
  11439. }
  11440. else if (lib$es6$promise$utils$$objectOrFunction(value)) {
  11441. lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
  11442. }
  11443. else {
  11444. lib$es6$promise$$internal$$fulfill(promise, value);
  11445. }
  11446. }
  11447. function lib$es6$promise$$internal$$publishRejection(promise) {
  11448. if (promise._onerror) {
  11449. promise._onerror(promise._result);
  11450. }
  11451. lib$es6$promise$$internal$$publish(promise);
  11452. }
  11453. function lib$es6$promise$$internal$$fulfill(promise, value) {
  11454. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  11455. return;
  11456. }
  11457. promise._result=value;
  11458. promise._state=lib$es6$promise$$internal$$FULFILLED;
  11459. if (promise._subscribers.length !==0) {
  11460. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
  11461. }
  11462. }
  11463. function lib$es6$promise$$internal$$reject(promise, reason) {
  11464. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  11465. return;
  11466. }
  11467. promise._state=lib$es6$promise$$internal$$REJECTED;
  11468. promise._result=reason;
  11469. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
  11470. }
  11471. function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
  11472. var subscribers=parent._subscribers;
  11473. var length=subscribers.length;
  11474. parent._onerror=null;
  11475. subscribers[length]=child;
  11476. subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;
  11477. subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;
  11478. if (length===0 && parent._state) {
  11479. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
  11480. }
  11481. }
  11482. function lib$es6$promise$$internal$$publish(promise) {
  11483. var subscribers=promise._subscribers;
  11484. var settled=promise._state;
  11485. if (subscribers.length===0) {
  11486. return;
  11487. }
  11488. var child, callback, detail=promise._result;
  11489. for (var i=0; i < subscribers.length; i+=3) {
  11490. child=subscribers[i];
  11491. callback=subscribers[i+settled];
  11492. if (child) {
  11493. lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
  11494. }
  11495. else {
  11496. callback(detail);
  11497. }
  11498. }
  11499. promise._subscribers.length=0;
  11500. }
  11501. function lib$es6$promise$$internal$$ErrorObject() {
  11502. this.error=null;
  11503. }
  11504. var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  11505. function lib$es6$promise$$internal$$tryCatch(callback, detail) {
  11506. try {
  11507. return callback(detail);
  11508. }
  11509. catch (e) {
  11510. lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;
  11511. return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
  11512. }
  11513. }
  11514. function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
  11515. var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed;
  11516. if (hasCallback) {
  11517. value=lib$es6$promise$$internal$$tryCatch(callback, detail);
  11518. if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
  11519. failed=true;
  11520. error=value.error;
  11521. value=null;
  11522. }
  11523. else {
  11524. succeeded=true;
  11525. }
  11526. if (promise===value) {
  11527. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
  11528. return;
  11529. }
  11530. }
  11531. else {
  11532. value=detail;
  11533. succeeded=true;
  11534. }
  11535. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  11536. }
  11537. else if (hasCallback && succeeded) {
  11538. lib$es6$promise$$internal$$resolve(promise, value);
  11539. }
  11540. else if (failed) {
  11541. lib$es6$promise$$internal$$reject(promise, error);
  11542. }
  11543. else if (settled===lib$es6$promise$$internal$$FULFILLED) {
  11544. lib$es6$promise$$internal$$fulfill(promise, value);
  11545. }
  11546. else if (settled===lib$es6$promise$$internal$$REJECTED) {
  11547. lib$es6$promise$$internal$$reject(promise, value);
  11548. }
  11549. }
  11550. function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
  11551. try {
  11552. resolver(function resolvePromise(value) {
  11553. lib$es6$promise$$internal$$resolve(promise, value);
  11554. }, function rejectPromise(reason) {
  11555. lib$es6$promise$$internal$$reject(promise, reason);
  11556. });
  11557. }
  11558. catch (e) {
  11559. lib$es6$promise$$internal$$reject(promise, e);
  11560. }
  11561. }
  11562. function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
  11563. var enumerator=this;
  11564. enumerator._instanceConstructor=Constructor;
  11565. enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);
  11566. if (enumerator._validateInput(input)) {
  11567. enumerator._input=input;
  11568. enumerator.length=input.length;
  11569. enumerator._remaining=input.length;
  11570. enumerator._init();
  11571. if (enumerator.length===0) {
  11572. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  11573. }
  11574. else {
  11575. enumerator.length=enumerator.length || 0;
  11576. enumerator._enumerate();
  11577. if (enumerator._remaining===0) {
  11578. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  11579. }
  11580. }
  11581. }
  11582. else {
  11583. lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
  11584. }
  11585. }
  11586. lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) {
  11587. return lib$es6$promise$utils$$isArray(input);
  11588. };
  11589. lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () {
  11590. return new _Internal.Error('Array Methods must be provided an Array');
  11591. };
  11592. lib$es6$promise$enumerator$$Enumerator.prototype._init=function () {
  11593. this._result=new Array(this.length);
  11594. };
  11595. var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;
  11596. lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () {
  11597. var enumerator=this;
  11598. var length=enumerator.length;
  11599. var promise=enumerator.promise;
  11600. var input=enumerator._input;
  11601. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  11602. enumerator._eachEntry(input[i], i);
  11603. }
  11604. };
  11605. lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) {
  11606. var enumerator=this;
  11607. var c=enumerator._instanceConstructor;
  11608. if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
  11609. if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) {
  11610. entry._onerror=null;
  11611. enumerator._settledAt(entry._state, i, entry._result);
  11612. }
  11613. else {
  11614. enumerator._willSettleAt(c.resolve(entry), i);
  11615. }
  11616. }
  11617. else {
  11618. enumerator._remaining--;
  11619. enumerator._result[i]=entry;
  11620. }
  11621. };
  11622. lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) {
  11623. var enumerator=this;
  11624. var promise=enumerator.promise;
  11625. if (promise._state===lib$es6$promise$$internal$$PENDING) {
  11626. enumerator._remaining--;
  11627. if (state===lib$es6$promise$$internal$$REJECTED) {
  11628. lib$es6$promise$$internal$$reject(promise, value);
  11629. }
  11630. else {
  11631. enumerator._result[i]=value;
  11632. }
  11633. }
  11634. if (enumerator._remaining===0) {
  11635. lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
  11636. }
  11637. };
  11638. lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) {
  11639. var enumerator=this;
  11640. lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {
  11641. enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
  11642. }, function (reason) {
  11643. enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
  11644. });
  11645. };
  11646. function lib$es6$promise$promise$all$$all(entries) {
  11647. return new lib$es6$promise$enumerator$$default(this, entries).promise;
  11648. }
  11649. var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;
  11650. function lib$es6$promise$promise$race$$race(entries) {
  11651. var Constructor=this;
  11652. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  11653. if (!lib$es6$promise$utils$$isArray(entries)) {
  11654. lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
  11655. return promise;
  11656. }
  11657. var length=entries.length;
  11658. function onFulfillment(value) {
  11659. lib$es6$promise$$internal$$resolve(promise, value);
  11660. }
  11661. function onRejection(reason) {
  11662. lib$es6$promise$$internal$$reject(promise, reason);
  11663. }
  11664. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  11665. lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
  11666. }
  11667. return promise;
  11668. }
  11669. var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;
  11670. function lib$es6$promise$promise$resolve$$resolve(object) {
  11671. var Constructor=this;
  11672. if (object && typeof object==='object' && object.constructor===Constructor) {
  11673. return object;
  11674. }
  11675. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  11676. lib$es6$promise$$internal$$resolve(promise, object);
  11677. return promise;
  11678. }
  11679. var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;
  11680. function lib$es6$promise$promise$reject$$reject(reason) {
  11681. var Constructor=this;
  11682. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  11683. lib$es6$promise$$internal$$reject(promise, reason);
  11684. return promise;
  11685. }
  11686. var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;
  11687. var lib$es6$promise$promise$$counter=0;
  11688. function lib$es6$promise$promise$$needsResolver() {
  11689. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  11690. }
  11691. function lib$es6$promise$promise$$needsNew() {
  11692. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  11693. }
  11694. var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;
  11695. function lib$es6$promise$promise$$Promise(resolver) {
  11696. this._id=lib$es6$promise$promise$$counter++;
  11697. this._state=undefined;
  11698. this._result=undefined;
  11699. this._subscribers=[];
  11700. if (lib$es6$promise$$internal$$noop !==resolver) {
  11701. if (!lib$es6$promise$utils$$isFunction(resolver)) {
  11702. lib$es6$promise$promise$$needsResolver();
  11703. }
  11704. if (!(this instanceof lib$es6$promise$promise$$Promise)) {
  11705. lib$es6$promise$promise$$needsNew();
  11706. }
  11707. lib$es6$promise$$internal$$initializePromise(this, resolver);
  11708. }
  11709. }
  11710. lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;
  11711. lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;
  11712. lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;
  11713. lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;
  11714. lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;
  11715. lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;
  11716. lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;
  11717. lib$es6$promise$promise$$Promise.prototype={
  11718. constructor: lib$es6$promise$promise$$Promise,
  11719. then: function (onFulfillment, onRejection) {
  11720. var parent=this;
  11721. var state=parent._state;
  11722. if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) {
  11723. return this;
  11724. }
  11725. var child=new this.constructor(lib$es6$promise$$internal$$noop);
  11726. var result=parent._result;
  11727. if (state) {
  11728. var callback=arguments[state - 1];
  11729. lib$es6$promise$asap$$asap(function () {
  11730. lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
  11731. });
  11732. }
  11733. else {
  11734. lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
  11735. }
  11736. return child;
  11737. },
  11738. 'catch': function (onRejection) {
  11739. return this.then(null, onRejection);
  11740. }
  11741. };
  11742. OfficeExtension.Promise=lib$es6$promise$promise$$default;
  11743. }).call(this);
  11744. }
  11745. PromiseImpl.Init=Init;
  11746. })(PromiseImpl=_Internal.PromiseImpl || (_Internal.PromiseImpl={}));
  11747. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  11748. if (!OfficeExtension["Promise"]) {
  11749. if (typeof (window) !=="undefined" && window.Promise) {
  11750. if (IsEdgeLessThan14()) {
  11751. _Internal.PromiseImpl.Init();
  11752. }
  11753. else {
  11754. OfficeExtension.Promise=window.Promise;
  11755. }
  11756. }
  11757. else {
  11758. _Internal.PromiseImpl.Init();
  11759. }
  11760. }
  11761. })(OfficeExtension || (OfficeExtension={}));
  11762. function IsEdgeLessThan14() {
  11763. var userAgent=window.navigator.userAgent;
  11764. var versionIdx=userAgent.indexOf("Edge/");
  11765. if (versionIdx >=0) {
  11766. userAgent=userAgent.substring(versionIdx+5, userAgent.length);
  11767. if (userAgent < "14.14393")
  11768. return true;
  11769. else
  11770. return false;
  11771. }
  11772. return false;
  11773. }
  11774. var OfficeExtension;
  11775. (function (OfficeExtension) {
  11776. (function (OperationType) {
  11777. OperationType[OperationType["Default"]=0]="Default";
  11778. OperationType[OperationType["Read"]=1]="Read";
  11779. })(OfficeExtension.OperationType || (OfficeExtension.OperationType={}));
  11780. var OperationType=OfficeExtension.OperationType;
  11781. })(OfficeExtension || (OfficeExtension={}));
  11782. var OfficeExtension;
  11783. (function (OfficeExtension) {
  11784. var TrackedObjects=(function () {
  11785. function TrackedObjects(context) {
  11786. this._autoCleanupList={};
  11787. this.m_context=context;
  11788. }
  11789. TrackedObjects.prototype.add=function (param) {
  11790. var _this=this;
  11791. if (Array.isArray(param)) {
  11792. param.forEach(function (item) { return _this._addCommon(item, true); });
  11793. }
  11794. else {
  11795. this._addCommon(param, true);
  11796. }
  11797. };
  11798. TrackedObjects.prototype._autoAdd=function (object) {
  11799. this._addCommon(object, false);
  11800. this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object;
  11801. };
  11802. TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) {
  11803. if (object[OfficeExtension.Constants.isTracked]) {
  11804. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  11805. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  11806. }
  11807. return;
  11808. }
  11809. var referenceId=object[OfficeExtension.Constants.referenceId];
  11810. if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) {
  11811. object._KeepReference();
  11812. OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object);
  11813. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  11814. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  11815. }
  11816. object[OfficeExtension.Constants.isTracked]=true;
  11817. }
  11818. };
  11819. TrackedObjects.prototype.remove=function (param) {
  11820. var _this=this;
  11821. if (Array.isArray(param)) {
  11822. param.forEach(function (item) { return _this._removeCommon(item); });
  11823. }
  11824. else {
  11825. this._removeCommon(param);
  11826. }
  11827. };
  11828. TrackedObjects.prototype._removeCommon=function (object) {
  11829. var referenceId=object[OfficeExtension.Constants.referenceId];
  11830. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  11831. var rootObject=this.m_context._rootObject;
  11832. if (rootObject._RemoveReference) {
  11833. rootObject._RemoveReference(referenceId);
  11834. }
  11835. delete object[OfficeExtension.Constants.isTracked];
  11836. }
  11837. };
  11838. TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () {
  11839. var list=this._autoCleanupList;
  11840. this._autoCleanupList={};
  11841. return list;
  11842. };
  11843. return TrackedObjects;
  11844. })();
  11845. OfficeExtension.TrackedObjects=TrackedObjects;
  11846. })(OfficeExtension || (OfficeExtension={}));
  11847. var OfficeExtension;
  11848. (function (OfficeExtension) {
  11849. var ResourceStrings=(function () {
  11850. function ResourceStrings() {
  11851. }
  11852. ResourceStrings.invalidObjectPath="InvalidObjectPath";
  11853. ResourceStrings.propertyNotLoaded="PropertyNotLoaded";
  11854. ResourceStrings.valueNotLoaded="ValueNotLoaded";
  11855. ResourceStrings.invalidRequestContext="InvalidRequestContext";
  11856. ResourceStrings.invalidArgument="InvalidArgument";
  11857. ResourceStrings.runMustReturnPromise="RunMustReturnPromise";
  11858. ResourceStrings.cannotRegisterEvent="CannotRegisterEvent";
  11859. ResourceStrings.connectionFailureWithStatus="ConnectionFailureWithStatus";
  11860. ResourceStrings.connectionFailureWithDetails="ConnectionFailureWithDetails";
  11861. return ResourceStrings;
  11862. })();
  11863. OfficeExtension.ResourceStrings=ResourceStrings;
  11864. })(OfficeExtension || (OfficeExtension={}));
  11865. var OfficeExtension;
  11866. (function (OfficeExtension) {
  11867. var RichApiMessageUtility=(function () {
  11868. function RichApiMessageUtility() {
  11869. }
  11870. RichApiMessageUtility.buildMessageArrayForIRequestExecutor=function (customData, requestFlags, requestMessage, sourceLibHeaderValue) {
  11871. var requestMessageText=JSON.stringify(requestMessage.Body);
  11872. OfficeExtension.Utility.log("Request:");
  11873. OfficeExtension.Utility.log(requestMessageText);
  11874. var headers={};
  11875. headers[OfficeExtension.Constants.sourceLibHeader]=sourceLibHeaderValue;
  11876. var messageSafearray=RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", headers, requestMessageText);
  11877. return messageSafearray;
  11878. };
  11879. RichApiMessageUtility.buildResponseOnSuccess=function (responseBody, responseHeaders) {
  11880. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  11881. response.Body=JSON.parse(responseBody);
  11882. response.Headers=responseHeaders;
  11883. return response;
  11884. };
  11885. RichApiMessageUtility.buildResponseOnError=function (errorCode, message) {
  11886. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  11887. response.ErrorCode=OfficeExtension.ErrorCodes.generalException;
  11888. if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  11889. response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied;
  11890. }
  11891. else if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  11892. response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached;
  11893. }
  11894. response.ErrorMessage=message;
  11895. return response;
  11896. };
  11897. RichApiMessageUtility.buildHttpResponseFromOfficeJsError=function (errorCode, message) {
  11898. var statusCode=500;
  11899. var errorBody={};
  11900. errorBody["error"]={};
  11901. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.generalException;
  11902. errorBody["error"]["message"]=message;
  11903. if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  11904. statusCode=403;
  11905. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.accessDenied;
  11906. }
  11907. else if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  11908. statusCode=429;
  11909. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.activityLimitReached;
  11910. }
  11911. return { statusCode: statusCode, headers: {}, body: JSON.stringify(errorBody) };
  11912. };
  11913. RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) {
  11914. var headerArray=[];
  11915. if (headers) {
  11916. for (var headerName in headers) {
  11917. headerArray.push(headerName);
  11918. headerArray.push(headers[headerName]);
  11919. }
  11920. }
  11921. var appPermission=0;
  11922. var solutionId="";
  11923. var instanceId="";
  11924. var marketplaceType="";
  11925. return [
  11926. customData,
  11927. method,
  11928. path,
  11929. headerArray,
  11930. body,
  11931. appPermission,
  11932. requestFlags,
  11933. solutionId,
  11934. instanceId,
  11935. marketplaceType
  11936. ];
  11937. };
  11938. RichApiMessageUtility.getResponseBody=function (result) {
  11939. return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data);
  11940. };
  11941. RichApiMessageUtility.getResponseHeaders=function (result) {
  11942. return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data);
  11943. };
  11944. RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) {
  11945. var ret=data[2 ];
  11946. if (typeof (ret)==="string") {
  11947. return ret;
  11948. }
  11949. var arr=ret;
  11950. return arr.join("");
  11951. };
  11952. RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) {
  11953. var arrayHeader=data[1 ];
  11954. if (!arrayHeader) {
  11955. return null;
  11956. }
  11957. var headers={};
  11958. for (var i=0; i < arrayHeader.length - 1; i+=2) {
  11959. headers[arrayHeader[i]]=arrayHeader[i+1];
  11960. }
  11961. return headers;
  11962. };
  11963. RichApiMessageUtility.getResponseStatusCode=function (result) {
  11964. return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data);
  11965. };
  11966. RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) {
  11967. return data[0 ];
  11968. };
  11969. RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability=7000;
  11970. RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached=5102;
  11971. return RichApiMessageUtility;
  11972. })();
  11973. OfficeExtension.RichApiMessageUtility=RichApiMessageUtility;
  11974. })(OfficeExtension || (OfficeExtension={}));
  11975. var OfficeExtension;
  11976. (function (OfficeExtension) {
  11977. var Utility=(function () {
  11978. function Utility() {
  11979. }
  11980. Utility.checkArgumentNull=function (value, name) {
  11981. if (Utility.isNullOrUndefined(value)) {
  11982. Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, name);
  11983. }
  11984. };
  11985. Utility.isNullOrUndefined=function (value) {
  11986. if (value===null) {
  11987. return true;
  11988. }
  11989. if (typeof (value)==="undefined") {
  11990. return true;
  11991. }
  11992. return false;
  11993. };
  11994. Utility.isUndefined=function (value) {
  11995. if (typeof (value)==="undefined") {
  11996. return true;
  11997. }
  11998. return false;
  11999. };
  12000. Utility.isNullOrEmptyString=function (value) {
  12001. if (value===null) {
  12002. return true;
  12003. }
  12004. if (typeof (value)==="undefined") {
  12005. return true;
  12006. }
  12007. if (value.length==0) {
  12008. return true;
  12009. }
  12010. return false;
  12011. };
  12012. Utility.isPlainJsonObject=function (value) {
  12013. if (Utility.isNullOrUndefined(value)) {
  12014. return false;
  12015. }
  12016. if (typeof (value) !=="object") {
  12017. return false;
  12018. }
  12019. return Object.getPrototypeOf(value)===Object.getPrototypeOf({});
  12020. };
  12021. Utility.trim=function (str) {
  12022. return str.replace(new RegExp("^\\s+|\\s+$", "g"), "");
  12023. };
  12024. Utility.caseInsensitiveCompareString=function (str1, str2) {
  12025. if (Utility.isNullOrUndefined(str1)) {
  12026. return Utility.isNullOrUndefined(str2);
  12027. }
  12028. else {
  12029. if (Utility.isNullOrUndefined(str2)) {
  12030. return false;
  12031. }
  12032. else {
  12033. return str1.toUpperCase()==str2.toUpperCase();
  12034. }
  12035. }
  12036. };
  12037. Utility.adjustToDateTime=function (value) {
  12038. if (Utility.isNullOrUndefined(value)) {
  12039. return null;
  12040. }
  12041. if (typeof (value)==="string") {
  12042. return new Date(value);
  12043. }
  12044. if (Array.isArray(value)) {
  12045. var arr=value;
  12046. for (var i=0; i < arr.length; i++) {
  12047. arr[i]=Utility.adjustToDateTime(arr[i]);
  12048. }
  12049. return arr;
  12050. }
  12051. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "date"), null);
  12052. };
  12053. Utility.isReadonlyRestRequest=function (method) {
  12054. return Utility.caseInsensitiveCompareString(method, "GET");
  12055. };
  12056. Utility.setMethodArguments=function (context, argumentInfo, args) {
  12057. if (Utility.isNullOrUndefined(args)) {
  12058. return null;
  12059. }
  12060. var referencedObjectPaths=new Array();
  12061. var referencedObjectPathIds=new Array();
  12062. var hasOne=Utility.collectObjectPathInfos(context, args, referencedObjectPaths, referencedObjectPathIds);
  12063. argumentInfo.Arguments=args;
  12064. if (hasOne) {
  12065. argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds;
  12066. return referencedObjectPaths;
  12067. }
  12068. return null;
  12069. };
  12070. Utility.collectObjectPathInfos=function (context, args, referencedObjectPaths, referencedObjectPathIds) {
  12071. var hasOne=false;
  12072. for (var i=0; i < args.length; i++) {
  12073. if (args[i] instanceof OfficeExtension.ClientObject) {
  12074. var clientObject=args[i];
  12075. Utility.validateContext(context, clientObject);
  12076. args[i]=clientObject._objectPath.objectPathInfo.Id;
  12077. referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id);
  12078. referencedObjectPaths.push(clientObject._objectPath);
  12079. hasOne=true;
  12080. }
  12081. else if (Array.isArray(args[i])) {
  12082. var childArrayObjectPathIds=new Array();
  12083. var childArrayHasOne=Utility.collectObjectPathInfos(context, args[i], referencedObjectPaths, childArrayObjectPathIds);
  12084. if (childArrayHasOne) {
  12085. referencedObjectPathIds.push(childArrayObjectPathIds);
  12086. hasOne=true;
  12087. }
  12088. else {
  12089. referencedObjectPathIds.push(0);
  12090. }
  12091. }
  12092. else {
  12093. referencedObjectPathIds.push(0);
  12094. }
  12095. }
  12096. return hasOne;
  12097. };
  12098. Utility.fixObjectPathIfNecessary=function (clientObject, value) {
  12099. if (clientObject && clientObject._objectPath && value) {
  12100. clientObject._objectPath.updateUsingObjectData(value);
  12101. }
  12102. };
  12103. Utility.validateObjectPath=function (clientObject) {
  12104. var objectPath=clientObject._objectPath;
  12105. while (objectPath) {
  12106. if (!objectPath.isValid) {
  12107. var pathExpression=Utility.getObjectPathExpression(objectPath);
  12108. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  12109. }
  12110. objectPath=objectPath.parentObjectPath;
  12111. }
  12112. };
  12113. Utility.validateReferencedObjectPaths=function (objectPaths) {
  12114. if (objectPaths) {
  12115. for (var i=0; i < objectPaths.length; i++) {
  12116. var objectPath=objectPaths[i];
  12117. while (objectPath) {
  12118. if (!objectPath.isValid) {
  12119. var pathExpression=Utility.getObjectPathExpression(objectPath);
  12120. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  12121. }
  12122. objectPath=objectPath.parentObjectPath;
  12123. }
  12124. }
  12125. }
  12126. };
  12127. Utility.validateContext=function (context, obj) {
  12128. if (obj && obj.context !==context) {
  12129. Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext);
  12130. }
  12131. };
  12132. Utility.log=function (message) {
  12133. if (Utility._logEnabled && typeof (console) !=="undefined" && console.log) {
  12134. console.log(message);
  12135. }
  12136. };
  12137. Utility.load=function (clientObj, option) {
  12138. clientObj.context.load(clientObj, option);
  12139. };
  12140. Utility._parseSelectExpand=function (select) {
  12141. var args=[];
  12142. if (!Utility.isNullOrEmptyString(select)) {
  12143. var propertyNames=select.split(",");
  12144. for (var i=0; i < propertyNames.length; i++) {
  12145. var propertyName=propertyNames[i];
  12146. propertyName=sanitizeForAnyItemsSlash(propertyName.trim());
  12147. if (propertyName.length > 0) {
  12148. args.push(propertyName);
  12149. }
  12150. }
  12151. }
  12152. return args;
  12153. function sanitizeForAnyItemsSlash(propertyName) {
  12154. var propertyNameLower=propertyName.toLowerCase();
  12155. if (propertyNameLower==="items" || propertyNameLower==="items/") {
  12156. return '*';
  12157. }
  12158. var itemsSlashLength=6;
  12159. if (propertyNameLower.substr(0, itemsSlashLength)==="items/") {
  12160. propertyName=propertyName.substr(itemsSlashLength);
  12161. }
  12162. return propertyName.replace(new RegExp("\/items\/", "gi"), "/");
  12163. }
  12164. };
  12165. Utility.throwError=function (resourceId, arg, errorLocation) {
  12166. throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), errorLocation ? { errorLocation: errorLocation } : {});
  12167. };
  12168. Utility.createRuntimeError=function (code, message, location) {
  12169. return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location });
  12170. };
  12171. Utility.createInvalidArgumentException=function (name, errorLocation) {
  12172. return Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, name), errorLocation);
  12173. };
  12174. Utility._getResourceString=function (resourceId, arg) {
  12175. var ret=resourceId;
  12176. if (typeof (window) !=="undefined" && window.Strings && window.Strings.OfficeOM) {
  12177. var stringName="L_"+resourceId;
  12178. var stringValue=window.Strings.OfficeOM[stringName];
  12179. if (stringValue) {
  12180. ret=stringValue;
  12181. }
  12182. }
  12183. if (!Utility.isNullOrUndefined(arg)) {
  12184. if (Array.isArray(arg)) {
  12185. var arrArg=arg;
  12186. ret=Utility._formatString(ret, arrArg);
  12187. }
  12188. else {
  12189. ret=ret.replace("{0}", arg);
  12190. }
  12191. }
  12192. return ret;
  12193. };
  12194. Utility._formatString=function (format, arrArg) {
  12195. return format.replace(/\{\d\}/g, function (v) {
  12196. var position=parseInt(v.substr(1, v.length - 2));
  12197. if (position < arrArg.length) {
  12198. return arrArg[position];
  12199. }
  12200. else {
  12201. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "format"), null);
  12202. }
  12203. return "";
  12204. });
  12205. };
  12206. Utility.throwIfNotLoaded=function (propertyName, fieldValue, entityName, isNull) {
  12207. if (!isNull && Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) {
  12208. Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName, (entityName ? entityName+"."+propertyName : null));
  12209. }
  12210. };
  12211. Utility.getObjectPathExpression=function (objectPath) {
  12212. var ret="";
  12213. while (objectPath) {
  12214. switch (objectPath.objectPathInfo.ObjectPathType) {
  12215. case 1 :
  12216. ret=ret;
  12217. break;
  12218. case 2 :
  12219. ret="new()"+(ret.length > 0 ? "." : "")+ret;
  12220. break;
  12221. case 3 :
  12222. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret;
  12223. break;
  12224. case 4 :
  12225. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret;
  12226. break;
  12227. case 5 :
  12228. ret="getItem()"+(ret.length > 0 ? "." : "")+ret;
  12229. break;
  12230. case 6 :
  12231. ret="_reference()"+(ret.length > 0 ? "." : "")+ret;
  12232. break;
  12233. }
  12234. objectPath=objectPath.parentObjectPath;
  12235. }
  12236. return ret;
  12237. };
  12238. Utility._createPromiseFromResult=function (value) {
  12239. return new OfficeExtension.Promise(function (resolve, reject) {
  12240. resolve(value);
  12241. });
  12242. };
  12243. Utility._createTimeoutPromise=function (timeout) {
  12244. return new OfficeExtension.Promise(function (resolve, reject) {
  12245. setTimeout(function () {
  12246. resolve(null);
  12247. }, timeout);
  12248. });
  12249. };
  12250. Utility.promisify=function (action) {
  12251. return new OfficeExtension.Promise(function (resolve, reject) {
  12252. var callback=function (result) {
  12253. if (result.status=="failed") {
  12254. reject(result.error);
  12255. }
  12256. else {
  12257. resolve(result.value);
  12258. }
  12259. };
  12260. action(callback);
  12261. });
  12262. };
  12263. Utility._addActionResultHandler=function (clientObj, action, resultHandler) {
  12264. clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler);
  12265. };
  12266. Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) {
  12267. for (var i=0; i < propertyNames.length - 1; i+=2) {
  12268. if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) {
  12269. clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]);
  12270. }
  12271. }
  12272. };
  12273. Utility.normalizeName=function (name) {
  12274. return name.substr(0, 1).toLowerCase()+name.substr(1);
  12275. };
  12276. Utility._isLocalDocumentUrl=function (url) {
  12277. return Utility._getLocalDocumentUrlPrefixLength(url) > 0;
  12278. };
  12279. Utility._getLocalDocumentUrlPrefixLength=function (url) {
  12280. var localDocumentPrefixes=["http://document.localhost", "https://document.localhost", "//document.localhost"];
  12281. var urlLower=url.toLowerCase().trim();
  12282. for (var i=0; i < localDocumentPrefixes.length; i++) {
  12283. if (urlLower===localDocumentPrefixes[i]) {
  12284. return localDocumentPrefixes[i].length;
  12285. }
  12286. else if (urlLower.substr(0, localDocumentPrefixes[i].length+1)===localDocumentPrefixes[i]+"/") {
  12287. return localDocumentPrefixes[i].length+1;
  12288. }
  12289. }
  12290. return 0;
  12291. };
  12292. Utility._validateLocalDocumentRequest=function (request) {
  12293. var index=Utility._getLocalDocumentUrlPrefixLength(request.url);
  12294. if (index <=0) {
  12295. throw Utility.createInvalidArgumentException("request");
  12296. }
  12297. var path=request.url.substr(index);
  12298. var pathLower=path.toLowerCase();
  12299. if (pathLower==="_api") {
  12300. path="";
  12301. }
  12302. else if (pathLower.substr(0, "_api/".length)==="_api/") {
  12303. path=path.substr("_api/".length);
  12304. }
  12305. return {
  12306. method: request.method,
  12307. url: path,
  12308. headers: request.headers,
  12309. body: request.body
  12310. };
  12311. };
  12312. Utility._buildRequestMessageSafeArray=function (request) {
  12313. var requestFlags=0 ;
  12314. if (!Utility.isReadonlyRestRequest(request.method)) {
  12315. requestFlags=1 ;
  12316. }
  12317. var requestInfo="";
  12318. if (request.headers) {
  12319. requestInfo=request.headers[OfficeExtension.Constants.requestInfoHeader];
  12320. if (!Utility.isNullOrEmptyString(requestInfo)) {
  12321. var parts=requestInfo.split("&");
  12322. for (var i=0; i < parts.length; i++) {
  12323. var keyvalue=parts[i].split("=");
  12324. if (keyvalue[0]=="flags") {
  12325. var flags=parseInt(keyvalue[1]);
  12326. requestFlags=flags;
  12327. break;
  12328. }
  12329. }
  12330. }
  12331. }
  12332. return OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray("", requestFlags, request.method, request.url, request.headers, request.body);
  12333. };
  12334. Utility._parseHttpResponseHeaders=function (allResponseHeaders) {
  12335. var responseHeaders={};
  12336. if (!Utility.isNullOrEmptyString(allResponseHeaders)) {
  12337. var regex=new RegExp("\r?\n");
  12338. var entries=allResponseHeaders.split(regex);
  12339. for (var i=0; i < entries.length; i++) {
  12340. var entry=entries[i];
  12341. if (entry !=null) {
  12342. var index=entry.indexOf(':');
  12343. if (index > 0) {
  12344. var key=entry.substr(0, index);
  12345. var value=entry.substr(index+1);
  12346. key=Utility.trim(key);
  12347. value=Utility.trim(value);
  12348. responseHeaders[key.toUpperCase()]=value;
  12349. }
  12350. }
  12351. }
  12352. }
  12353. return responseHeaders;
  12354. };
  12355. Utility._logEnabled=false;
  12356. Utility.s_underscoreCharCode="_".charCodeAt(0);
  12357. return Utility;
  12358. })();
  12359. OfficeExtension.Utility=Utility;
  12360. })(OfficeExtension || (OfficeExtension={}));
  12361. var __extends=(this && this.__extends) || function (d, b) {
  12362. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  12363. function __() { this.constructor=d; }
  12364. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  12365. };
  12366. var Excel;
  12367. (function (Excel) {
  12368. function lowerCaseFirst(str) {
  12369. return str[0].toLowerCase()+str.slice(1);
  12370. }
  12371. var iconSets=["ThreeArrows",
  12372. "ThreeArrowsGray",
  12373. "ThreeFlags",
  12374. "ThreeTrafficLights1",
  12375. "ThreeTrafficLights2",
  12376. "ThreeSigns",
  12377. "ThreeSymbols",
  12378. "ThreeSymbols2",
  12379. "FourArrows",
  12380. "FourArrowsGray",
  12381. "FourRedToBlack",
  12382. "FourRating",
  12383. "FourTrafficLights",
  12384. "FiveArrows",
  12385. "FiveArrowsGray",
  12386. "FiveRating",
  12387. "FiveQuarters",
  12388. "ThreeStars",
  12389. "ThreeTriangles",
  12390. "FiveBoxes"];
  12391. var iconNames=[["RedDownArrow", "YellowSideArrow", "GreenUpArrow"],
  12392. ["GrayDownArrow", "GraySideArrow", "GrayUpArrow"],
  12393. ["RedFlag", "YellowFlag", "GreenFlag"],
  12394. ["RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  12395. ["RedTrafficLight", "YellowTrafficLight", "GreenTrafficLight"],
  12396. ["RedDiamond", "YellowTriangle", "GreenCircle"],
  12397. ["RedCrossSymbol", "YellowExclamationSymbol", "GreenCheckSymbol"],
  12398. ["RedCross", "YellowExclamation", "GreenCheck"],
  12399. ["RedDownArrow", "YellowDownInclineArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  12400. ["GrayDownArrow", "GrayDownInclineArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  12401. ["BlackCircle", "GrayCircle", "PinkCircle", "RedCircle"],
  12402. ["OneBar", "TwoBars", "ThreeBars", "FourBars"],
  12403. ["BlackCircleWithBorder", "RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  12404. ["RedDownArrow", "YellowDownInclineArrow", "YellowSideArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  12405. ["GrayDownArrow", "GrayDownInclineArrow", "GraySideArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  12406. ["NoBars", "OneBar", "TwoBars", "ThreeBars", "FourBars"],
  12407. ["WhiteCircleAllWhiteQuarters", "CircleWithThreeWhiteQuarters", "CircleWithTwoWhiteQuarters", "CircleWithOneWhiteQuarter", "BlackCircle"],
  12408. ["SilverStar", "HalfGoldStar", "GoldStar"],
  12409. ["RedDownTriangle", "YellowDash", "GreenUpTriangle"],
  12410. ["NoFilledBoxes", "OneFilledBox", "TwoFilledBoxes", "ThreeFilledBoxes", "FourFilledBoxes"],];
  12411. Excel.icons={};
  12412. iconSets.map(function (title, i) {
  12413. var camelTitle=lowerCaseFirst(title);
  12414. Excel.icons[camelTitle]=[];
  12415. iconNames[i].map(function (iconName, j) {
  12416. iconName=lowerCaseFirst(iconName);
  12417. var obj={ set: title, index: j };
  12418. Excel.icons[camelTitle].push(obj);
  12419. Excel.icons[camelTitle][iconName]=obj;
  12420. });
  12421. });
  12422. function setRangePropertiesInBulk(range, propertyName, values) {
  12423. var maxCellCount=1500;
  12424. if (Array.isArray(values) && values.length > 0 && Array.isArray(values[0]) && (values.length * values[0].length > maxCellCount) && isExcel1_3OrAbove()) {
  12425. var maxRowCount=Math.max(1, Math.round(maxCellCount / values[0].length));
  12426. range._ValidateArraySize(values.length, values[0].length);
  12427. for (var startRowIndex=0; startRowIndex < values.length; startRowIndex+=maxRowCount) {
  12428. var rowCount=maxRowCount;
  12429. if (startRowIndex+rowCount > values.length) {
  12430. rowCount=values.length - startRowIndex;
  12431. }
  12432. var chunk=range.getRow(startRowIndex).getBoundingRect(range.getRow(startRowIndex+rowCount - 1));
  12433. var valueSlice=values.slice(startRowIndex, startRowIndex+rowCount);
  12434. _createSetPropertyAction(chunk.context, chunk, propertyName, valueSlice);
  12435. }
  12436. return true;
  12437. }
  12438. return false;
  12439. }
  12440. function isExcel1_3OrAbove() {
  12441. if (typeof (window) !=="undefined" && window.Office && window.Office.context && window.Office.context.requirements) {
  12442. return window.Office.context.requirements.isSetSupported("ExcelApi", 1.3);
  12443. }
  12444. else {
  12445. return true;
  12446. }
  12447. }
  12448. var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath;
  12449. var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath;
  12450. var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath;
  12451. var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath;
  12452. var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer;
  12453. var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt;
  12454. var _createChildItemObjectPathUsingIndexerOrGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt;
  12455. var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction;
  12456. var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction;
  12457. var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined;
  12458. var _isUndefined=OfficeExtension.Utility.isUndefined;
  12459. var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded;
  12460. var _load=OfficeExtension.Utility.load;
  12461. var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary;
  12462. var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler;
  12463. var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults;
  12464. var _adjustToDateTime=OfficeExtension.Utility.adjustToDateTime;
  12465. var Application=(function (_super) {
  12466. __extends(Application, _super);
  12467. function Application() {
  12468. _super.apply(this, arguments);
  12469. }
  12470. Object.defineProperty(Application.prototype, "calculationMode", {
  12471. get: function () {
  12472. _throwIfNotLoaded("calculationMode", this.m_calculationMode, "Application", this._isNull);
  12473. return this.m_calculationMode;
  12474. },
  12475. enumerable: true,
  12476. configurable: true
  12477. });
  12478. Application.prototype.calculate=function (calculationType) {
  12479. _createMethodAction(this.context, this, "Calculate", OfficeExtension.OperationType.Default, [calculationType]);
  12480. };
  12481. Application.prototype._handleResult=function (value) {
  12482. _super.prototype._handleResult.call(this, value);
  12483. if (_isNullOrUndefined(value))
  12484. return;
  12485. var obj=value;
  12486. _fixObjectPathIfNecessary(this, obj);
  12487. if (!_isUndefined(obj["CalculationMode"])) {
  12488. this.m_calculationMode=obj["CalculationMode"];
  12489. }
  12490. };
  12491. Application.prototype.load=function (option) {
  12492. _load(this, option);
  12493. return this;
  12494. };
  12495. Application.prototype.toJSON=function () {
  12496. return {
  12497. "calculationMode": this.m_calculationMode
  12498. };
  12499. };
  12500. return Application;
  12501. }(OfficeExtension.ClientObject));
  12502. Excel.Application=Application;
  12503. var Workbook=(function (_super) {
  12504. __extends(Workbook, _super);
  12505. function Workbook() {
  12506. _super.apply(this, arguments);
  12507. }
  12508. Object.defineProperty(Workbook.prototype, "application", {
  12509. get: function () {
  12510. if (!this.m_application) {
  12511. this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false));
  12512. }
  12513. return this.m_application;
  12514. },
  12515. enumerable: true,
  12516. configurable: true
  12517. });
  12518. Object.defineProperty(Workbook.prototype, "bindings", {
  12519. get: function () {
  12520. if (!this.m_bindings) {
  12521. this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false));
  12522. }
  12523. return this.m_bindings;
  12524. },
  12525. enumerable: true,
  12526. configurable: true
  12527. });
  12528. Object.defineProperty(Workbook.prototype, "functions", {
  12529. get: function () {
  12530. if (!this.m_functions) {
  12531. this.m_functions=new Excel.Functions(this.context, _createPropertyObjectPath(this.context, this, "Functions", false, false));
  12532. }
  12533. return this.m_functions;
  12534. },
  12535. enumerable: true,
  12536. configurable: true
  12537. });
  12538. Object.defineProperty(Workbook.prototype, "names", {
  12539. get: function () {
  12540. if (!this.m_names) {
  12541. this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false));
  12542. }
  12543. return this.m_names;
  12544. },
  12545. enumerable: true,
  12546. configurable: true
  12547. });
  12548. Object.defineProperty(Workbook.prototype, "pivotTables", {
  12549. get: function () {
  12550. if (!this.m_pivotTables) {
  12551. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  12552. }
  12553. return this.m_pivotTables;
  12554. },
  12555. enumerable: true,
  12556. configurable: true
  12557. });
  12558. Object.defineProperty(Workbook.prototype, "tables", {
  12559. get: function () {
  12560. if (!this.m_tables) {
  12561. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  12562. }
  12563. return this.m_tables;
  12564. },
  12565. enumerable: true,
  12566. configurable: true
  12567. });
  12568. Object.defineProperty(Workbook.prototype, "worksheets", {
  12569. get: function () {
  12570. if (!this.m_worksheets) {
  12571. this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false));
  12572. }
  12573. return this.m_worksheets;
  12574. },
  12575. enumerable: true,
  12576. configurable: true
  12577. });
  12578. Object.defineProperty(Workbook.prototype, "_V1Api", {
  12579. get: function () {
  12580. if (!this.m__V1Api) {
  12581. this.m__V1Api=new Excel._V1Api(this.context, _createPropertyObjectPath(this.context, this, "_V1Api", false, false));
  12582. }
  12583. return this.m__V1Api;
  12584. },
  12585. enumerable: true,
  12586. configurable: true
  12587. });
  12588. Workbook.prototype.getSelectedRange=function () {
  12589. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12590. };
  12591. Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) {
  12592. var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  12593. var ret=new OfficeExtension.ClientResult();
  12594. _addActionResultHandler(this, action, ret);
  12595. return ret;
  12596. };
  12597. Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) {
  12598. var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  12599. var ret=new OfficeExtension.ClientResult();
  12600. _addActionResultHandler(this, action, ret);
  12601. return ret;
  12602. };
  12603. Workbook.prototype._GetReferenceCount=function () {
  12604. var action=_createMethodAction(this.context, this, "_GetReferenceCount", OfficeExtension.OperationType.Read, []);
  12605. var ret=new OfficeExtension.ClientResult();
  12606. _addActionResultHandler(this, action, ret);
  12607. return ret;
  12608. };
  12609. Workbook.prototype._RemoveAllReferences=function () {
  12610. _createMethodAction(this.context, this, "_RemoveAllReferences", OfficeExtension.OperationType.Read, []);
  12611. };
  12612. Workbook.prototype._RemoveReference=function (bstrReferenceId) {
  12613. _createMethodAction(this.context, this, "_RemoveReference", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  12614. };
  12615. Workbook.prototype._handleResult=function (value) {
  12616. _super.prototype._handleResult.call(this, value);
  12617. if (_isNullOrUndefined(value))
  12618. return;
  12619. var obj=value;
  12620. _fixObjectPathIfNecessary(this, obj);
  12621. _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "functions", "Functions", "names", "Names", "pivotTables", "PivotTables", "tables", "Tables", "worksheets", "Worksheets", "_V1Api", "_V1Api"]);
  12622. };
  12623. Workbook.prototype.load=function (option) {
  12624. _load(this, option);
  12625. return this;
  12626. };
  12627. Object.defineProperty(Workbook.prototype, "onSelectionChanged", {
  12628. get: function () {
  12629. var _this=this;
  12630. if (!this.m_selectionChanged) {
  12631. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  12632. registerFunc: function (handlerCallback) {
  12633. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, handlerCallback, callback); });
  12634. },
  12635. unregisterFunc: function (handlerCallback) {
  12636. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged, { handler: handlerCallback }, callback); });
  12637. },
  12638. eventArgsTransformFunc: function (args) {
  12639. return OfficeExtension.Utility._createPromiseFromResult({ workbook: _this });
  12640. }
  12641. });
  12642. }
  12643. return this.m_selectionChanged;
  12644. },
  12645. enumerable: true,
  12646. configurable: true
  12647. });
  12648. Workbook.prototype.toJSON=function () {
  12649. return {};
  12650. };
  12651. return Workbook;
  12652. }(OfficeExtension.ClientObject));
  12653. Excel.Workbook=Workbook;
  12654. var Worksheet=(function (_super) {
  12655. __extends(Worksheet, _super);
  12656. function Worksheet() {
  12657. _super.apply(this, arguments);
  12658. }
  12659. Object.defineProperty(Worksheet.prototype, "charts", {
  12660. get: function () {
  12661. if (!this.m_charts) {
  12662. this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false));
  12663. }
  12664. return this.m_charts;
  12665. },
  12666. enumerable: true,
  12667. configurable: true
  12668. });
  12669. Object.defineProperty(Worksheet.prototype, "pivotTables", {
  12670. get: function () {
  12671. if (!this.m_pivotTables) {
  12672. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  12673. }
  12674. return this.m_pivotTables;
  12675. },
  12676. enumerable: true,
  12677. configurable: true
  12678. });
  12679. Object.defineProperty(Worksheet.prototype, "protection", {
  12680. get: function () {
  12681. if (!this.m_protection) {
  12682. this.m_protection=new Excel.WorksheetProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  12683. }
  12684. return this.m_protection;
  12685. },
  12686. enumerable: true,
  12687. configurable: true
  12688. });
  12689. Object.defineProperty(Worksheet.prototype, "tables", {
  12690. get: function () {
  12691. if (!this.m_tables) {
  12692. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  12693. }
  12694. return this.m_tables;
  12695. },
  12696. enumerable: true,
  12697. configurable: true
  12698. });
  12699. Object.defineProperty(Worksheet.prototype, "id", {
  12700. get: function () {
  12701. _throwIfNotLoaded("id", this.m_id, "Worksheet", this._isNull);
  12702. return this.m_id;
  12703. },
  12704. enumerable: true,
  12705. configurable: true
  12706. });
  12707. Object.defineProperty(Worksheet.prototype, "name", {
  12708. get: function () {
  12709. _throwIfNotLoaded("name", this.m_name, "Worksheet", this._isNull);
  12710. return this.m_name;
  12711. },
  12712. set: function (value) {
  12713. this.m_name=value;
  12714. _createSetPropertyAction(this.context, this, "Name", value);
  12715. },
  12716. enumerable: true,
  12717. configurable: true
  12718. });
  12719. Object.defineProperty(Worksheet.prototype, "position", {
  12720. get: function () {
  12721. _throwIfNotLoaded("position", this.m_position, "Worksheet", this._isNull);
  12722. return this.m_position;
  12723. },
  12724. set: function (value) {
  12725. this.m_position=value;
  12726. _createSetPropertyAction(this.context, this, "Position", value);
  12727. },
  12728. enumerable: true,
  12729. configurable: true
  12730. });
  12731. Object.defineProperty(Worksheet.prototype, "visibility", {
  12732. get: function () {
  12733. _throwIfNotLoaded("visibility", this.m_visibility, "Worksheet", this._isNull);
  12734. return this.m_visibility;
  12735. },
  12736. set: function (value) {
  12737. this.m_visibility=value;
  12738. _createSetPropertyAction(this.context, this, "Visibility", value);
  12739. },
  12740. enumerable: true,
  12741. configurable: true
  12742. });
  12743. Worksheet.prototype.activate=function () {
  12744. _createMethodAction(this.context, this, "Activate", OfficeExtension.OperationType.Read, []);
  12745. };
  12746. Worksheet.prototype.delete=function () {
  12747. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12748. };
  12749. Worksheet.prototype.getCell=function (row, column) {
  12750. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  12751. };
  12752. Worksheet.prototype.getRange=function (address) {
  12753. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [address], false, true, null));
  12754. };
  12755. Worksheet.prototype.getUsedRange=function (valuesOnly) {
  12756. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  12757. };
  12758. Worksheet.prototype._handleResult=function (value) {
  12759. _super.prototype._handleResult.call(this, value);
  12760. if (_isNullOrUndefined(value))
  12761. return;
  12762. var obj=value;
  12763. _fixObjectPathIfNecessary(this, obj);
  12764. if (!_isUndefined(obj["Id"])) {
  12765. this.m_id=obj["Id"];
  12766. }
  12767. if (!_isUndefined(obj["Name"])) {
  12768. this.m_name=obj["Name"];
  12769. }
  12770. if (!_isUndefined(obj["Position"])) {
  12771. this.m_position=obj["Position"];
  12772. }
  12773. if (!_isUndefined(obj["Visibility"])) {
  12774. this.m_visibility=obj["Visibility"];
  12775. }
  12776. _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "pivotTables", "PivotTables", "protection", "Protection", "tables", "Tables"]);
  12777. };
  12778. Worksheet.prototype.load=function (option) {
  12779. _load(this, option);
  12780. return this;
  12781. };
  12782. Worksheet.prototype._handleIdResult=function (value) {
  12783. _super.prototype._handleIdResult.call(this, value);
  12784. if (_isNullOrUndefined(value)) {
  12785. return;
  12786. }
  12787. if (!_isUndefined(value["Id"])) {
  12788. this.m_id=value["Id"];
  12789. }
  12790. };
  12791. Worksheet.prototype.toJSON=function () {
  12792. return {
  12793. "id": this.m_id,
  12794. "name": this.m_name,
  12795. "position": this.m_position,
  12796. "protection": this.m_protection,
  12797. "visibility": this.m_visibility
  12798. };
  12799. };
  12800. return Worksheet;
  12801. }(OfficeExtension.ClientObject));
  12802. Excel.Worksheet=Worksheet;
  12803. var WorksheetCollection=(function (_super) {
  12804. __extends(WorksheetCollection, _super);
  12805. function WorksheetCollection() {
  12806. _super.apply(this, arguments);
  12807. }
  12808. Object.defineProperty(WorksheetCollection.prototype, "items", {
  12809. get: function () {
  12810. _throwIfNotLoaded("items", this.m__items, "WorksheetCollection", this._isNull);
  12811. return this.m__items;
  12812. },
  12813. enumerable: true,
  12814. configurable: true
  12815. });
  12816. WorksheetCollection.prototype.add=function (name) {
  12817. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [name], false, true, null));
  12818. };
  12819. WorksheetCollection.prototype.getActiveWorksheet=function () {
  12820. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", OfficeExtension.OperationType.Read, [], false, false, null));
  12821. };
  12822. WorksheetCollection.prototype.getItem=function (key) {
  12823. return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12824. };
  12825. WorksheetCollection.prototype._handleResult=function (value) {
  12826. _super.prototype._handleResult.call(this, value);
  12827. if (_isNullOrUndefined(value))
  12828. return;
  12829. var obj=value;
  12830. _fixObjectPathIfNecessary(this, obj);
  12831. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12832. this.m__items=[];
  12833. var _data=obj[OfficeExtension.Constants.items];
  12834. for (var i=0; i < _data.length; i++) {
  12835. var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12836. _item._handleResult(_data[i]);
  12837. this.m__items.push(_item);
  12838. }
  12839. }
  12840. };
  12841. WorksheetCollection.prototype.load=function (option) {
  12842. _load(this, option);
  12843. return this;
  12844. };
  12845. WorksheetCollection.prototype.toJSON=function () {
  12846. return {};
  12847. };
  12848. return WorksheetCollection;
  12849. }(OfficeExtension.ClientObject));
  12850. Excel.WorksheetCollection=WorksheetCollection;
  12851. var WorksheetProtection=(function (_super) {
  12852. __extends(WorksheetProtection, _super);
  12853. function WorksheetProtection() {
  12854. _super.apply(this, arguments);
  12855. }
  12856. Object.defineProperty(WorksheetProtection.prototype, "options", {
  12857. get: function () {
  12858. _throwIfNotLoaded("options", this.m_options, "WorksheetProtection", this._isNull);
  12859. return this.m_options;
  12860. },
  12861. enumerable: true,
  12862. configurable: true
  12863. });
  12864. Object.defineProperty(WorksheetProtection.prototype, "protected", {
  12865. get: function () {
  12866. _throwIfNotLoaded("protected", this.m_protected, "WorksheetProtection", this._isNull);
  12867. return this.m_protected;
  12868. },
  12869. enumerable: true,
  12870. configurable: true
  12871. });
  12872. WorksheetProtection.prototype.protect=function (options) {
  12873. _createMethodAction(this.context, this, "Protect", OfficeExtension.OperationType.Default, [options]);
  12874. };
  12875. WorksheetProtection.prototype.unprotect=function () {
  12876. _createMethodAction(this.context, this, "Unprotect", OfficeExtension.OperationType.Default, []);
  12877. };
  12878. WorksheetProtection.prototype._handleResult=function (value) {
  12879. _super.prototype._handleResult.call(this, value);
  12880. if (_isNullOrUndefined(value))
  12881. return;
  12882. var obj=value;
  12883. _fixObjectPathIfNecessary(this, obj);
  12884. if (!_isUndefined(obj["Options"])) {
  12885. this.m_options=obj["Options"];
  12886. }
  12887. if (!_isUndefined(obj["Protected"])) {
  12888. this.m_protected=obj["Protected"];
  12889. }
  12890. };
  12891. WorksheetProtection.prototype.load=function (option) {
  12892. _load(this, option);
  12893. return this;
  12894. };
  12895. WorksheetProtection.prototype.toJSON=function () {
  12896. return {
  12897. "options": this.m_options,
  12898. "protected": this.m_protected
  12899. };
  12900. };
  12901. return WorksheetProtection;
  12902. }(OfficeExtension.ClientObject));
  12903. Excel.WorksheetProtection=WorksheetProtection;
  12904. var Range=(function (_super) {
  12905. __extends(Range, _super);
  12906. function Range() {
  12907. _super.apply(this, arguments);
  12908. }
  12909. Range.prototype._ensureInteger=function (num, methodName) {
  12910. if (!(typeof num==="number" && isFinite(num) && Math.floor(num)===num)) {
  12911. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, num, methodName);
  12912. }
  12913. };
  12914. Range.prototype._getAdjacentRange=function (functionName, count, referenceRange, rowDirection, columnDirection) {
  12915. if (count==null) {
  12916. count=1;
  12917. }
  12918. this._ensureInteger(count, functionName);
  12919. var startRange;
  12920. var rowOffset=0;
  12921. var columnOffset=0;
  12922. if (count > 0) {
  12923. startRange=referenceRange.getOffsetRange(rowDirection, columnDirection);
  12924. }
  12925. else {
  12926. startRange=referenceRange;
  12927. rowOffset=rowDirection;
  12928. columnOffset=columnDirection;
  12929. }
  12930. if (Math.abs(count)==1) {
  12931. return startRange;
  12932. }
  12933. return startRange.getBoundingRect(referenceRange.getOffsetRange(rowDirection * count+rowOffset, columnDirection * count+columnOffset));
  12934. };
  12935. Object.defineProperty(Range.prototype, "format", {
  12936. get: function () {
  12937. if (!this.m_format) {
  12938. this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  12939. }
  12940. return this.m_format;
  12941. },
  12942. enumerable: true,
  12943. configurable: true
  12944. });
  12945. Object.defineProperty(Range.prototype, "sort", {
  12946. get: function () {
  12947. if (!this.m_sort) {
  12948. this.m_sort=new Excel.RangeSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  12949. }
  12950. return this.m_sort;
  12951. },
  12952. enumerable: true,
  12953. configurable: true
  12954. });
  12955. Object.defineProperty(Range.prototype, "worksheet", {
  12956. get: function () {
  12957. if (!this.m_worksheet) {
  12958. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  12959. }
  12960. return this.m_worksheet;
  12961. },
  12962. enumerable: true,
  12963. configurable: true
  12964. });
  12965. Object.defineProperty(Range.prototype, "address", {
  12966. get: function () {
  12967. _throwIfNotLoaded("address", this.m_address, "Range", this._isNull);
  12968. return this.m_address;
  12969. },
  12970. enumerable: true,
  12971. configurable: true
  12972. });
  12973. Object.defineProperty(Range.prototype, "addressLocal", {
  12974. get: function () {
  12975. _throwIfNotLoaded("addressLocal", this.m_addressLocal, "Range", this._isNull);
  12976. return this.m_addressLocal;
  12977. },
  12978. enumerable: true,
  12979. configurable: true
  12980. });
  12981. Object.defineProperty(Range.prototype, "cellCount", {
  12982. get: function () {
  12983. _throwIfNotLoaded("cellCount", this.m_cellCount, "Range", this._isNull);
  12984. return this.m_cellCount;
  12985. },
  12986. enumerable: true,
  12987. configurable: true
  12988. });
  12989. Object.defineProperty(Range.prototype, "columnCount", {
  12990. get: function () {
  12991. _throwIfNotLoaded("columnCount", this.m_columnCount, "Range", this._isNull);
  12992. return this.m_columnCount;
  12993. },
  12994. enumerable: true,
  12995. configurable: true
  12996. });
  12997. Object.defineProperty(Range.prototype, "columnHidden", {
  12998. get: function () {
  12999. _throwIfNotLoaded("columnHidden", this.m_columnHidden, "Range", this._isNull);
  13000. return this.m_columnHidden;
  13001. },
  13002. set: function (value) {
  13003. this.m_columnHidden=value;
  13004. _createSetPropertyAction(this.context, this, "ColumnHidden", value);
  13005. },
  13006. enumerable: true,
  13007. configurable: true
  13008. });
  13009. Object.defineProperty(Range.prototype, "columnIndex", {
  13010. get: function () {
  13011. _throwIfNotLoaded("columnIndex", this.m_columnIndex, "Range", this._isNull);
  13012. return this.m_columnIndex;
  13013. },
  13014. enumerable: true,
  13015. configurable: true
  13016. });
  13017. Object.defineProperty(Range.prototype, "formulas", {
  13018. get: function () {
  13019. _throwIfNotLoaded("formulas", this.m_formulas, "Range", this._isNull);
  13020. return this.m_formulas;
  13021. },
  13022. set: function (value) {
  13023. this.m_formulas=value;
  13024. if (setRangePropertiesInBulk(this, "Formulas", value)) {
  13025. return;
  13026. }
  13027. this.m_formulas=value;
  13028. _createSetPropertyAction(this.context, this, "Formulas", value);
  13029. },
  13030. enumerable: true,
  13031. configurable: true
  13032. });
  13033. Object.defineProperty(Range.prototype, "formulasLocal", {
  13034. get: function () {
  13035. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "Range", this._isNull);
  13036. return this.m_formulasLocal;
  13037. },
  13038. set: function (value) {
  13039. this.m_formulasLocal=value;
  13040. if (setRangePropertiesInBulk(this, "FormulasLocal", value)) {
  13041. return;
  13042. }
  13043. this.m_formulasLocal=value;
  13044. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  13045. },
  13046. enumerable: true,
  13047. configurable: true
  13048. });
  13049. Object.defineProperty(Range.prototype, "formulasR1C1", {
  13050. get: function () {
  13051. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "Range", this._isNull);
  13052. return this.m_formulasR1C1;
  13053. },
  13054. set: function (value) {
  13055. this.m_formulasR1C1=value;
  13056. if (setRangePropertiesInBulk(this, "FormulasR1C1", value)) {
  13057. return;
  13058. }
  13059. this.m_formulasR1C1=value;
  13060. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  13061. },
  13062. enumerable: true,
  13063. configurable: true
  13064. });
  13065. Object.defineProperty(Range.prototype, "hidden", {
  13066. get: function () {
  13067. _throwIfNotLoaded("hidden", this.m_hidden, "Range", this._isNull);
  13068. return this.m_hidden;
  13069. },
  13070. enumerable: true,
  13071. configurable: true
  13072. });
  13073. Object.defineProperty(Range.prototype, "numberFormat", {
  13074. get: function () {
  13075. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "Range", this._isNull);
  13076. return this.m_numberFormat;
  13077. },
  13078. set: function (value) {
  13079. this.m_numberFormat=value;
  13080. if (setRangePropertiesInBulk(this, "NumberFormat", value)) {
  13081. return;
  13082. }
  13083. this.m_numberFormat=value;
  13084. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  13085. },
  13086. enumerable: true,
  13087. configurable: true
  13088. });
  13089. Object.defineProperty(Range.prototype, "rowCount", {
  13090. get: function () {
  13091. _throwIfNotLoaded("rowCount", this.m_rowCount, "Range", this._isNull);
  13092. return this.m_rowCount;
  13093. },
  13094. enumerable: true,
  13095. configurable: true
  13096. });
  13097. Object.defineProperty(Range.prototype, "rowHidden", {
  13098. get: function () {
  13099. _throwIfNotLoaded("rowHidden", this.m_rowHidden, "Range", this._isNull);
  13100. return this.m_rowHidden;
  13101. },
  13102. set: function (value) {
  13103. this.m_rowHidden=value;
  13104. _createSetPropertyAction(this.context, this, "RowHidden", value);
  13105. },
  13106. enumerable: true,
  13107. configurable: true
  13108. });
  13109. Object.defineProperty(Range.prototype, "rowIndex", {
  13110. get: function () {
  13111. _throwIfNotLoaded("rowIndex", this.m_rowIndex, "Range", this._isNull);
  13112. return this.m_rowIndex;
  13113. },
  13114. enumerable: true,
  13115. configurable: true
  13116. });
  13117. Object.defineProperty(Range.prototype, "text", {
  13118. get: function () {
  13119. _throwIfNotLoaded("text", this.m_text, "Range", this._isNull);
  13120. return this.m_text;
  13121. },
  13122. enumerable: true,
  13123. configurable: true
  13124. });
  13125. Object.defineProperty(Range.prototype, "valueTypes", {
  13126. get: function () {
  13127. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "Range", this._isNull);
  13128. return this.m_valueTypes;
  13129. },
  13130. enumerable: true,
  13131. configurable: true
  13132. });
  13133. Object.defineProperty(Range.prototype, "values", {
  13134. get: function () {
  13135. _throwIfNotLoaded("values", this.m_values, "Range", this._isNull);
  13136. return this.m_values;
  13137. },
  13138. set: function (value) {
  13139. this.m_values=value;
  13140. if (setRangePropertiesInBulk(this, "Values", value)) {
  13141. return;
  13142. }
  13143. this.m_values=value;
  13144. _createSetPropertyAction(this.context, this, "Values", value);
  13145. },
  13146. enumerable: true,
  13147. configurable: true
  13148. });
  13149. Object.defineProperty(Range.prototype, "_ReferenceId", {
  13150. get: function () {
  13151. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId, "Range", this._isNull);
  13152. return this.m__ReferenceId;
  13153. },
  13154. enumerable: true,
  13155. configurable: true
  13156. });
  13157. Range.prototype.clear=function (applyTo) {
  13158. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, [applyTo]);
  13159. };
  13160. Range.prototype.delete=function (shift) {
  13161. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, [shift]);
  13162. };
  13163. Range.prototype.getBoundingRect=function (anotherRange) {
  13164. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  13165. };
  13166. Range.prototype.getCell=function (row, column) {
  13167. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  13168. };
  13169. Range.prototype.getColumn=function (column) {
  13170. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", OfficeExtension.OperationType.Read, [column], false, true, null));
  13171. };
  13172. Range.prototype.getColumnsAfter=function (count) {
  13173. if (!isExcel1_3OrAbove()) {
  13174. if (count==null) {
  13175. count=1;
  13176. }
  13177. this._ensureInteger(count, "RowsAbove");
  13178. if (count==0) {
  13179. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  13180. }
  13181. return this._getAdjacentRange("getColumnsAfter", count, this.getLastColumn(), 0, 1);
  13182. }
  13183. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsAfter", OfficeExtension.OperationType.Read, [count], false, true, null));
  13184. };
  13185. Range.prototype.getColumnsBefore=function (count) {
  13186. if (!isExcel1_3OrAbove()) {
  13187. if (count==null) {
  13188. count=1;
  13189. }
  13190. this._ensureInteger(count, "RowsAbove");
  13191. if (count==0) {
  13192. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  13193. }
  13194. return this._getAdjacentRange("getColumnsBefore", count, this.getColumn(0), 0, -1);
  13195. }
  13196. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsBefore", OfficeExtension.OperationType.Read, [count], false, true, null));
  13197. };
  13198. Range.prototype.getEntireColumn=function () {
  13199. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  13200. };
  13201. Range.prototype.getEntireRow=function () {
  13202. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", OfficeExtension.OperationType.Read, [], false, true, null));
  13203. };
  13204. Range.prototype.getIntersection=function (anotherRange) {
  13205. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  13206. };
  13207. Range.prototype.getLastCell=function () {
  13208. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", OfficeExtension.OperationType.Read, [], false, true, null));
  13209. };
  13210. Range.prototype.getLastColumn=function () {
  13211. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  13212. };
  13213. Range.prototype.getLastRow=function () {
  13214. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", OfficeExtension.OperationType.Read, [], false, true, null));
  13215. };
  13216. Range.prototype.getOffsetRange=function (rowOffset, columnOffset) {
  13217. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", OfficeExtension.OperationType.Read, [rowOffset, columnOffset], false, true, null));
  13218. };
  13219. Range.prototype.getResizedRange=function (deltaRows, deltaColumns) {
  13220. if (!isExcel1_3OrAbove()) {
  13221. this._ensureInteger(deltaRows, "getResizedRange");
  13222. this._ensureInteger(deltaColumns, "getResizedRange");
  13223. var referenceRange=(deltaRows >=0 && deltaColumns >=0) ? this : this.getCell(0, 0);
  13224. return referenceRange.getBoundingRect(this.getLastCell().getOffsetRange(deltaRows, deltaColumns));
  13225. }
  13226. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetResizedRange", OfficeExtension.OperationType.Read, [deltaRows, deltaColumns], false, true, null));
  13227. };
  13228. Range.prototype.getRow=function (row) {
  13229. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", OfficeExtension.OperationType.Read, [row], false, true, null));
  13230. };
  13231. Range.prototype.getRowsAbove=function (count) {
  13232. if (!isExcel1_3OrAbove()) {
  13233. if (count==null) {
  13234. count=1;
  13235. }
  13236. this._ensureInteger(count, "RowsAbove");
  13237. if (count==0) {
  13238. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  13239. }
  13240. return this._getAdjacentRange("getRowsAbove", count, this.getRow(0), -1, 0);
  13241. }
  13242. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsAbove", OfficeExtension.OperationType.Read, [count], false, true, null));
  13243. };
  13244. Range.prototype.getRowsBelow=function (count) {
  13245. if (!isExcel1_3OrAbove()) {
  13246. if (count==null) {
  13247. count=1;
  13248. }
  13249. this._ensureInteger(count, "RowsAbove");
  13250. if (count==0) {
  13251. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  13252. }
  13253. return this._getAdjacentRange("getRowsBelow", count, this.getLastRow(), 1, 0);
  13254. }
  13255. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsBelow", OfficeExtension.OperationType.Read, [count], false, true, null));
  13256. };
  13257. Range.prototype.getUsedRange=function (valuesOnly) {
  13258. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  13259. };
  13260. Range.prototype.getVisibleView=function () {
  13261. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetVisibleView", OfficeExtension.OperationType.Read, [], false, false, null));
  13262. };
  13263. Range.prototype.insert=function (shift) {
  13264. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", OfficeExtension.OperationType.Default, [shift], false, true, null));
  13265. };
  13266. Range.prototype.merge=function (across) {
  13267. _createMethodAction(this.context, this, "Merge", OfficeExtension.OperationType.Default, [across]);
  13268. };
  13269. Range.prototype.select=function () {
  13270. _createMethodAction(this.context, this, "Select", OfficeExtension.OperationType.Read, []);
  13271. };
  13272. Range.prototype.unmerge=function () {
  13273. _createMethodAction(this.context, this, "Unmerge", OfficeExtension.OperationType.Default, []);
  13274. };
  13275. Range.prototype._KeepReference=function () {
  13276. _createMethodAction(this.context, this, "_KeepReference", OfficeExtension.OperationType.Read, []);
  13277. };
  13278. Range.prototype._ValidateArraySize=function (rows, columns) {
  13279. _createMethodAction(this.context, this, "_ValidateArraySize", OfficeExtension.OperationType.Read, [rows, columns]);
  13280. };
  13281. Range.prototype._handleResult=function (value) {
  13282. _super.prototype._handleResult.call(this, value);
  13283. if (_isNullOrUndefined(value))
  13284. return;
  13285. var obj=value;
  13286. _fixObjectPathIfNecessary(this, obj);
  13287. if (!_isUndefined(obj["Address"])) {
  13288. this.m_address=obj["Address"];
  13289. }
  13290. if (!_isUndefined(obj["AddressLocal"])) {
  13291. this.m_addressLocal=obj["AddressLocal"];
  13292. }
  13293. if (!_isUndefined(obj["CellCount"])) {
  13294. this.m_cellCount=obj["CellCount"];
  13295. }
  13296. if (!_isUndefined(obj["ColumnCount"])) {
  13297. this.m_columnCount=obj["ColumnCount"];
  13298. }
  13299. if (!_isUndefined(obj["ColumnHidden"])) {
  13300. this.m_columnHidden=obj["ColumnHidden"];
  13301. }
  13302. if (!_isUndefined(obj["ColumnIndex"])) {
  13303. this.m_columnIndex=obj["ColumnIndex"];
  13304. }
  13305. if (!_isUndefined(obj["Formulas"])) {
  13306. this.m_formulas=obj["Formulas"];
  13307. }
  13308. if (!_isUndefined(obj["FormulasLocal"])) {
  13309. this.m_formulasLocal=obj["FormulasLocal"];
  13310. }
  13311. if (!_isUndefined(obj["FormulasR1C1"])) {
  13312. this.m_formulasR1C1=obj["FormulasR1C1"];
  13313. }
  13314. if (!_isUndefined(obj["Hidden"])) {
  13315. this.m_hidden=obj["Hidden"];
  13316. }
  13317. if (!_isUndefined(obj["NumberFormat"])) {
  13318. this.m_numberFormat=obj["NumberFormat"];
  13319. }
  13320. if (!_isUndefined(obj["RowCount"])) {
  13321. this.m_rowCount=obj["RowCount"];
  13322. }
  13323. if (!_isUndefined(obj["RowHidden"])) {
  13324. this.m_rowHidden=obj["RowHidden"];
  13325. }
  13326. if (!_isUndefined(obj["RowIndex"])) {
  13327. this.m_rowIndex=obj["RowIndex"];
  13328. }
  13329. if (!_isUndefined(obj["Text"])) {
  13330. this.m_text=obj["Text"];
  13331. }
  13332. if (!_isUndefined(obj["ValueTypes"])) {
  13333. this.m_valueTypes=obj["ValueTypes"];
  13334. }
  13335. if (!_isUndefined(obj["Values"])) {
  13336. this.m_values=obj["Values"];
  13337. }
  13338. if (!_isUndefined(obj["_ReferenceId"])) {
  13339. this.m__ReferenceId=obj["_ReferenceId"];
  13340. }
  13341. _handleNavigationPropertyResults(this, obj, ["format", "Format", "sort", "Sort", "worksheet", "Worksheet"]);
  13342. };
  13343. Range.prototype.load=function (option) {
  13344. _load(this, option);
  13345. return this;
  13346. };
  13347. Range.prototype._handleIdResult=function (value) {
  13348. _super.prototype._handleIdResult.call(this, value);
  13349. if (_isNullOrUndefined(value)) {
  13350. return;
  13351. }
  13352. if (!_isUndefined(value["_ReferenceId"])) {
  13353. this.m__ReferenceId=value["_ReferenceId"];
  13354. }
  13355. };
  13356. Range.prototype.track=function () {
  13357. this.context.trackedObjects.add(this);
  13358. return this;
  13359. };
  13360. Range.prototype.untrack=function () {
  13361. this.context.trackedObjects.remove(this);
  13362. return this;
  13363. };
  13364. Range.prototype.toJSON=function () {
  13365. return {
  13366. "address": this.m_address,
  13367. "addressLocal": this.m_addressLocal,
  13368. "cellCount": this.m_cellCount,
  13369. "columnCount": this.m_columnCount,
  13370. "columnHidden": this.m_columnHidden,
  13371. "columnIndex": this.m_columnIndex,
  13372. "format": this.m_format,
  13373. "formulas": this.m_formulas,
  13374. "formulasLocal": this.m_formulasLocal,
  13375. "formulasR1C1": this.m_formulasR1C1,
  13376. "hidden": this.m_hidden,
  13377. "numberFormat": this.m_numberFormat,
  13378. "rowCount": this.m_rowCount,
  13379. "rowHidden": this.m_rowHidden,
  13380. "rowIndex": this.m_rowIndex,
  13381. "text": this.m_text,
  13382. "values": this.m_values,
  13383. "valueTypes": this.m_valueTypes
  13384. };
  13385. };
  13386. return Range;
  13387. }(OfficeExtension.ClientObject));
  13388. Excel.Range=Range;
  13389. var RangeView=(function (_super) {
  13390. __extends(RangeView, _super);
  13391. function RangeView() {
  13392. _super.apply(this, arguments);
  13393. }
  13394. Object.defineProperty(RangeView.prototype, "rows", {
  13395. get: function () {
  13396. if (!this.m_rows) {
  13397. this.m_rows=new Excel.RangeViewCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  13398. }
  13399. return this.m_rows;
  13400. },
  13401. enumerable: true,
  13402. configurable: true
  13403. });
  13404. Object.defineProperty(RangeView.prototype, "cellAddresses", {
  13405. get: function () {
  13406. _throwIfNotLoaded("cellAddresses", this.m_cellAddresses, "RangeView", this._isNull);
  13407. return this.m_cellAddresses;
  13408. },
  13409. enumerable: true,
  13410. configurable: true
  13411. });
  13412. Object.defineProperty(RangeView.prototype, "columnCount", {
  13413. get: function () {
  13414. _throwIfNotLoaded("columnCount", this.m_columnCount, "RangeView", this._isNull);
  13415. return this.m_columnCount;
  13416. },
  13417. enumerable: true,
  13418. configurable: true
  13419. });
  13420. Object.defineProperty(RangeView.prototype, "formulas", {
  13421. get: function () {
  13422. _throwIfNotLoaded("formulas", this.m_formulas, "RangeView", this._isNull);
  13423. return this.m_formulas;
  13424. },
  13425. set: function (value) {
  13426. this.m_formulas=value;
  13427. _createSetPropertyAction(this.context, this, "Formulas", value);
  13428. },
  13429. enumerable: true,
  13430. configurable: true
  13431. });
  13432. Object.defineProperty(RangeView.prototype, "formulasLocal", {
  13433. get: function () {
  13434. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "RangeView", this._isNull);
  13435. return this.m_formulasLocal;
  13436. },
  13437. set: function (value) {
  13438. this.m_formulasLocal=value;
  13439. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  13440. },
  13441. enumerable: true,
  13442. configurable: true
  13443. });
  13444. Object.defineProperty(RangeView.prototype, "formulasR1C1", {
  13445. get: function () {
  13446. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "RangeView", this._isNull);
  13447. return this.m_formulasR1C1;
  13448. },
  13449. set: function (value) {
  13450. this.m_formulasR1C1=value;
  13451. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  13452. },
  13453. enumerable: true,
  13454. configurable: true
  13455. });
  13456. Object.defineProperty(RangeView.prototype, "index", {
  13457. get: function () {
  13458. _throwIfNotLoaded("index", this.m_index, "RangeView", this._isNull);
  13459. return this.m_index;
  13460. },
  13461. enumerable: true,
  13462. configurable: true
  13463. });
  13464. Object.defineProperty(RangeView.prototype, "numberFormat", {
  13465. get: function () {
  13466. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "RangeView", this._isNull);
  13467. return this.m_numberFormat;
  13468. },
  13469. set: function (value) {
  13470. this.m_numberFormat=value;
  13471. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  13472. },
  13473. enumerable: true,
  13474. configurable: true
  13475. });
  13476. Object.defineProperty(RangeView.prototype, "rowCount", {
  13477. get: function () {
  13478. _throwIfNotLoaded("rowCount", this.m_rowCount, "RangeView", this._isNull);
  13479. return this.m_rowCount;
  13480. },
  13481. enumerable: true,
  13482. configurable: true
  13483. });
  13484. Object.defineProperty(RangeView.prototype, "text", {
  13485. get: function () {
  13486. _throwIfNotLoaded("text", this.m_text, "RangeView", this._isNull);
  13487. return this.m_text;
  13488. },
  13489. enumerable: true,
  13490. configurable: true
  13491. });
  13492. Object.defineProperty(RangeView.prototype, "valueTypes", {
  13493. get: function () {
  13494. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "RangeView", this._isNull);
  13495. return this.m_valueTypes;
  13496. },
  13497. enumerable: true,
  13498. configurable: true
  13499. });
  13500. Object.defineProperty(RangeView.prototype, "values", {
  13501. get: function () {
  13502. _throwIfNotLoaded("values", this.m_values, "RangeView", this._isNull);
  13503. return this.m_values;
  13504. },
  13505. set: function (value) {
  13506. this.m_values=value;
  13507. _createSetPropertyAction(this.context, this, "Values", value);
  13508. },
  13509. enumerable: true,
  13510. configurable: true
  13511. });
  13512. RangeView.prototype.getRange=function () {
  13513. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  13514. };
  13515. RangeView.prototype._handleResult=function (value) {
  13516. _super.prototype._handleResult.call(this, value);
  13517. if (_isNullOrUndefined(value))
  13518. return;
  13519. var obj=value;
  13520. _fixObjectPathIfNecessary(this, obj);
  13521. if (!_isUndefined(obj["CellAddresses"])) {
  13522. this.m_cellAddresses=obj["CellAddresses"];
  13523. }
  13524. if (!_isUndefined(obj["ColumnCount"])) {
  13525. this.m_columnCount=obj["ColumnCount"];
  13526. }
  13527. if (!_isUndefined(obj["Formulas"])) {
  13528. this.m_formulas=obj["Formulas"];
  13529. }
  13530. if (!_isUndefined(obj["FormulasLocal"])) {
  13531. this.m_formulasLocal=obj["FormulasLocal"];
  13532. }
  13533. if (!_isUndefined(obj["FormulasR1C1"])) {
  13534. this.m_formulasR1C1=obj["FormulasR1C1"];
  13535. }
  13536. if (!_isUndefined(obj["Index"])) {
  13537. this.m_index=obj["Index"];
  13538. }
  13539. if (!_isUndefined(obj["NumberFormat"])) {
  13540. this.m_numberFormat=obj["NumberFormat"];
  13541. }
  13542. if (!_isUndefined(obj["RowCount"])) {
  13543. this.m_rowCount=obj["RowCount"];
  13544. }
  13545. if (!_isUndefined(obj["Text"])) {
  13546. this.m_text=obj["Text"];
  13547. }
  13548. if (!_isUndefined(obj["ValueTypes"])) {
  13549. this.m_valueTypes=obj["ValueTypes"];
  13550. }
  13551. if (!_isUndefined(obj["Values"])) {
  13552. this.m_values=obj["Values"];
  13553. }
  13554. _handleNavigationPropertyResults(this, obj, ["rows", "Rows"]);
  13555. };
  13556. RangeView.prototype.load=function (option) {
  13557. _load(this, option);
  13558. return this;
  13559. };
  13560. RangeView.prototype.toJSON=function () {
  13561. return {
  13562. "cellAddresses": this.m_cellAddresses,
  13563. "columnCount": this.m_columnCount,
  13564. "formulas": this.m_formulas,
  13565. "formulasLocal": this.m_formulasLocal,
  13566. "formulasR1C1": this.m_formulasR1C1,
  13567. "index": this.m_index,
  13568. "numberFormat": this.m_numberFormat,
  13569. "rowCount": this.m_rowCount,
  13570. "text": this.m_text,
  13571. "values": this.m_values,
  13572. "valueTypes": this.m_valueTypes
  13573. };
  13574. };
  13575. return RangeView;
  13576. }(OfficeExtension.ClientObject));
  13577. Excel.RangeView=RangeView;
  13578. var RangeViewCollection=(function (_super) {
  13579. __extends(RangeViewCollection, _super);
  13580. function RangeViewCollection() {
  13581. _super.apply(this, arguments);
  13582. }
  13583. Object.defineProperty(RangeViewCollection.prototype, "items", {
  13584. get: function () {
  13585. _throwIfNotLoaded("items", this.m__items, "RangeViewCollection", this._isNull);
  13586. return this.m__items;
  13587. },
  13588. enumerable: true,
  13589. configurable: true
  13590. });
  13591. RangeViewCollection.prototype.getItemAt=function (index) {
  13592. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13593. };
  13594. RangeViewCollection.prototype._handleResult=function (value) {
  13595. _super.prototype._handleResult.call(this, value);
  13596. if (_isNullOrUndefined(value))
  13597. return;
  13598. var obj=value;
  13599. _fixObjectPathIfNecessary(this, obj);
  13600. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13601. this.m__items=[];
  13602. var _data=obj[OfficeExtension.Constants.items];
  13603. for (var i=0; i < _data.length; i++) {
  13604. var _item=new Excel.RangeView(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13605. _item._handleResult(_data[i]);
  13606. this.m__items.push(_item);
  13607. }
  13608. }
  13609. };
  13610. RangeViewCollection.prototype.load=function (option) {
  13611. _load(this, option);
  13612. return this;
  13613. };
  13614. RangeViewCollection.prototype.toJSON=function () {
  13615. return {};
  13616. };
  13617. return RangeViewCollection;
  13618. }(OfficeExtension.ClientObject));
  13619. Excel.RangeViewCollection=RangeViewCollection;
  13620. var Setting=(function (_super) {
  13621. __extends(Setting, _super);
  13622. function Setting() {
  13623. _super.apply(this, arguments);
  13624. }
  13625. Object.defineProperty(Setting.prototype, "value", {
  13626. get: function () {
  13627. return JSON.parse(this._Value);
  13628. },
  13629. set: function (value) {
  13630. this._Value=JSON.stringify(value);
  13631. },
  13632. enumerable: true,
  13633. configurable: true
  13634. });
  13635. Object.defineProperty(Setting.prototype, "key", {
  13636. get: function () {
  13637. _throwIfNotLoaded("key", this.m_key, "Setting", this._isNull);
  13638. return this.m_key;
  13639. },
  13640. enumerable: true,
  13641. configurable: true
  13642. });
  13643. Object.defineProperty(Setting.prototype, "_Value", {
  13644. get: function () {
  13645. _throwIfNotLoaded("_Value", this.m__Value, "Setting", this._isNull);
  13646. return this.m__Value;
  13647. },
  13648. set: function (value) {
  13649. this.m__Value=value;
  13650. _createSetPropertyAction(this.context, this, "_Value", value);
  13651. },
  13652. enumerable: true,
  13653. configurable: true
  13654. });
  13655. Setting.prototype.delete=function () {
  13656. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  13657. };
  13658. Setting.prototype._handleResult=function (value) {
  13659. _super.prototype._handleResult.call(this, value);
  13660. if (_isNullOrUndefined(value))
  13661. return;
  13662. var obj=value;
  13663. _fixObjectPathIfNecessary(this, obj);
  13664. if (!_isUndefined(obj["Key"])) {
  13665. this.m_key=obj["Key"];
  13666. }
  13667. if (!_isUndefined(obj["_Value"])) {
  13668. this.m__Value=obj["_Value"];
  13669. }
  13670. };
  13671. Setting.prototype.load=function (option) {
  13672. _load(this, option);
  13673. return this;
  13674. };
  13675. Setting.prototype.toJSON=function () {
  13676. return {
  13677. "key": this.m_key
  13678. };
  13679. };
  13680. return Setting;
  13681. }(OfficeExtension.ClientObject));
  13682. Excel.Setting=Setting;
  13683. var NamedItemCollection=(function (_super) {
  13684. __extends(NamedItemCollection, _super);
  13685. function NamedItemCollection() {
  13686. _super.apply(this, arguments);
  13687. }
  13688. Object.defineProperty(NamedItemCollection.prototype, "items", {
  13689. get: function () {
  13690. _throwIfNotLoaded("items", this.m__items, "NamedItemCollection", this._isNull);
  13691. return this.m__items;
  13692. },
  13693. enumerable: true,
  13694. configurable: true
  13695. });
  13696. NamedItemCollection.prototype.getItem=function (name) {
  13697. return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name]));
  13698. };
  13699. NamedItemCollection.prototype._handleResult=function (value) {
  13700. _super.prototype._handleResult.call(this, value);
  13701. if (_isNullOrUndefined(value))
  13702. return;
  13703. var obj=value;
  13704. _fixObjectPathIfNecessary(this, obj);
  13705. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13706. this.m__items=[];
  13707. var _data=obj[OfficeExtension.Constants.items];
  13708. for (var i=0; i < _data.length; i++) {
  13709. var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13710. _item._handleResult(_data[i]);
  13711. this.m__items.push(_item);
  13712. }
  13713. }
  13714. };
  13715. NamedItemCollection.prototype.load=function (option) {
  13716. _load(this, option);
  13717. return this;
  13718. };
  13719. NamedItemCollection.prototype.toJSON=function () {
  13720. return {};
  13721. };
  13722. return NamedItemCollection;
  13723. }(OfficeExtension.ClientObject));
  13724. Excel.NamedItemCollection=NamedItemCollection;
  13725. var NamedItem=(function (_super) {
  13726. __extends(NamedItem, _super);
  13727. function NamedItem() {
  13728. _super.apply(this, arguments);
  13729. }
  13730. Object.defineProperty(NamedItem.prototype, "name", {
  13731. get: function () {
  13732. _throwIfNotLoaded("name", this.m_name, "NamedItem", this._isNull);
  13733. return this.m_name;
  13734. },
  13735. enumerable: true,
  13736. configurable: true
  13737. });
  13738. Object.defineProperty(NamedItem.prototype, "type", {
  13739. get: function () {
  13740. _throwIfNotLoaded("type", this.m_type, "NamedItem", this._isNull);
  13741. return this.m_type;
  13742. },
  13743. enumerable: true,
  13744. configurable: true
  13745. });
  13746. Object.defineProperty(NamedItem.prototype, "value", {
  13747. get: function () {
  13748. _throwIfNotLoaded("value", this.m_value, "NamedItem", this._isNull);
  13749. return this.m_value;
  13750. },
  13751. enumerable: true,
  13752. configurable: true
  13753. });
  13754. Object.defineProperty(NamedItem.prototype, "visible", {
  13755. get: function () {
  13756. _throwIfNotLoaded("visible", this.m_visible, "NamedItem", this._isNull);
  13757. return this.m_visible;
  13758. },
  13759. set: function (value) {
  13760. this.m_visible=value;
  13761. _createSetPropertyAction(this.context, this, "Visible", value);
  13762. },
  13763. enumerable: true,
  13764. configurable: true
  13765. });
  13766. Object.defineProperty(NamedItem.prototype, "_Id", {
  13767. get: function () {
  13768. _throwIfNotLoaded("_Id", this.m__Id, "NamedItem", this._isNull);
  13769. return this.m__Id;
  13770. },
  13771. enumerable: true,
  13772. configurable: true
  13773. });
  13774. NamedItem.prototype.getRange=function () {
  13775. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  13776. };
  13777. NamedItem.prototype._handleResult=function (value) {
  13778. _super.prototype._handleResult.call(this, value);
  13779. if (_isNullOrUndefined(value))
  13780. return;
  13781. var obj=value;
  13782. _fixObjectPathIfNecessary(this, obj);
  13783. if (!_isUndefined(obj["Name"])) {
  13784. this.m_name=obj["Name"];
  13785. }
  13786. if (!_isUndefined(obj["Type"])) {
  13787. this.m_type=obj["Type"];
  13788. }
  13789. if (!_isUndefined(obj["Value"])) {
  13790. this.m_value=obj["Value"];
  13791. }
  13792. if (!_isUndefined(obj["Visible"])) {
  13793. this.m_visible=obj["Visible"];
  13794. }
  13795. if (!_isUndefined(obj["_Id"])) {
  13796. this.m__Id=obj["_Id"];
  13797. }
  13798. };
  13799. NamedItem.prototype.load=function (option) {
  13800. _load(this, option);
  13801. return this;
  13802. };
  13803. NamedItem.prototype._handleIdResult=function (value) {
  13804. _super.prototype._handleIdResult.call(this, value);
  13805. if (_isNullOrUndefined(value)) {
  13806. return;
  13807. }
  13808. if (!_isUndefined(value["_Id"])) {
  13809. this.m__Id=value["_Id"];
  13810. }
  13811. };
  13812. NamedItem.prototype.toJSON=function () {
  13813. return {
  13814. "name": this.m_name,
  13815. "type": this.m_type,
  13816. "value": this.m_value,
  13817. "visible": this.m_visible
  13818. };
  13819. };
  13820. return NamedItem;
  13821. }(OfficeExtension.ClientObject));
  13822. Excel.NamedItem=NamedItem;
  13823. var Binding=(function (_super) {
  13824. __extends(Binding, _super);
  13825. function Binding() {
  13826. _super.apply(this, arguments);
  13827. }
  13828. Object.defineProperty(Binding.prototype, "id", {
  13829. get: function () {
  13830. _throwIfNotLoaded("id", this.m_id, "Binding", this._isNull);
  13831. return this.m_id;
  13832. },
  13833. enumerable: true,
  13834. configurable: true
  13835. });
  13836. Object.defineProperty(Binding.prototype, "type", {
  13837. get: function () {
  13838. _throwIfNotLoaded("type", this.m_type, "Binding", this._isNull);
  13839. return this.m_type;
  13840. },
  13841. enumerable: true,
  13842. configurable: true
  13843. });
  13844. Binding.prototype.delete=function () {
  13845. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  13846. };
  13847. Binding.prototype.getRange=function () {
  13848. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, false, null));
  13849. };
  13850. Binding.prototype.getTable=function () {
  13851. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", OfficeExtension.OperationType.Read, [], false, false, null));
  13852. };
  13853. Binding.prototype.getText=function () {
  13854. var action=_createMethodAction(this.context, this, "GetText", OfficeExtension.OperationType.Read, []);
  13855. var ret=new OfficeExtension.ClientResult();
  13856. _addActionResultHandler(this, action, ret);
  13857. return ret;
  13858. };
  13859. Binding.prototype._handleResult=function (value) {
  13860. _super.prototype._handleResult.call(this, value);
  13861. if (_isNullOrUndefined(value))
  13862. return;
  13863. var obj=value;
  13864. _fixObjectPathIfNecessary(this, obj);
  13865. if (!_isUndefined(obj["Id"])) {
  13866. this.m_id=obj["Id"];
  13867. }
  13868. if (!_isUndefined(obj["Type"])) {
  13869. this.m_type=obj["Type"];
  13870. }
  13871. };
  13872. Binding.prototype.load=function (option) {
  13873. _load(this, option);
  13874. return this;
  13875. };
  13876. Binding.prototype._handleIdResult=function (value) {
  13877. _super.prototype._handleIdResult.call(this, value);
  13878. if (_isNullOrUndefined(value)) {
  13879. return;
  13880. }
  13881. if (!_isUndefined(value["Id"])) {
  13882. this.m_id=value["Id"];
  13883. }
  13884. };
  13885. Object.defineProperty(Binding.prototype, "onDataChanged", {
  13886. get: function () {
  13887. var _this=this;
  13888. if (!this.m_dataChanged) {
  13889. this.m_dataChanged=new OfficeExtension.EventHandlers(this.context, this, "DataChanged", {
  13890. registerFunc: function (handlerCallback) {
  13891. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  13892. .then(function (officeBinding) {
  13893. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingDataChanged, handlerCallback, callback); });
  13894. });
  13895. },
  13896. unregisterFunc: function (handlerCallback) {
  13897. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  13898. .then(function (officeBinding) {
  13899. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingDataChanged, { handler: handlerCallback }, callback); });
  13900. });
  13901. },
  13902. eventArgsTransformFunc: function (args) {
  13903. var evt={
  13904. binding: _this
  13905. };
  13906. return OfficeExtension.Utility._createPromiseFromResult(evt);
  13907. }
  13908. });
  13909. }
  13910. return this.m_dataChanged;
  13911. },
  13912. enumerable: true,
  13913. configurable: true
  13914. });
  13915. Object.defineProperty(Binding.prototype, "onSelectionChanged", {
  13916. get: function () {
  13917. var _this=this;
  13918. if (!this.m_selectionChanged) {
  13919. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  13920. registerFunc: function (handlerCallback) {
  13921. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  13922. .then(function (officeBinding) {
  13923. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingSelectionChanged, handlerCallback, callback); });
  13924. });
  13925. },
  13926. unregisterFunc: function (handlerCallback) {
  13927. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  13928. .then(function (officeBinding) {
  13929. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingSelectionChanged, { handler: handlerCallback }, callback); });
  13930. });
  13931. },
  13932. eventArgsTransformFunc: function (args) {
  13933. var evt={
  13934. binding: _this,
  13935. columnCount: args.columnCount,
  13936. rowCount: args.rowCount,
  13937. startColumn: args.startColumn,
  13938. startRow: args.startRow
  13939. };
  13940. return OfficeExtension.Utility._createPromiseFromResult(evt);
  13941. }
  13942. });
  13943. }
  13944. return this.m_selectionChanged;
  13945. },
  13946. enumerable: true,
  13947. configurable: true
  13948. });
  13949. Binding.prototype.toJSON=function () {
  13950. return {
  13951. "id": this.m_id,
  13952. "type": this.m_type
  13953. };
  13954. };
  13955. return Binding;
  13956. }(OfficeExtension.ClientObject));
  13957. Excel.Binding=Binding;
  13958. var BindingCollection=(function (_super) {
  13959. __extends(BindingCollection, _super);
  13960. function BindingCollection() {
  13961. _super.apply(this, arguments);
  13962. }
  13963. Object.defineProperty(BindingCollection.prototype, "items", {
  13964. get: function () {
  13965. _throwIfNotLoaded("items", this.m__items, "BindingCollection", this._isNull);
  13966. return this.m__items;
  13967. },
  13968. enumerable: true,
  13969. configurable: true
  13970. });
  13971. Object.defineProperty(BindingCollection.prototype, "count", {
  13972. get: function () {
  13973. _throwIfNotLoaded("count", this.m_count, "BindingCollection", this._isNull);
  13974. return this.m_count;
  13975. },
  13976. enumerable: true,
  13977. configurable: true
  13978. });
  13979. BindingCollection.prototype.add=function (range, bindingType, id) {
  13980. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [range, bindingType, id], false, true, null));
  13981. };
  13982. BindingCollection.prototype.addFromNamedItem=function (name, bindingType, id) {
  13983. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromNamedItem", OfficeExtension.OperationType.Default, [name, bindingType, id], false, false, null));
  13984. };
  13985. BindingCollection.prototype.addFromSelection=function (bindingType, id) {
  13986. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromSelection", OfficeExtension.OperationType.Default, [bindingType, id], false, false, null));
  13987. };
  13988. BindingCollection.prototype.getItem=function (id) {
  13989. return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id]));
  13990. };
  13991. BindingCollection.prototype.getItemAt=function (index) {
  13992. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13993. };
  13994. BindingCollection.prototype._handleResult=function (value) {
  13995. _super.prototype._handleResult.call(this, value);
  13996. if (_isNullOrUndefined(value))
  13997. return;
  13998. var obj=value;
  13999. _fixObjectPathIfNecessary(this, obj);
  14000. if (!_isUndefined(obj["Count"])) {
  14001. this.m_count=obj["Count"];
  14002. }
  14003. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14004. this.m__items=[];
  14005. var _data=obj[OfficeExtension.Constants.items];
  14006. for (var i=0; i < _data.length; i++) {
  14007. var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  14008. _item._handleResult(_data[i]);
  14009. this.m__items.push(_item);
  14010. }
  14011. }
  14012. };
  14013. BindingCollection.prototype.load=function (option) {
  14014. _load(this, option);
  14015. return this;
  14016. };
  14017. BindingCollection.prototype.toJSON=function () {
  14018. return {
  14019. "count": this.m_count
  14020. };
  14021. };
  14022. return BindingCollection;
  14023. }(OfficeExtension.ClientObject));
  14024. Excel.BindingCollection=BindingCollection;
  14025. var TableCollection=(function (_super) {
  14026. __extends(TableCollection, _super);
  14027. function TableCollection() {
  14028. _super.apply(this, arguments);
  14029. }
  14030. Object.defineProperty(TableCollection.prototype, "items", {
  14031. get: function () {
  14032. _throwIfNotLoaded("items", this.m__items, "TableCollection", this._isNull);
  14033. return this.m__items;
  14034. },
  14035. enumerable: true,
  14036. configurable: true
  14037. });
  14038. Object.defineProperty(TableCollection.prototype, "count", {
  14039. get: function () {
  14040. _throwIfNotLoaded("count", this.m_count, "TableCollection", this._isNull);
  14041. return this.m_count;
  14042. },
  14043. enumerable: true,
  14044. configurable: true
  14045. });
  14046. TableCollection.prototype.add=function (address, hasHeaders) {
  14047. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [address, hasHeaders], false, true, null));
  14048. };
  14049. TableCollection.prototype.getItem=function (key) {
  14050. return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key]));
  14051. };
  14052. TableCollection.prototype.getItemAt=function (index) {
  14053. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14054. };
  14055. TableCollection.prototype._handleResult=function (value) {
  14056. _super.prototype._handleResult.call(this, value);
  14057. if (_isNullOrUndefined(value))
  14058. return;
  14059. var obj=value;
  14060. _fixObjectPathIfNecessary(this, obj);
  14061. if (!_isUndefined(obj["Count"])) {
  14062. this.m_count=obj["Count"];
  14063. }
  14064. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14065. this.m__items=[];
  14066. var _data=obj[OfficeExtension.Constants.items];
  14067. for (var i=0; i < _data.length; i++) {
  14068. var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  14069. _item._handleResult(_data[i]);
  14070. this.m__items.push(_item);
  14071. }
  14072. }
  14073. };
  14074. TableCollection.prototype.load=function (option) {
  14075. _load(this, option);
  14076. return this;
  14077. };
  14078. TableCollection.prototype.toJSON=function () {
  14079. return {
  14080. "count": this.m_count
  14081. };
  14082. };
  14083. return TableCollection;
  14084. }(OfficeExtension.ClientObject));
  14085. Excel.TableCollection=TableCollection;
  14086. var Table=(function (_super) {
  14087. __extends(Table, _super);
  14088. function Table() {
  14089. _super.apply(this, arguments);
  14090. }
  14091. Object.defineProperty(Table.prototype, "columns", {
  14092. get: function () {
  14093. if (!this.m_columns) {
  14094. this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false));
  14095. }
  14096. return this.m_columns;
  14097. },
  14098. enumerable: true,
  14099. configurable: true
  14100. });
  14101. Object.defineProperty(Table.prototype, "rows", {
  14102. get: function () {
  14103. if (!this.m_rows) {
  14104. this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  14105. }
  14106. return this.m_rows;
  14107. },
  14108. enumerable: true,
  14109. configurable: true
  14110. });
  14111. Object.defineProperty(Table.prototype, "sort", {
  14112. get: function () {
  14113. if (!this.m_sort) {
  14114. this.m_sort=new Excel.TableSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  14115. }
  14116. return this.m_sort;
  14117. },
  14118. enumerable: true,
  14119. configurable: true
  14120. });
  14121. Object.defineProperty(Table.prototype, "worksheet", {
  14122. get: function () {
  14123. if (!this.m_worksheet) {
  14124. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  14125. }
  14126. return this.m_worksheet;
  14127. },
  14128. enumerable: true,
  14129. configurable: true
  14130. });
  14131. Object.defineProperty(Table.prototype, "highlightFirstColumn", {
  14132. get: function () {
  14133. _throwIfNotLoaded("highlightFirstColumn", this.m_highlightFirstColumn, "Table", this._isNull);
  14134. return this.m_highlightFirstColumn;
  14135. },
  14136. set: function (value) {
  14137. this.m_highlightFirstColumn=value;
  14138. _createSetPropertyAction(this.context, this, "HighlightFirstColumn", value);
  14139. },
  14140. enumerable: true,
  14141. configurable: true
  14142. });
  14143. Object.defineProperty(Table.prototype, "highlightLastColumn", {
  14144. get: function () {
  14145. _throwIfNotLoaded("highlightLastColumn", this.m_highlightLastColumn, "Table", this._isNull);
  14146. return this.m_highlightLastColumn;
  14147. },
  14148. set: function (value) {
  14149. this.m_highlightLastColumn=value;
  14150. _createSetPropertyAction(this.context, this, "HighlightLastColumn", value);
  14151. },
  14152. enumerable: true,
  14153. configurable: true
  14154. });
  14155. Object.defineProperty(Table.prototype, "id", {
  14156. get: function () {
  14157. _throwIfNotLoaded("id", this.m_id, "Table", this._isNull);
  14158. return this.m_id;
  14159. },
  14160. enumerable: true,
  14161. configurable: true
  14162. });
  14163. Object.defineProperty(Table.prototype, "name", {
  14164. get: function () {
  14165. _throwIfNotLoaded("name", this.m_name, "Table", this._isNull);
  14166. return this.m_name;
  14167. },
  14168. set: function (value) {
  14169. this.m_name=value;
  14170. _createSetPropertyAction(this.context, this, "Name", value);
  14171. },
  14172. enumerable: true,
  14173. configurable: true
  14174. });
  14175. Object.defineProperty(Table.prototype, "showBandedColumns", {
  14176. get: function () {
  14177. _throwIfNotLoaded("showBandedColumns", this.m_showBandedColumns, "Table", this._isNull);
  14178. return this.m_showBandedColumns;
  14179. },
  14180. set: function (value) {
  14181. this.m_showBandedColumns=value;
  14182. _createSetPropertyAction(this.context, this, "ShowBandedColumns", value);
  14183. },
  14184. enumerable: true,
  14185. configurable: true
  14186. });
  14187. Object.defineProperty(Table.prototype, "showBandedRows", {
  14188. get: function () {
  14189. _throwIfNotLoaded("showBandedRows", this.m_showBandedRows, "Table", this._isNull);
  14190. return this.m_showBandedRows;
  14191. },
  14192. set: function (value) {
  14193. this.m_showBandedRows=value;
  14194. _createSetPropertyAction(this.context, this, "ShowBandedRows", value);
  14195. },
  14196. enumerable: true,
  14197. configurable: true
  14198. });
  14199. Object.defineProperty(Table.prototype, "showFilterButton", {
  14200. get: function () {
  14201. _throwIfNotLoaded("showFilterButton", this.m_showFilterButton, "Table", this._isNull);
  14202. return this.m_showFilterButton;
  14203. },
  14204. set: function (value) {
  14205. this.m_showFilterButton=value;
  14206. _createSetPropertyAction(this.context, this, "ShowFilterButton", value);
  14207. },
  14208. enumerable: true,
  14209. configurable: true
  14210. });
  14211. Object.defineProperty(Table.prototype, "showHeaders", {
  14212. get: function () {
  14213. _throwIfNotLoaded("showHeaders", this.m_showHeaders, "Table", this._isNull);
  14214. return this.m_showHeaders;
  14215. },
  14216. set: function (value) {
  14217. this.m_showHeaders=value;
  14218. _createSetPropertyAction(this.context, this, "ShowHeaders", value);
  14219. },
  14220. enumerable: true,
  14221. configurable: true
  14222. });
  14223. Object.defineProperty(Table.prototype, "showTotals", {
  14224. get: function () {
  14225. _throwIfNotLoaded("showTotals", this.m_showTotals, "Table", this._isNull);
  14226. return this.m_showTotals;
  14227. },
  14228. set: function (value) {
  14229. this.m_showTotals=value;
  14230. _createSetPropertyAction(this.context, this, "ShowTotals", value);
  14231. },
  14232. enumerable: true,
  14233. configurable: true
  14234. });
  14235. Object.defineProperty(Table.prototype, "style", {
  14236. get: function () {
  14237. _throwIfNotLoaded("style", this.m_style, "Table", this._isNull);
  14238. return this.m_style;
  14239. },
  14240. set: function (value) {
  14241. this.m_style=value;
  14242. _createSetPropertyAction(this.context, this, "Style", value);
  14243. },
  14244. enumerable: true,
  14245. configurable: true
  14246. });
  14247. Table.prototype.clearFilters=function () {
  14248. _createMethodAction(this.context, this, "ClearFilters", OfficeExtension.OperationType.Default, []);
  14249. };
  14250. Table.prototype.convertToRange=function () {
  14251. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "ConvertToRange", OfficeExtension.OperationType.Default, [], false, true, null));
  14252. };
  14253. Table.prototype.delete=function () {
  14254. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  14255. };
  14256. Table.prototype.getDataBodyRange=function () {
  14257. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14258. };
  14259. Table.prototype.getHeaderRowRange=function () {
  14260. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14261. };
  14262. Table.prototype.getRange=function () {
  14263. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14264. };
  14265. Table.prototype.getTotalRowRange=function () {
  14266. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14267. };
  14268. Table.prototype.reapplyFilters=function () {
  14269. _createMethodAction(this.context, this, "ReapplyFilters", OfficeExtension.OperationType.Default, []);
  14270. };
  14271. Table.prototype._handleResult=function (value) {
  14272. _super.prototype._handleResult.call(this, value);
  14273. if (_isNullOrUndefined(value))
  14274. return;
  14275. var obj=value;
  14276. _fixObjectPathIfNecessary(this, obj);
  14277. if (!_isUndefined(obj["HighlightFirstColumn"])) {
  14278. this.m_highlightFirstColumn=obj["HighlightFirstColumn"];
  14279. }
  14280. if (!_isUndefined(obj["HighlightLastColumn"])) {
  14281. this.m_highlightLastColumn=obj["HighlightLastColumn"];
  14282. }
  14283. if (!_isUndefined(obj["Id"])) {
  14284. this.m_id=obj["Id"];
  14285. }
  14286. if (!_isUndefined(obj["Name"])) {
  14287. this.m_name=obj["Name"];
  14288. }
  14289. if (!_isUndefined(obj["ShowBandedColumns"])) {
  14290. this.m_showBandedColumns=obj["ShowBandedColumns"];
  14291. }
  14292. if (!_isUndefined(obj["ShowBandedRows"])) {
  14293. this.m_showBandedRows=obj["ShowBandedRows"];
  14294. }
  14295. if (!_isUndefined(obj["ShowFilterButton"])) {
  14296. this.m_showFilterButton=obj["ShowFilterButton"];
  14297. }
  14298. if (!_isUndefined(obj["ShowHeaders"])) {
  14299. this.m_showHeaders=obj["ShowHeaders"];
  14300. }
  14301. if (!_isUndefined(obj["ShowTotals"])) {
  14302. this.m_showTotals=obj["ShowTotals"];
  14303. }
  14304. if (!_isUndefined(obj["Style"])) {
  14305. this.m_style=obj["Style"];
  14306. }
  14307. _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows", "sort", "Sort", "worksheet", "Worksheet"]);
  14308. };
  14309. Table.prototype.load=function (option) {
  14310. _load(this, option);
  14311. return this;
  14312. };
  14313. Table.prototype._handleIdResult=function (value) {
  14314. _super.prototype._handleIdResult.call(this, value);
  14315. if (_isNullOrUndefined(value)) {
  14316. return;
  14317. }
  14318. if (!_isUndefined(value["Id"])) {
  14319. this.m_id=value["Id"];
  14320. }
  14321. };
  14322. Table.prototype.toJSON=function () {
  14323. return {
  14324. "highlightFirstColumn": this.m_highlightFirstColumn,
  14325. "highlightLastColumn": this.m_highlightLastColumn,
  14326. "id": this.m_id,
  14327. "name": this.m_name,
  14328. "showBandedColumns": this.m_showBandedColumns,
  14329. "showBandedRows": this.m_showBandedRows,
  14330. "showFilterButton": this.m_showFilterButton,
  14331. "showHeaders": this.m_showHeaders,
  14332. "showTotals": this.m_showTotals,
  14333. "style": this.m_style
  14334. };
  14335. };
  14336. return Table;
  14337. }(OfficeExtension.ClientObject));
  14338. Excel.Table=Table;
  14339. var TableColumnCollection=(function (_super) {
  14340. __extends(TableColumnCollection, _super);
  14341. function TableColumnCollection() {
  14342. _super.apply(this, arguments);
  14343. }
  14344. Object.defineProperty(TableColumnCollection.prototype, "items", {
  14345. get: function () {
  14346. _throwIfNotLoaded("items", this.m__items, "TableColumnCollection", this._isNull);
  14347. return this.m__items;
  14348. },
  14349. enumerable: true,
  14350. configurable: true
  14351. });
  14352. Object.defineProperty(TableColumnCollection.prototype, "count", {
  14353. get: function () {
  14354. _throwIfNotLoaded("count", this.m_count, "TableColumnCollection", this._isNull);
  14355. return this.m_count;
  14356. },
  14357. enumerable: true,
  14358. configurable: true
  14359. });
  14360. TableColumnCollection.prototype.add=function (index, values) {
  14361. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  14362. };
  14363. TableColumnCollection.prototype.getItem=function (key) {
  14364. return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key]));
  14365. };
  14366. TableColumnCollection.prototype.getItemAt=function (index) {
  14367. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14368. };
  14369. TableColumnCollection.prototype._handleResult=function (value) {
  14370. _super.prototype._handleResult.call(this, value);
  14371. if (_isNullOrUndefined(value))
  14372. return;
  14373. var obj=value;
  14374. _fixObjectPathIfNecessary(this, obj);
  14375. if (!_isUndefined(obj["Count"])) {
  14376. this.m_count=obj["Count"];
  14377. }
  14378. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14379. this.m__items=[];
  14380. var _data=obj[OfficeExtension.Constants.items];
  14381. for (var i=0; i < _data.length; i++) {
  14382. var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  14383. _item._handleResult(_data[i]);
  14384. this.m__items.push(_item);
  14385. }
  14386. }
  14387. };
  14388. TableColumnCollection.prototype.load=function (option) {
  14389. _load(this, option);
  14390. return this;
  14391. };
  14392. TableColumnCollection.prototype.toJSON=function () {
  14393. return {
  14394. "count": this.m_count
  14395. };
  14396. };
  14397. return TableColumnCollection;
  14398. }(OfficeExtension.ClientObject));
  14399. Excel.TableColumnCollection=TableColumnCollection;
  14400. var TableColumn=(function (_super) {
  14401. __extends(TableColumn, _super);
  14402. function TableColumn() {
  14403. _super.apply(this, arguments);
  14404. }
  14405. Object.defineProperty(TableColumn.prototype, "filter", {
  14406. get: function () {
  14407. if (!this.m_filter) {
  14408. this.m_filter=new Excel.Filter(this.context, _createPropertyObjectPath(this.context, this, "Filter", false, false));
  14409. }
  14410. return this.m_filter;
  14411. },
  14412. enumerable: true,
  14413. configurable: true
  14414. });
  14415. Object.defineProperty(TableColumn.prototype, "id", {
  14416. get: function () {
  14417. _throwIfNotLoaded("id", this.m_id, "TableColumn", this._isNull);
  14418. return this.m_id;
  14419. },
  14420. enumerable: true,
  14421. configurable: true
  14422. });
  14423. Object.defineProperty(TableColumn.prototype, "index", {
  14424. get: function () {
  14425. _throwIfNotLoaded("index", this.m_index, "TableColumn", this._isNull);
  14426. return this.m_index;
  14427. },
  14428. enumerable: true,
  14429. configurable: true
  14430. });
  14431. Object.defineProperty(TableColumn.prototype, "name", {
  14432. get: function () {
  14433. _throwIfNotLoaded("name", this.m_name, "TableColumn", this._isNull);
  14434. return this.m_name;
  14435. },
  14436. enumerable: true,
  14437. configurable: true
  14438. });
  14439. Object.defineProperty(TableColumn.prototype, "values", {
  14440. get: function () {
  14441. _throwIfNotLoaded("values", this.m_values, "TableColumn", this._isNull);
  14442. return this.m_values;
  14443. },
  14444. set: function (value) {
  14445. this.m_values=value;
  14446. _createSetPropertyAction(this.context, this, "Values", value);
  14447. },
  14448. enumerable: true,
  14449. configurable: true
  14450. });
  14451. TableColumn.prototype.delete=function () {
  14452. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  14453. };
  14454. TableColumn.prototype.getDataBodyRange=function () {
  14455. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14456. };
  14457. TableColumn.prototype.getHeaderRowRange=function () {
  14458. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14459. };
  14460. TableColumn.prototype.getRange=function () {
  14461. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14462. };
  14463. TableColumn.prototype.getTotalRowRange=function () {
  14464. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14465. };
  14466. TableColumn.prototype._handleResult=function (value) {
  14467. _super.prototype._handleResult.call(this, value);
  14468. if (_isNullOrUndefined(value))
  14469. return;
  14470. var obj=value;
  14471. _fixObjectPathIfNecessary(this, obj);
  14472. if (!_isUndefined(obj["Id"])) {
  14473. this.m_id=obj["Id"];
  14474. }
  14475. if (!_isUndefined(obj["Index"])) {
  14476. this.m_index=obj["Index"];
  14477. }
  14478. if (!_isUndefined(obj["Name"])) {
  14479. this.m_name=obj["Name"];
  14480. }
  14481. if (!_isUndefined(obj["Values"])) {
  14482. this.m_values=obj["Values"];
  14483. }
  14484. _handleNavigationPropertyResults(this, obj, ["filter", "Filter"]);
  14485. };
  14486. TableColumn.prototype.load=function (option) {
  14487. _load(this, option);
  14488. return this;
  14489. };
  14490. TableColumn.prototype._handleIdResult=function (value) {
  14491. _super.prototype._handleIdResult.call(this, value);
  14492. if (_isNullOrUndefined(value)) {
  14493. return;
  14494. }
  14495. if (!_isUndefined(value["Id"])) {
  14496. this.m_id=value["Id"];
  14497. }
  14498. };
  14499. TableColumn.prototype.toJSON=function () {
  14500. return {
  14501. "id": this.m_id,
  14502. "index": this.m_index,
  14503. "name": this.m_name,
  14504. "values": this.m_values
  14505. };
  14506. };
  14507. return TableColumn;
  14508. }(OfficeExtension.ClientObject));
  14509. Excel.TableColumn=TableColumn;
  14510. var TableRowCollection=(function (_super) {
  14511. __extends(TableRowCollection, _super);
  14512. function TableRowCollection() {
  14513. _super.apply(this, arguments);
  14514. }
  14515. Object.defineProperty(TableRowCollection.prototype, "items", {
  14516. get: function () {
  14517. _throwIfNotLoaded("items", this.m__items, "TableRowCollection", this._isNull);
  14518. return this.m__items;
  14519. },
  14520. enumerable: true,
  14521. configurable: true
  14522. });
  14523. Object.defineProperty(TableRowCollection.prototype, "count", {
  14524. get: function () {
  14525. _throwIfNotLoaded("count", this.m_count, "TableRowCollection", this._isNull);
  14526. return this.m_count;
  14527. },
  14528. enumerable: true,
  14529. configurable: true
  14530. });
  14531. TableRowCollection.prototype.add=function (index, values) {
  14532. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  14533. };
  14534. TableRowCollection.prototype.getItemAt=function (index) {
  14535. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14536. };
  14537. TableRowCollection.prototype._handleResult=function (value) {
  14538. _super.prototype._handleResult.call(this, value);
  14539. if (_isNullOrUndefined(value))
  14540. return;
  14541. var obj=value;
  14542. _fixObjectPathIfNecessary(this, obj);
  14543. if (!_isUndefined(obj["Count"])) {
  14544. this.m_count=obj["Count"];
  14545. }
  14546. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14547. this.m__items=[];
  14548. var _data=obj[OfficeExtension.Constants.items];
  14549. for (var i=0; i < _data.length; i++) {
  14550. var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  14551. _item._handleResult(_data[i]);
  14552. this.m__items.push(_item);
  14553. }
  14554. }
  14555. };
  14556. TableRowCollection.prototype.load=function (option) {
  14557. _load(this, option);
  14558. return this;
  14559. };
  14560. TableRowCollection.prototype.toJSON=function () {
  14561. return {
  14562. "count": this.m_count
  14563. };
  14564. };
  14565. return TableRowCollection;
  14566. }(OfficeExtension.ClientObject));
  14567. Excel.TableRowCollection=TableRowCollection;
  14568. var TableRow=(function (_super) {
  14569. __extends(TableRow, _super);
  14570. function TableRow() {
  14571. _super.apply(this, arguments);
  14572. }
  14573. Object.defineProperty(TableRow.prototype, "index", {
  14574. get: function () {
  14575. _throwIfNotLoaded("index", this.m_index, "TableRow", this._isNull);
  14576. return this.m_index;
  14577. },
  14578. enumerable: true,
  14579. configurable: true
  14580. });
  14581. Object.defineProperty(TableRow.prototype, "values", {
  14582. get: function () {
  14583. _throwIfNotLoaded("values", this.m_values, "TableRow", this._isNull);
  14584. return this.m_values;
  14585. },
  14586. set: function (value) {
  14587. this.m_values=value;
  14588. _createSetPropertyAction(this.context, this, "Values", value);
  14589. },
  14590. enumerable: true,
  14591. configurable: true
  14592. });
  14593. TableRow.prototype.delete=function () {
  14594. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  14595. };
  14596. TableRow.prototype.getRange=function () {
  14597. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14598. };
  14599. TableRow.prototype._handleResult=function (value) {
  14600. _super.prototype._handleResult.call(this, value);
  14601. if (_isNullOrUndefined(value))
  14602. return;
  14603. var obj=value;
  14604. _fixObjectPathIfNecessary(this, obj);
  14605. if (!_isUndefined(obj["Index"])) {
  14606. this.m_index=obj["Index"];
  14607. }
  14608. if (!_isUndefined(obj["Values"])) {
  14609. this.m_values=obj["Values"];
  14610. }
  14611. };
  14612. TableRow.prototype.load=function (option) {
  14613. _load(this, option);
  14614. return this;
  14615. };
  14616. TableRow.prototype.toJSON=function () {
  14617. return {
  14618. "index": this.m_index,
  14619. "values": this.m_values
  14620. };
  14621. };
  14622. return TableRow;
  14623. }(OfficeExtension.ClientObject));
  14624. Excel.TableRow=TableRow;
  14625. var RangeFormat=(function (_super) {
  14626. __extends(RangeFormat, _super);
  14627. function RangeFormat() {
  14628. _super.apply(this, arguments);
  14629. }
  14630. Object.defineProperty(RangeFormat.prototype, "borders", {
  14631. get: function () {
  14632. if (!this.m_borders) {
  14633. this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false));
  14634. }
  14635. return this.m_borders;
  14636. },
  14637. enumerable: true,
  14638. configurable: true
  14639. });
  14640. Object.defineProperty(RangeFormat.prototype, "fill", {
  14641. get: function () {
  14642. if (!this.m_fill) {
  14643. this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14644. }
  14645. return this.m_fill;
  14646. },
  14647. enumerable: true,
  14648. configurable: true
  14649. });
  14650. Object.defineProperty(RangeFormat.prototype, "font", {
  14651. get: function () {
  14652. if (!this.m_font) {
  14653. this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14654. }
  14655. return this.m_font;
  14656. },
  14657. enumerable: true,
  14658. configurable: true
  14659. });
  14660. Object.defineProperty(RangeFormat.prototype, "protection", {
  14661. get: function () {
  14662. if (!this.m_protection) {
  14663. this.m_protection=new Excel.FormatProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  14664. }
  14665. return this.m_protection;
  14666. },
  14667. enumerable: true,
  14668. configurable: true
  14669. });
  14670. Object.defineProperty(RangeFormat.prototype, "columnWidth", {
  14671. get: function () {
  14672. _throwIfNotLoaded("columnWidth", this.m_columnWidth, "RangeFormat", this._isNull);
  14673. return this.m_columnWidth;
  14674. },
  14675. set: function (value) {
  14676. this.m_columnWidth=value;
  14677. _createSetPropertyAction(this.context, this, "ColumnWidth", value);
  14678. },
  14679. enumerable: true,
  14680. configurable: true
  14681. });
  14682. Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", {
  14683. get: function () {
  14684. _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment, "RangeFormat", this._isNull);
  14685. return this.m_horizontalAlignment;
  14686. },
  14687. set: function (value) {
  14688. this.m_horizontalAlignment=value;
  14689. _createSetPropertyAction(this.context, this, "HorizontalAlignment", value);
  14690. },
  14691. enumerable: true,
  14692. configurable: true
  14693. });
  14694. Object.defineProperty(RangeFormat.prototype, "rowHeight", {
  14695. get: function () {
  14696. _throwIfNotLoaded("rowHeight", this.m_rowHeight, "RangeFormat", this._isNull);
  14697. return this.m_rowHeight;
  14698. },
  14699. set: function (value) {
  14700. this.m_rowHeight=value;
  14701. _createSetPropertyAction(this.context, this, "RowHeight", value);
  14702. },
  14703. enumerable: true,
  14704. configurable: true
  14705. });
  14706. Object.defineProperty(RangeFormat.prototype, "verticalAlignment", {
  14707. get: function () {
  14708. _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment, "RangeFormat", this._isNull);
  14709. return this.m_verticalAlignment;
  14710. },
  14711. set: function (value) {
  14712. this.m_verticalAlignment=value;
  14713. _createSetPropertyAction(this.context, this, "VerticalAlignment", value);
  14714. },
  14715. enumerable: true,
  14716. configurable: true
  14717. });
  14718. Object.defineProperty(RangeFormat.prototype, "wrapText", {
  14719. get: function () {
  14720. _throwIfNotLoaded("wrapText", this.m_wrapText, "RangeFormat", this._isNull);
  14721. return this.m_wrapText;
  14722. },
  14723. set: function (value) {
  14724. this.m_wrapText=value;
  14725. _createSetPropertyAction(this.context, this, "WrapText", value);
  14726. },
  14727. enumerable: true,
  14728. configurable: true
  14729. });
  14730. RangeFormat.prototype.autofitColumns=function () {
  14731. _createMethodAction(this.context, this, "AutofitColumns", OfficeExtension.OperationType.Default, []);
  14732. };
  14733. RangeFormat.prototype.autofitRows=function () {
  14734. _createMethodAction(this.context, this, "AutofitRows", OfficeExtension.OperationType.Default, []);
  14735. };
  14736. RangeFormat.prototype._handleResult=function (value) {
  14737. _super.prototype._handleResult.call(this, value);
  14738. if (_isNullOrUndefined(value))
  14739. return;
  14740. var obj=value;
  14741. _fixObjectPathIfNecessary(this, obj);
  14742. if (!_isUndefined(obj["ColumnWidth"])) {
  14743. this.m_columnWidth=obj["ColumnWidth"];
  14744. }
  14745. if (!_isUndefined(obj["HorizontalAlignment"])) {
  14746. this.m_horizontalAlignment=obj["HorizontalAlignment"];
  14747. }
  14748. if (!_isUndefined(obj["RowHeight"])) {
  14749. this.m_rowHeight=obj["RowHeight"];
  14750. }
  14751. if (!_isUndefined(obj["VerticalAlignment"])) {
  14752. this.m_verticalAlignment=obj["VerticalAlignment"];
  14753. }
  14754. if (!_isUndefined(obj["WrapText"])) {
  14755. this.m_wrapText=obj["WrapText"];
  14756. }
  14757. _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font", "protection", "Protection"]);
  14758. };
  14759. RangeFormat.prototype.load=function (option) {
  14760. _load(this, option);
  14761. return this;
  14762. };
  14763. RangeFormat.prototype.toJSON=function () {
  14764. return {
  14765. "columnWidth": this.m_columnWidth,
  14766. "fill": this.m_fill,
  14767. "font": this.m_font,
  14768. "horizontalAlignment": this.m_horizontalAlignment,
  14769. "protection": this.m_protection,
  14770. "rowHeight": this.m_rowHeight,
  14771. "verticalAlignment": this.m_verticalAlignment,
  14772. "wrapText": this.m_wrapText
  14773. };
  14774. };
  14775. return RangeFormat;
  14776. }(OfficeExtension.ClientObject));
  14777. Excel.RangeFormat=RangeFormat;
  14778. var FormatProtection=(function (_super) {
  14779. __extends(FormatProtection, _super);
  14780. function FormatProtection() {
  14781. _super.apply(this, arguments);
  14782. }
  14783. Object.defineProperty(FormatProtection.prototype, "formulaHidden", {
  14784. get: function () {
  14785. _throwIfNotLoaded("formulaHidden", this.m_formulaHidden, "FormatProtection", this._isNull);
  14786. return this.m_formulaHidden;
  14787. },
  14788. set: function (value) {
  14789. this.m_formulaHidden=value;
  14790. _createSetPropertyAction(this.context, this, "FormulaHidden", value);
  14791. },
  14792. enumerable: true,
  14793. configurable: true
  14794. });
  14795. Object.defineProperty(FormatProtection.prototype, "locked", {
  14796. get: function () {
  14797. _throwIfNotLoaded("locked", this.m_locked, "FormatProtection", this._isNull);
  14798. return this.m_locked;
  14799. },
  14800. set: function (value) {
  14801. this.m_locked=value;
  14802. _createSetPropertyAction(this.context, this, "Locked", value);
  14803. },
  14804. enumerable: true,
  14805. configurable: true
  14806. });
  14807. FormatProtection.prototype._handleResult=function (value) {
  14808. _super.prototype._handleResult.call(this, value);
  14809. if (_isNullOrUndefined(value))
  14810. return;
  14811. var obj=value;
  14812. _fixObjectPathIfNecessary(this, obj);
  14813. if (!_isUndefined(obj["FormulaHidden"])) {
  14814. this.m_formulaHidden=obj["FormulaHidden"];
  14815. }
  14816. if (!_isUndefined(obj["Locked"])) {
  14817. this.m_locked=obj["Locked"];
  14818. }
  14819. };
  14820. FormatProtection.prototype.load=function (option) {
  14821. _load(this, option);
  14822. return this;
  14823. };
  14824. FormatProtection.prototype.toJSON=function () {
  14825. return {
  14826. "formulaHidden": this.m_formulaHidden,
  14827. "locked": this.m_locked
  14828. };
  14829. };
  14830. return FormatProtection;
  14831. }(OfficeExtension.ClientObject));
  14832. Excel.FormatProtection=FormatProtection;
  14833. var RangeFill=(function (_super) {
  14834. __extends(RangeFill, _super);
  14835. function RangeFill() {
  14836. _super.apply(this, arguments);
  14837. }
  14838. Object.defineProperty(RangeFill.prototype, "color", {
  14839. get: function () {
  14840. _throwIfNotLoaded("color", this.m_color, "RangeFill", this._isNull);
  14841. return this.m_color;
  14842. },
  14843. set: function (value) {
  14844. this.m_color=value;
  14845. _createSetPropertyAction(this.context, this, "Color", value);
  14846. },
  14847. enumerable: true,
  14848. configurable: true
  14849. });
  14850. RangeFill.prototype.clear=function () {
  14851. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14852. };
  14853. RangeFill.prototype._handleResult=function (value) {
  14854. _super.prototype._handleResult.call(this, value);
  14855. if (_isNullOrUndefined(value))
  14856. return;
  14857. var obj=value;
  14858. _fixObjectPathIfNecessary(this, obj);
  14859. if (!_isUndefined(obj["Color"])) {
  14860. this.m_color=obj["Color"];
  14861. }
  14862. };
  14863. RangeFill.prototype.load=function (option) {
  14864. _load(this, option);
  14865. return this;
  14866. };
  14867. RangeFill.prototype.toJSON=function () {
  14868. return {
  14869. "color": this.m_color
  14870. };
  14871. };
  14872. return RangeFill;
  14873. }(OfficeExtension.ClientObject));
  14874. Excel.RangeFill=RangeFill;
  14875. var RangeBorder=(function (_super) {
  14876. __extends(RangeBorder, _super);
  14877. function RangeBorder() {
  14878. _super.apply(this, arguments);
  14879. }
  14880. Object.defineProperty(RangeBorder.prototype, "color", {
  14881. get: function () {
  14882. _throwIfNotLoaded("color", this.m_color, "RangeBorder", this._isNull);
  14883. return this.m_color;
  14884. },
  14885. set: function (value) {
  14886. this.m_color=value;
  14887. _createSetPropertyAction(this.context, this, "Color", value);
  14888. },
  14889. enumerable: true,
  14890. configurable: true
  14891. });
  14892. Object.defineProperty(RangeBorder.prototype, "sideIndex", {
  14893. get: function () {
  14894. _throwIfNotLoaded("sideIndex", this.m_sideIndex, "RangeBorder", this._isNull);
  14895. return this.m_sideIndex;
  14896. },
  14897. enumerable: true,
  14898. configurable: true
  14899. });
  14900. Object.defineProperty(RangeBorder.prototype, "style", {
  14901. get: function () {
  14902. _throwIfNotLoaded("style", this.m_style, "RangeBorder", this._isNull);
  14903. return this.m_style;
  14904. },
  14905. set: function (value) {
  14906. this.m_style=value;
  14907. _createSetPropertyAction(this.context, this, "Style", value);
  14908. },
  14909. enumerable: true,
  14910. configurable: true
  14911. });
  14912. Object.defineProperty(RangeBorder.prototype, "weight", {
  14913. get: function () {
  14914. _throwIfNotLoaded("weight", this.m_weight, "RangeBorder", this._isNull);
  14915. return this.m_weight;
  14916. },
  14917. set: function (value) {
  14918. this.m_weight=value;
  14919. _createSetPropertyAction(this.context, this, "Weight", value);
  14920. },
  14921. enumerable: true,
  14922. configurable: true
  14923. });
  14924. RangeBorder.prototype._handleResult=function (value) {
  14925. _super.prototype._handleResult.call(this, value);
  14926. if (_isNullOrUndefined(value))
  14927. return;
  14928. var obj=value;
  14929. _fixObjectPathIfNecessary(this, obj);
  14930. if (!_isUndefined(obj["Color"])) {
  14931. this.m_color=obj["Color"];
  14932. }
  14933. if (!_isUndefined(obj["SideIndex"])) {
  14934. this.m_sideIndex=obj["SideIndex"];
  14935. }
  14936. if (!_isUndefined(obj["Style"])) {
  14937. this.m_style=obj["Style"];
  14938. }
  14939. if (!_isUndefined(obj["Weight"])) {
  14940. this.m_weight=obj["Weight"];
  14941. }
  14942. };
  14943. RangeBorder.prototype.load=function (option) {
  14944. _load(this, option);
  14945. return this;
  14946. };
  14947. RangeBorder.prototype.toJSON=function () {
  14948. return {
  14949. "color": this.m_color,
  14950. "sideIndex": this.m_sideIndex,
  14951. "style": this.m_style,
  14952. "weight": this.m_weight
  14953. };
  14954. };
  14955. return RangeBorder;
  14956. }(OfficeExtension.ClientObject));
  14957. Excel.RangeBorder=RangeBorder;
  14958. var RangeBorderCollection=(function (_super) {
  14959. __extends(RangeBorderCollection, _super);
  14960. function RangeBorderCollection() {
  14961. _super.apply(this, arguments);
  14962. }
  14963. Object.defineProperty(RangeBorderCollection.prototype, "items", {
  14964. get: function () {
  14965. _throwIfNotLoaded("items", this.m__items, "RangeBorderCollection", this._isNull);
  14966. return this.m__items;
  14967. },
  14968. enumerable: true,
  14969. configurable: true
  14970. });
  14971. Object.defineProperty(RangeBorderCollection.prototype, "count", {
  14972. get: function () {
  14973. _throwIfNotLoaded("count", this.m_count, "RangeBorderCollection", this._isNull);
  14974. return this.m_count;
  14975. },
  14976. enumerable: true,
  14977. configurable: true
  14978. });
  14979. RangeBorderCollection.prototype.getItem=function (index) {
  14980. return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index]));
  14981. };
  14982. RangeBorderCollection.prototype.getItemAt=function (index) {
  14983. return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14984. };
  14985. RangeBorderCollection.prototype._handleResult=function (value) {
  14986. _super.prototype._handleResult.call(this, value);
  14987. if (_isNullOrUndefined(value))
  14988. return;
  14989. var obj=value;
  14990. _fixObjectPathIfNecessary(this, obj);
  14991. if (!_isUndefined(obj["Count"])) {
  14992. this.m_count=obj["Count"];
  14993. }
  14994. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14995. this.m__items=[];
  14996. var _data=obj[OfficeExtension.Constants.items];
  14997. for (var i=0; i < _data.length; i++) {
  14998. var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  14999. _item._handleResult(_data[i]);
  15000. this.m__items.push(_item);
  15001. }
  15002. }
  15003. };
  15004. RangeBorderCollection.prototype.load=function (option) {
  15005. _load(this, option);
  15006. return this;
  15007. };
  15008. RangeBorderCollection.prototype.toJSON=function () {
  15009. return {
  15010. "count": this.m_count
  15011. };
  15012. };
  15013. return RangeBorderCollection;
  15014. }(OfficeExtension.ClientObject));
  15015. Excel.RangeBorderCollection=RangeBorderCollection;
  15016. var RangeFont=(function (_super) {
  15017. __extends(RangeFont, _super);
  15018. function RangeFont() {
  15019. _super.apply(this, arguments);
  15020. }
  15021. Object.defineProperty(RangeFont.prototype, "bold", {
  15022. get: function () {
  15023. _throwIfNotLoaded("bold", this.m_bold, "RangeFont", this._isNull);
  15024. return this.m_bold;
  15025. },
  15026. set: function (value) {
  15027. this.m_bold=value;
  15028. _createSetPropertyAction(this.context, this, "Bold", value);
  15029. },
  15030. enumerable: true,
  15031. configurable: true
  15032. });
  15033. Object.defineProperty(RangeFont.prototype, "color", {
  15034. get: function () {
  15035. _throwIfNotLoaded("color", this.m_color, "RangeFont", this._isNull);
  15036. return this.m_color;
  15037. },
  15038. set: function (value) {
  15039. this.m_color=value;
  15040. _createSetPropertyAction(this.context, this, "Color", value);
  15041. },
  15042. enumerable: true,
  15043. configurable: true
  15044. });
  15045. Object.defineProperty(RangeFont.prototype, "italic", {
  15046. get: function () {
  15047. _throwIfNotLoaded("italic", this.m_italic, "RangeFont", this._isNull);
  15048. return this.m_italic;
  15049. },
  15050. set: function (value) {
  15051. this.m_italic=value;
  15052. _createSetPropertyAction(this.context, this, "Italic", value);
  15053. },
  15054. enumerable: true,
  15055. configurable: true
  15056. });
  15057. Object.defineProperty(RangeFont.prototype, "name", {
  15058. get: function () {
  15059. _throwIfNotLoaded("name", this.m_name, "RangeFont", this._isNull);
  15060. return this.m_name;
  15061. },
  15062. set: function (value) {
  15063. this.m_name=value;
  15064. _createSetPropertyAction(this.context, this, "Name", value);
  15065. },
  15066. enumerable: true,
  15067. configurable: true
  15068. });
  15069. Object.defineProperty(RangeFont.prototype, "size", {
  15070. get: function () {
  15071. _throwIfNotLoaded("size", this.m_size, "RangeFont", this._isNull);
  15072. return this.m_size;
  15073. },
  15074. set: function (value) {
  15075. this.m_size=value;
  15076. _createSetPropertyAction(this.context, this, "Size", value);
  15077. },
  15078. enumerable: true,
  15079. configurable: true
  15080. });
  15081. Object.defineProperty(RangeFont.prototype, "underline", {
  15082. get: function () {
  15083. _throwIfNotLoaded("underline", this.m_underline, "RangeFont", this._isNull);
  15084. return this.m_underline;
  15085. },
  15086. set: function (value) {
  15087. this.m_underline=value;
  15088. _createSetPropertyAction(this.context, this, "Underline", value);
  15089. },
  15090. enumerable: true,
  15091. configurable: true
  15092. });
  15093. RangeFont.prototype._handleResult=function (value) {
  15094. _super.prototype._handleResult.call(this, value);
  15095. if (_isNullOrUndefined(value))
  15096. return;
  15097. var obj=value;
  15098. _fixObjectPathIfNecessary(this, obj);
  15099. if (!_isUndefined(obj["Bold"])) {
  15100. this.m_bold=obj["Bold"];
  15101. }
  15102. if (!_isUndefined(obj["Color"])) {
  15103. this.m_color=obj["Color"];
  15104. }
  15105. if (!_isUndefined(obj["Italic"])) {
  15106. this.m_italic=obj["Italic"];
  15107. }
  15108. if (!_isUndefined(obj["Name"])) {
  15109. this.m_name=obj["Name"];
  15110. }
  15111. if (!_isUndefined(obj["Size"])) {
  15112. this.m_size=obj["Size"];
  15113. }
  15114. if (!_isUndefined(obj["Underline"])) {
  15115. this.m_underline=obj["Underline"];
  15116. }
  15117. };
  15118. RangeFont.prototype.load=function (option) {
  15119. _load(this, option);
  15120. return this;
  15121. };
  15122. RangeFont.prototype.toJSON=function () {
  15123. return {
  15124. "bold": this.m_bold,
  15125. "color": this.m_color,
  15126. "italic": this.m_italic,
  15127. "name": this.m_name,
  15128. "size": this.m_size,
  15129. "underline": this.m_underline
  15130. };
  15131. };
  15132. return RangeFont;
  15133. }(OfficeExtension.ClientObject));
  15134. Excel.RangeFont=RangeFont;
  15135. var ChartCollection=(function (_super) {
  15136. __extends(ChartCollection, _super);
  15137. function ChartCollection() {
  15138. _super.apply(this, arguments);
  15139. }
  15140. Object.defineProperty(ChartCollection.prototype, "items", {
  15141. get: function () {
  15142. _throwIfNotLoaded("items", this.m__items, "ChartCollection", this._isNull);
  15143. return this.m__items;
  15144. },
  15145. enumerable: true,
  15146. configurable: true
  15147. });
  15148. Object.defineProperty(ChartCollection.prototype, "count", {
  15149. get: function () {
  15150. _throwIfNotLoaded("count", this.m_count, "ChartCollection", this._isNull);
  15151. return this.m_count;
  15152. },
  15153. enumerable: true,
  15154. configurable: true
  15155. });
  15156. ChartCollection.prototype.add=function (type, sourceData, seriesBy) {
  15157. if (!(sourceData instanceof Range)) {
  15158. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add");
  15159. }
  15160. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [type, sourceData, seriesBy], false, true, null));
  15161. };
  15162. ChartCollection.prototype.getItem=function (name) {
  15163. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", OfficeExtension.OperationType.Read, [name], false, false, null));
  15164. };
  15165. ChartCollection.prototype.getItemAt=function (index) {
  15166. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  15167. };
  15168. ChartCollection.prototype._GetItem=function (key) {
  15169. return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [key]));
  15170. };
  15171. ChartCollection.prototype._handleResult=function (value) {
  15172. _super.prototype._handleResult.call(this, value);
  15173. if (_isNullOrUndefined(value))
  15174. return;
  15175. var obj=value;
  15176. _fixObjectPathIfNecessary(this, obj);
  15177. if (!_isUndefined(obj["Count"])) {
  15178. this.m_count=obj["Count"];
  15179. }
  15180. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15181. this.m__items=[];
  15182. var _data=obj[OfficeExtension.Constants.items];
  15183. for (var i=0; i < _data.length; i++) {
  15184. var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  15185. _item._handleResult(_data[i]);
  15186. this.m__items.push(_item);
  15187. }
  15188. }
  15189. };
  15190. ChartCollection.prototype.load=function (option) {
  15191. _load(this, option);
  15192. return this;
  15193. };
  15194. ChartCollection.prototype.toJSON=function () {
  15195. return {
  15196. "count": this.m_count
  15197. };
  15198. };
  15199. return ChartCollection;
  15200. }(OfficeExtension.ClientObject));
  15201. Excel.ChartCollection=ChartCollection;
  15202. var Chart=(function (_super) {
  15203. __extends(Chart, _super);
  15204. function Chart() {
  15205. _super.apply(this, arguments);
  15206. }
  15207. Object.defineProperty(Chart.prototype, "axes", {
  15208. get: function () {
  15209. if (!this.m_axes) {
  15210. this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false));
  15211. }
  15212. return this.m_axes;
  15213. },
  15214. enumerable: true,
  15215. configurable: true
  15216. });
  15217. Object.defineProperty(Chart.prototype, "dataLabels", {
  15218. get: function () {
  15219. if (!this.m_dataLabels) {
  15220. this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false));
  15221. }
  15222. return this.m_dataLabels;
  15223. },
  15224. enumerable: true,
  15225. configurable: true
  15226. });
  15227. Object.defineProperty(Chart.prototype, "format", {
  15228. get: function () {
  15229. if (!this.m_format) {
  15230. this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15231. }
  15232. return this.m_format;
  15233. },
  15234. enumerable: true,
  15235. configurable: true
  15236. });
  15237. Object.defineProperty(Chart.prototype, "legend", {
  15238. get: function () {
  15239. if (!this.m_legend) {
  15240. this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false));
  15241. }
  15242. return this.m_legend;
  15243. },
  15244. enumerable: true,
  15245. configurable: true
  15246. });
  15247. Object.defineProperty(Chart.prototype, "series", {
  15248. get: function () {
  15249. if (!this.m_series) {
  15250. this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false));
  15251. }
  15252. return this.m_series;
  15253. },
  15254. enumerable: true,
  15255. configurable: true
  15256. });
  15257. Object.defineProperty(Chart.prototype, "title", {
  15258. get: function () {
  15259. if (!this.m_title) {
  15260. this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  15261. }
  15262. return this.m_title;
  15263. },
  15264. enumerable: true,
  15265. configurable: true
  15266. });
  15267. Object.defineProperty(Chart.prototype, "worksheet", {
  15268. get: function () {
  15269. if (!this.m_worksheet) {
  15270. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  15271. }
  15272. return this.m_worksheet;
  15273. },
  15274. enumerable: true,
  15275. configurable: true
  15276. });
  15277. Object.defineProperty(Chart.prototype, "height", {
  15278. get: function () {
  15279. _throwIfNotLoaded("height", this.m_height, "Chart", this._isNull);
  15280. return this.m_height;
  15281. },
  15282. set: function (value) {
  15283. this.m_height=value;
  15284. _createSetPropertyAction(this.context, this, "Height", value);
  15285. },
  15286. enumerable: true,
  15287. configurable: true
  15288. });
  15289. Object.defineProperty(Chart.prototype, "left", {
  15290. get: function () {
  15291. _throwIfNotLoaded("left", this.m_left, "Chart", this._isNull);
  15292. return this.m_left;
  15293. },
  15294. set: function (value) {
  15295. this.m_left=value;
  15296. _createSetPropertyAction(this.context, this, "Left", value);
  15297. },
  15298. enumerable: true,
  15299. configurable: true
  15300. });
  15301. Object.defineProperty(Chart.prototype, "name", {
  15302. get: function () {
  15303. _throwIfNotLoaded("name", this.m_name, "Chart", this._isNull);
  15304. return this.m_name;
  15305. },
  15306. set: function (value) {
  15307. this.m_name=value;
  15308. _createSetPropertyAction(this.context, this, "Name", value);
  15309. },
  15310. enumerable: true,
  15311. configurable: true
  15312. });
  15313. Object.defineProperty(Chart.prototype, "top", {
  15314. get: function () {
  15315. _throwIfNotLoaded("top", this.m_top, "Chart", this._isNull);
  15316. return this.m_top;
  15317. },
  15318. set: function (value) {
  15319. this.m_top=value;
  15320. _createSetPropertyAction(this.context, this, "Top", value);
  15321. },
  15322. enumerable: true,
  15323. configurable: true
  15324. });
  15325. Object.defineProperty(Chart.prototype, "width", {
  15326. get: function () {
  15327. _throwIfNotLoaded("width", this.m_width, "Chart", this._isNull);
  15328. return this.m_width;
  15329. },
  15330. set: function (value) {
  15331. this.m_width=value;
  15332. _createSetPropertyAction(this.context, this, "Width", value);
  15333. },
  15334. enumerable: true,
  15335. configurable: true
  15336. });
  15337. Chart.prototype.delete=function () {
  15338. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  15339. };
  15340. Chart.prototype.getImage=function (width, height, fittingMode) {
  15341. var action=_createMethodAction(this.context, this, "GetImage", OfficeExtension.OperationType.Read, [width, height, fittingMode]);
  15342. var ret=new OfficeExtension.ClientResult();
  15343. _addActionResultHandler(this, action, ret);
  15344. return ret;
  15345. };
  15346. Chart.prototype.setData=function (sourceData, seriesBy) {
  15347. if (!(sourceData instanceof Range)) {
  15348. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData");
  15349. }
  15350. _createMethodAction(this.context, this, "SetData", OfficeExtension.OperationType.Default, [sourceData, seriesBy]);
  15351. };
  15352. Chart.prototype.setPosition=function (startCell, endCell) {
  15353. _createMethodAction(this.context, this, "SetPosition", OfficeExtension.OperationType.Default, [startCell, endCell]);
  15354. };
  15355. Chart.prototype._handleResult=function (value) {
  15356. _super.prototype._handleResult.call(this, value);
  15357. if (_isNullOrUndefined(value))
  15358. return;
  15359. var obj=value;
  15360. _fixObjectPathIfNecessary(this, obj);
  15361. if (!_isUndefined(obj["Height"])) {
  15362. this.m_height=obj["Height"];
  15363. }
  15364. if (!_isUndefined(obj["Left"])) {
  15365. this.m_left=obj["Left"];
  15366. }
  15367. if (!_isUndefined(obj["Name"])) {
  15368. this.m_name=obj["Name"];
  15369. }
  15370. if (!_isUndefined(obj["Top"])) {
  15371. this.m_top=obj["Top"];
  15372. }
  15373. if (!_isUndefined(obj["Width"])) {
  15374. this.m_width=obj["Width"];
  15375. }
  15376. _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title", "worksheet", "Worksheet"]);
  15377. };
  15378. Chart.prototype.load=function (option) {
  15379. _load(this, option);
  15380. return this;
  15381. };
  15382. Chart.prototype.toJSON=function () {
  15383. return {
  15384. "axes": this.m_axes,
  15385. "dataLabels": this.m_dataLabels,
  15386. "format": this.m_format,
  15387. "height": this.m_height,
  15388. "left": this.m_left,
  15389. "legend": this.m_legend,
  15390. "name": this.m_name,
  15391. "title": this.m_title,
  15392. "top": this.m_top,
  15393. "width": this.m_width
  15394. };
  15395. };
  15396. return Chart;
  15397. }(OfficeExtension.ClientObject));
  15398. Excel.Chart=Chart;
  15399. var ChartAreaFormat=(function (_super) {
  15400. __extends(ChartAreaFormat, _super);
  15401. function ChartAreaFormat() {
  15402. _super.apply(this, arguments);
  15403. }
  15404. Object.defineProperty(ChartAreaFormat.prototype, "fill", {
  15405. get: function () {
  15406. if (!this.m_fill) {
  15407. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  15408. }
  15409. return this.m_fill;
  15410. },
  15411. enumerable: true,
  15412. configurable: true
  15413. });
  15414. Object.defineProperty(ChartAreaFormat.prototype, "font", {
  15415. get: function () {
  15416. if (!this.m_font) {
  15417. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  15418. }
  15419. return this.m_font;
  15420. },
  15421. enumerable: true,
  15422. configurable: true
  15423. });
  15424. ChartAreaFormat.prototype._handleResult=function (value) {
  15425. _super.prototype._handleResult.call(this, value);
  15426. if (_isNullOrUndefined(value))
  15427. return;
  15428. var obj=value;
  15429. _fixObjectPathIfNecessary(this, obj);
  15430. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  15431. };
  15432. ChartAreaFormat.prototype.load=function (option) {
  15433. _load(this, option);
  15434. return this;
  15435. };
  15436. ChartAreaFormat.prototype.toJSON=function () {
  15437. return {
  15438. "fill": this.m_fill,
  15439. "font": this.m_font
  15440. };
  15441. };
  15442. return ChartAreaFormat;
  15443. }(OfficeExtension.ClientObject));
  15444. Excel.ChartAreaFormat=ChartAreaFormat;
  15445. var ChartSeriesCollection=(function (_super) {
  15446. __extends(ChartSeriesCollection, _super);
  15447. function ChartSeriesCollection() {
  15448. _super.apply(this, arguments);
  15449. }
  15450. Object.defineProperty(ChartSeriesCollection.prototype, "items", {
  15451. get: function () {
  15452. _throwIfNotLoaded("items", this.m__items, "ChartSeriesCollection", this._isNull);
  15453. return this.m__items;
  15454. },
  15455. enumerable: true,
  15456. configurable: true
  15457. });
  15458. Object.defineProperty(ChartSeriesCollection.prototype, "count", {
  15459. get: function () {
  15460. _throwIfNotLoaded("count", this.m_count, "ChartSeriesCollection", this._isNull);
  15461. return this.m_count;
  15462. },
  15463. enumerable: true,
  15464. configurable: true
  15465. });
  15466. ChartSeriesCollection.prototype.getItemAt=function (index) {
  15467. return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  15468. };
  15469. ChartSeriesCollection.prototype._handleResult=function (value) {
  15470. _super.prototype._handleResult.call(this, value);
  15471. if (_isNullOrUndefined(value))
  15472. return;
  15473. var obj=value;
  15474. _fixObjectPathIfNecessary(this, obj);
  15475. if (!_isUndefined(obj["Count"])) {
  15476. this.m_count=obj["Count"];
  15477. }
  15478. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15479. this.m__items=[];
  15480. var _data=obj[OfficeExtension.Constants.items];
  15481. for (var i=0; i < _data.length; i++) {
  15482. var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  15483. _item._handleResult(_data[i]);
  15484. this.m__items.push(_item);
  15485. }
  15486. }
  15487. };
  15488. ChartSeriesCollection.prototype.load=function (option) {
  15489. _load(this, option);
  15490. return this;
  15491. };
  15492. ChartSeriesCollection.prototype.toJSON=function () {
  15493. return {
  15494. "count": this.m_count
  15495. };
  15496. };
  15497. return ChartSeriesCollection;
  15498. }(OfficeExtension.ClientObject));
  15499. Excel.ChartSeriesCollection=ChartSeriesCollection;
  15500. var ChartSeries=(function (_super) {
  15501. __extends(ChartSeries, _super);
  15502. function ChartSeries() {
  15503. _super.apply(this, arguments);
  15504. }
  15505. Object.defineProperty(ChartSeries.prototype, "format", {
  15506. get: function () {
  15507. if (!this.m_format) {
  15508. this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15509. }
  15510. return this.m_format;
  15511. },
  15512. enumerable: true,
  15513. configurable: true
  15514. });
  15515. Object.defineProperty(ChartSeries.prototype, "points", {
  15516. get: function () {
  15517. if (!this.m_points) {
  15518. this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false));
  15519. }
  15520. return this.m_points;
  15521. },
  15522. enumerable: true,
  15523. configurable: true
  15524. });
  15525. Object.defineProperty(ChartSeries.prototype, "name", {
  15526. get: function () {
  15527. _throwIfNotLoaded("name", this.m_name, "ChartSeries", this._isNull);
  15528. return this.m_name;
  15529. },
  15530. set: function (value) {
  15531. this.m_name=value;
  15532. _createSetPropertyAction(this.context, this, "Name", value);
  15533. },
  15534. enumerable: true,
  15535. configurable: true
  15536. });
  15537. ChartSeries.prototype._handleResult=function (value) {
  15538. _super.prototype._handleResult.call(this, value);
  15539. if (_isNullOrUndefined(value))
  15540. return;
  15541. var obj=value;
  15542. _fixObjectPathIfNecessary(this, obj);
  15543. if (!_isUndefined(obj["Name"])) {
  15544. this.m_name=obj["Name"];
  15545. }
  15546. _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]);
  15547. };
  15548. ChartSeries.prototype.load=function (option) {
  15549. _load(this, option);
  15550. return this;
  15551. };
  15552. ChartSeries.prototype.toJSON=function () {
  15553. return {
  15554. "format": this.m_format,
  15555. "name": this.m_name
  15556. };
  15557. };
  15558. return ChartSeries;
  15559. }(OfficeExtension.ClientObject));
  15560. Excel.ChartSeries=ChartSeries;
  15561. var ChartSeriesFormat=(function (_super) {
  15562. __extends(ChartSeriesFormat, _super);
  15563. function ChartSeriesFormat() {
  15564. _super.apply(this, arguments);
  15565. }
  15566. Object.defineProperty(ChartSeriesFormat.prototype, "fill", {
  15567. get: function () {
  15568. if (!this.m_fill) {
  15569. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  15570. }
  15571. return this.m_fill;
  15572. },
  15573. enumerable: true,
  15574. configurable: true
  15575. });
  15576. Object.defineProperty(ChartSeriesFormat.prototype, "line", {
  15577. get: function () {
  15578. if (!this.m_line) {
  15579. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  15580. }
  15581. return this.m_line;
  15582. },
  15583. enumerable: true,
  15584. configurable: true
  15585. });
  15586. ChartSeriesFormat.prototype._handleResult=function (value) {
  15587. _super.prototype._handleResult.call(this, value);
  15588. if (_isNullOrUndefined(value))
  15589. return;
  15590. var obj=value;
  15591. _fixObjectPathIfNecessary(this, obj);
  15592. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]);
  15593. };
  15594. ChartSeriesFormat.prototype.load=function (option) {
  15595. _load(this, option);
  15596. return this;
  15597. };
  15598. ChartSeriesFormat.prototype.toJSON=function () {
  15599. return {
  15600. "fill": this.m_fill,
  15601. "line": this.m_line
  15602. };
  15603. };
  15604. return ChartSeriesFormat;
  15605. }(OfficeExtension.ClientObject));
  15606. Excel.ChartSeriesFormat=ChartSeriesFormat;
  15607. var ChartPointsCollection=(function (_super) {
  15608. __extends(ChartPointsCollection, _super);
  15609. function ChartPointsCollection() {
  15610. _super.apply(this, arguments);
  15611. }
  15612. Object.defineProperty(ChartPointsCollection.prototype, "items", {
  15613. get: function () {
  15614. _throwIfNotLoaded("items", this.m__items, "ChartPointsCollection", this._isNull);
  15615. return this.m__items;
  15616. },
  15617. enumerable: true,
  15618. configurable: true
  15619. });
  15620. Object.defineProperty(ChartPointsCollection.prototype, "count", {
  15621. get: function () {
  15622. _throwIfNotLoaded("count", this.m_count, "ChartPointsCollection", this._isNull);
  15623. return this.m_count;
  15624. },
  15625. enumerable: true,
  15626. configurable: true
  15627. });
  15628. ChartPointsCollection.prototype.getItemAt=function (index) {
  15629. return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  15630. };
  15631. ChartPointsCollection.prototype._handleResult=function (value) {
  15632. _super.prototype._handleResult.call(this, value);
  15633. if (_isNullOrUndefined(value))
  15634. return;
  15635. var obj=value;
  15636. _fixObjectPathIfNecessary(this, obj);
  15637. if (!_isUndefined(obj["Count"])) {
  15638. this.m_count=obj["Count"];
  15639. }
  15640. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15641. this.m__items=[];
  15642. var _data=obj[OfficeExtension.Constants.items];
  15643. for (var i=0; i < _data.length; i++) {
  15644. var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  15645. _item._handleResult(_data[i]);
  15646. this.m__items.push(_item);
  15647. }
  15648. }
  15649. };
  15650. ChartPointsCollection.prototype.load=function (option) {
  15651. _load(this, option);
  15652. return this;
  15653. };
  15654. ChartPointsCollection.prototype.toJSON=function () {
  15655. return {
  15656. "count": this.m_count
  15657. };
  15658. };
  15659. return ChartPointsCollection;
  15660. }(OfficeExtension.ClientObject));
  15661. Excel.ChartPointsCollection=ChartPointsCollection;
  15662. var ChartPoint=(function (_super) {
  15663. __extends(ChartPoint, _super);
  15664. function ChartPoint() {
  15665. _super.apply(this, arguments);
  15666. }
  15667. Object.defineProperty(ChartPoint.prototype, "format", {
  15668. get: function () {
  15669. if (!this.m_format) {
  15670. this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15671. }
  15672. return this.m_format;
  15673. },
  15674. enumerable: true,
  15675. configurable: true
  15676. });
  15677. Object.defineProperty(ChartPoint.prototype, "value", {
  15678. get: function () {
  15679. _throwIfNotLoaded("value", this.m_value, "ChartPoint", this._isNull);
  15680. return this.m_value;
  15681. },
  15682. enumerable: true,
  15683. configurable: true
  15684. });
  15685. ChartPoint.prototype._handleResult=function (value) {
  15686. _super.prototype._handleResult.call(this, value);
  15687. if (_isNullOrUndefined(value))
  15688. return;
  15689. var obj=value;
  15690. _fixObjectPathIfNecessary(this, obj);
  15691. if (!_isUndefined(obj["Value"])) {
  15692. this.m_value=obj["Value"];
  15693. }
  15694. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  15695. };
  15696. ChartPoint.prototype.load=function (option) {
  15697. _load(this, option);
  15698. return this;
  15699. };
  15700. ChartPoint.prototype.toJSON=function () {
  15701. return {
  15702. "format": this.m_format,
  15703. "value": this.m_value
  15704. };
  15705. };
  15706. return ChartPoint;
  15707. }(OfficeExtension.ClientObject));
  15708. Excel.ChartPoint=ChartPoint;
  15709. var ChartPointFormat=(function (_super) {
  15710. __extends(ChartPointFormat, _super);
  15711. function ChartPointFormat() {
  15712. _super.apply(this, arguments);
  15713. }
  15714. Object.defineProperty(ChartPointFormat.prototype, "fill", {
  15715. get: function () {
  15716. if (!this.m_fill) {
  15717. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  15718. }
  15719. return this.m_fill;
  15720. },
  15721. enumerable: true,
  15722. configurable: true
  15723. });
  15724. ChartPointFormat.prototype._handleResult=function (value) {
  15725. _super.prototype._handleResult.call(this, value);
  15726. if (_isNullOrUndefined(value))
  15727. return;
  15728. var obj=value;
  15729. _fixObjectPathIfNecessary(this, obj);
  15730. _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]);
  15731. };
  15732. ChartPointFormat.prototype.load=function (option) {
  15733. _load(this, option);
  15734. return this;
  15735. };
  15736. ChartPointFormat.prototype.toJSON=function () {
  15737. return {
  15738. "fill": this.m_fill
  15739. };
  15740. };
  15741. return ChartPointFormat;
  15742. }(OfficeExtension.ClientObject));
  15743. Excel.ChartPointFormat=ChartPointFormat;
  15744. var ChartAxes=(function (_super) {
  15745. __extends(ChartAxes, _super);
  15746. function ChartAxes() {
  15747. _super.apply(this, arguments);
  15748. }
  15749. Object.defineProperty(ChartAxes.prototype, "categoryAxis", {
  15750. get: function () {
  15751. if (!this.m_categoryAxis) {
  15752. this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false));
  15753. }
  15754. return this.m_categoryAxis;
  15755. },
  15756. enumerable: true,
  15757. configurable: true
  15758. });
  15759. Object.defineProperty(ChartAxes.prototype, "seriesAxis", {
  15760. get: function () {
  15761. if (!this.m_seriesAxis) {
  15762. this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false));
  15763. }
  15764. return this.m_seriesAxis;
  15765. },
  15766. enumerable: true,
  15767. configurable: true
  15768. });
  15769. Object.defineProperty(ChartAxes.prototype, "valueAxis", {
  15770. get: function () {
  15771. if (!this.m_valueAxis) {
  15772. this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false));
  15773. }
  15774. return this.m_valueAxis;
  15775. },
  15776. enumerable: true,
  15777. configurable: true
  15778. });
  15779. ChartAxes.prototype._handleResult=function (value) {
  15780. _super.prototype._handleResult.call(this, value);
  15781. if (_isNullOrUndefined(value))
  15782. return;
  15783. var obj=value;
  15784. _fixObjectPathIfNecessary(this, obj);
  15785. _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]);
  15786. };
  15787. ChartAxes.prototype.load=function (option) {
  15788. _load(this, option);
  15789. return this;
  15790. };
  15791. ChartAxes.prototype.toJSON=function () {
  15792. return {
  15793. "categoryAxis": this.m_categoryAxis,
  15794. "seriesAxis": this.m_seriesAxis,
  15795. "valueAxis": this.m_valueAxis
  15796. };
  15797. };
  15798. return ChartAxes;
  15799. }(OfficeExtension.ClientObject));
  15800. Excel.ChartAxes=ChartAxes;
  15801. var ChartAxis=(function (_super) {
  15802. __extends(ChartAxis, _super);
  15803. function ChartAxis() {
  15804. _super.apply(this, arguments);
  15805. }
  15806. Object.defineProperty(ChartAxis.prototype, "format", {
  15807. get: function () {
  15808. if (!this.m_format) {
  15809. this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15810. }
  15811. return this.m_format;
  15812. },
  15813. enumerable: true,
  15814. configurable: true
  15815. });
  15816. Object.defineProperty(ChartAxis.prototype, "majorGridlines", {
  15817. get: function () {
  15818. if (!this.m_majorGridlines) {
  15819. this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false));
  15820. }
  15821. return this.m_majorGridlines;
  15822. },
  15823. enumerable: true,
  15824. configurable: true
  15825. });
  15826. Object.defineProperty(ChartAxis.prototype, "minorGridlines", {
  15827. get: function () {
  15828. if (!this.m_minorGridlines) {
  15829. this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false));
  15830. }
  15831. return this.m_minorGridlines;
  15832. },
  15833. enumerable: true,
  15834. configurable: true
  15835. });
  15836. Object.defineProperty(ChartAxis.prototype, "title", {
  15837. get: function () {
  15838. if (!this.m_title) {
  15839. this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  15840. }
  15841. return this.m_title;
  15842. },
  15843. enumerable: true,
  15844. configurable: true
  15845. });
  15846. Object.defineProperty(ChartAxis.prototype, "majorUnit", {
  15847. get: function () {
  15848. _throwIfNotLoaded("majorUnit", this.m_majorUnit, "ChartAxis", this._isNull);
  15849. return this.m_majorUnit;
  15850. },
  15851. set: function (value) {
  15852. this.m_majorUnit=value;
  15853. _createSetPropertyAction(this.context, this, "MajorUnit", value);
  15854. },
  15855. enumerable: true,
  15856. configurable: true
  15857. });
  15858. Object.defineProperty(ChartAxis.prototype, "maximum", {
  15859. get: function () {
  15860. _throwIfNotLoaded("maximum", this.m_maximum, "ChartAxis", this._isNull);
  15861. return this.m_maximum;
  15862. },
  15863. set: function (value) {
  15864. this.m_maximum=value;
  15865. _createSetPropertyAction(this.context, this, "Maximum", value);
  15866. },
  15867. enumerable: true,
  15868. configurable: true
  15869. });
  15870. Object.defineProperty(ChartAxis.prototype, "minimum", {
  15871. get: function () {
  15872. _throwIfNotLoaded("minimum", this.m_minimum, "ChartAxis", this._isNull);
  15873. return this.m_minimum;
  15874. },
  15875. set: function (value) {
  15876. this.m_minimum=value;
  15877. _createSetPropertyAction(this.context, this, "Minimum", value);
  15878. },
  15879. enumerable: true,
  15880. configurable: true
  15881. });
  15882. Object.defineProperty(ChartAxis.prototype, "minorUnit", {
  15883. get: function () {
  15884. _throwIfNotLoaded("minorUnit", this.m_minorUnit, "ChartAxis", this._isNull);
  15885. return this.m_minorUnit;
  15886. },
  15887. set: function (value) {
  15888. this.m_minorUnit=value;
  15889. _createSetPropertyAction(this.context, this, "MinorUnit", value);
  15890. },
  15891. enumerable: true,
  15892. configurable: true
  15893. });
  15894. ChartAxis.prototype._handleResult=function (value) {
  15895. _super.prototype._handleResult.call(this, value);
  15896. if (_isNullOrUndefined(value))
  15897. return;
  15898. var obj=value;
  15899. _fixObjectPathIfNecessary(this, obj);
  15900. if (!_isUndefined(obj["MajorUnit"])) {
  15901. this.m_majorUnit=obj["MajorUnit"];
  15902. }
  15903. if (!_isUndefined(obj["Maximum"])) {
  15904. this.m_maximum=obj["Maximum"];
  15905. }
  15906. if (!_isUndefined(obj["Minimum"])) {
  15907. this.m_minimum=obj["Minimum"];
  15908. }
  15909. if (!_isUndefined(obj["MinorUnit"])) {
  15910. this.m_minorUnit=obj["MinorUnit"];
  15911. }
  15912. _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]);
  15913. };
  15914. ChartAxis.prototype.load=function (option) {
  15915. _load(this, option);
  15916. return this;
  15917. };
  15918. ChartAxis.prototype.toJSON=function () {
  15919. return {
  15920. "format": this.m_format,
  15921. "majorGridlines": this.m_majorGridlines,
  15922. "majorUnit": this.m_majorUnit,
  15923. "maximum": this.m_maximum,
  15924. "minimum": this.m_minimum,
  15925. "minorGridlines": this.m_minorGridlines,
  15926. "minorUnit": this.m_minorUnit,
  15927. "title": this.m_title
  15928. };
  15929. };
  15930. return ChartAxis;
  15931. }(OfficeExtension.ClientObject));
  15932. Excel.ChartAxis=ChartAxis;
  15933. var ChartAxisFormat=(function (_super) {
  15934. __extends(ChartAxisFormat, _super);
  15935. function ChartAxisFormat() {
  15936. _super.apply(this, arguments);
  15937. }
  15938. Object.defineProperty(ChartAxisFormat.prototype, "font", {
  15939. get: function () {
  15940. if (!this.m_font) {
  15941. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  15942. }
  15943. return this.m_font;
  15944. },
  15945. enumerable: true,
  15946. configurable: true
  15947. });
  15948. Object.defineProperty(ChartAxisFormat.prototype, "line", {
  15949. get: function () {
  15950. if (!this.m_line) {
  15951. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  15952. }
  15953. return this.m_line;
  15954. },
  15955. enumerable: true,
  15956. configurable: true
  15957. });
  15958. ChartAxisFormat.prototype._handleResult=function (value) {
  15959. _super.prototype._handleResult.call(this, value);
  15960. if (_isNullOrUndefined(value))
  15961. return;
  15962. var obj=value;
  15963. _fixObjectPathIfNecessary(this, obj);
  15964. _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]);
  15965. };
  15966. ChartAxisFormat.prototype.load=function (option) {
  15967. _load(this, option);
  15968. return this;
  15969. };
  15970. ChartAxisFormat.prototype.toJSON=function () {
  15971. return {
  15972. "font": this.m_font,
  15973. "line": this.m_line
  15974. };
  15975. };
  15976. return ChartAxisFormat;
  15977. }(OfficeExtension.ClientObject));
  15978. Excel.ChartAxisFormat=ChartAxisFormat;
  15979. var ChartAxisTitle=(function (_super) {
  15980. __extends(ChartAxisTitle, _super);
  15981. function ChartAxisTitle() {
  15982. _super.apply(this, arguments);
  15983. }
  15984. Object.defineProperty(ChartAxisTitle.prototype, "format", {
  15985. get: function () {
  15986. if (!this.m_format) {
  15987. this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15988. }
  15989. return this.m_format;
  15990. },
  15991. enumerable: true,
  15992. configurable: true
  15993. });
  15994. Object.defineProperty(ChartAxisTitle.prototype, "text", {
  15995. get: function () {
  15996. _throwIfNotLoaded("text", this.m_text, "ChartAxisTitle", this._isNull);
  15997. return this.m_text;
  15998. },
  15999. set: function (value) {
  16000. this.m_text=value;
  16001. _createSetPropertyAction(this.context, this, "Text", value);
  16002. },
  16003. enumerable: true,
  16004. configurable: true
  16005. });
  16006. Object.defineProperty(ChartAxisTitle.prototype, "visible", {
  16007. get: function () {
  16008. _throwIfNotLoaded("visible", this.m_visible, "ChartAxisTitle", this._isNull);
  16009. return this.m_visible;
  16010. },
  16011. set: function (value) {
  16012. this.m_visible=value;
  16013. _createSetPropertyAction(this.context, this, "Visible", value);
  16014. },
  16015. enumerable: true,
  16016. configurable: true
  16017. });
  16018. ChartAxisTitle.prototype._handleResult=function (value) {
  16019. _super.prototype._handleResult.call(this, value);
  16020. if (_isNullOrUndefined(value))
  16021. return;
  16022. var obj=value;
  16023. _fixObjectPathIfNecessary(this, obj);
  16024. if (!_isUndefined(obj["Text"])) {
  16025. this.m_text=obj["Text"];
  16026. }
  16027. if (!_isUndefined(obj["Visible"])) {
  16028. this.m_visible=obj["Visible"];
  16029. }
  16030. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16031. };
  16032. ChartAxisTitle.prototype.load=function (option) {
  16033. _load(this, option);
  16034. return this;
  16035. };
  16036. ChartAxisTitle.prototype.toJSON=function () {
  16037. return {
  16038. "format": this.m_format,
  16039. "text": this.m_text,
  16040. "visible": this.m_visible
  16041. };
  16042. };
  16043. return ChartAxisTitle;
  16044. }(OfficeExtension.ClientObject));
  16045. Excel.ChartAxisTitle=ChartAxisTitle;
  16046. var ChartAxisTitleFormat=(function (_super) {
  16047. __extends(ChartAxisTitleFormat, _super);
  16048. function ChartAxisTitleFormat() {
  16049. _super.apply(this, arguments);
  16050. }
  16051. Object.defineProperty(ChartAxisTitleFormat.prototype, "font", {
  16052. get: function () {
  16053. if (!this.m_font) {
  16054. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  16055. }
  16056. return this.m_font;
  16057. },
  16058. enumerable: true,
  16059. configurable: true
  16060. });
  16061. ChartAxisTitleFormat.prototype._handleResult=function (value) {
  16062. _super.prototype._handleResult.call(this, value);
  16063. if (_isNullOrUndefined(value))
  16064. return;
  16065. var obj=value;
  16066. _fixObjectPathIfNecessary(this, obj);
  16067. _handleNavigationPropertyResults(this, obj, ["font", "Font"]);
  16068. };
  16069. ChartAxisTitleFormat.prototype.load=function (option) {
  16070. _load(this, option);
  16071. return this;
  16072. };
  16073. ChartAxisTitleFormat.prototype.toJSON=function () {
  16074. return {
  16075. "font": this.m_font
  16076. };
  16077. };
  16078. return ChartAxisTitleFormat;
  16079. }(OfficeExtension.ClientObject));
  16080. Excel.ChartAxisTitleFormat=ChartAxisTitleFormat;
  16081. var ChartDataLabels=(function (_super) {
  16082. __extends(ChartDataLabels, _super);
  16083. function ChartDataLabels() {
  16084. _super.apply(this, arguments);
  16085. }
  16086. Object.defineProperty(ChartDataLabels.prototype, "format", {
  16087. get: function () {
  16088. if (!this.m_format) {
  16089. this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16090. }
  16091. return this.m_format;
  16092. },
  16093. enumerable: true,
  16094. configurable: true
  16095. });
  16096. Object.defineProperty(ChartDataLabels.prototype, "position", {
  16097. get: function () {
  16098. _throwIfNotLoaded("position", this.m_position, "ChartDataLabels", this._isNull);
  16099. return this.m_position;
  16100. },
  16101. set: function (value) {
  16102. this.m_position=value;
  16103. _createSetPropertyAction(this.context, this, "Position", value);
  16104. },
  16105. enumerable: true,
  16106. configurable: true
  16107. });
  16108. Object.defineProperty(ChartDataLabels.prototype, "separator", {
  16109. get: function () {
  16110. _throwIfNotLoaded("separator", this.m_separator, "ChartDataLabels", this._isNull);
  16111. return this.m_separator;
  16112. },
  16113. set: function (value) {
  16114. this.m_separator=value;
  16115. _createSetPropertyAction(this.context, this, "Separator", value);
  16116. },
  16117. enumerable: true,
  16118. configurable: true
  16119. });
  16120. Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", {
  16121. get: function () {
  16122. _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize, "ChartDataLabels", this._isNull);
  16123. return this.m_showBubbleSize;
  16124. },
  16125. set: function (value) {
  16126. this.m_showBubbleSize=value;
  16127. _createSetPropertyAction(this.context, this, "ShowBubbleSize", value);
  16128. },
  16129. enumerable: true,
  16130. configurable: true
  16131. });
  16132. Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", {
  16133. get: function () {
  16134. _throwIfNotLoaded("showCategoryName", this.m_showCategoryName, "ChartDataLabels", this._isNull);
  16135. return this.m_showCategoryName;
  16136. },
  16137. set: function (value) {
  16138. this.m_showCategoryName=value;
  16139. _createSetPropertyAction(this.context, this, "ShowCategoryName", value);
  16140. },
  16141. enumerable: true,
  16142. configurable: true
  16143. });
  16144. Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", {
  16145. get: function () {
  16146. _throwIfNotLoaded("showLegendKey", this.m_showLegendKey, "ChartDataLabels", this._isNull);
  16147. return this.m_showLegendKey;
  16148. },
  16149. set: function (value) {
  16150. this.m_showLegendKey=value;
  16151. _createSetPropertyAction(this.context, this, "ShowLegendKey", value);
  16152. },
  16153. enumerable: true,
  16154. configurable: true
  16155. });
  16156. Object.defineProperty(ChartDataLabels.prototype, "showPercentage", {
  16157. get: function () {
  16158. _throwIfNotLoaded("showPercentage", this.m_showPercentage, "ChartDataLabels", this._isNull);
  16159. return this.m_showPercentage;
  16160. },
  16161. set: function (value) {
  16162. this.m_showPercentage=value;
  16163. _createSetPropertyAction(this.context, this, "ShowPercentage", value);
  16164. },
  16165. enumerable: true,
  16166. configurable: true
  16167. });
  16168. Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", {
  16169. get: function () {
  16170. _throwIfNotLoaded("showSeriesName", this.m_showSeriesName, "ChartDataLabels", this._isNull);
  16171. return this.m_showSeriesName;
  16172. },
  16173. set: function (value) {
  16174. this.m_showSeriesName=value;
  16175. _createSetPropertyAction(this.context, this, "ShowSeriesName", value);
  16176. },
  16177. enumerable: true,
  16178. configurable: true
  16179. });
  16180. Object.defineProperty(ChartDataLabels.prototype, "showValue", {
  16181. get: function () {
  16182. _throwIfNotLoaded("showValue", this.m_showValue, "ChartDataLabels", this._isNull);
  16183. return this.m_showValue;
  16184. },
  16185. set: function (value) {
  16186. this.m_showValue=value;
  16187. _createSetPropertyAction(this.context, this, "ShowValue", value);
  16188. },
  16189. enumerable: true,
  16190. configurable: true
  16191. });
  16192. ChartDataLabels.prototype._handleResult=function (value) {
  16193. _super.prototype._handleResult.call(this, value);
  16194. if (_isNullOrUndefined(value))
  16195. return;
  16196. var obj=value;
  16197. _fixObjectPathIfNecessary(this, obj);
  16198. if (!_isUndefined(obj["Position"])) {
  16199. this.m_position=obj["Position"];
  16200. }
  16201. if (!_isUndefined(obj["Separator"])) {
  16202. this.m_separator=obj["Separator"];
  16203. }
  16204. if (!_isUndefined(obj["ShowBubbleSize"])) {
  16205. this.m_showBubbleSize=obj["ShowBubbleSize"];
  16206. }
  16207. if (!_isUndefined(obj["ShowCategoryName"])) {
  16208. this.m_showCategoryName=obj["ShowCategoryName"];
  16209. }
  16210. if (!_isUndefined(obj["ShowLegendKey"])) {
  16211. this.m_showLegendKey=obj["ShowLegendKey"];
  16212. }
  16213. if (!_isUndefined(obj["ShowPercentage"])) {
  16214. this.m_showPercentage=obj["ShowPercentage"];
  16215. }
  16216. if (!_isUndefined(obj["ShowSeriesName"])) {
  16217. this.m_showSeriesName=obj["ShowSeriesName"];
  16218. }
  16219. if (!_isUndefined(obj["ShowValue"])) {
  16220. this.m_showValue=obj["ShowValue"];
  16221. }
  16222. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16223. };
  16224. ChartDataLabels.prototype.load=function (option) {
  16225. _load(this, option);
  16226. return this;
  16227. };
  16228. ChartDataLabels.prototype.toJSON=function () {
  16229. return {
  16230. "format": this.m_format,
  16231. "position": this.m_position,
  16232. "separator": this.m_separator,
  16233. "showBubbleSize": this.m_showBubbleSize,
  16234. "showCategoryName": this.m_showCategoryName,
  16235. "showLegendKey": this.m_showLegendKey,
  16236. "showPercentage": this.m_showPercentage,
  16237. "showSeriesName": this.m_showSeriesName,
  16238. "showValue": this.m_showValue
  16239. };
  16240. };
  16241. return ChartDataLabels;
  16242. }(OfficeExtension.ClientObject));
  16243. Excel.ChartDataLabels=ChartDataLabels;
  16244. var ChartDataLabelFormat=(function (_super) {
  16245. __extends(ChartDataLabelFormat, _super);
  16246. function ChartDataLabelFormat() {
  16247. _super.apply(this, arguments);
  16248. }
  16249. Object.defineProperty(ChartDataLabelFormat.prototype, "fill", {
  16250. get: function () {
  16251. if (!this.m_fill) {
  16252. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  16253. }
  16254. return this.m_fill;
  16255. },
  16256. enumerable: true,
  16257. configurable: true
  16258. });
  16259. Object.defineProperty(ChartDataLabelFormat.prototype, "font", {
  16260. get: function () {
  16261. if (!this.m_font) {
  16262. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  16263. }
  16264. return this.m_font;
  16265. },
  16266. enumerable: true,
  16267. configurable: true
  16268. });
  16269. ChartDataLabelFormat.prototype._handleResult=function (value) {
  16270. _super.prototype._handleResult.call(this, value);
  16271. if (_isNullOrUndefined(value))
  16272. return;
  16273. var obj=value;
  16274. _fixObjectPathIfNecessary(this, obj);
  16275. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  16276. };
  16277. ChartDataLabelFormat.prototype.load=function (option) {
  16278. _load(this, option);
  16279. return this;
  16280. };
  16281. ChartDataLabelFormat.prototype.toJSON=function () {
  16282. return {
  16283. "fill": this.m_fill,
  16284. "font": this.m_font
  16285. };
  16286. };
  16287. return ChartDataLabelFormat;
  16288. }(OfficeExtension.ClientObject));
  16289. Excel.ChartDataLabelFormat=ChartDataLabelFormat;
  16290. var ChartGridlines=(function (_super) {
  16291. __extends(ChartGridlines, _super);
  16292. function ChartGridlines() {
  16293. _super.apply(this, arguments);
  16294. }
  16295. Object.defineProperty(ChartGridlines.prototype, "format", {
  16296. get: function () {
  16297. if (!this.m_format) {
  16298. this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16299. }
  16300. return this.m_format;
  16301. },
  16302. enumerable: true,
  16303. configurable: true
  16304. });
  16305. Object.defineProperty(ChartGridlines.prototype, "visible", {
  16306. get: function () {
  16307. _throwIfNotLoaded("visible", this.m_visible, "ChartGridlines", this._isNull);
  16308. return this.m_visible;
  16309. },
  16310. set: function (value) {
  16311. this.m_visible=value;
  16312. _createSetPropertyAction(this.context, this, "Visible", value);
  16313. },
  16314. enumerable: true,
  16315. configurable: true
  16316. });
  16317. ChartGridlines.prototype._handleResult=function (value) {
  16318. _super.prototype._handleResult.call(this, value);
  16319. if (_isNullOrUndefined(value))
  16320. return;
  16321. var obj=value;
  16322. _fixObjectPathIfNecessary(this, obj);
  16323. if (!_isUndefined(obj["Visible"])) {
  16324. this.m_visible=obj["Visible"];
  16325. }
  16326. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16327. };
  16328. ChartGridlines.prototype.load=function (option) {
  16329. _load(this, option);
  16330. return this;
  16331. };
  16332. ChartGridlines.prototype.toJSON=function () {
  16333. return {
  16334. "format": this.m_format,
  16335. "visible": this.m_visible
  16336. };
  16337. };
  16338. return ChartGridlines;
  16339. }(OfficeExtension.ClientObject));
  16340. Excel.ChartGridlines=ChartGridlines;
  16341. var ChartGridlinesFormat=(function (_super) {
  16342. __extends(ChartGridlinesFormat, _super);
  16343. function ChartGridlinesFormat() {
  16344. _super.apply(this, arguments);
  16345. }
  16346. Object.defineProperty(ChartGridlinesFormat.prototype, "line", {
  16347. get: function () {
  16348. if (!this.m_line) {
  16349. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  16350. }
  16351. return this.m_line;
  16352. },
  16353. enumerable: true,
  16354. configurable: true
  16355. });
  16356. ChartGridlinesFormat.prototype._handleResult=function (value) {
  16357. _super.prototype._handleResult.call(this, value);
  16358. if (_isNullOrUndefined(value))
  16359. return;
  16360. var obj=value;
  16361. _fixObjectPathIfNecessary(this, obj);
  16362. _handleNavigationPropertyResults(this, obj, ["line", "Line"]);
  16363. };
  16364. ChartGridlinesFormat.prototype.load=function (option) {
  16365. _load(this, option);
  16366. return this;
  16367. };
  16368. ChartGridlinesFormat.prototype.toJSON=function () {
  16369. return {
  16370. "line": this.m_line
  16371. };
  16372. };
  16373. return ChartGridlinesFormat;
  16374. }(OfficeExtension.ClientObject));
  16375. Excel.ChartGridlinesFormat=ChartGridlinesFormat;
  16376. var ChartLegend=(function (_super) {
  16377. __extends(ChartLegend, _super);
  16378. function ChartLegend() {
  16379. _super.apply(this, arguments);
  16380. }
  16381. Object.defineProperty(ChartLegend.prototype, "format", {
  16382. get: function () {
  16383. if (!this.m_format) {
  16384. this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16385. }
  16386. return this.m_format;
  16387. },
  16388. enumerable: true,
  16389. configurable: true
  16390. });
  16391. Object.defineProperty(ChartLegend.prototype, "overlay", {
  16392. get: function () {
  16393. _throwIfNotLoaded("overlay", this.m_overlay, "ChartLegend", this._isNull);
  16394. return this.m_overlay;
  16395. },
  16396. set: function (value) {
  16397. this.m_overlay=value;
  16398. _createSetPropertyAction(this.context, this, "Overlay", value);
  16399. },
  16400. enumerable: true,
  16401. configurable: true
  16402. });
  16403. Object.defineProperty(ChartLegend.prototype, "position", {
  16404. get: function () {
  16405. _throwIfNotLoaded("position", this.m_position, "ChartLegend", this._isNull);
  16406. return this.m_position;
  16407. },
  16408. set: function (value) {
  16409. this.m_position=value;
  16410. _createSetPropertyAction(this.context, this, "Position", value);
  16411. },
  16412. enumerable: true,
  16413. configurable: true
  16414. });
  16415. Object.defineProperty(ChartLegend.prototype, "visible", {
  16416. get: function () {
  16417. _throwIfNotLoaded("visible", this.m_visible, "ChartLegend", this._isNull);
  16418. return this.m_visible;
  16419. },
  16420. set: function (value) {
  16421. this.m_visible=value;
  16422. _createSetPropertyAction(this.context, this, "Visible", value);
  16423. },
  16424. enumerable: true,
  16425. configurable: true
  16426. });
  16427. ChartLegend.prototype._handleResult=function (value) {
  16428. _super.prototype._handleResult.call(this, value);
  16429. if (_isNullOrUndefined(value))
  16430. return;
  16431. var obj=value;
  16432. _fixObjectPathIfNecessary(this, obj);
  16433. if (!_isUndefined(obj["Overlay"])) {
  16434. this.m_overlay=obj["Overlay"];
  16435. }
  16436. if (!_isUndefined(obj["Position"])) {
  16437. this.m_position=obj["Position"];
  16438. }
  16439. if (!_isUndefined(obj["Visible"])) {
  16440. this.m_visible=obj["Visible"];
  16441. }
  16442. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16443. };
  16444. ChartLegend.prototype.load=function (option) {
  16445. _load(this, option);
  16446. return this;
  16447. };
  16448. ChartLegend.prototype.toJSON=function () {
  16449. return {
  16450. "format": this.m_format,
  16451. "overlay": this.m_overlay,
  16452. "position": this.m_position,
  16453. "visible": this.m_visible
  16454. };
  16455. };
  16456. return ChartLegend;
  16457. }(OfficeExtension.ClientObject));
  16458. Excel.ChartLegend=ChartLegend;
  16459. var ChartLegendFormat=(function (_super) {
  16460. __extends(ChartLegendFormat, _super);
  16461. function ChartLegendFormat() {
  16462. _super.apply(this, arguments);
  16463. }
  16464. Object.defineProperty(ChartLegendFormat.prototype, "fill", {
  16465. get: function () {
  16466. if (!this.m_fill) {
  16467. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  16468. }
  16469. return this.m_fill;
  16470. },
  16471. enumerable: true,
  16472. configurable: true
  16473. });
  16474. Object.defineProperty(ChartLegendFormat.prototype, "font", {
  16475. get: function () {
  16476. if (!this.m_font) {
  16477. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  16478. }
  16479. return this.m_font;
  16480. },
  16481. enumerable: true,
  16482. configurable: true
  16483. });
  16484. ChartLegendFormat.prototype._handleResult=function (value) {
  16485. _super.prototype._handleResult.call(this, value);
  16486. if (_isNullOrUndefined(value))
  16487. return;
  16488. var obj=value;
  16489. _fixObjectPathIfNecessary(this, obj);
  16490. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  16491. };
  16492. ChartLegendFormat.prototype.load=function (option) {
  16493. _load(this, option);
  16494. return this;
  16495. };
  16496. ChartLegendFormat.prototype.toJSON=function () {
  16497. return {
  16498. "fill": this.m_fill,
  16499. "font": this.m_font
  16500. };
  16501. };
  16502. return ChartLegendFormat;
  16503. }(OfficeExtension.ClientObject));
  16504. Excel.ChartLegendFormat=ChartLegendFormat;
  16505. var ChartTitle=(function (_super) {
  16506. __extends(ChartTitle, _super);
  16507. function ChartTitle() {
  16508. _super.apply(this, arguments);
  16509. }
  16510. Object.defineProperty(ChartTitle.prototype, "format", {
  16511. get: function () {
  16512. if (!this.m_format) {
  16513. this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16514. }
  16515. return this.m_format;
  16516. },
  16517. enumerable: true,
  16518. configurable: true
  16519. });
  16520. Object.defineProperty(ChartTitle.prototype, "overlay", {
  16521. get: function () {
  16522. _throwIfNotLoaded("overlay", this.m_overlay, "ChartTitle", this._isNull);
  16523. return this.m_overlay;
  16524. },
  16525. set: function (value) {
  16526. this.m_overlay=value;
  16527. _createSetPropertyAction(this.context, this, "Overlay", value);
  16528. },
  16529. enumerable: true,
  16530. configurable: true
  16531. });
  16532. Object.defineProperty(ChartTitle.prototype, "text", {
  16533. get: function () {
  16534. _throwIfNotLoaded("text", this.m_text, "ChartTitle", this._isNull);
  16535. return this.m_text;
  16536. },
  16537. set: function (value) {
  16538. this.m_text=value;
  16539. _createSetPropertyAction(this.context, this, "Text", value);
  16540. },
  16541. enumerable: true,
  16542. configurable: true
  16543. });
  16544. Object.defineProperty(ChartTitle.prototype, "visible", {
  16545. get: function () {
  16546. _throwIfNotLoaded("visible", this.m_visible, "ChartTitle", this._isNull);
  16547. return this.m_visible;
  16548. },
  16549. set: function (value) {
  16550. this.m_visible=value;
  16551. _createSetPropertyAction(this.context, this, "Visible", value);
  16552. },
  16553. enumerable: true,
  16554. configurable: true
  16555. });
  16556. ChartTitle.prototype._handleResult=function (value) {
  16557. _super.prototype._handleResult.call(this, value);
  16558. if (_isNullOrUndefined(value))
  16559. return;
  16560. var obj=value;
  16561. _fixObjectPathIfNecessary(this, obj);
  16562. if (!_isUndefined(obj["Overlay"])) {
  16563. this.m_overlay=obj["Overlay"];
  16564. }
  16565. if (!_isUndefined(obj["Text"])) {
  16566. this.m_text=obj["Text"];
  16567. }
  16568. if (!_isUndefined(obj["Visible"])) {
  16569. this.m_visible=obj["Visible"];
  16570. }
  16571. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16572. };
  16573. ChartTitle.prototype.load=function (option) {
  16574. _load(this, option);
  16575. return this;
  16576. };
  16577. ChartTitle.prototype.toJSON=function () {
  16578. return {
  16579. "format": this.m_format,
  16580. "overlay": this.m_overlay,
  16581. "text": this.m_text,
  16582. "visible": this.m_visible
  16583. };
  16584. };
  16585. return ChartTitle;
  16586. }(OfficeExtension.ClientObject));
  16587. Excel.ChartTitle=ChartTitle;
  16588. var ChartTitleFormat=(function (_super) {
  16589. __extends(ChartTitleFormat, _super);
  16590. function ChartTitleFormat() {
  16591. _super.apply(this, arguments);
  16592. }
  16593. Object.defineProperty(ChartTitleFormat.prototype, "fill", {
  16594. get: function () {
  16595. if (!this.m_fill) {
  16596. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  16597. }
  16598. return this.m_fill;
  16599. },
  16600. enumerable: true,
  16601. configurable: true
  16602. });
  16603. Object.defineProperty(ChartTitleFormat.prototype, "font", {
  16604. get: function () {
  16605. if (!this.m_font) {
  16606. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  16607. }
  16608. return this.m_font;
  16609. },
  16610. enumerable: true,
  16611. configurable: true
  16612. });
  16613. ChartTitleFormat.prototype._handleResult=function (value) {
  16614. _super.prototype._handleResult.call(this, value);
  16615. if (_isNullOrUndefined(value))
  16616. return;
  16617. var obj=value;
  16618. _fixObjectPathIfNecessary(this, obj);
  16619. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  16620. };
  16621. ChartTitleFormat.prototype.load=function (option) {
  16622. _load(this, option);
  16623. return this;
  16624. };
  16625. ChartTitleFormat.prototype.toJSON=function () {
  16626. return {
  16627. "fill": this.m_fill,
  16628. "font": this.m_font
  16629. };
  16630. };
  16631. return ChartTitleFormat;
  16632. }(OfficeExtension.ClientObject));
  16633. Excel.ChartTitleFormat=ChartTitleFormat;
  16634. var ChartFill=(function (_super) {
  16635. __extends(ChartFill, _super);
  16636. function ChartFill() {
  16637. _super.apply(this, arguments);
  16638. }
  16639. ChartFill.prototype.load=function (option) {
  16640. _load(this, option);
  16641. return this;
  16642. };
  16643. ChartFill.prototype.clear=function () {
  16644. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  16645. };
  16646. ChartFill.prototype.setSolidColor=function (color) {
  16647. _createMethodAction(this.context, this, "SetSolidColor", OfficeExtension.OperationType.Default, [color]);
  16648. };
  16649. ChartFill.prototype._handleResult=function (value) {
  16650. _super.prototype._handleResult.call(this, value);
  16651. if (_isNullOrUndefined(value))
  16652. return;
  16653. var obj=value;
  16654. _fixObjectPathIfNecessary(this, obj);
  16655. };
  16656. ChartFill.prototype.toJSON=function () {
  16657. return {};
  16658. };
  16659. return ChartFill;
  16660. }(OfficeExtension.ClientObject));
  16661. Excel.ChartFill=ChartFill;
  16662. var ChartLineFormat=(function (_super) {
  16663. __extends(ChartLineFormat, _super);
  16664. function ChartLineFormat() {
  16665. _super.apply(this, arguments);
  16666. }
  16667. Object.defineProperty(ChartLineFormat.prototype, "color", {
  16668. get: function () {
  16669. _throwIfNotLoaded("color", this.m_color, "ChartLineFormat", this._isNull);
  16670. return this.m_color;
  16671. },
  16672. set: function (value) {
  16673. this.m_color=value;
  16674. _createSetPropertyAction(this.context, this, "Color", value);
  16675. },
  16676. enumerable: true,
  16677. configurable: true
  16678. });
  16679. ChartLineFormat.prototype.clear=function () {
  16680. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  16681. };
  16682. ChartLineFormat.prototype._handleResult=function (value) {
  16683. _super.prototype._handleResult.call(this, value);
  16684. if (_isNullOrUndefined(value))
  16685. return;
  16686. var obj=value;
  16687. _fixObjectPathIfNecessary(this, obj);
  16688. if (!_isUndefined(obj["Color"])) {
  16689. this.m_color=obj["Color"];
  16690. }
  16691. };
  16692. ChartLineFormat.prototype.load=function (option) {
  16693. _load(this, option);
  16694. return this;
  16695. };
  16696. ChartLineFormat.prototype.toJSON=function () {
  16697. return {
  16698. "color": this.m_color
  16699. };
  16700. };
  16701. return ChartLineFormat;
  16702. }(OfficeExtension.ClientObject));
  16703. Excel.ChartLineFormat=ChartLineFormat;
  16704. var ChartFont=(function (_super) {
  16705. __extends(ChartFont, _super);
  16706. function ChartFont() {
  16707. _super.apply(this, arguments);
  16708. }
  16709. Object.defineProperty(ChartFont.prototype, "bold", {
  16710. get: function () {
  16711. _throwIfNotLoaded("bold", this.m_bold, "ChartFont", this._isNull);
  16712. return this.m_bold;
  16713. },
  16714. set: function (value) {
  16715. this.m_bold=value;
  16716. _createSetPropertyAction(this.context, this, "Bold", value);
  16717. },
  16718. enumerable: true,
  16719. configurable: true
  16720. });
  16721. Object.defineProperty(ChartFont.prototype, "color", {
  16722. get: function () {
  16723. _throwIfNotLoaded("color", this.m_color, "ChartFont", this._isNull);
  16724. return this.m_color;
  16725. },
  16726. set: function (value) {
  16727. this.m_color=value;
  16728. _createSetPropertyAction(this.context, this, "Color", value);
  16729. },
  16730. enumerable: true,
  16731. configurable: true
  16732. });
  16733. Object.defineProperty(ChartFont.prototype, "italic", {
  16734. get: function () {
  16735. _throwIfNotLoaded("italic", this.m_italic, "ChartFont", this._isNull);
  16736. return this.m_italic;
  16737. },
  16738. set: function (value) {
  16739. this.m_italic=value;
  16740. _createSetPropertyAction(this.context, this, "Italic", value);
  16741. },
  16742. enumerable: true,
  16743. configurable: true
  16744. });
  16745. Object.defineProperty(ChartFont.prototype, "name", {
  16746. get: function () {
  16747. _throwIfNotLoaded("name", this.m_name, "ChartFont", this._isNull);
  16748. return this.m_name;
  16749. },
  16750. set: function (value) {
  16751. this.m_name=value;
  16752. _createSetPropertyAction(this.context, this, "Name", value);
  16753. },
  16754. enumerable: true,
  16755. configurable: true
  16756. });
  16757. Object.defineProperty(ChartFont.prototype, "size", {
  16758. get: function () {
  16759. _throwIfNotLoaded("size", this.m_size, "ChartFont", this._isNull);
  16760. return this.m_size;
  16761. },
  16762. set: function (value) {
  16763. this.m_size=value;
  16764. _createSetPropertyAction(this.context, this, "Size", value);
  16765. },
  16766. enumerable: true,
  16767. configurable: true
  16768. });
  16769. Object.defineProperty(ChartFont.prototype, "underline", {
  16770. get: function () {
  16771. _throwIfNotLoaded("underline", this.m_underline, "ChartFont", this._isNull);
  16772. return this.m_underline;
  16773. },
  16774. set: function (value) {
  16775. this.m_underline=value;
  16776. _createSetPropertyAction(this.context, this, "Underline", value);
  16777. },
  16778. enumerable: true,
  16779. configurable: true
  16780. });
  16781. ChartFont.prototype._handleResult=function (value) {
  16782. _super.prototype._handleResult.call(this, value);
  16783. if (_isNullOrUndefined(value))
  16784. return;
  16785. var obj=value;
  16786. _fixObjectPathIfNecessary(this, obj);
  16787. if (!_isUndefined(obj["Bold"])) {
  16788. this.m_bold=obj["Bold"];
  16789. }
  16790. if (!_isUndefined(obj["Color"])) {
  16791. this.m_color=obj["Color"];
  16792. }
  16793. if (!_isUndefined(obj["Italic"])) {
  16794. this.m_italic=obj["Italic"];
  16795. }
  16796. if (!_isUndefined(obj["Name"])) {
  16797. this.m_name=obj["Name"];
  16798. }
  16799. if (!_isUndefined(obj["Size"])) {
  16800. this.m_size=obj["Size"];
  16801. }
  16802. if (!_isUndefined(obj["Underline"])) {
  16803. this.m_underline=obj["Underline"];
  16804. }
  16805. };
  16806. ChartFont.prototype.load=function (option) {
  16807. _load(this, option);
  16808. return this;
  16809. };
  16810. ChartFont.prototype.toJSON=function () {
  16811. return {
  16812. "bold": this.m_bold,
  16813. "color": this.m_color,
  16814. "italic": this.m_italic,
  16815. "name": this.m_name,
  16816. "size": this.m_size,
  16817. "underline": this.m_underline
  16818. };
  16819. };
  16820. return ChartFont;
  16821. }(OfficeExtension.ClientObject));
  16822. Excel.ChartFont=ChartFont;
  16823. var RangeSort=(function (_super) {
  16824. __extends(RangeSort, _super);
  16825. function RangeSort() {
  16826. _super.apply(this, arguments);
  16827. }
  16828. RangeSort.prototype.apply=function (fields, matchCase, hasHeaders, orientation, method) {
  16829. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, hasHeaders, orientation, method]);
  16830. };
  16831. RangeSort.prototype._handleResult=function (value) {
  16832. _super.prototype._handleResult.call(this, value);
  16833. if (_isNullOrUndefined(value))
  16834. return;
  16835. var obj=value;
  16836. _fixObjectPathIfNecessary(this, obj);
  16837. };
  16838. RangeSort.prototype.toJSON=function () {
  16839. return {};
  16840. };
  16841. return RangeSort;
  16842. }(OfficeExtension.ClientObject));
  16843. Excel.RangeSort=RangeSort;
  16844. var TableSort=(function (_super) {
  16845. __extends(TableSort, _super);
  16846. function TableSort() {
  16847. _super.apply(this, arguments);
  16848. }
  16849. Object.defineProperty(TableSort.prototype, "fields", {
  16850. get: function () {
  16851. _throwIfNotLoaded("fields", this.m_fields, "TableSort", this._isNull);
  16852. return this.m_fields;
  16853. },
  16854. enumerable: true,
  16855. configurable: true
  16856. });
  16857. Object.defineProperty(TableSort.prototype, "matchCase", {
  16858. get: function () {
  16859. _throwIfNotLoaded("matchCase", this.m_matchCase, "TableSort", this._isNull);
  16860. return this.m_matchCase;
  16861. },
  16862. enumerable: true,
  16863. configurable: true
  16864. });
  16865. Object.defineProperty(TableSort.prototype, "method", {
  16866. get: function () {
  16867. _throwIfNotLoaded("method", this.m_method, "TableSort", this._isNull);
  16868. return this.m_method;
  16869. },
  16870. enumerable: true,
  16871. configurable: true
  16872. });
  16873. TableSort.prototype.apply=function (fields, matchCase, method) {
  16874. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, method]);
  16875. };
  16876. TableSort.prototype.clear=function () {
  16877. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  16878. };
  16879. TableSort.prototype.reapply=function () {
  16880. _createMethodAction(this.context, this, "Reapply", OfficeExtension.OperationType.Default, []);
  16881. };
  16882. TableSort.prototype._handleResult=function (value) {
  16883. _super.prototype._handleResult.call(this, value);
  16884. if (_isNullOrUndefined(value))
  16885. return;
  16886. var obj=value;
  16887. _fixObjectPathIfNecessary(this, obj);
  16888. if (!_isUndefined(obj["Fields"])) {
  16889. this.m_fields=obj["Fields"];
  16890. }
  16891. if (!_isUndefined(obj["MatchCase"])) {
  16892. this.m_matchCase=obj["MatchCase"];
  16893. }
  16894. if (!_isUndefined(obj["Method"])) {
  16895. this.m_method=obj["Method"];
  16896. }
  16897. };
  16898. TableSort.prototype.load=function (option) {
  16899. _load(this, option);
  16900. return this;
  16901. };
  16902. TableSort.prototype.toJSON=function () {
  16903. return {
  16904. "fields": this.m_fields,
  16905. "matchCase": this.m_matchCase,
  16906. "method": this.m_method
  16907. };
  16908. };
  16909. return TableSort;
  16910. }(OfficeExtension.ClientObject));
  16911. Excel.TableSort=TableSort;
  16912. var Filter=(function (_super) {
  16913. __extends(Filter, _super);
  16914. function Filter() {
  16915. _super.apply(this, arguments);
  16916. }
  16917. Object.defineProperty(Filter.prototype, "criteria", {
  16918. get: function () {
  16919. _throwIfNotLoaded("criteria", this.m_criteria, "Filter", this._isNull);
  16920. return this.m_criteria;
  16921. },
  16922. enumerable: true,
  16923. configurable: true
  16924. });
  16925. Filter.prototype.apply=function (criteria) {
  16926. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [criteria]);
  16927. };
  16928. Filter.prototype.applyBottomItemsFilter=function (count) {
  16929. _createMethodAction(this.context, this, "ApplyBottomItemsFilter", OfficeExtension.OperationType.Default, [count]);
  16930. };
  16931. Filter.prototype.applyBottomPercentFilter=function (percent) {
  16932. _createMethodAction(this.context, this, "ApplyBottomPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  16933. };
  16934. Filter.prototype.applyCellColorFilter=function (color) {
  16935. _createMethodAction(this.context, this, "ApplyCellColorFilter", OfficeExtension.OperationType.Default, [color]);
  16936. };
  16937. Filter.prototype.applyCustomFilter=function (criteria1, criteria2, oper) {
  16938. _createMethodAction(this.context, this, "ApplyCustomFilter", OfficeExtension.OperationType.Default, [criteria1, criteria2, oper]);
  16939. };
  16940. Filter.prototype.applyDynamicFilter=function (criteria) {
  16941. _createMethodAction(this.context, this, "ApplyDynamicFilter", OfficeExtension.OperationType.Default, [criteria]);
  16942. };
  16943. Filter.prototype.applyFontColorFilter=function (color) {
  16944. _createMethodAction(this.context, this, "ApplyFontColorFilter", OfficeExtension.OperationType.Default, [color]);
  16945. };
  16946. Filter.prototype.applyIconFilter=function (icon) {
  16947. _createMethodAction(this.context, this, "ApplyIconFilter", OfficeExtension.OperationType.Default, [icon]);
  16948. };
  16949. Filter.prototype.applyTopItemsFilter=function (count) {
  16950. _createMethodAction(this.context, this, "ApplyTopItemsFilter", OfficeExtension.OperationType.Default, [count]);
  16951. };
  16952. Filter.prototype.applyTopPercentFilter=function (percent) {
  16953. _createMethodAction(this.context, this, "ApplyTopPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  16954. };
  16955. Filter.prototype.applyValuesFilter=function (values) {
  16956. _createMethodAction(this.context, this, "ApplyValuesFilter", OfficeExtension.OperationType.Default, [values]);
  16957. };
  16958. Filter.prototype.clear=function () {
  16959. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  16960. };
  16961. Filter.prototype._handleResult=function (value) {
  16962. _super.prototype._handleResult.call(this, value);
  16963. if (_isNullOrUndefined(value))
  16964. return;
  16965. var obj=value;
  16966. _fixObjectPathIfNecessary(this, obj);
  16967. if (!_isUndefined(obj["Criteria"])) {
  16968. this.m_criteria=obj["Criteria"];
  16969. }
  16970. };
  16971. Filter.prototype.load=function (option) {
  16972. _load(this, option);
  16973. return this;
  16974. };
  16975. Filter.prototype.toJSON=function () {
  16976. return {
  16977. "criteria": this.m_criteria
  16978. };
  16979. };
  16980. return Filter;
  16981. }(OfficeExtension.ClientObject));
  16982. Excel.Filter=Filter;
  16983. var _V1Api=(function (_super) {
  16984. __extends(_V1Api, _super);
  16985. function _V1Api() {
  16986. _super.apply(this, arguments);
  16987. }
  16988. _V1Api.prototype.bindingAddColumns=function (input) {
  16989. var action=_createMethodAction(this.context, this, "BindingAddColumns", OfficeExtension.OperationType.Default, [input]);
  16990. var ret=new OfficeExtension.ClientResult();
  16991. _addActionResultHandler(this, action, ret);
  16992. return ret;
  16993. };
  16994. _V1Api.prototype.bindingAddFromNamedItem=function (input) {
  16995. var action=_createMethodAction(this.context, this, "BindingAddFromNamedItem", OfficeExtension.OperationType.Read, [input]);
  16996. var ret=new OfficeExtension.ClientResult();
  16997. _addActionResultHandler(this, action, ret);
  16998. return ret;
  16999. };
  17000. _V1Api.prototype.bindingAddFromPrompt=function (input) {
  17001. var action=_createMethodAction(this.context, this, "BindingAddFromPrompt", OfficeExtension.OperationType.Read, [input]);
  17002. var ret=new OfficeExtension.ClientResult();
  17003. _addActionResultHandler(this, action, ret);
  17004. return ret;
  17005. };
  17006. _V1Api.prototype.bindingAddFromSelection=function (input) {
  17007. var action=_createMethodAction(this.context, this, "BindingAddFromSelection", OfficeExtension.OperationType.Read, [input]);
  17008. var ret=new OfficeExtension.ClientResult();
  17009. _addActionResultHandler(this, action, ret);
  17010. return ret;
  17011. };
  17012. _V1Api.prototype.bindingAddRows=function (input) {
  17013. var action=_createMethodAction(this.context, this, "BindingAddRows", OfficeExtension.OperationType.Default, [input]);
  17014. var ret=new OfficeExtension.ClientResult();
  17015. _addActionResultHandler(this, action, ret);
  17016. return ret;
  17017. };
  17018. _V1Api.prototype.bindingClearFormats=function (input) {
  17019. var action=_createMethodAction(this.context, this, "BindingClearFormats", OfficeExtension.OperationType.Default, [input]);
  17020. var ret=new OfficeExtension.ClientResult();
  17021. _addActionResultHandler(this, action, ret);
  17022. return ret;
  17023. };
  17024. _V1Api.prototype.bindingDeleteAllDataValues=function (input) {
  17025. var action=_createMethodAction(this.context, this, "BindingDeleteAllDataValues", OfficeExtension.OperationType.Default, [input]);
  17026. var ret=new OfficeExtension.ClientResult();
  17027. _addActionResultHandler(this, action, ret);
  17028. return ret;
  17029. };
  17030. _V1Api.prototype.bindingGetAll=function () {
  17031. var action=_createMethodAction(this.context, this, "BindingGetAll", OfficeExtension.OperationType.Read, []);
  17032. var ret=new OfficeExtension.ClientResult();
  17033. _addActionResultHandler(this, action, ret);
  17034. return ret;
  17035. };
  17036. _V1Api.prototype.bindingGetById=function (input) {
  17037. var action=_createMethodAction(this.context, this, "BindingGetById", OfficeExtension.OperationType.Read, [input]);
  17038. var ret=new OfficeExtension.ClientResult();
  17039. _addActionResultHandler(this, action, ret);
  17040. return ret;
  17041. };
  17042. _V1Api.prototype.bindingGetData=function (input) {
  17043. var action=_createMethodAction(this.context, this, "BindingGetData", OfficeExtension.OperationType.Read, [input]);
  17044. var ret=new OfficeExtension.ClientResult();
  17045. _addActionResultHandler(this, action, ret);
  17046. return ret;
  17047. };
  17048. _V1Api.prototype.bindingReleaseById=function (input) {
  17049. var action=_createMethodAction(this.context, this, "BindingReleaseById", OfficeExtension.OperationType.Read, [input]);
  17050. var ret=new OfficeExtension.ClientResult();
  17051. _addActionResultHandler(this, action, ret);
  17052. return ret;
  17053. };
  17054. _V1Api.prototype.bindingSetData=function (input) {
  17055. var action=_createMethodAction(this.context, this, "BindingSetData", OfficeExtension.OperationType.Default, [input]);
  17056. var ret=new OfficeExtension.ClientResult();
  17057. _addActionResultHandler(this, action, ret);
  17058. return ret;
  17059. };
  17060. _V1Api.prototype.bindingSetFormats=function (input) {
  17061. var action=_createMethodAction(this.context, this, "BindingSetFormats", OfficeExtension.OperationType.Default, [input]);
  17062. var ret=new OfficeExtension.ClientResult();
  17063. _addActionResultHandler(this, action, ret);
  17064. return ret;
  17065. };
  17066. _V1Api.prototype.bindingSetTableOptions=function (input) {
  17067. var action=_createMethodAction(this.context, this, "BindingSetTableOptions", OfficeExtension.OperationType.Default, [input]);
  17068. var ret=new OfficeExtension.ClientResult();
  17069. _addActionResultHandler(this, action, ret);
  17070. return ret;
  17071. };
  17072. _V1Api.prototype.getSelectedData=function (input) {
  17073. var action=_createMethodAction(this.context, this, "GetSelectedData", OfficeExtension.OperationType.Read, [input]);
  17074. var ret=new OfficeExtension.ClientResult();
  17075. _addActionResultHandler(this, action, ret);
  17076. return ret;
  17077. };
  17078. _V1Api.prototype.gotoById=function (input) {
  17079. var action=_createMethodAction(this.context, this, "GotoById", OfficeExtension.OperationType.Read, [input]);
  17080. var ret=new OfficeExtension.ClientResult();
  17081. _addActionResultHandler(this, action, ret);
  17082. return ret;
  17083. };
  17084. _V1Api.prototype.setSelectedData=function (input) {
  17085. var action=_createMethodAction(this.context, this, "SetSelectedData", OfficeExtension.OperationType.Default, [input]);
  17086. var ret=new OfficeExtension.ClientResult();
  17087. _addActionResultHandler(this, action, ret);
  17088. return ret;
  17089. };
  17090. _V1Api.prototype._handleResult=function (value) {
  17091. _super.prototype._handleResult.call(this, value);
  17092. if (_isNullOrUndefined(value))
  17093. return;
  17094. var obj=value;
  17095. _fixObjectPathIfNecessary(this, obj);
  17096. };
  17097. _V1Api.prototype.toJSON=function () {
  17098. return {};
  17099. };
  17100. return _V1Api;
  17101. }(OfficeExtension.ClientObject));
  17102. Excel._V1Api=_V1Api;
  17103. var PivotTableCollection=(function (_super) {
  17104. __extends(PivotTableCollection, _super);
  17105. function PivotTableCollection() {
  17106. _super.apply(this, arguments);
  17107. }
  17108. Object.defineProperty(PivotTableCollection.prototype, "items", {
  17109. get: function () {
  17110. _throwIfNotLoaded("items", this.m__items, "PivotTableCollection", this._isNull);
  17111. return this.m__items;
  17112. },
  17113. enumerable: true,
  17114. configurable: true
  17115. });
  17116. PivotTableCollection.prototype.getItem=function (name) {
  17117. return new Excel.PivotTable(this.context, _createIndexerObjectPath(this.context, this, [name]));
  17118. };
  17119. PivotTableCollection.prototype.refreshAll=function () {
  17120. _createMethodAction(this.context, this, "RefreshAll", OfficeExtension.OperationType.Default, []);
  17121. };
  17122. PivotTableCollection.prototype._handleResult=function (value) {
  17123. _super.prototype._handleResult.call(this, value);
  17124. if (_isNullOrUndefined(value))
  17125. return;
  17126. var obj=value;
  17127. _fixObjectPathIfNecessary(this, obj);
  17128. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  17129. this.m__items=[];
  17130. var _data=obj[OfficeExtension.Constants.items];
  17131. for (var i=0; i < _data.length; i++) {
  17132. var _item=new Excel.PivotTable(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  17133. _item._handleResult(_data[i]);
  17134. this.m__items.push(_item);
  17135. }
  17136. }
  17137. };
  17138. PivotTableCollection.prototype.load=function (option) {
  17139. _load(this, option);
  17140. return this;
  17141. };
  17142. PivotTableCollection.prototype.toJSON=function () {
  17143. return {};
  17144. };
  17145. return PivotTableCollection;
  17146. }(OfficeExtension.ClientObject));
  17147. Excel.PivotTableCollection=PivotTableCollection;
  17148. var PivotTable=(function (_super) {
  17149. __extends(PivotTable, _super);
  17150. function PivotTable() {
  17151. _super.apply(this, arguments);
  17152. }
  17153. Object.defineProperty(PivotTable.prototype, "worksheet", {
  17154. get: function () {
  17155. if (!this.m_worksheet) {
  17156. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  17157. }
  17158. return this.m_worksheet;
  17159. },
  17160. enumerable: true,
  17161. configurable: true
  17162. });
  17163. Object.defineProperty(PivotTable.prototype, "name", {
  17164. get: function () {
  17165. _throwIfNotLoaded("name", this.m_name, "PivotTable", this._isNull);
  17166. return this.m_name;
  17167. },
  17168. set: function (value) {
  17169. this.m_name=value;
  17170. _createSetPropertyAction(this.context, this, "Name", value);
  17171. },
  17172. enumerable: true,
  17173. configurable: true
  17174. });
  17175. PivotTable.prototype.refresh=function () {
  17176. _createMethodAction(this.context, this, "Refresh", OfficeExtension.OperationType.Default, []);
  17177. };
  17178. PivotTable.prototype._handleResult=function (value) {
  17179. _super.prototype._handleResult.call(this, value);
  17180. if (_isNullOrUndefined(value))
  17181. return;
  17182. var obj=value;
  17183. _fixObjectPathIfNecessary(this, obj);
  17184. if (!_isUndefined(obj["Name"])) {
  17185. this.m_name=obj["Name"];
  17186. }
  17187. _handleNavigationPropertyResults(this, obj, ["worksheet", "Worksheet"]);
  17188. };
  17189. PivotTable.prototype.load=function (option) {
  17190. _load(this, option);
  17191. return this;
  17192. };
  17193. PivotTable.prototype.toJSON=function () {
  17194. return {
  17195. "name": this.m_name
  17196. };
  17197. };
  17198. return PivotTable;
  17199. }(OfficeExtension.ClientObject));
  17200. Excel.PivotTable=PivotTable;
  17201. var BindingType;
  17202. (function (BindingType) {
  17203. BindingType.range="Range";
  17204. BindingType.table="Table";
  17205. BindingType.text="Text";
  17206. })(BindingType=Excel.BindingType || (Excel.BindingType={}));
  17207. var BorderIndex;
  17208. (function (BorderIndex) {
  17209. BorderIndex.edgeTop="EdgeTop";
  17210. BorderIndex.edgeBottom="EdgeBottom";
  17211. BorderIndex.edgeLeft="EdgeLeft";
  17212. BorderIndex.edgeRight="EdgeRight";
  17213. BorderIndex.insideVertical="InsideVertical";
  17214. BorderIndex.insideHorizontal="InsideHorizontal";
  17215. BorderIndex.diagonalDown="DiagonalDown";
  17216. BorderIndex.diagonalUp="DiagonalUp";
  17217. })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={}));
  17218. var BorderLineStyle;
  17219. (function (BorderLineStyle) {
  17220. BorderLineStyle.none="None";
  17221. BorderLineStyle.continuous="Continuous";
  17222. BorderLineStyle.dash="Dash";
  17223. BorderLineStyle.dashDot="DashDot";
  17224. BorderLineStyle.dashDotDot="DashDotDot";
  17225. BorderLineStyle.dot="Dot";
  17226. BorderLineStyle.double="Double";
  17227. BorderLineStyle.slantDashDot="SlantDashDot";
  17228. })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={}));
  17229. var BorderWeight;
  17230. (function (BorderWeight) {
  17231. BorderWeight.hairline="Hairline";
  17232. BorderWeight.thin="Thin";
  17233. BorderWeight.medium="Medium";
  17234. BorderWeight.thick="Thick";
  17235. })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={}));
  17236. var CalculationMode;
  17237. (function (CalculationMode) {
  17238. CalculationMode.automatic="Automatic";
  17239. CalculationMode.automaticExceptTables="AutomaticExceptTables";
  17240. CalculationMode.manual="Manual";
  17241. })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={}));
  17242. var CalculationType;
  17243. (function (CalculationType) {
  17244. CalculationType.recalculate="Recalculate";
  17245. CalculationType.full="Full";
  17246. CalculationType.fullRebuild="FullRebuild";
  17247. })(CalculationType=Excel.CalculationType || (Excel.CalculationType={}));
  17248. var ClearApplyTo;
  17249. (function (ClearApplyTo) {
  17250. ClearApplyTo.all="All";
  17251. ClearApplyTo.formats="Formats";
  17252. ClearApplyTo.contents="Contents";
  17253. })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={}));
  17254. var ChartDataLabelPosition;
  17255. (function (ChartDataLabelPosition) {
  17256. ChartDataLabelPosition.invalid="Invalid";
  17257. ChartDataLabelPosition.none="None";
  17258. ChartDataLabelPosition.center="Center";
  17259. ChartDataLabelPosition.insideEnd="InsideEnd";
  17260. ChartDataLabelPosition.insideBase="InsideBase";
  17261. ChartDataLabelPosition.outsideEnd="OutsideEnd";
  17262. ChartDataLabelPosition.left="Left";
  17263. ChartDataLabelPosition.right="Right";
  17264. ChartDataLabelPosition.top="Top";
  17265. ChartDataLabelPosition.bottom="Bottom";
  17266. ChartDataLabelPosition.bestFit="BestFit";
  17267. ChartDataLabelPosition.callout="Callout";
  17268. })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={}));
  17269. var ChartLegendPosition;
  17270. (function (ChartLegendPosition) {
  17271. ChartLegendPosition.invalid="Invalid";
  17272. ChartLegendPosition.top="Top";
  17273. ChartLegendPosition.bottom="Bottom";
  17274. ChartLegendPosition.left="Left";
  17275. ChartLegendPosition.right="Right";
  17276. ChartLegendPosition.corner="Corner";
  17277. ChartLegendPosition.custom="Custom";
  17278. })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={}));
  17279. var ChartSeriesBy;
  17280. (function (ChartSeriesBy) {
  17281. ChartSeriesBy.auto="Auto";
  17282. ChartSeriesBy.columns="Columns";
  17283. ChartSeriesBy.rows="Rows";
  17284. })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={}));
  17285. var ChartType;
  17286. (function (ChartType) {
  17287. ChartType.invalid="Invalid";
  17288. ChartType.columnClustered="ColumnClustered";
  17289. ChartType.columnStacked="ColumnStacked";
  17290. ChartType.columnStacked100="ColumnStacked100";
  17291. ChartType._3DColumnClustered="3DColumnClustered";
  17292. ChartType._3DColumnStacked="3DColumnStacked";
  17293. ChartType._3DColumnStacked100="3DColumnStacked100";
  17294. ChartType.barClustered="BarClustered";
  17295. ChartType.barStacked="BarStacked";
  17296. ChartType.barStacked100="BarStacked100";
  17297. ChartType._3DBarClustered="3DBarClustered";
  17298. ChartType._3DBarStacked="3DBarStacked";
  17299. ChartType._3DBarStacked100="3DBarStacked100";
  17300. ChartType.lineStacked="LineStacked";
  17301. ChartType.lineStacked100="LineStacked100";
  17302. ChartType.lineMarkers="LineMarkers";
  17303. ChartType.lineMarkersStacked="LineMarkersStacked";
  17304. ChartType.lineMarkersStacked100="LineMarkersStacked100";
  17305. ChartType.pieOfPie="PieOfPie";
  17306. ChartType.pieExploded="PieExploded";
  17307. ChartType._3DPieExploded="3DPieExploded";
  17308. ChartType.barOfPie="BarOfPie";
  17309. ChartType.xyscatterSmooth="XYScatterSmooth";
  17310. ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers";
  17311. ChartType.xyscatterLines="XYScatterLines";
  17312. ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers";
  17313. ChartType.areaStacked="AreaStacked";
  17314. ChartType.areaStacked100="AreaStacked100";
  17315. ChartType._3DAreaStacked="3DAreaStacked";
  17316. ChartType._3DAreaStacked100="3DAreaStacked100";
  17317. ChartType.doughnutExploded="DoughnutExploded";
  17318. ChartType.radarMarkers="RadarMarkers";
  17319. ChartType.radarFilled="RadarFilled";
  17320. ChartType.surface="Surface";
  17321. ChartType.surfaceWireframe="SurfaceWireframe";
  17322. ChartType.surfaceTopView="SurfaceTopView";
  17323. ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe";
  17324. ChartType.bubble="Bubble";
  17325. ChartType.bubble3DEffect="Bubble3DEffect";
  17326. ChartType.stockHLC="StockHLC";
  17327. ChartType.stockOHLC="StockOHLC";
  17328. ChartType.stockVHLC="StockVHLC";
  17329. ChartType.stockVOHLC="StockVOHLC";
  17330. ChartType.cylinderColClustered="CylinderColClustered";
  17331. ChartType.cylinderColStacked="CylinderColStacked";
  17332. ChartType.cylinderColStacked100="CylinderColStacked100";
  17333. ChartType.cylinderBarClustered="CylinderBarClustered";
  17334. ChartType.cylinderBarStacked="CylinderBarStacked";
  17335. ChartType.cylinderBarStacked100="CylinderBarStacked100";
  17336. ChartType.cylinderCol="CylinderCol";
  17337. ChartType.coneColClustered="ConeColClustered";
  17338. ChartType.coneColStacked="ConeColStacked";
  17339. ChartType.coneColStacked100="ConeColStacked100";
  17340. ChartType.coneBarClustered="ConeBarClustered";
  17341. ChartType.coneBarStacked="ConeBarStacked";
  17342. ChartType.coneBarStacked100="ConeBarStacked100";
  17343. ChartType.coneCol="ConeCol";
  17344. ChartType.pyramidColClustered="PyramidColClustered";
  17345. ChartType.pyramidColStacked="PyramidColStacked";
  17346. ChartType.pyramidColStacked100="PyramidColStacked100";
  17347. ChartType.pyramidBarClustered="PyramidBarClustered";
  17348. ChartType.pyramidBarStacked="PyramidBarStacked";
  17349. ChartType.pyramidBarStacked100="PyramidBarStacked100";
  17350. ChartType.pyramidCol="PyramidCol";
  17351. ChartType._3DColumn="3DColumn";
  17352. ChartType.line="Line";
  17353. ChartType._3DLine="3DLine";
  17354. ChartType._3DPie="3DPie";
  17355. ChartType.pie="Pie";
  17356. ChartType.xyscatter="XYScatter";
  17357. ChartType._3DArea="3DArea";
  17358. ChartType.area="Area";
  17359. ChartType.doughnut="Doughnut";
  17360. ChartType.radar="Radar";
  17361. })(ChartType=Excel.ChartType || (Excel.ChartType={}));
  17362. var ChartUnderlineStyle;
  17363. (function (ChartUnderlineStyle) {
  17364. ChartUnderlineStyle.none="None";
  17365. ChartUnderlineStyle.single="Single";
  17366. })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={}));
  17367. var DeleteShiftDirection;
  17368. (function (DeleteShiftDirection) {
  17369. DeleteShiftDirection.up="Up";
  17370. DeleteShiftDirection.left="Left";
  17371. })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={}));
  17372. var DynamicFilterCriteria;
  17373. (function (DynamicFilterCriteria) {
  17374. DynamicFilterCriteria.unknown="Unknown";
  17375. DynamicFilterCriteria.aboveAverage="AboveAverage";
  17376. DynamicFilterCriteria.allDatesInPeriodApril="AllDatesInPeriodApril";
  17377. DynamicFilterCriteria.allDatesInPeriodAugust="AllDatesInPeriodAugust";
  17378. DynamicFilterCriteria.allDatesInPeriodDecember="AllDatesInPeriodDecember";
  17379. DynamicFilterCriteria.allDatesInPeriodFebruray="AllDatesInPeriodFebruray";
  17380. DynamicFilterCriteria.allDatesInPeriodJanuary="AllDatesInPeriodJanuary";
  17381. DynamicFilterCriteria.allDatesInPeriodJuly="AllDatesInPeriodJuly";
  17382. DynamicFilterCriteria.allDatesInPeriodJune="AllDatesInPeriodJune";
  17383. DynamicFilterCriteria.allDatesInPeriodMarch="AllDatesInPeriodMarch";
  17384. DynamicFilterCriteria.allDatesInPeriodMay="AllDatesInPeriodMay";
  17385. DynamicFilterCriteria.allDatesInPeriodNovember="AllDatesInPeriodNovember";
  17386. DynamicFilterCriteria.allDatesInPeriodOctober="AllDatesInPeriodOctober";
  17387. DynamicFilterCriteria.allDatesInPeriodQuarter1="AllDatesInPeriodQuarter1";
  17388. DynamicFilterCriteria.allDatesInPeriodQuarter2="AllDatesInPeriodQuarter2";
  17389. DynamicFilterCriteria.allDatesInPeriodQuarter3="AllDatesInPeriodQuarter3";
  17390. DynamicFilterCriteria.allDatesInPeriodQuarter4="AllDatesInPeriodQuarter4";
  17391. DynamicFilterCriteria.allDatesInPeriodSeptember="AllDatesInPeriodSeptember";
  17392. DynamicFilterCriteria.belowAverage="BelowAverage";
  17393. DynamicFilterCriteria.lastMonth="LastMonth";
  17394. DynamicFilterCriteria.lastQuarter="LastQuarter";
  17395. DynamicFilterCriteria.lastWeek="LastWeek";
  17396. DynamicFilterCriteria.lastYear="LastYear";
  17397. DynamicFilterCriteria.nextMonth="NextMonth";
  17398. DynamicFilterCriteria.nextQuarter="NextQuarter";
  17399. DynamicFilterCriteria.nextWeek="NextWeek";
  17400. DynamicFilterCriteria.nextYear="NextYear";
  17401. DynamicFilterCriteria.thisMonth="ThisMonth";
  17402. DynamicFilterCriteria.thisQuarter="ThisQuarter";
  17403. DynamicFilterCriteria.thisWeek="ThisWeek";
  17404. DynamicFilterCriteria.thisYear="ThisYear";
  17405. DynamicFilterCriteria.today="Today";
  17406. DynamicFilterCriteria.tomorrow="Tomorrow";
  17407. DynamicFilterCriteria.yearToDate="YearToDate";
  17408. DynamicFilterCriteria.yesterday="Yesterday";
  17409. })(DynamicFilterCriteria=Excel.DynamicFilterCriteria || (Excel.DynamicFilterCriteria={}));
  17410. var FilterDatetimeSpecificity;
  17411. (function (FilterDatetimeSpecificity) {
  17412. FilterDatetimeSpecificity.year="Year";
  17413. FilterDatetimeSpecificity.month="Month";
  17414. FilterDatetimeSpecificity.day="Day";
  17415. FilterDatetimeSpecificity.hour="Hour";
  17416. FilterDatetimeSpecificity.minute="Minute";
  17417. FilterDatetimeSpecificity.second="Second";
  17418. })(FilterDatetimeSpecificity=Excel.FilterDatetimeSpecificity || (Excel.FilterDatetimeSpecificity={}));
  17419. var FilterOn;
  17420. (function (FilterOn) {
  17421. FilterOn.bottomItems="BottomItems";
  17422. FilterOn.bottomPercent="BottomPercent";
  17423. FilterOn.cellColor="CellColor";
  17424. FilterOn.dynamic="Dynamic";
  17425. FilterOn.fontColor="FontColor";
  17426. FilterOn.values="Values";
  17427. FilterOn.topItems="TopItems";
  17428. FilterOn.topPercent="TopPercent";
  17429. FilterOn.icon="Icon";
  17430. FilterOn.custom="Custom";
  17431. })(FilterOn=Excel.FilterOn || (Excel.FilterOn={}));
  17432. var FilterOperator;
  17433. (function (FilterOperator) {
  17434. FilterOperator.and="And";
  17435. FilterOperator.or="Or";
  17436. })(FilterOperator=Excel.FilterOperator || (Excel.FilterOperator={}));
  17437. var HorizontalAlignment;
  17438. (function (HorizontalAlignment) {
  17439. HorizontalAlignment.general="General";
  17440. HorizontalAlignment.left="Left";
  17441. HorizontalAlignment.center="Center";
  17442. HorizontalAlignment.right="Right";
  17443. HorizontalAlignment.fill="Fill";
  17444. HorizontalAlignment.justify="Justify";
  17445. HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection";
  17446. HorizontalAlignment.distributed="Distributed";
  17447. })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={}));
  17448. var IconSet;
  17449. (function (IconSet) {
  17450. IconSet.invalid="Invalid";
  17451. IconSet.threeArrows="ThreeArrows";
  17452. IconSet.threeArrowsGray="ThreeArrowsGray";
  17453. IconSet.threeFlags="ThreeFlags";
  17454. IconSet.threeTrafficLights1="ThreeTrafficLights1";
  17455. IconSet.threeTrafficLights2="ThreeTrafficLights2";
  17456. IconSet.threeSigns="ThreeSigns";
  17457. IconSet.threeSymbols="ThreeSymbols";
  17458. IconSet.threeSymbols2="ThreeSymbols2";
  17459. IconSet.fourArrows="FourArrows";
  17460. IconSet.fourArrowsGray="FourArrowsGray";
  17461. IconSet.fourRedToBlack="FourRedToBlack";
  17462. IconSet.fourRating="FourRating";
  17463. IconSet.fourTrafficLights="FourTrafficLights";
  17464. IconSet.fiveArrows="FiveArrows";
  17465. IconSet.fiveArrowsGray="FiveArrowsGray";
  17466. IconSet.fiveRating="FiveRating";
  17467. IconSet.fiveQuarters="FiveQuarters";
  17468. IconSet.threeStars="ThreeStars";
  17469. IconSet.threeTriangles="ThreeTriangles";
  17470. IconSet.fiveBoxes="FiveBoxes";
  17471. })(IconSet=Excel.IconSet || (Excel.IconSet={}));
  17472. var ImageFittingMode;
  17473. (function (ImageFittingMode) {
  17474. ImageFittingMode.fit="Fit";
  17475. ImageFittingMode.fitAndCenter="FitAndCenter";
  17476. ImageFittingMode.fill="Fill";
  17477. })(ImageFittingMode=Excel.ImageFittingMode || (Excel.ImageFittingMode={}));
  17478. var InsertShiftDirection;
  17479. (function (InsertShiftDirection) {
  17480. InsertShiftDirection.down="Down";
  17481. InsertShiftDirection.right="Right";
  17482. })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={}));
  17483. var NamedItemType;
  17484. (function (NamedItemType) {
  17485. NamedItemType.string="String";
  17486. NamedItemType.integer="Integer";
  17487. NamedItemType.double="Double";
  17488. NamedItemType.boolean="Boolean";
  17489. NamedItemType.range="Range";
  17490. })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={}));
  17491. var RangeUnderlineStyle;
  17492. (function (RangeUnderlineStyle) {
  17493. RangeUnderlineStyle.none="None";
  17494. RangeUnderlineStyle.single="Single";
  17495. RangeUnderlineStyle.double="Double";
  17496. RangeUnderlineStyle.singleAccountant="SingleAccountant";
  17497. RangeUnderlineStyle.doubleAccountant="DoubleAccountant";
  17498. })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={}));
  17499. var SheetVisibility;
  17500. (function (SheetVisibility) {
  17501. SheetVisibility.visible="Visible";
  17502. SheetVisibility.hidden="Hidden";
  17503. SheetVisibility.veryHidden="VeryHidden";
  17504. })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={}));
  17505. var RangeValueType;
  17506. (function (RangeValueType) {
  17507. RangeValueType.unknown="Unknown";
  17508. RangeValueType.empty="Empty";
  17509. RangeValueType.string="String";
  17510. RangeValueType.integer="Integer";
  17511. RangeValueType.double="Double";
  17512. RangeValueType.boolean="Boolean";
  17513. RangeValueType.error="Error";
  17514. })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={}));
  17515. var SortOrientation;
  17516. (function (SortOrientation) {
  17517. SortOrientation.rows="Rows";
  17518. SortOrientation.columns="Columns";
  17519. })(SortOrientation=Excel.SortOrientation || (Excel.SortOrientation={}));
  17520. var SortOn;
  17521. (function (SortOn) {
  17522. SortOn.value="Value";
  17523. SortOn.cellColor="CellColor";
  17524. SortOn.fontColor="FontColor";
  17525. SortOn.icon="Icon";
  17526. })(SortOn=Excel.SortOn || (Excel.SortOn={}));
  17527. var SortDataOption;
  17528. (function (SortDataOption) {
  17529. SortDataOption.normal="Normal";
  17530. SortDataOption.textAsNumber="TextAsNumber";
  17531. })(SortDataOption=Excel.SortDataOption || (Excel.SortDataOption={}));
  17532. var SortMethod;
  17533. (function (SortMethod) {
  17534. SortMethod.pinYin="PinYin";
  17535. SortMethod.strokeCount="StrokeCount";
  17536. })(SortMethod=Excel.SortMethod || (Excel.SortMethod={}));
  17537. var VerticalAlignment;
  17538. (function (VerticalAlignment) {
  17539. VerticalAlignment.top="Top";
  17540. VerticalAlignment.center="Center";
  17541. VerticalAlignment.bottom="Bottom";
  17542. VerticalAlignment.justify="Justify";
  17543. VerticalAlignment.distributed="Distributed";
  17544. })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={}));
  17545. var FunctionResult=(function (_super) {
  17546. __extends(FunctionResult, _super);
  17547. function FunctionResult() {
  17548. _super.apply(this, arguments);
  17549. }
  17550. Object.defineProperty(FunctionResult.prototype, "error", {
  17551. get: function () {
  17552. _throwIfNotLoaded("error", this.m_error, "FunctionResult", this._isNull);
  17553. return this.m_error;
  17554. },
  17555. enumerable: true,
  17556. configurable: true
  17557. });
  17558. Object.defineProperty(FunctionResult.prototype, "value", {
  17559. get: function () {
  17560. _throwIfNotLoaded("value", this.m_value, "FunctionResult", this._isNull);
  17561. return this.m_value;
  17562. },
  17563. enumerable: true,
  17564. configurable: true
  17565. });
  17566. FunctionResult.prototype._handleResult=function (value) {
  17567. _super.prototype._handleResult.call(this, value);
  17568. if (_isNullOrUndefined(value))
  17569. return;
  17570. var obj=value;
  17571. _fixObjectPathIfNecessary(this, obj);
  17572. if (!_isUndefined(obj["Error"])) {
  17573. this.m_error=obj["Error"];
  17574. }
  17575. if (!_isUndefined(obj["Value"])) {
  17576. this.m_value=obj["Value"];
  17577. }
  17578. };
  17579. FunctionResult.prototype.load=function (option) {
  17580. _load(this, option);
  17581. return this;
  17582. };
  17583. FunctionResult.prototype.toJSON=function () {
  17584. return {
  17585. "error": this.m_error,
  17586. "value": this.m_value
  17587. };
  17588. };
  17589. return FunctionResult;
  17590. }(OfficeExtension.ClientObject));
  17591. Excel.FunctionResult=FunctionResult;
  17592. var Functions=(function (_super) {
  17593. __extends(Functions, _super);
  17594. function Functions() {
  17595. _super.apply(this, arguments);
  17596. }
  17597. Functions.prototype.abs=function (number) {
  17598. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Abs", OfficeExtension.OperationType.Default, [number], false, true, null));
  17599. };
  17600. Functions.prototype.accrInt=function (issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod) {
  17601. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrInt", OfficeExtension.OperationType.Default, [issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod], false, true, null));
  17602. };
  17603. Functions.prototype.accrIntM=function (issue, settlement, rate, par, basis) {
  17604. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrIntM", OfficeExtension.OperationType.Default, [issue, settlement, rate, par, basis], false, true, null));
  17605. };
  17606. Functions.prototype.acos=function (number) {
  17607. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acos", OfficeExtension.OperationType.Default, [number], false, true, null));
  17608. };
  17609. Functions.prototype.acosh=function (number) {
  17610. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  17611. };
  17612. Functions.prototype.acot=function (number) {
  17613. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acot", OfficeExtension.OperationType.Default, [number], false, true, null));
  17614. };
  17615. Functions.prototype.acoth=function (number) {
  17616. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acoth", OfficeExtension.OperationType.Default, [number], false, true, null));
  17617. };
  17618. Functions.prototype.amorDegrc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  17619. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorDegrc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  17620. };
  17621. Functions.prototype.amorLinc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  17622. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorLinc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  17623. };
  17624. Functions.prototype.and=function () {
  17625. var values=[];
  17626. for (var _i=0; _i < arguments.length; _i++) {
  17627. values[_i - 0]=arguments[_i];
  17628. }
  17629. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "And", OfficeExtension.OperationType.Default, [values], false, true, null));
  17630. };
  17631. Functions.prototype.arabic=function (text) {
  17632. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Arabic", OfficeExtension.OperationType.Default, [text], false, true, null));
  17633. };
  17634. Functions.prototype.areas=function (reference) {
  17635. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Areas", OfficeExtension.OperationType.Default, [reference], false, true, null));
  17636. };
  17637. Functions.prototype.asc=function (text) {
  17638. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asc", OfficeExtension.OperationType.Default, [text], false, true, null));
  17639. };
  17640. Functions.prototype.asin=function (number) {
  17641. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asin", OfficeExtension.OperationType.Default, [number], false, true, null));
  17642. };
  17643. Functions.prototype.asinh=function (number) {
  17644. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  17645. };
  17646. Functions.prototype.atan=function (number) {
  17647. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan", OfficeExtension.OperationType.Default, [number], false, true, null));
  17648. };
  17649. Functions.prototype.atan2=function (xNum, yNum) {
  17650. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan2", OfficeExtension.OperationType.Default, [xNum, yNum], false, true, null));
  17651. };
  17652. Functions.prototype.atanh=function (number) {
  17653. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  17654. };
  17655. Functions.prototype.aveDev=function () {
  17656. var values=[];
  17657. for (var _i=0; _i < arguments.length; _i++) {
  17658. values[_i - 0]=arguments[_i];
  17659. }
  17660. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AveDev", OfficeExtension.OperationType.Default, [values], false, true, null));
  17661. };
  17662. Functions.prototype.average=function () {
  17663. var values=[];
  17664. for (var _i=0; _i < arguments.length; _i++) {
  17665. values[_i - 0]=arguments[_i];
  17666. }
  17667. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Average", OfficeExtension.OperationType.Default, [values], false, true, null));
  17668. };
  17669. Functions.prototype.averageA=function () {
  17670. var values=[];
  17671. for (var _i=0; _i < arguments.length; _i++) {
  17672. values[_i - 0]=arguments[_i];
  17673. }
  17674. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageA", OfficeExtension.OperationType.Default, [values], false, true, null));
  17675. };
  17676. Functions.prototype.averageIf=function (range, criteria, averageRange) {
  17677. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIf", OfficeExtension.OperationType.Default, [range, criteria, averageRange], false, true, null));
  17678. };
  17679. Functions.prototype.averageIfs=function (averageRange) {
  17680. var values=[];
  17681. for (var _i=1; _i < arguments.length; _i++) {
  17682. values[_i - 1]=arguments[_i];
  17683. }
  17684. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIfs", OfficeExtension.OperationType.Default, [averageRange, values], false, true, null));
  17685. };
  17686. Functions.prototype.bahtText=function (number) {
  17687. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BahtText", OfficeExtension.OperationType.Default, [number], false, true, null));
  17688. };
  17689. Functions.prototype.base=function (number, radix, minLength) {
  17690. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Base", OfficeExtension.OperationType.Default, [number, radix, minLength], false, true, null));
  17691. };
  17692. Functions.prototype.besselI=function (x, n) {
  17693. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselI", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  17694. };
  17695. Functions.prototype.besselJ=function (x, n) {
  17696. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselJ", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  17697. };
  17698. Functions.prototype.besselK=function (x, n) {
  17699. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselK", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  17700. };
  17701. Functions.prototype.besselY=function (x, n) {
  17702. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselY", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  17703. };
  17704. Functions.prototype.beta_Dist=function (x, alpha, beta, cumulative, A, B) {
  17705. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative, A, B], false, true, null));
  17706. };
  17707. Functions.prototype.beta_Inv=function (probability, alpha, beta, A, B) {
  17708. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta, A, B], false, true, null));
  17709. };
  17710. Functions.prototype.bin2Dec=function (number) {
  17711. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  17712. };
  17713. Functions.prototype.bin2Hex=function (number, places) {
  17714. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17715. };
  17716. Functions.prototype.bin2Oct=function (number, places) {
  17717. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17718. };
  17719. Functions.prototype.binom_Dist=function (numberS, trials, probabilityS, cumulative) {
  17720. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist", OfficeExtension.OperationType.Default, [numberS, trials, probabilityS, cumulative], false, true, null));
  17721. };
  17722. Functions.prototype.binom_Dist_Range=function (trials, probabilityS, numberS, numberS2) {
  17723. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist_Range", OfficeExtension.OperationType.Default, [trials, probabilityS, numberS, numberS2], false, true, null));
  17724. };
  17725. Functions.prototype.binom_Inv=function (trials, probabilityS, alpha) {
  17726. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Inv", OfficeExtension.OperationType.Default, [trials, probabilityS, alpha], false, true, null));
  17727. };
  17728. Functions.prototype.bitand=function (number1, number2) {
  17729. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitand", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  17730. };
  17731. Functions.prototype.bitlshift=function (number, shiftAmount) {
  17732. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitlshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  17733. };
  17734. Functions.prototype.bitor=function (number1, number2) {
  17735. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  17736. };
  17737. Functions.prototype.bitrshift=function (number, shiftAmount) {
  17738. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitrshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  17739. };
  17740. Functions.prototype.bitxor=function (number1, number2) {
  17741. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitxor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  17742. };
  17743. Functions.prototype.ceiling_Math=function (number, significance, mode) {
  17744. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  17745. };
  17746. Functions.prototype.ceiling_Precise=function (number, significance) {
  17747. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  17748. };
  17749. Functions.prototype.char=function (number) {
  17750. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Char", OfficeExtension.OperationType.Default, [number], false, true, null));
  17751. };
  17752. Functions.prototype.chiSq_Dist=function (x, degFreedom, cumulative) {
  17753. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  17754. };
  17755. Functions.prototype.chiSq_Dist_RT=function (x, degFreedom) {
  17756. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  17757. };
  17758. Functions.prototype.chiSq_Inv=function (probability, degFreedom) {
  17759. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  17760. };
  17761. Functions.prototype.chiSq_Inv_RT=function (probability, degFreedom) {
  17762. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  17763. };
  17764. Functions.prototype.choose=function (indexNum) {
  17765. var values=[];
  17766. for (var _i=1; _i < arguments.length; _i++) {
  17767. values[_i - 1]=arguments[_i];
  17768. }
  17769. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Choose", OfficeExtension.OperationType.Default, [indexNum, values], false, true, null));
  17770. };
  17771. Functions.prototype.clean=function (text) {
  17772. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Clean", OfficeExtension.OperationType.Default, [text], false, true, null));
  17773. };
  17774. Functions.prototype.code=function (text) {
  17775. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Code", OfficeExtension.OperationType.Default, [text], false, true, null));
  17776. };
  17777. Functions.prototype.columns=function (array) {
  17778. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Columns", OfficeExtension.OperationType.Default, [array], false, true, null));
  17779. };
  17780. Functions.prototype.combin=function (number, numberChosen) {
  17781. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combin", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  17782. };
  17783. Functions.prototype.combina=function (number, numberChosen) {
  17784. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combina", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  17785. };
  17786. Functions.prototype.complex=function (realNum, iNum, suffix) {
  17787. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Complex", OfficeExtension.OperationType.Default, [realNum, iNum, suffix], false, true, null));
  17788. };
  17789. Functions.prototype.concatenate=function () {
  17790. var values=[];
  17791. for (var _i=0; _i < arguments.length; _i++) {
  17792. values[_i - 0]=arguments[_i];
  17793. }
  17794. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Concatenate", OfficeExtension.OperationType.Default, [values], false, true, null));
  17795. };
  17796. Functions.prototype.confidence_Norm=function (alpha, standardDev, size) {
  17797. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_Norm", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  17798. };
  17799. Functions.prototype.confidence_T=function (alpha, standardDev, size) {
  17800. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_T", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  17801. };
  17802. Functions.prototype.convert=function (number, fromUnit, toUnit) {
  17803. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Convert", OfficeExtension.OperationType.Default, [number, fromUnit, toUnit], false, true, null));
  17804. };
  17805. Functions.prototype.cos=function (number) {
  17806. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cos", OfficeExtension.OperationType.Default, [number], false, true, null));
  17807. };
  17808. Functions.prototype.cosh=function (number) {
  17809. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  17810. };
  17811. Functions.prototype.cot=function (number) {
  17812. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cot", OfficeExtension.OperationType.Default, [number], false, true, null));
  17813. };
  17814. Functions.prototype.coth=function (number) {
  17815. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Coth", OfficeExtension.OperationType.Default, [number], false, true, null));
  17816. };
  17817. Functions.prototype.count=function () {
  17818. var values=[];
  17819. for (var _i=0; _i < arguments.length; _i++) {
  17820. values[_i - 0]=arguments[_i];
  17821. }
  17822. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Count", OfficeExtension.OperationType.Default, [values], false, true, null));
  17823. };
  17824. Functions.prototype.countA=function () {
  17825. var values=[];
  17826. for (var _i=0; _i < arguments.length; _i++) {
  17827. values[_i - 0]=arguments[_i];
  17828. }
  17829. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountA", OfficeExtension.OperationType.Default, [values], false, true, null));
  17830. };
  17831. Functions.prototype.countBlank=function (range) {
  17832. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountBlank", OfficeExtension.OperationType.Default, [range], false, true, null));
  17833. };
  17834. Functions.prototype.countIf=function (range, criteria) {
  17835. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIf", OfficeExtension.OperationType.Default, [range, criteria], false, true, null));
  17836. };
  17837. Functions.prototype.countIfs=function () {
  17838. var values=[];
  17839. for (var _i=0; _i < arguments.length; _i++) {
  17840. values[_i - 0]=arguments[_i];
  17841. }
  17842. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIfs", OfficeExtension.OperationType.Default, [values], false, true, null));
  17843. };
  17844. Functions.prototype.coupDayBs=function (settlement, maturity, frequency, basis) {
  17845. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDayBs", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17846. };
  17847. Functions.prototype.coupDays=function (settlement, maturity, frequency, basis) {
  17848. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDays", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17849. };
  17850. Functions.prototype.coupDaysNc=function (settlement, maturity, frequency, basis) {
  17851. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDaysNc", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17852. };
  17853. Functions.prototype.coupNcd=function (settlement, maturity, frequency, basis) {
  17854. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17855. };
  17856. Functions.prototype.coupNum=function (settlement, maturity, frequency, basis) {
  17857. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNum", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17858. };
  17859. Functions.prototype.coupPcd=function (settlement, maturity, frequency, basis) {
  17860. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupPcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17861. };
  17862. Functions.prototype.csc=function (number) {
  17863. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csc", OfficeExtension.OperationType.Default, [number], false, true, null));
  17864. };
  17865. Functions.prototype.csch=function (number) {
  17866. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csch", OfficeExtension.OperationType.Default, [number], false, true, null));
  17867. };
  17868. Functions.prototype.cumIPmt=function (rate, nper, pv, startPeriod, endPeriod, type) {
  17869. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumIPmt", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  17870. };
  17871. Functions.prototype.cumPrinc=function (rate, nper, pv, startPeriod, endPeriod, type) {
  17872. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumPrinc", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  17873. };
  17874. Functions.prototype.daverage=function (database, field, criteria) {
  17875. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DAverage", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17876. };
  17877. Functions.prototype.dcount=function (database, field, criteria) {
  17878. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCount", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17879. };
  17880. Functions.prototype.dcountA=function (database, field, criteria) {
  17881. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCountA", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17882. };
  17883. Functions.prototype.dget=function (database, field, criteria) {
  17884. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DGet", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17885. };
  17886. Functions.prototype.dmax=function (database, field, criteria) {
  17887. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMax", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17888. };
  17889. Functions.prototype.dmin=function (database, field, criteria) {
  17890. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMin", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17891. };
  17892. Functions.prototype.dproduct=function (database, field, criteria) {
  17893. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DProduct", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17894. };
  17895. Functions.prototype.dstDev=function (database, field, criteria) {
  17896. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDev", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17897. };
  17898. Functions.prototype.dstDevP=function (database, field, criteria) {
  17899. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDevP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17900. };
  17901. Functions.prototype.dsum=function (database, field, criteria) {
  17902. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DSum", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17903. };
  17904. Functions.prototype.dvar=function (database, field, criteria) {
  17905. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVar", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17906. };
  17907. Functions.prototype.dvarP=function (database, field, criteria) {
  17908. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVarP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17909. };
  17910. Functions.prototype.date=function (year, month, day) {
  17911. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Date", OfficeExtension.OperationType.Default, [year, month, day], false, true, null));
  17912. };
  17913. Functions.prototype.datevalue=function (dateText) {
  17914. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Datevalue", OfficeExtension.OperationType.Default, [dateText], false, true, null));
  17915. };
  17916. Functions.prototype.day=function (serialNumber) {
  17917. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Day", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  17918. };
  17919. Functions.prototype.days=function (endDate, startDate) {
  17920. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days", OfficeExtension.OperationType.Default, [endDate, startDate], false, true, null));
  17921. };
  17922. Functions.prototype.days360=function (startDate, endDate, method) {
  17923. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days360", OfficeExtension.OperationType.Default, [startDate, endDate, method], false, true, null));
  17924. };
  17925. Functions.prototype.db=function (cost, salvage, life, period, month) {
  17926. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Db", OfficeExtension.OperationType.Default, [cost, salvage, life, period, month], false, true, null));
  17927. };
  17928. Functions.prototype.dbcs=function (text) {
  17929. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dbcs", OfficeExtension.OperationType.Default, [text], false, true, null));
  17930. };
  17931. Functions.prototype.ddb=function (cost, salvage, life, period, factor) {
  17932. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ddb", OfficeExtension.OperationType.Default, [cost, salvage, life, period, factor], false, true, null));
  17933. };
  17934. Functions.prototype.dec2Bin=function (number, places) {
  17935. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17936. };
  17937. Functions.prototype.dec2Hex=function (number, places) {
  17938. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17939. };
  17940. Functions.prototype.dec2Oct=function (number, places) {
  17941. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17942. };
  17943. Functions.prototype.decimal=function (number, radix) {
  17944. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Decimal", OfficeExtension.OperationType.Default, [number, radix], false, true, null));
  17945. };
  17946. Functions.prototype.degrees=function (angle) {
  17947. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Degrees", OfficeExtension.OperationType.Default, [angle], false, true, null));
  17948. };
  17949. Functions.prototype.delta=function (number1, number2) {
  17950. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Delta", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  17951. };
  17952. Functions.prototype.devSq=function () {
  17953. var values=[];
  17954. for (var _i=0; _i < arguments.length; _i++) {
  17955. values[_i - 0]=arguments[_i];
  17956. }
  17957. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DevSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  17958. };
  17959. Functions.prototype.disc=function (settlement, maturity, pr, redemption, basis) {
  17960. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Disc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  17961. };
  17962. Functions.prototype.dollar=function (number, decimals) {
  17963. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  17964. };
  17965. Functions.prototype.dollarDe=function (fractionalDollar, fraction) {
  17966. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarDe", OfficeExtension.OperationType.Default, [fractionalDollar, fraction], false, true, null));
  17967. };
  17968. Functions.prototype.dollarFr=function (decimalDollar, fraction) {
  17969. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarFr", OfficeExtension.OperationType.Default, [decimalDollar, fraction], false, true, null));
  17970. };
  17971. Functions.prototype.duration=function (settlement, maturity, coupon, yld, frequency, basis) {
  17972. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Duration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  17973. };
  17974. Functions.prototype.ecma_Ceiling=function (number, significance) {
  17975. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ECMA_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  17976. };
  17977. Functions.prototype.edate=function (startDate, months) {
  17978. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EDate", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  17979. };
  17980. Functions.prototype.effect=function (nominalRate, npery) {
  17981. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Effect", OfficeExtension.OperationType.Default, [nominalRate, npery], false, true, null));
  17982. };
  17983. Functions.prototype.eoMonth=function (startDate, months) {
  17984. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EoMonth", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  17985. };
  17986. Functions.prototype.erf=function (lowerLimit, upperLimit) {
  17987. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf", OfficeExtension.OperationType.Default, [lowerLimit, upperLimit], false, true, null));
  17988. };
  17989. Functions.prototype.erfC=function (x) {
  17990. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC", OfficeExtension.OperationType.Default, [x], false, true, null));
  17991. };
  17992. Functions.prototype.erfC_Precise=function (X) {
  17993. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  17994. };
  17995. Functions.prototype.erf_Precise=function (X) {
  17996. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  17997. };
  17998. Functions.prototype.error_Type=function (errorVal) {
  17999. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Error_Type", OfficeExtension.OperationType.Default, [errorVal], false, true, null));
  18000. };
  18001. Functions.prototype.even=function (number) {
  18002. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Even", OfficeExtension.OperationType.Default, [number], false, true, null));
  18003. };
  18004. Functions.prototype.exact=function (text1, text2) {
  18005. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exact", OfficeExtension.OperationType.Default, [text1, text2], false, true, null));
  18006. };
  18007. Functions.prototype.exp=function (number) {
  18008. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exp", OfficeExtension.OperationType.Default, [number], false, true, null));
  18009. };
  18010. Functions.prototype.expon_Dist=function (x, lambda, cumulative) {
  18011. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Expon_Dist", OfficeExtension.OperationType.Default, [x, lambda, cumulative], false, true, null));
  18012. };
  18013. Functions.prototype.fvschedule=function (principal, schedule) {
  18014. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FVSchedule", OfficeExtension.OperationType.Default, [principal, schedule], false, true, null));
  18015. };
  18016. Functions.prototype.f_Dist=function (x, degFreedom1, degFreedom2, cumulative) {
  18017. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2, cumulative], false, true, null));
  18018. };
  18019. Functions.prototype.f_Dist_RT=function (x, degFreedom1, degFreedom2) {
  18020. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2], false, true, null));
  18021. };
  18022. Functions.prototype.f_Inv=function (probability, degFreedom1, degFreedom2) {
  18023. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  18024. };
  18025. Functions.prototype.f_Inv_RT=function (probability, degFreedom1, degFreedom2) {
  18026. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  18027. };
  18028. Functions.prototype.fact=function (number) {
  18029. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fact", OfficeExtension.OperationType.Default, [number], false, true, null));
  18030. };
  18031. Functions.prototype.factDouble=function (number) {
  18032. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FactDouble", OfficeExtension.OperationType.Default, [number], false, true, null));
  18033. };
  18034. Functions.prototype.false=function () {
  18035. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "False", OfficeExtension.OperationType.Default, [], false, true, null));
  18036. };
  18037. Functions.prototype.find=function (findText, withinText, startNum) {
  18038. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Find", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  18039. };
  18040. Functions.prototype.findB=function (findText, withinText, startNum) {
  18041. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FindB", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  18042. };
  18043. Functions.prototype.fisher=function (x) {
  18044. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fisher", OfficeExtension.OperationType.Default, [x], false, true, null));
  18045. };
  18046. Functions.prototype.fisherInv=function (y) {
  18047. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FisherInv", OfficeExtension.OperationType.Default, [y], false, true, null));
  18048. };
  18049. Functions.prototype.fixed=function (number, decimals, noCommas) {
  18050. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fixed", OfficeExtension.OperationType.Default, [number, decimals, noCommas], false, true, null));
  18051. };
  18052. Functions.prototype.floor_Math=function (number, significance, mode) {
  18053. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  18054. };
  18055. Functions.prototype.floor_Precise=function (number, significance) {
  18056. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  18057. };
  18058. Functions.prototype.fv=function (rate, nper, pmt, pv, type) {
  18059. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fv", OfficeExtension.OperationType.Default, [rate, nper, pmt, pv, type], false, true, null));
  18060. };
  18061. Functions.prototype.gamma=function (x) {
  18062. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma", OfficeExtension.OperationType.Default, [x], false, true, null));
  18063. };
  18064. Functions.prototype.gammaLn=function (x) {
  18065. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn", OfficeExtension.OperationType.Default, [x], false, true, null));
  18066. };
  18067. Functions.prototype.gammaLn_Precise=function (x) {
  18068. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn_Precise", OfficeExtension.OperationType.Default, [x], false, true, null));
  18069. };
  18070. Functions.prototype.gamma_Dist=function (x, alpha, beta, cumulative) {
  18071. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  18072. };
  18073. Functions.prototype.gamma_Inv=function (probability, alpha, beta) {
  18074. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta], false, true, null));
  18075. };
  18076. Functions.prototype.gauss=function (x) {
  18077. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gauss", OfficeExtension.OperationType.Default, [x], false, true, null));
  18078. };
  18079. Functions.prototype.gcd=function () {
  18080. var values=[];
  18081. for (var _i=0; _i < arguments.length; _i++) {
  18082. values[_i - 0]=arguments[_i];
  18083. }
  18084. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gcd", OfficeExtension.OperationType.Default, [values], false, true, null));
  18085. };
  18086. Functions.prototype.geStep=function (number, step) {
  18087. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeStep", OfficeExtension.OperationType.Default, [number, step], false, true, null));
  18088. };
  18089. Functions.prototype.geoMean=function () {
  18090. var values=[];
  18091. for (var _i=0; _i < arguments.length; _i++) {
  18092. values[_i - 0]=arguments[_i];
  18093. }
  18094. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeoMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  18095. };
  18096. Functions.prototype.hlookup=function (lookupValue, tableArray, rowIndexNum, rangeLookup) {
  18097. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, rowIndexNum, rangeLookup], false, true, null));
  18098. };
  18099. Functions.prototype.harMean=function () {
  18100. var values=[];
  18101. for (var _i=0; _i < arguments.length; _i++) {
  18102. values[_i - 0]=arguments[_i];
  18103. }
  18104. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HarMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  18105. };
  18106. Functions.prototype.hex2Bin=function (number, places) {
  18107. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  18108. };
  18109. Functions.prototype.hex2Dec=function (number) {
  18110. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  18111. };
  18112. Functions.prototype.hex2Oct=function (number, places) {
  18113. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  18114. };
  18115. Functions.prototype.hour=function (serialNumber) {
  18116. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hour", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18117. };
  18118. Functions.prototype.hypGeom_Dist=function (sampleS, numberSample, populationS, numberPop, cumulative) {
  18119. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HypGeom_Dist", OfficeExtension.OperationType.Default, [sampleS, numberSample, populationS, numberPop, cumulative], false, true, null));
  18120. };
  18121. Functions.prototype.hyperlink=function (linkLocation, friendlyName) {
  18122. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hyperlink", OfficeExtension.OperationType.Default, [linkLocation, friendlyName], false, true, null));
  18123. };
  18124. Functions.prototype.iso_Ceiling=function (number, significance) {
  18125. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ISO_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  18126. };
  18127. Functions.prototype.if=function (logicalTest, valueIfTrue, valueIfFalse) {
  18128. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "If", OfficeExtension.OperationType.Default, [logicalTest, valueIfTrue, valueIfFalse], false, true, null));
  18129. };
  18130. Functions.prototype.imAbs=function (inumber) {
  18131. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImAbs", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18132. };
  18133. Functions.prototype.imArgument=function (inumber) {
  18134. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImArgument", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18135. };
  18136. Functions.prototype.imConjugate=function (inumber) {
  18137. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImConjugate", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18138. };
  18139. Functions.prototype.imCos=function (inumber) {
  18140. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCos", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18141. };
  18142. Functions.prototype.imCosh=function (inumber) {
  18143. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCosh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18144. };
  18145. Functions.prototype.imCot=function (inumber) {
  18146. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCot", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18147. };
  18148. Functions.prototype.imCsc=function (inumber) {
  18149. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsc", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18150. };
  18151. Functions.prototype.imCsch=function (inumber) {
  18152. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsch", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18153. };
  18154. Functions.prototype.imDiv=function (inumber1, inumber2) {
  18155. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImDiv", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  18156. };
  18157. Functions.prototype.imExp=function (inumber) {
  18158. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImExp", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18159. };
  18160. Functions.prototype.imLn=function (inumber) {
  18161. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLn", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18162. };
  18163. Functions.prototype.imLog10=function (inumber) {
  18164. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog10", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18165. };
  18166. Functions.prototype.imLog2=function (inumber) {
  18167. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog2", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18168. };
  18169. Functions.prototype.imPower=function (inumber, number) {
  18170. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImPower", OfficeExtension.OperationType.Default, [inumber, number], false, true, null));
  18171. };
  18172. Functions.prototype.imProduct=function () {
  18173. var values=[];
  18174. for (var _i=0; _i < arguments.length; _i++) {
  18175. values[_i - 0]=arguments[_i];
  18176. }
  18177. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImProduct", OfficeExtension.OperationType.Default, [values], false, true, null));
  18178. };
  18179. Functions.prototype.imReal=function (inumber) {
  18180. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImReal", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18181. };
  18182. Functions.prototype.imSec=function (inumber) {
  18183. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSec", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18184. };
  18185. Functions.prototype.imSech=function (inumber) {
  18186. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSech", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18187. };
  18188. Functions.prototype.imSin=function (inumber) {
  18189. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSin", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18190. };
  18191. Functions.prototype.imSinh=function (inumber) {
  18192. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSinh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18193. };
  18194. Functions.prototype.imSqrt=function (inumber) {
  18195. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSqrt", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18196. };
  18197. Functions.prototype.imSub=function (inumber1, inumber2) {
  18198. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSub", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  18199. };
  18200. Functions.prototype.imSum=function () {
  18201. var values=[];
  18202. for (var _i=0; _i < arguments.length; _i++) {
  18203. values[_i - 0]=arguments[_i];
  18204. }
  18205. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSum", OfficeExtension.OperationType.Default, [values], false, true, null));
  18206. };
  18207. Functions.prototype.imTan=function (inumber) {
  18208. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImTan", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18209. };
  18210. Functions.prototype.imaginary=function (inumber) {
  18211. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Imaginary", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18212. };
  18213. Functions.prototype.int=function (number) {
  18214. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Int", OfficeExtension.OperationType.Default, [number], false, true, null));
  18215. };
  18216. Functions.prototype.intRate=function (settlement, maturity, investment, redemption, basis) {
  18217. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IntRate", OfficeExtension.OperationType.Default, [settlement, maturity, investment, redemption, basis], false, true, null));
  18218. };
  18219. Functions.prototype.ipmt=function (rate, per, nper, pv, fv, type) {
  18220. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ipmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  18221. };
  18222. Functions.prototype.irr=function (values, guess) {
  18223. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Irr", OfficeExtension.OperationType.Default, [values, guess], false, true, null));
  18224. };
  18225. Functions.prototype.isErr=function (value) {
  18226. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsErr", OfficeExtension.OperationType.Default, [value], false, true, null));
  18227. };
  18228. Functions.prototype.isError=function (value) {
  18229. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsError", OfficeExtension.OperationType.Default, [value], false, true, null));
  18230. };
  18231. Functions.prototype.isEven=function (number) {
  18232. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsEven", OfficeExtension.OperationType.Default, [number], false, true, null));
  18233. };
  18234. Functions.prototype.isFormula=function (reference) {
  18235. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsFormula", OfficeExtension.OperationType.Default, [reference], false, true, null));
  18236. };
  18237. Functions.prototype.isLogical=function (value) {
  18238. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsLogical", OfficeExtension.OperationType.Default, [value], false, true, null));
  18239. };
  18240. Functions.prototype.isNA=function (value) {
  18241. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNA", OfficeExtension.OperationType.Default, [value], false, true, null));
  18242. };
  18243. Functions.prototype.isNonText=function (value) {
  18244. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNonText", OfficeExtension.OperationType.Default, [value], false, true, null));
  18245. };
  18246. Functions.prototype.isNumber=function (value) {
  18247. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNumber", OfficeExtension.OperationType.Default, [value], false, true, null));
  18248. };
  18249. Functions.prototype.isOdd=function (number) {
  18250. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsOdd", OfficeExtension.OperationType.Default, [number], false, true, null));
  18251. };
  18252. Functions.prototype.isText=function (value) {
  18253. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsText", OfficeExtension.OperationType.Default, [value], false, true, null));
  18254. };
  18255. Functions.prototype.isoWeekNum=function (date) {
  18256. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsoWeekNum", OfficeExtension.OperationType.Default, [date], false, true, null));
  18257. };
  18258. Functions.prototype.ispmt=function (rate, per, nper, pv) {
  18259. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ispmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv], false, true, null));
  18260. };
  18261. Functions.prototype.isref=function (value) {
  18262. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Isref", OfficeExtension.OperationType.Default, [value], false, true, null));
  18263. };
  18264. Functions.prototype.kurt=function () {
  18265. var values=[];
  18266. for (var _i=0; _i < arguments.length; _i++) {
  18267. values[_i - 0]=arguments[_i];
  18268. }
  18269. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Kurt", OfficeExtension.OperationType.Default, [values], false, true, null));
  18270. };
  18271. Functions.prototype.large=function (array, k) {
  18272. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Large", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  18273. };
  18274. Functions.prototype.lcm=function () {
  18275. var values=[];
  18276. for (var _i=0; _i < arguments.length; _i++) {
  18277. values[_i - 0]=arguments[_i];
  18278. }
  18279. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lcm", OfficeExtension.OperationType.Default, [values], false, true, null));
  18280. };
  18281. Functions.prototype.left=function (text, numChars) {
  18282. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Left", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  18283. };
  18284. Functions.prototype.leftb=function (text, numBytes) {
  18285. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Leftb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  18286. };
  18287. Functions.prototype.len=function (text) {
  18288. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Len", OfficeExtension.OperationType.Default, [text], false, true, null));
  18289. };
  18290. Functions.prototype.lenb=function (text) {
  18291. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lenb", OfficeExtension.OperationType.Default, [text], false, true, null));
  18292. };
  18293. Functions.prototype.ln=function (number) {
  18294. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ln", OfficeExtension.OperationType.Default, [number], false, true, null));
  18295. };
  18296. Functions.prototype.log=function (number, base) {
  18297. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log", OfficeExtension.OperationType.Default, [number, base], false, true, null));
  18298. };
  18299. Functions.prototype.log10=function (number) {
  18300. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log10", OfficeExtension.OperationType.Default, [number], false, true, null));
  18301. };
  18302. Functions.prototype.logNorm_Dist=function (x, mean, standardDev, cumulative) {
  18303. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  18304. };
  18305. Functions.prototype.logNorm_Inv=function (probability, mean, standardDev) {
  18306. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  18307. };
  18308. Functions.prototype.lookup=function (lookupValue, lookupVector, resultVector) {
  18309. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lookup", OfficeExtension.OperationType.Default, [lookupValue, lookupVector, resultVector], false, true, null));
  18310. };
  18311. Functions.prototype.lower=function (text) {
  18312. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lower", OfficeExtension.OperationType.Default, [text], false, true, null));
  18313. };
  18314. Functions.prototype.mduration=function (settlement, maturity, coupon, yld, frequency, basis) {
  18315. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MDuration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  18316. };
  18317. Functions.prototype.mirr=function (values, financeRate, reinvestRate) {
  18318. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MIrr", OfficeExtension.OperationType.Default, [values, financeRate, reinvestRate], false, true, null));
  18319. };
  18320. Functions.prototype.mround=function (number, multiple) {
  18321. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MRound", OfficeExtension.OperationType.Default, [number, multiple], false, true, null));
  18322. };
  18323. Functions.prototype.match=function (lookupValue, lookupArray, matchType) {
  18324. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Match", OfficeExtension.OperationType.Default, [lookupValue, lookupArray, matchType], false, true, null));
  18325. };
  18326. Functions.prototype.max=function () {
  18327. var values=[];
  18328. for (var _i=0; _i < arguments.length; _i++) {
  18329. values[_i - 0]=arguments[_i];
  18330. }
  18331. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Max", OfficeExtension.OperationType.Default, [values], false, true, null));
  18332. };
  18333. Functions.prototype.maxA=function () {
  18334. var values=[];
  18335. for (var _i=0; _i < arguments.length; _i++) {
  18336. values[_i - 0]=arguments[_i];
  18337. }
  18338. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MaxA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18339. };
  18340. Functions.prototype.median=function () {
  18341. var values=[];
  18342. for (var _i=0; _i < arguments.length; _i++) {
  18343. values[_i - 0]=arguments[_i];
  18344. }
  18345. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Median", OfficeExtension.OperationType.Default, [values], false, true, null));
  18346. };
  18347. Functions.prototype.mid=function (text, startNum, numChars) {
  18348. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mid", OfficeExtension.OperationType.Default, [text, startNum, numChars], false, true, null));
  18349. };
  18350. Functions.prototype.midb=function (text, startNum, numBytes) {
  18351. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Midb", OfficeExtension.OperationType.Default, [text, startNum, numBytes], false, true, null));
  18352. };
  18353. Functions.prototype.min=function () {
  18354. var values=[];
  18355. for (var _i=0; _i < arguments.length; _i++) {
  18356. values[_i - 0]=arguments[_i];
  18357. }
  18358. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Min", OfficeExtension.OperationType.Default, [values], false, true, null));
  18359. };
  18360. Functions.prototype.minA=function () {
  18361. var values=[];
  18362. for (var _i=0; _i < arguments.length; _i++) {
  18363. values[_i - 0]=arguments[_i];
  18364. }
  18365. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MinA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18366. };
  18367. Functions.prototype.minute=function (serialNumber) {
  18368. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Minute", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18369. };
  18370. Functions.prototype.mod=function (number, divisor) {
  18371. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mod", OfficeExtension.OperationType.Default, [number, divisor], false, true, null));
  18372. };
  18373. Functions.prototype.month=function (serialNumber) {
  18374. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Month", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18375. };
  18376. Functions.prototype.multiNomial=function () {
  18377. var values=[];
  18378. for (var _i=0; _i < arguments.length; _i++) {
  18379. values[_i - 0]=arguments[_i];
  18380. }
  18381. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MultiNomial", OfficeExtension.OperationType.Default, [values], false, true, null));
  18382. };
  18383. Functions.prototype.n=function (value) {
  18384. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "N", OfficeExtension.OperationType.Default, [value], false, true, null));
  18385. };
  18386. Functions.prototype.nper=function (rate, pmt, pv, fv, type) {
  18387. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NPer", OfficeExtension.OperationType.Default, [rate, pmt, pv, fv, type], false, true, null));
  18388. };
  18389. Functions.prototype.na=function () {
  18390. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Na", OfficeExtension.OperationType.Default, [], false, true, null));
  18391. };
  18392. Functions.prototype.negBinom_Dist=function (numberF, numberS, probabilityS, cumulative) {
  18393. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NegBinom_Dist", OfficeExtension.OperationType.Default, [numberF, numberS, probabilityS, cumulative], false, true, null));
  18394. };
  18395. Functions.prototype.networkDays=function (startDate, endDate, holidays) {
  18396. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays", OfficeExtension.OperationType.Default, [startDate, endDate, holidays], false, true, null));
  18397. };
  18398. Functions.prototype.networkDays_Intl=function (startDate, endDate, weekend, holidays) {
  18399. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays_Intl", OfficeExtension.OperationType.Default, [startDate, endDate, weekend, holidays], false, true, null));
  18400. };
  18401. Functions.prototype.nominal=function (effectRate, npery) {
  18402. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Nominal", OfficeExtension.OperationType.Default, [effectRate, npery], false, true, null));
  18403. };
  18404. Functions.prototype.norm_Dist=function (x, mean, standardDev, cumulative) {
  18405. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  18406. };
  18407. Functions.prototype.norm_Inv=function (probability, mean, standardDev) {
  18408. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  18409. };
  18410. Functions.prototype.norm_S_Dist=function (z, cumulative) {
  18411. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Dist", OfficeExtension.OperationType.Default, [z, cumulative], false, true, null));
  18412. };
  18413. Functions.prototype.norm_S_Inv=function (probability) {
  18414. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Inv", OfficeExtension.OperationType.Default, [probability], false, true, null));
  18415. };
  18416. Functions.prototype.not=function (logical) {
  18417. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Not", OfficeExtension.OperationType.Default, [logical], false, true, null));
  18418. };
  18419. Functions.prototype.now=function () {
  18420. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Now", OfficeExtension.OperationType.Default, [], false, true, null));
  18421. };
  18422. Functions.prototype.npv=function (rate) {
  18423. var values=[];
  18424. for (var _i=1; _i < arguments.length; _i++) {
  18425. values[_i - 1]=arguments[_i];
  18426. }
  18427. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Npv", OfficeExtension.OperationType.Default, [rate, values], false, true, null));
  18428. };
  18429. Functions.prototype.numberValue=function (text, decimalSeparator, groupSeparator) {
  18430. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NumberValue", OfficeExtension.OperationType.Default, [text, decimalSeparator, groupSeparator], false, true, null));
  18431. };
  18432. Functions.prototype.oct2Bin=function (number, places) {
  18433. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  18434. };
  18435. Functions.prototype.oct2Dec=function (number) {
  18436. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  18437. };
  18438. Functions.prototype.oct2Hex=function (number, places) {
  18439. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  18440. };
  18441. Functions.prototype.odd=function (number) {
  18442. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Odd", OfficeExtension.OperationType.Default, [number], false, true, null));
  18443. };
  18444. Functions.prototype.oddFPrice=function (settlement, maturity, issue, firstCoupon, rate, yld, redemption, frequency, basis) {
  18445. 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));
  18446. };
  18447. Functions.prototype.oddFYield=function (settlement, maturity, issue, firstCoupon, rate, pr, redemption, frequency, basis) {
  18448. 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));
  18449. };
  18450. Functions.prototype.oddLPrice=function (settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis) {
  18451. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLPrice", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis], false, true, null));
  18452. };
  18453. Functions.prototype.oddLYield=function (settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis) {
  18454. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLYield", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis], false, true, null));
  18455. };
  18456. Functions.prototype.or=function () {
  18457. var values=[];
  18458. for (var _i=0; _i < arguments.length; _i++) {
  18459. values[_i - 0]=arguments[_i];
  18460. }
  18461. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Or", OfficeExtension.OperationType.Default, [values], false, true, null));
  18462. };
  18463. Functions.prototype.pduration=function (rate, pv, fv) {
  18464. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PDuration", OfficeExtension.OperationType.Default, [rate, pv, fv], false, true, null));
  18465. };
  18466. Functions.prototype.percentRank_Exc=function (array, x, significance) {
  18467. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Exc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  18468. };
  18469. Functions.prototype.percentRank_Inc=function (array, x, significance) {
  18470. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Inc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  18471. };
  18472. Functions.prototype.percentile_Exc=function (array, k) {
  18473. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Exc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  18474. };
  18475. Functions.prototype.percentile_Inc=function (array, k) {
  18476. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Inc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  18477. };
  18478. Functions.prototype.permut=function (number, numberChosen) {
  18479. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permut", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  18480. };
  18481. Functions.prototype.permutationa=function (number, numberChosen) {
  18482. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permutationa", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  18483. };
  18484. Functions.prototype.phi=function (x) {
  18485. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Phi", OfficeExtension.OperationType.Default, [x], false, true, null));
  18486. };
  18487. Functions.prototype.pi=function () {
  18488. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pi", OfficeExtension.OperationType.Default, [], false, true, null));
  18489. };
  18490. Functions.prototype.pmt=function (rate, nper, pv, fv, type) {
  18491. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pmt", OfficeExtension.OperationType.Default, [rate, nper, pv, fv, type], false, true, null));
  18492. };
  18493. Functions.prototype.poisson_Dist=function (x, mean, cumulative) {
  18494. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Poisson_Dist", OfficeExtension.OperationType.Default, [x, mean, cumulative], false, true, null));
  18495. };
  18496. Functions.prototype.power=function (number, power) {
  18497. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Power", OfficeExtension.OperationType.Default, [number, power], false, true, null));
  18498. };
  18499. Functions.prototype.ppmt=function (rate, per, nper, pv, fv, type) {
  18500. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ppmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  18501. };
  18502. Functions.prototype.price=function (settlement, maturity, rate, yld, redemption, frequency, basis) {
  18503. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Price", OfficeExtension.OperationType.Default, [settlement, maturity, rate, yld, redemption, frequency, basis], false, true, null));
  18504. };
  18505. Functions.prototype.priceDisc=function (settlement, maturity, discount, redemption, basis) {
  18506. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceDisc", OfficeExtension.OperationType.Default, [settlement, maturity, discount, redemption, basis], false, true, null));
  18507. };
  18508. Functions.prototype.priceMat=function (settlement, maturity, issue, rate, yld, basis) {
  18509. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, yld, basis], false, true, null));
  18510. };
  18511. Functions.prototype.product=function () {
  18512. var values=[];
  18513. for (var _i=0; _i < arguments.length; _i++) {
  18514. values[_i - 0]=arguments[_i];
  18515. }
  18516. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Product", OfficeExtension.OperationType.Default, [values], false, true, null));
  18517. };
  18518. Functions.prototype.proper=function (text) {
  18519. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Proper", OfficeExtension.OperationType.Default, [text], false, true, null));
  18520. };
  18521. Functions.prototype.pv=function (rate, nper, pmt, fv, type) {
  18522. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pv", OfficeExtension.OperationType.Default, [rate, nper, pmt, fv, type], false, true, null));
  18523. };
  18524. Functions.prototype.quartile_Exc=function (array, quart) {
  18525. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Exc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  18526. };
  18527. Functions.prototype.quartile_Inc=function (array, quart) {
  18528. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Inc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  18529. };
  18530. Functions.prototype.quotient=function (numerator, denominator) {
  18531. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quotient", OfficeExtension.OperationType.Default, [numerator, denominator], false, true, null));
  18532. };
  18533. Functions.prototype.radians=function (angle) {
  18534. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Radians", OfficeExtension.OperationType.Default, [angle], false, true, null));
  18535. };
  18536. Functions.prototype.rand=function () {
  18537. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rand", OfficeExtension.OperationType.Default, [], false, true, null));
  18538. };
  18539. Functions.prototype.randBetween=function (bottom, top) {
  18540. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RandBetween", OfficeExtension.OperationType.Default, [bottom, top], false, true, null));
  18541. };
  18542. Functions.prototype.rank_Avg=function (number, ref, order) {
  18543. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Avg", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  18544. };
  18545. Functions.prototype.rank_Eq=function (number, ref, order) {
  18546. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Eq", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  18547. };
  18548. Functions.prototype.rate=function (nper, pmt, pv, fv, type, guess) {
  18549. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rate", OfficeExtension.OperationType.Default, [nper, pmt, pv, fv, type, guess], false, true, null));
  18550. };
  18551. Functions.prototype.received=function (settlement, maturity, investment, discount, basis) {
  18552. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Received", OfficeExtension.OperationType.Default, [settlement, maturity, investment, discount, basis], false, true, null));
  18553. };
  18554. Functions.prototype.replace=function (oldText, startNum, numChars, newText) {
  18555. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Replace", OfficeExtension.OperationType.Default, [oldText, startNum, numChars, newText], false, true, null));
  18556. };
  18557. Functions.prototype.replaceB=function (oldText, startNum, numBytes, newText) {
  18558. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ReplaceB", OfficeExtension.OperationType.Default, [oldText, startNum, numBytes, newText], false, true, null));
  18559. };
  18560. Functions.prototype.rept=function (text, numberTimes) {
  18561. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rept", OfficeExtension.OperationType.Default, [text, numberTimes], false, true, null));
  18562. };
  18563. Functions.prototype.right=function (text, numChars) {
  18564. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Right", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  18565. };
  18566. Functions.prototype.rightb=function (text, numBytes) {
  18567. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rightb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  18568. };
  18569. Functions.prototype.roman=function (number, form) {
  18570. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Roman", OfficeExtension.OperationType.Default, [number, form], false, true, null));
  18571. };
  18572. Functions.prototype.round=function (number, numDigits) {
  18573. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Round", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  18574. };
  18575. Functions.prototype.roundDown=function (number, numDigits) {
  18576. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundDown", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  18577. };
  18578. Functions.prototype.roundUp=function (number, numDigits) {
  18579. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundUp", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  18580. };
  18581. Functions.prototype.rows=function (array) {
  18582. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rows", OfficeExtension.OperationType.Default, [array], false, true, null));
  18583. };
  18584. Functions.prototype.rri=function (nper, pv, fv) {
  18585. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rri", OfficeExtension.OperationType.Default, [nper, pv, fv], false, true, null));
  18586. };
  18587. Functions.prototype.sec=function (number) {
  18588. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sec", OfficeExtension.OperationType.Default, [number], false, true, null));
  18589. };
  18590. Functions.prototype.sech=function (number) {
  18591. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sech", OfficeExtension.OperationType.Default, [number], false, true, null));
  18592. };
  18593. Functions.prototype.second=function (serialNumber) {
  18594. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Second", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18595. };
  18596. Functions.prototype.seriesSum=function (x, n, m, coefficients) {
  18597. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SeriesSum", OfficeExtension.OperationType.Default, [x, n, m, coefficients], false, true, null));
  18598. };
  18599. Functions.prototype.sheet=function (value) {
  18600. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheet", OfficeExtension.OperationType.Default, [value], false, true, null));
  18601. };
  18602. Functions.prototype.sheets=function (reference) {
  18603. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheets", OfficeExtension.OperationType.Default, [reference], false, true, null));
  18604. };
  18605. Functions.prototype.sign=function (number) {
  18606. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sign", OfficeExtension.OperationType.Default, [number], false, true, null));
  18607. };
  18608. Functions.prototype.sin=function (number) {
  18609. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sin", OfficeExtension.OperationType.Default, [number], false, true, null));
  18610. };
  18611. Functions.prototype.sinh=function (number) {
  18612. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  18613. };
  18614. Functions.prototype.skew=function () {
  18615. var values=[];
  18616. for (var _i=0; _i < arguments.length; _i++) {
  18617. values[_i - 0]=arguments[_i];
  18618. }
  18619. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew", OfficeExtension.OperationType.Default, [values], false, true, null));
  18620. };
  18621. Functions.prototype.skew_p=function () {
  18622. var values=[];
  18623. for (var _i=0; _i < arguments.length; _i++) {
  18624. values[_i - 0]=arguments[_i];
  18625. }
  18626. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew_p", OfficeExtension.OperationType.Default, [values], false, true, null));
  18627. };
  18628. Functions.prototype.sln=function (cost, salvage, life) {
  18629. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sln", OfficeExtension.OperationType.Default, [cost, salvage, life], false, true, null));
  18630. };
  18631. Functions.prototype.small=function (array, k) {
  18632. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Small", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  18633. };
  18634. Functions.prototype.sqrt=function (number) {
  18635. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sqrt", OfficeExtension.OperationType.Default, [number], false, true, null));
  18636. };
  18637. Functions.prototype.sqrtPi=function (number) {
  18638. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SqrtPi", OfficeExtension.OperationType.Default, [number], false, true, null));
  18639. };
  18640. Functions.prototype.stDevA=function () {
  18641. var values=[];
  18642. for (var _i=0; _i < arguments.length; _i++) {
  18643. values[_i - 0]=arguments[_i];
  18644. }
  18645. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18646. };
  18647. Functions.prototype.stDevPA=function () {
  18648. var values=[];
  18649. for (var _i=0; _i < arguments.length; _i++) {
  18650. values[_i - 0]=arguments[_i];
  18651. }
  18652. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18653. };
  18654. Functions.prototype.stDev_P=function () {
  18655. var values=[];
  18656. for (var _i=0; _i < arguments.length; _i++) {
  18657. values[_i - 0]=arguments[_i];
  18658. }
  18659. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  18660. };
  18661. Functions.prototype.stDev_S=function () {
  18662. var values=[];
  18663. for (var _i=0; _i < arguments.length; _i++) {
  18664. values[_i - 0]=arguments[_i];
  18665. }
  18666. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  18667. };
  18668. Functions.prototype.standardize=function (x, mean, standardDev) {
  18669. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Standardize", OfficeExtension.OperationType.Default, [x, mean, standardDev], false, true, null));
  18670. };
  18671. Functions.prototype.substitute=function (text, oldText, newText, instanceNum) {
  18672. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Substitute", OfficeExtension.OperationType.Default, [text, oldText, newText, instanceNum], false, true, null));
  18673. };
  18674. Functions.prototype.subtotal=function (functionNum) {
  18675. var values=[];
  18676. for (var _i=1; _i < arguments.length; _i++) {
  18677. values[_i - 1]=arguments[_i];
  18678. }
  18679. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Subtotal", OfficeExtension.OperationType.Default, [functionNum, values], false, true, null));
  18680. };
  18681. Functions.prototype.sum=function () {
  18682. var values=[];
  18683. for (var _i=0; _i < arguments.length; _i++) {
  18684. values[_i - 0]=arguments[_i];
  18685. }
  18686. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sum", OfficeExtension.OperationType.Default, [values], false, true, null));
  18687. };
  18688. Functions.prototype.sumIf=function (range, criteria, sumRange) {
  18689. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIf", OfficeExtension.OperationType.Default, [range, criteria, sumRange], false, true, null));
  18690. };
  18691. Functions.prototype.sumIfs=function (sumRange) {
  18692. var values=[];
  18693. for (var _i=1; _i < arguments.length; _i++) {
  18694. values[_i - 1]=arguments[_i];
  18695. }
  18696. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIfs", OfficeExtension.OperationType.Default, [sumRange, values], false, true, null));
  18697. };
  18698. Functions.prototype.sumSq=function () {
  18699. var values=[];
  18700. for (var _i=0; _i < arguments.length; _i++) {
  18701. values[_i - 0]=arguments[_i];
  18702. }
  18703. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  18704. };
  18705. Functions.prototype.syd=function (cost, salvage, life, per) {
  18706. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Syd", OfficeExtension.OperationType.Default, [cost, salvage, life, per], false, true, null));
  18707. };
  18708. Functions.prototype.t=function (value) {
  18709. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T", OfficeExtension.OperationType.Default, [value], false, true, null));
  18710. };
  18711. Functions.prototype.tbillEq=function (settlement, maturity, discount) {
  18712. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillEq", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  18713. };
  18714. Functions.prototype.tbillPrice=function (settlement, maturity, discount) {
  18715. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillPrice", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  18716. };
  18717. Functions.prototype.tbillYield=function (settlement, maturity, pr) {
  18718. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillYield", OfficeExtension.OperationType.Default, [settlement, maturity, pr], false, true, null));
  18719. };
  18720. Functions.prototype.t_Dist=function (x, degFreedom, cumulative) {
  18721. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  18722. };
  18723. Functions.prototype.t_Dist_2T=function (x, degFreedom) {
  18724. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_2T", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  18725. };
  18726. Functions.prototype.t_Dist_RT=function (x, degFreedom) {
  18727. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  18728. };
  18729. Functions.prototype.t_Inv=function (probability, degFreedom) {
  18730. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  18731. };
  18732. Functions.prototype.t_Inv_2T=function (probability, degFreedom) {
  18733. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv_2T", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  18734. };
  18735. Functions.prototype.tan=function (number) {
  18736. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tan", OfficeExtension.OperationType.Default, [number], false, true, null));
  18737. };
  18738. Functions.prototype.tanh=function (number) {
  18739. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  18740. };
  18741. Functions.prototype.text=function (value, formatText) {
  18742. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Text", OfficeExtension.OperationType.Default, [value, formatText], false, true, null));
  18743. };
  18744. Functions.prototype.time=function (hour, minute, second) {
  18745. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Time", OfficeExtension.OperationType.Default, [hour, minute, second], false, true, null));
  18746. };
  18747. Functions.prototype.timevalue=function (timeText) {
  18748. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Timevalue", OfficeExtension.OperationType.Default, [timeText], false, true, null));
  18749. };
  18750. Functions.prototype.today=function () {
  18751. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Today", OfficeExtension.OperationType.Default, [], false, true, null));
  18752. };
  18753. Functions.prototype.trim=function (text) {
  18754. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trim", OfficeExtension.OperationType.Default, [text], false, true, null));
  18755. };
  18756. Functions.prototype.trimMean=function (array, percent) {
  18757. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TrimMean", OfficeExtension.OperationType.Default, [array, percent], false, true, null));
  18758. };
  18759. Functions.prototype.true=function () {
  18760. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "True", OfficeExtension.OperationType.Default, [], false, true, null));
  18761. };
  18762. Functions.prototype.trunc=function (number, numDigits) {
  18763. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trunc", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  18764. };
  18765. Functions.prototype.type=function (value) {
  18766. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Type", OfficeExtension.OperationType.Default, [value], false, true, null));
  18767. };
  18768. Functions.prototype.usdollar=function (number, decimals) {
  18769. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "USDollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  18770. };
  18771. Functions.prototype.unichar=function (number) {
  18772. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unichar", OfficeExtension.OperationType.Default, [number], false, true, null));
  18773. };
  18774. Functions.prototype.unicode=function (text) {
  18775. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unicode", OfficeExtension.OperationType.Default, [text], false, true, null));
  18776. };
  18777. Functions.prototype.upper=function (text) {
  18778. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Upper", OfficeExtension.OperationType.Default, [text], false, true, null));
  18779. };
  18780. Functions.prototype.vlookup=function (lookupValue, tableArray, colIndexNum, rangeLookup) {
  18781. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, colIndexNum, rangeLookup], false, true, null));
  18782. };
  18783. Functions.prototype.value=function (text) {
  18784. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Value", OfficeExtension.OperationType.Default, [text], false, true, null));
  18785. };
  18786. Functions.prototype.varA=function () {
  18787. var values=[];
  18788. for (var _i=0; _i < arguments.length; _i++) {
  18789. values[_i - 0]=arguments[_i];
  18790. }
  18791. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18792. };
  18793. Functions.prototype.varPA=function () {
  18794. var values=[];
  18795. for (var _i=0; _i < arguments.length; _i++) {
  18796. values[_i - 0]=arguments[_i];
  18797. }
  18798. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18799. };
  18800. Functions.prototype.var_P=function () {
  18801. var values=[];
  18802. for (var _i=0; _i < arguments.length; _i++) {
  18803. values[_i - 0]=arguments[_i];
  18804. }
  18805. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  18806. };
  18807. Functions.prototype.var_S=function () {
  18808. var values=[];
  18809. for (var _i=0; _i < arguments.length; _i++) {
  18810. values[_i - 0]=arguments[_i];
  18811. }
  18812. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  18813. };
  18814. Functions.prototype.vdb=function (cost, salvage, life, startPeriod, endPeriod, factor, noSwitch) {
  18815. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Vdb", OfficeExtension.OperationType.Default, [cost, salvage, life, startPeriod, endPeriod, factor, noSwitch], false, true, null));
  18816. };
  18817. Functions.prototype.weekNum=function (serialNumber, returnType) {
  18818. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WeekNum", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  18819. };
  18820. Functions.prototype.weekday=function (serialNumber, returnType) {
  18821. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weekday", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  18822. };
  18823. Functions.prototype.weibull_Dist=function (x, alpha, beta, cumulative) {
  18824. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weibull_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  18825. };
  18826. Functions.prototype.workDay=function (startDate, days, holidays) {
  18827. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay", OfficeExtension.OperationType.Default, [startDate, days, holidays], false, true, null));
  18828. };
  18829. Functions.prototype.workDay_Intl=function (startDate, days, weekend, holidays) {
  18830. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay_Intl", OfficeExtension.OperationType.Default, [startDate, days, weekend, holidays], false, true, null));
  18831. };
  18832. Functions.prototype.xirr=function (values, dates, guess) {
  18833. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xirr", OfficeExtension.OperationType.Default, [values, dates, guess], false, true, null));
  18834. };
  18835. Functions.prototype.xnpv=function (rate, values, dates) {
  18836. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xnpv", OfficeExtension.OperationType.Default, [rate, values, dates], false, true, null));
  18837. };
  18838. Functions.prototype.xor=function () {
  18839. var values=[];
  18840. for (var _i=0; _i < arguments.length; _i++) {
  18841. values[_i - 0]=arguments[_i];
  18842. }
  18843. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xor", OfficeExtension.OperationType.Default, [values], false, true, null));
  18844. };
  18845. Functions.prototype.year=function (serialNumber) {
  18846. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Year", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18847. };
  18848. Functions.prototype.yearFrac=function (startDate, endDate, basis) {
  18849. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YearFrac", OfficeExtension.OperationType.Default, [startDate, endDate, basis], false, true, null));
  18850. };
  18851. Functions.prototype.yield=function (settlement, maturity, rate, pr, redemption, frequency, basis) {
  18852. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Yield", OfficeExtension.OperationType.Default, [settlement, maturity, rate, pr, redemption, frequency, basis], false, true, null));
  18853. };
  18854. Functions.prototype.yieldDisc=function (settlement, maturity, pr, redemption, basis) {
  18855. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldDisc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  18856. };
  18857. Functions.prototype.yieldMat=function (settlement, maturity, issue, rate, pr, basis) {
  18858. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, pr, basis], false, true, null));
  18859. };
  18860. Functions.prototype.z_Test=function (array, x, sigma) {
  18861. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Z_Test", OfficeExtension.OperationType.Default, [array, x, sigma], false, true, null));
  18862. };
  18863. Functions.prototype._handleResult=function (value) {
  18864. _super.prototype._handleResult.call(this, value);
  18865. if (_isNullOrUndefined(value))
  18866. return;
  18867. var obj=value;
  18868. _fixObjectPathIfNecessary(this, obj);
  18869. };
  18870. Functions.prototype.toJSON=function () {
  18871. return {};
  18872. };
  18873. return Functions;
  18874. }(OfficeExtension.ClientObject));
  18875. Excel.Functions=Functions;
  18876. var ErrorCodes;
  18877. (function (ErrorCodes) {
  18878. ErrorCodes.accessDenied="AccessDenied";
  18879. ErrorCodes.apiNotFound="ApiNotFound";
  18880. ErrorCodes.generalException="GeneralException";
  18881. ErrorCodes.insertDeleteConflict="InsertDeleteConflict";
  18882. ErrorCodes.invalidArgument="InvalidArgument";
  18883. ErrorCodes.invalidBinding="InvalidBinding";
  18884. ErrorCodes.invalidOperation="InvalidOperation";
  18885. ErrorCodes.invalidReference="InvalidReference";
  18886. ErrorCodes.invalidSelection="InvalidSelection";
  18887. ErrorCodes.itemAlreadyExists="ItemAlreadyExists";
  18888. ErrorCodes.itemNotFound="ItemNotFound";
  18889. ErrorCodes.notImplemented="NotImplemented";
  18890. ErrorCodes.unsupportedOperation="UnsupportedOperation";
  18891. })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={}));
  18892. })(Excel || (Excel={}));
  18893. var Excel;
  18894. (function (Excel) {
  18895. var RequestContext=(function (_super) {
  18896. __extends(RequestContext, _super);
  18897. function RequestContext(url) {
  18898. _super.call(this, url);
  18899. this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this));
  18900. this._rootObject=this.m_workbook;
  18901. }
  18902. Object.defineProperty(RequestContext.prototype, "workbook", {
  18903. get: function () {
  18904. return this.m_workbook;
  18905. },
  18906. enumerable: true,
  18907. configurable: true
  18908. });
  18909. return RequestContext;
  18910. }(OfficeExtension.ClientRequestContext));
  18911. Excel.RequestContext=RequestContext;
  18912. function run(arg1, arg2, arg3) {
  18913. return OfficeExtension.ClientRequestContext._runBatch("Excel.run", arguments, function (requestInfo) {
  18914. var ret=new Excel.RequestContext(requestInfo ? requestInfo.url : null);
  18915. if (requestInfo && requestInfo.headers) {
  18916. for (var name in requestInfo.headers) {
  18917. ret.requestHeaders[name]=requestInfo.headers[name];
  18918. }
  18919. }
  18920. return ret;
  18921. });
  18922. }
  18923. Excel.run=run;
  18924. })(Excel || (Excel={}));
  18925. var Excel;
  18926. (function (Excel) {
  18927. Excel._RedirectV1APIs=false;
  18928. Excel._V1APIMap={
  18929. "GetDataAsync": {
  18930. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetData(callArgs); },
  18931. postprocess: getDataCommonPostprocess
  18932. },
  18933. "GetSelectedDataAsync": {
  18934. call: function (ctx, callArgs) { return ctx.workbook._V1Api.getSelectedData(callArgs); },
  18935. postprocess: getDataCommonPostprocess
  18936. },
  18937. "GoToByIdAsync": {
  18938. call: function (ctx, callArgs) { return ctx.workbook._V1Api.gotoById(callArgs); }
  18939. },
  18940. "AddColumnsAsync": {
  18941. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddColumns(callArgs); }
  18942. },
  18943. "AddFromSelectionAsync": {
  18944. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromSelection(callArgs); },
  18945. postprocess: postprocessBindingDescriptor
  18946. },
  18947. "AddFromNamedItemAsync": {
  18948. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromNamedItem(callArgs); },
  18949. postprocess: postprocessBindingDescriptor
  18950. },
  18951. "AddFromPromptAsync": {
  18952. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromPrompt(callArgs); },
  18953. postprocess: postprocessBindingDescriptor
  18954. },
  18955. "AddRowsAsync": {
  18956. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddRows(callArgs); }
  18957. },
  18958. "GetByIdAsync": {
  18959. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetById(callArgs); },
  18960. postprocess: postprocessBindingDescriptor
  18961. },
  18962. "ReleaseByIdAsync": {
  18963. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingReleaseById(callArgs); }
  18964. },
  18965. "GetAllAsync": {
  18966. call: function (ctx) { return ctx.workbook._V1Api.bindingGetAll(); },
  18967. postprocess: function (response) {
  18968. return response.bindings.map(function (descriptor) { return postprocessBindingDescriptor(descriptor); });
  18969. }
  18970. },
  18971. "DeleteAllDataValuesAsync": {
  18972. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingDeleteAllDataValues(callArgs); }
  18973. },
  18974. "SetSelectedDataAsync": {
  18975. preprocess: function (callArgs) {
  18976. var preimage=callArgs["cellFormat"];
  18977. if (window.OSF.DDA.SafeArray) {
  18978. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  18979. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  18980. }
  18981. }
  18982. else if (window.OSF.DDA.WAC) {
  18983. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  18984. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  18985. }
  18986. }
  18987. return callArgs;
  18988. },
  18989. call: function (ctx, callArgs) { return ctx.workbook._V1Api.setSelectedData(callArgs); }
  18990. },
  18991. "SetDataAsync": {
  18992. preprocess: function (callArgs) {
  18993. var preimage=callArgs["cellFormat"];
  18994. if (window.OSF.DDA.SafeArray) {
  18995. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  18996. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  18997. }
  18998. }
  18999. else if (window.OSF.DDA.WAC) {
  19000. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  19001. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  19002. }
  19003. }
  19004. return callArgs;
  19005. },
  19006. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetData(callArgs); }
  19007. },
  19008. "SetFormatsAsync": {
  19009. preprocess: function (callArgs) {
  19010. var preimage=callArgs["cellFormat"];
  19011. if (window.OSF.DDA.SafeArray) {
  19012. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  19013. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  19014. }
  19015. }
  19016. else if (window.OSF.DDA.WAC) {
  19017. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  19018. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  19019. }
  19020. }
  19021. return callArgs;
  19022. },
  19023. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetFormats(callArgs); }
  19024. },
  19025. "SetTableOptionsAsync": {
  19026. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetTableOptions(callArgs); }
  19027. },
  19028. "ClearFormatsAsync": {
  19029. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingClearFormats(callArgs); }
  19030. },
  19031. };
  19032. function postprocessBindingDescriptor(response) {
  19033. var bindingDescriptor={
  19034. BindingColumnCount: response.bindingColumnCount,
  19035. BindingId: response.bindingId,
  19036. BindingRowCount: response.bindingRowCount,
  19037. bindingType: response.bindingType,
  19038. HasHeaders: response.hasHeaders
  19039. };
  19040. return window.OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, window.Microsoft.Office.WebExtension.context.document);
  19041. }
  19042. function getDataCommonPostprocess(response, callArgs) {
  19043. var isPlainData=response.headers==null;
  19044. var data;
  19045. if (isPlainData) {
  19046. data=response.rows;
  19047. }
  19048. else {
  19049. data=response;
  19050. }
  19051. data=window.OSF.DDA.DataCoercion.coerceData(data, callArgs[window.Microsoft.Office.WebExtension.Parameters.CoercionType]);
  19052. return data==undefined ? null : data;
  19053. }
  19054. })(Excel || (Excel={}));