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

excel-win32-16.00.debug.js 379KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507
  1. /* Excel specific API library */
  2. /* Version: 16.0.6216.3006 */
  3. /*
  4. Copyright (c) Microsoft Corporation. All rights reserved.
  5. */
  6. /*
  7. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  8. */
  9. /*
  10. * @overview es6-promise - a tiny implementation of Promises/A+.
  11. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  12. * @license Licensed under MIT license
  13. * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
  14. * @version 2.3.0
  15. */
  16. var __extends=this.__extends || function (d, b) {
  17. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  18. function __() { this.constructor=d; }
  19. __.prototype=b.prototype;
  20. d.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' && Sys.StringBuilder && typeof (Sys.StringBuilder)==="function" && Type.registerNamespace && typeof (Type.registerNamespace)==="function" && Type.registerClass && typeof (Type.registerClass)==="function" && typeof (Function._validateParams)==="function") {
  29. return true;
  30. } else {
  31. return false;
  32. }
  33. };
  34. MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function (callback) {
  35. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js';
  36. OSF.OUtil.loadScript(msAjaxCDNPath, callback);
  37. };
  38. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", {
  39. get: function () {
  40. if (this._msAjaxError==null && this.isMsAjaxLoaded()) {
  41. this._msAjaxError=Error;
  42. }
  43. return this._msAjaxError;
  44. },
  45. set: function (errorClass) {
  46. this._msAjaxError=errorClass;
  47. },
  48. enumerable: true,
  49. configurable: true
  50. });
  51. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxSerializer", {
  52. get: function () {
  53. if (this._msAjaxSerializer==null && this.isMsAjaxLoaded()) {
  54. this._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;
  55. }
  56. return this._msAjaxSerializer;
  57. },
  58. set: function (serializerClass) {
  59. this._msAjaxSerializer=serializerClass;
  60. },
  61. enumerable: true,
  62. configurable: true
  63. });
  64. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", {
  65. get: function () {
  66. if (this._msAjaxString==null && this.isMsAjaxLoaded()) {
  67. this._msAjaxSerializer=String;
  68. }
  69. return this._msAjaxString;
  70. },
  71. set: function (stringClass) {
  72. this._msAjaxString=stringClass;
  73. },
  74. enumerable: true,
  75. configurable: true
  76. });
  77. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", {
  78. get: function () {
  79. if (this._msAjaxDebug==null && this.isMsAjaxLoaded()) {
  80. this._msAjaxDebug=Sys.Debug;
  81. }
  82. return this._msAjaxDebug;
  83. },
  84. set: function (debugClass) {
  85. this._msAjaxDebug=debugClass;
  86. },
  87. enumerable: true,
  88. configurable: true
  89. });
  90. return MicrosoftAjaxFactory;
  91. })();
  92. OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory;
  93. })(OfficeExt || (OfficeExt={}));
  94. var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory();
  95. var OSF=OSF || {};
  96. var OfficeExt;
  97. (function (OfficeExt) {
  98. var SafeStorage=(function () {
  99. function SafeStorage(_internalStorage) {
  100. this._internalStorage=_internalStorage;
  101. }
  102. SafeStorage.prototype.getItem=function (key) {
  103. try {
  104. return this._internalStorage && this._internalStorage.getItem(key);
  105. } catch (e) {
  106. return null;
  107. }
  108. };
  109. SafeStorage.prototype.setItem=function (key, data) {
  110. try {
  111. this._internalStorage && this._internalStorage.setItem(key, data);
  112. } catch (e) {
  113. }
  114. };
  115. SafeStorage.prototype.clear=function () {
  116. try {
  117. this._internalStorage && this._internalStorage.clear();
  118. } catch (e) {
  119. }
  120. };
  121. SafeStorage.prototype.removeItem=function (key) {
  122. try {
  123. this._internalStorage && this._internalStorage.removeItem(key);
  124. } catch (e) {
  125. }
  126. };
  127. SafeStorage.prototype.getKeysWithPrefix=function (keyPrefix) {
  128. var keyList=[];
  129. try {
  130. var len=this._internalStorage && this._internalStorage.length || 0;
  131. for (var i=0; i < len; i++) {
  132. var key=this._internalStorage.key(i);
  133. if (key.indexOf(keyPrefix)===0) {
  134. keyList.push(key);
  135. }
  136. }
  137. } catch (e) {
  138. }
  139. return keyList;
  140. };
  141. return SafeStorage;
  142. })();
  143. OfficeExt.SafeStorage=SafeStorage;
  144. })(OfficeExt || (OfficeExt={}));
  145. OSF.OUtil=(function () {
  146. var _uniqueId=-1;
  147. var _xdmInfoKey='&_xdm_Info=';
  148. var _serializerVersionKey='&_serializer_version=';
  149. var _xdmSessionKeyPrefix='_xdm_';
  150. var _serializerVersionKeyPrefix='_serializer_version=';
  151. var _fragmentSeparator='#';
  152. var _loadedScripts={};
  153. var _defaultScriptLoadingTimeout=30000;
  154. var _safeSessionStorage=null;
  155. var _safeLocalStorage=null;
  156. var _rndentropy=new Date().getTime();
  157. function _random() {
  158. var nextrand=0x7fffffff * (Math.random());
  159. nextrand ^=_rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10)));
  160. return nextrand.toString(16);
  161. }
  162. ;
  163. function _getSessionStorage() {
  164. if (!_safeSessionStorage) {
  165. try {
  166. var sessionStorage=window.sessionStorage;
  167. } catch (ex) {
  168. sessionStorage=null;
  169. }
  170. _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage);
  171. }
  172. return _safeSessionStorage;
  173. }
  174. ;
  175. return {
  176. set_entropy: function OSF_OUtil$set_entropy(entropy) {
  177. if (typeof entropy=="string") {
  178. for (var i=0; i < entropy.length; i+=4) {
  179. var temp=0;
  180. for (var j=0; j < 4 && i+j < entropy.length; j++) {
  181. temp=(temp << 8)+entropy.charCodeAt(i+j);
  182. }
  183. _rndentropy ^=temp;
  184. }
  185. } else if (typeof entropy=="number") {
  186. _rndentropy ^=entropy;
  187. } else {
  188. _rndentropy ^=0x7fffffff * Math.random();
  189. }
  190. _rndentropy &=0x7fffffff;
  191. },
  192. extend: function OSF_OUtil$extend(child, parent) {
  193. var F=function () {
  194. };
  195. F.prototype=parent.prototype;
  196. child.prototype=new F();
  197. child.prototype.constructor=child;
  198. child.uber=parent.prototype;
  199. if (parent.prototype.constructor===Object.prototype.constructor) {
  200. parent.prototype.constructor=parent;
  201. }
  202. },
  203. setNamespace: function OSF_OUtil$setNamespace(name, parent) {
  204. if (parent && name && !parent[name]) {
  205. parent[name]={};
  206. }
  207. },
  208. unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) {
  209. if (parent && name && parent[name]) {
  210. delete parent[name];
  211. }
  212. },
  213. loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) {
  214. if (url && callback) {
  215. var doc=window.document;
  216. var _loadedScriptEntry=_loadedScripts[url];
  217. if (!_loadedScriptEntry) {
  218. var script=doc.createElement("script");
  219. script.type="text/javascript";
  220. _loadedScriptEntry={ loaded: false, pendingCallbacks: [callback], timer: null };
  221. _loadedScripts[url]=_loadedScriptEntry;
  222. var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback() {
  223. if (_loadedScriptEntry.timer !=null) {
  224. clearTimeout(_loadedScriptEntry.timer);
  225. delete _loadedScriptEntry.timer;
  226. }
  227. _loadedScriptEntry.loaded=true;
  228. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  229. for (var i=0; i < pendingCallbackCount; i++) {
  230. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  231. currentCallback();
  232. }
  233. };
  234. var onLoadError=function OSF_OUtil_loadScript$onLoadError() {
  235. delete _loadedScripts[url];
  236. if (_loadedScriptEntry.timer !=null) {
  237. clearTimeout(_loadedScriptEntry.timer);
  238. delete _loadedScriptEntry.timer;
  239. }
  240. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  241. for (var i=0; i < pendingCallbackCount; i++) {
  242. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  243. currentCallback();
  244. }
  245. };
  246. if (script.readyState) {
  247. script.onreadystatechange=function () {
  248. if (script.readyState=="loaded" || script.readyState=="complete") {
  249. script.onreadystatechange=null;
  250. onLoadCallback();
  251. }
  252. };
  253. } else {
  254. script.onload=onLoadCallback;
  255. }
  256. script.onerror=onLoadError;
  257. timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout;
  258. _loadedScriptEntry.timer=setTimeout(onLoadError, timeoutInMs);
  259. script.src=url;
  260. doc.getElementsByTagName("head")[0].appendChild(script);
  261. } else if (_loadedScriptEntry.loaded) {
  262. callback();
  263. } else {
  264. _loadedScriptEntry.pendingCallbacks.push(callback);
  265. }
  266. }
  267. },
  268. loadCSS: function OSF_OUtil$loadCSS(url) {
  269. if (url) {
  270. var doc=window.document;
  271. var link=doc.createElement("link");
  272. link.type="text/css";
  273. link.rel="stylesheet";
  274. link.href=url;
  275. doc.getElementsByTagName("head")[0].appendChild(link);
  276. }
  277. },
  278. parseEnum: function OSF_OUtil$parseEnum(str, enumObject) {
  279. var parsed=enumObject[str.trim()];
  280. if (typeof (parsed)=='undefined') {
  281. OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str);
  282. throw OsfMsAjaxFactory.msAjaxError.argument("str");
  283. }
  284. return parsed;
  285. },
  286. delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() {
  287. var obj={ calc: arguments[0] };
  288. return function () {
  289. if (obj.calc) {
  290. obj.val=obj.calc.apply(this, arguments);
  291. delete obj.calc;
  292. }
  293. return obj.val;
  294. };
  295. },
  296. getUniqueId: function OSF_OUtil$getUniqueId() {
  297. _uniqueId=_uniqueId+1;
  298. return _uniqueId.toString();
  299. },
  300. formatString: function OSF_OUtil$formatString() {
  301. var args=arguments;
  302. var source=args[0];
  303. return source.replace(/{(\d+)}/gm, function (match, number) {
  304. var index=parseInt(number, 10)+1;
  305. return args[index]===undefined ? '{'+number+'}' : args[index];
  306. });
  307. },
  308. generateConversationId: function OSF_OUtil$generateConversationId() {
  309. return [_random(), _random(), (new Date()).getTime().toString()].join('_');
  310. },
  311. getFrameNameAndConversationId: function OSF_OUtil$getFrameNameAndConversationId(cacheKey, frame) {
  312. var frameName=_xdmSessionKeyPrefix+cacheKey+this.generateConversationId();
  313. frame.setAttribute("name", frameName);
  314. return this.generateConversationId();
  315. },
  316. addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) {
  317. return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue);
  318. },
  319. addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) {
  320. return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion);
  321. },
  322. addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue) {
  323. url=url.trim() || '';
  324. var urlParts=url.split(_fragmentSeparator);
  325. var urlWithoutFragment=urlParts.shift();
  326. var fragment=urlParts.join(_fragmentSeparator);
  327. return [urlWithoutFragment, _fragmentSeparator, fragment, keyName, infoValue].join('');
  328. },
  329. parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) {
  330. return OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash);
  331. },
  332. parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) {
  333. return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, skipSessionStorage, fragment);
  334. },
  335. parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) {
  336. return OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash);
  337. },
  338. parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) {
  339. return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, skipSessionStorage, fragment));
  340. },
  341. parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, skipSessionStorage, fragment) {
  342. var fragmentParts=fragment.split(infoKey);
  343. var xdmInfoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null;
  344. var osfSessionStorage=_getSessionStorage();
  345. if (!skipSessionStorage && osfSessionStorage) {
  346. var sessionKeyStart=window.name.indexOf(infoKeyPrefix);
  347. if (sessionKeyStart > -1) {
  348. var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart);
  349. if (sessionKeyEnd==-1) {
  350. sessionKeyEnd=window.name.length;
  351. }
  352. var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd);
  353. if (xdmInfoValue) {
  354. osfSessionStorage.setItem(sessionKey, xdmInfoValue);
  355. } else {
  356. xdmInfoValue=osfSessionStorage.getItem(sessionKey);
  357. }
  358. }
  359. }
  360. return xdmInfoValue;
  361. },
  362. getConversationId: function OSF_OUtil$getConversationId() {
  363. var searchString=window.location.search;
  364. var conversationId=null;
  365. if (searchString) {
  366. var index=searchString.indexOf("&");
  367. conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1);
  368. if (conversationId && conversationId.charAt(conversationId.length - 1)==='=') {
  369. conversationId=conversationId.substring(0, conversationId.length - 1);
  370. if (conversationId) {
  371. conversationId=decodeURIComponent(conversationId);
  372. }
  373. }
  374. }
  375. return conversationId;
  376. },
  377. getInfoItems: function OSF_OUtil$getInfoItems(strInfo) {
  378. var items=strInfo.split("$");
  379. if (typeof items[1]=="undefined") {
  380. items=strInfo.split("|");
  381. }
  382. return items;
  383. },
  384. getConversationUrl: function OSF_OUtil$getConversationUrl() {
  385. var conversationUrl='';
  386. var xdmInfoValue=OSF.OUtil.parseXdmInfo(true);
  387. if (xdmInfoValue) {
  388. var items=OSF.OUtil.getInfoItems(xdmInfoValue);
  389. if (items !=undefined && items.length >=3) {
  390. conversationUrl=items[2];
  391. }
  392. }
  393. return conversationUrl;
  394. },
  395. validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) {
  396. var e=Function._validateParams(arguments, [
  397. { name: "params", type: Object, mayBeNull: false },
  398. { name: "expectedProperties", type: Object, mayBeNull: false },
  399. { name: "callback", type: Function, mayBeNull: true }
  400. ]);
  401. if (e)
  402. throw e;
  403. for (var p in expectedProperties) {
  404. e=Function._validateParameter(params[p], expectedProperties[p], p);
  405. if (e)
  406. throw e;
  407. }
  408. },
  409. writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) {
  410. if (window.msWriteProfilerMark) {
  411. window.msWriteProfilerMark(text);
  412. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  413. }
  414. },
  415. outputDebug: function OSF_OUtil$outputDebug(text) {
  416. if (typeof (Sys) !=='undefined' && Sys && Sys.Debug) {
  417. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  418. }
  419. },
  420. defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) {
  421. descriptor=descriptor || {};
  422. for (var nd in attributes) {
  423. var attribute=attributes[nd];
  424. if (descriptor[attribute]==undefined) {
  425. descriptor[attribute]=true;
  426. }
  427. }
  428. Object.defineProperty(obj, prop, descriptor);
  429. return obj;
  430. },
  431. defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) {
  432. descriptors=descriptors || {};
  433. for (var prop in descriptors) {
  434. OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes);
  435. }
  436. return obj;
  437. },
  438. defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) {
  439. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]);
  440. },
  441. defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) {
  442. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]);
  443. },
  444. defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) {
  445. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]);
  446. },
  447. defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) {
  448. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]);
  449. },
  450. finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) {
  451. descriptor=descriptor || {};
  452. var props=Object.getOwnPropertyNames(obj);
  453. var propsLength=props.length;
  454. for (var i=0; i < propsLength; i++) {
  455. var prop=props[i];
  456. var desc=Object.getOwnPropertyDescriptor(obj, prop);
  457. if (!desc.get && !desc.set) {
  458. desc.writable=descriptor.writable || false;
  459. }
  460. desc.configurable=descriptor.configurable || false;
  461. desc.enumerable=descriptor.enumerable || true;
  462. Object.defineProperty(obj, prop, desc);
  463. }
  464. return obj;
  465. },
  466. mapList: function OSF_OUtil$MapList(list, mapFunction) {
  467. var ret=[];
  468. if (list) {
  469. for (var item in list) {
  470. ret.push(mapFunction(list[item]));
  471. }
  472. }
  473. return ret;
  474. },
  475. listContainsKey: function OSF_OUtil$listContainsKey(list, key) {
  476. for (var item in list) {
  477. if (key==item) {
  478. return true;
  479. }
  480. }
  481. return false;
  482. },
  483. listContainsValue: function OSF_OUtil$listContainsElement(list, value) {
  484. for (var item in list) {
  485. if (value==list[item]) {
  486. return true;
  487. }
  488. }
  489. return false;
  490. },
  491. augmentList: function OSF_OUtil$augmentList(list, addenda) {
  492. var add=list.push ? function (key, value) {
  493. list.push(value);
  494. } : function (key, value) {
  495. list[key]=value;
  496. };
  497. for (var key in addenda) {
  498. add(key, addenda[key]);
  499. }
  500. },
  501. redefineList: function OSF_Outil$redefineList(oldList, newList) {
  502. for (var key1 in oldList) {
  503. delete oldList[key1];
  504. }
  505. for (var key2 in newList) {
  506. oldList[key2]=newList[key2];
  507. }
  508. },
  509. isArray: function OSF_OUtil$isArray(obj) {
  510. return Object.prototype.toString.apply(obj)==="[object Array]";
  511. },
  512. isFunction: function OSF_OUtil$isFunction(obj) {
  513. return Object.prototype.toString.apply(obj)==="[object Function]";
  514. },
  515. isDate: function OSF_OUtil$isDate(obj) {
  516. return Object.prototype.toString.apply(obj)==="[object Date]";
  517. },
  518. addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) {
  519. if (element.addEventListener) {
  520. element.addEventListener(eventName, listener, false);
  521. } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.attachEvent) {
  522. element.attachEvent("on"+eventName, listener);
  523. } else {
  524. element["on"+eventName]=listener;
  525. }
  526. },
  527. removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) {
  528. if (element.removeEventListener) {
  529. element.removeEventListener(eventName, listener, false);
  530. } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.detachEvent) {
  531. element.detachEvent("on"+eventName, listener);
  532. } else {
  533. element["on"+eventName]=null;
  534. }
  535. },
  536. xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) {
  537. var xmlhttp;
  538. try {
  539. xmlhttp=new XMLHttpRequest();
  540. xmlhttp.onreadystatechange=function () {
  541. if (xmlhttp.readyState==4) {
  542. if (xmlhttp.status==200) {
  543. onSuccess(xmlhttp.responseText);
  544. } else {
  545. onError(xmlhttp.status);
  546. }
  547. }
  548. };
  549. xmlhttp.open("GET", url, true);
  550. xmlhttp.send();
  551. } catch (ex) {
  552. onError(ex);
  553. }
  554. },
  555. encodeBase64: function OSF_Outil$encodeBase64(input) {
  556. if (!input)
  557. return input;
  558. var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/=";
  559. var output=[];
  560. var temp=[];
  561. var index=0;
  562. var c1, c2, c3, a, b, c;
  563. var i;
  564. var length=input.length;
  565. do {
  566. c1=input.charCodeAt(index++);
  567. c2=input.charCodeAt(index++);
  568. c3=input.charCodeAt(index++);
  569. i=0;
  570. a=c1 & 255;
  571. b=c1 >> 8;
  572. c=c2 & 255;
  573. temp[i++]=a >> 2;
  574. temp[i++]=((a & 3) << 4) | (b >> 4);
  575. temp[i++]=((b & 15) << 2) | (c >> 6);
  576. temp[i++]=c & 63;
  577. if (!isNaN(c2)) {
  578. a=c2 >> 8;
  579. b=c3 & 255;
  580. c=c3 >> 8;
  581. temp[i++]=a >> 2;
  582. temp[i++]=((a & 3) << 4) | (b >> 4);
  583. temp[i++]=((b & 15) << 2) | (c >> 6);
  584. temp[i++]=c & 63;
  585. }
  586. if (isNaN(c2)) {
  587. temp[i - 1]=64;
  588. } else if (isNaN(c3)) {
  589. temp[i - 2]=64;
  590. temp[i - 1]=64;
  591. }
  592. for (var t=0; t < i; t++) {
  593. output.push(codex.charAt(temp[t]));
  594. }
  595. } while(index < length);
  596. return output.join("");
  597. },
  598. getSessionStorage: function OSF_Outil$getSessionStorage() {
  599. return _getSessionStorage();
  600. },
  601. getLocalStorage: function OSF_Outil$getLocalStorage() {
  602. if (!_safeLocalStorage) {
  603. try {
  604. var localStorage=window.localStorage;
  605. } catch (ex) {
  606. localStorage=null;
  607. }
  608. _safeLocalStorage=new OfficeExt.SafeStorage(localStorage);
  609. }
  610. return _safeLocalStorage;
  611. },
  612. convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) {
  613. var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6);
  614. return hex;
  615. },
  616. attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) {
  617. element.onclick=function (e) {
  618. handler();
  619. };
  620. element.ontouchend=function (e) {
  621. handler();
  622. e.preventDefault();
  623. };
  624. },
  625. getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) {
  626. var e=Function._validateParams(arguments, [
  627. { name: "queryString", type: String, mayBeNull: false },
  628. { name: "paramName", type: String, mayBeNull: false }
  629. ]);
  630. if (e) {
  631. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null.");
  632. return "";
  633. }
  634. var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)", "i");
  635. if (!queryExp.test(queryString)) {
  636. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found.");
  637. return "";
  638. }
  639. return queryExp.exec(queryString)[1];
  640. },
  641. isiOS: function OSF_Outil$isiOS() {
  642. return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
  643. },
  644. shallowCopy: function OSF_Outil$shallowCopy(sourceObj) {
  645. var copyObj=sourceObj.constructor();
  646. for (var property in sourceObj) {
  647. if (sourceObj.hasOwnProperty(property)) {
  648. copyObj[property]=sourceObj[property];
  649. }
  650. }
  651. return copyObj;
  652. }
  653. };
  654. })();
  655. OSF.OUtil.Guid=(function () {
  656. var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
  657. return {
  658. generateNewGuid: function OSF_Outil_Guid$generateNewGuid() {
  659. var result="";
  660. var tick=(new Date()).getTime();
  661. var index=0;
  662. for (; index < 32 && tick > 0; index++) {
  663. if (index==8 || index==12 || index==16 || index==20) {
  664. result+="-";
  665. }
  666. result+=hexCode[tick % 16];
  667. tick=Math.floor(tick / 16);
  668. }
  669. for (; index < 32; index++) {
  670. if (index==8 || index==12 || index==16 || index==20) {
  671. result+="-";
  672. }
  673. result+=hexCode[Math.floor(Math.random() * 16)];
  674. }
  675. return result;
  676. }
  677. };
  678. })();
  679. window.OSF=OSF;
  680. OSF.OUtil.setNamespace("OSF", window);
  681. OSF.AppName={
  682. Unsupported: 0,
  683. Excel: 1,
  684. Word: 2,
  685. PowerPoint: 4,
  686. Outlook: 8,
  687. ExcelWebApp: 16,
  688. WordWebApp: 32,
  689. OutlookWebApp: 64,
  690. Project: 128,
  691. AccessWebApp: 256,
  692. PowerpointWebApp: 512,
  693. ExcelIOS: 1024,
  694. Sway: 2048,
  695. WordIOS: 4096,
  696. PowerPointIOS: 8192,
  697. Access: 16384,
  698. Lync: 32768,
  699. OutlookIOS: 65536,
  700. OneNoteWebApp: 131072
  701. };
  702. OSF.InternalPerfMarker={
  703. DataCoercionBegin: "Agave.HostCall.CoerceDataStart",
  704. DataCoercionEnd: "Agave.HostCall.CoerceDataEnd"
  705. };
  706. OSF.HostCallPerfMarker={
  707. IssueCall: "Agave.HostCall.IssueCall",
  708. ReceiveResponse: "Agave.HostCall.ReceiveResponse",
  709. RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised"
  710. };
  711. OSF.AgaveHostAction={
  712. "Select": 0,
  713. "UnSelect": 1,
  714. "CancelDialog": 2,
  715. "InsertAgave": 3,
  716. "CtrlF6In": 4,
  717. "CtrlF6Exit": 5,
  718. "CtrlF6ExitShift": 6,
  719. "SelectWithError": 7,
  720. "NotifyHostError": 8
  721. };
  722. OSF.SharedConstants={
  723. "NotificationConversationIdSuffix": '_ntf'
  724. };
  725. OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) {
  726. this._id=id;
  727. this._appName=appName;
  728. this._appVersion=appVersion;
  729. this._appUILocale=appUILocale;
  730. this._dataLocale=dataLocale;
  731. this._docUrl=docUrl;
  732. this._clientMode=clientMode;
  733. this._settings=settings;
  734. this._reason=reason;
  735. this._osfControlType=osfControlType;
  736. this._eToken=eToken;
  737. this._correlationId=correlationId;
  738. this._appInstanceId=appInstanceId;
  739. this._touchEnabled=touchEnabled;
  740. this._commerceAllowed=commerceAllowed;
  741. this._appMinorVersion=appMinorVersion;
  742. this._requirementMatrix=requirementMatrix;
  743. this.get_id=function get_id() {
  744. return this._id;
  745. };
  746. this.get_appName=function get_appName() {
  747. return this._appName;
  748. };
  749. this.get_appVersion=function get_appVersion() {
  750. return this._appVersion;
  751. };
  752. this.get_appUILocale=function get_appUILocale() {
  753. return this._appUILocale;
  754. };
  755. this.get_dataLocale=function get_dataLocale() {
  756. return this._dataLocale;
  757. };
  758. this.get_docUrl=function get_docUrl() {
  759. return this._docUrl;
  760. };
  761. this.get_clientMode=function get_clientMode() {
  762. return this._clientMode;
  763. };
  764. this.get_bindings=function get_bindings() {
  765. return this._bindings;
  766. };
  767. this.get_settings=function get_settings() {
  768. return this._settings;
  769. };
  770. this.get_reason=function get_reason() {
  771. return this._reason;
  772. };
  773. this.get_osfControlType=function get_osfControlType() {
  774. return this._osfControlType;
  775. };
  776. this.get_eToken=function get_eToken() {
  777. return this._eToken;
  778. };
  779. this.get_correlationId=function get_correlationId() {
  780. return this._correlationId;
  781. };
  782. this.get_appInstanceId=function get_appInstanceId() {
  783. return this._appInstanceId;
  784. };
  785. this.get_touchEnabled=function get_touchEnabled() {
  786. return this._touchEnabled;
  787. };
  788. this.get_commerceAllowed=function get_commerceAllowed() {
  789. return this._commerceAllowed;
  790. };
  791. this.get_appMinorVersion=function get_appMinorVersion() {
  792. return this._appMinorVersion;
  793. };
  794. this.get_requirementMatrix=function get_requirementMatrix() {
  795. return this._requirementMatrix;
  796. };
  797. };
  798. OSF.OsfControlType={
  799. DocumentLevel: 0,
  800. ContainerLevel: 1
  801. };
  802. OSF.ClientMode={
  803. ReadOnly: 0,
  804. ReadWrite: 1
  805. };
  806. OSF.OUtil.setNamespace("Microsoft", window);
  807. OSF.OUtil.setNamespace("Office", Microsoft);
  808. OSF.OUtil.setNamespace("Client", Microsoft.Office);
  809. OSF.OUtil.setNamespace("WebExtension", Microsoft.Office);
  810. Microsoft.Office.WebExtension.InitializationReason={
  811. Inserted: "inserted",
  812. DocumentOpened: "documentOpened"
  813. };
  814. Microsoft.Office.WebExtension.ValueFormat={
  815. Unformatted: "unformatted",
  816. Formatted: "formatted"
  817. };
  818. Microsoft.Office.WebExtension.FilterType={
  819. All: "all"
  820. };
  821. Microsoft.Office.WebExtension.Parameters={
  822. BindingType: "bindingType",
  823. CoercionType: "coercionType",
  824. ValueFormat: "valueFormat",
  825. FilterType: "filterType",
  826. Columns: "columns",
  827. SampleData: "sampleData",
  828. GoToType: "goToType",
  829. SelectionMode: "selectionMode",
  830. Id: "id",
  831. PromptText: "promptText",
  832. ItemName: "itemName",
  833. FailOnCollision: "failOnCollision",
  834. StartRow: "startRow",
  835. StartColumn: "startColumn",
  836. RowCount: "rowCount",
  837. ColumnCount: "columnCount",
  838. Callback: "callback",
  839. AsyncContext: "asyncContext",
  840. Data: "data",
  841. Rows: "rows",
  842. OverwriteIfStale: "overwriteIfStale",
  843. FileType: "fileType",
  844. EventType: "eventType",
  845. Handler: "handler",
  846. SliceSize: "sliceSize",
  847. SliceIndex: "sliceIndex",
  848. ActiveView: "activeView",
  849. Status: "status",
  850. Xml: "xml",
  851. Namespace: "namespace",
  852. Prefix: "prefix",
  853. XPath: "xPath",
  854. ImageLeft: "imageLeft",
  855. ImageTop: "imageTop",
  856. ImageWidth: "imageWidth",
  857. ImageHeight: "imageHeight",
  858. TaskId: "taskId",
  859. FieldId: "fieldId",
  860. FieldValue: "fieldValue",
  861. ServerUrl: "serverUrl",
  862. ListName: "listName",
  863. ResourceId: "resourceId",
  864. ViewType: "viewType",
  865. ViewName: "viewName",
  866. GetRawValue: "getRawValue",
  867. CellFormat: "cellFormat",
  868. TableOptions: "tableOptions",
  869. TaskIndex: "taskIndex",
  870. ResourceIndex: "resourceIndex"
  871. };
  872. OSF.OUtil.setNamespace("DDA", OSF);
  873. OSF.DDA.DocumentMode={
  874. ReadOnly: 1,
  875. ReadWrite: 0
  876. };
  877. OSF.DDA.PropertyDescriptors={
  878. AsyncResultStatus: "AsyncResultStatus"
  879. };
  880. OSF.DDA.EventDescriptors={};
  881. OSF.DDA.ListDescriptors={};
  882. OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType) {
  883. if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged) {
  884. return bindingId+"_"+eventType;
  885. } else {
  886. return eventType;
  887. }
  888. };
  889. OSF.DDA.MethodDispId={
  890. dispidMethodMin: 64,
  891. dispidGetSelectedDataMethod: 64,
  892. dispidSetSelectedDataMethod: 65,
  893. dispidAddBindingFromSelectionMethod: 66,
  894. dispidAddBindingFromPromptMethod: 67,
  895. dispidGetBindingMethod: 68,
  896. dispidReleaseBindingMethod: 69,
  897. dispidGetBindingDataMethod: 70,
  898. dispidSetBindingDataMethod: 71,
  899. dispidAddRowsMethod: 72,
  900. dispidClearAllRowsMethod: 73,
  901. dispidGetAllBindingsMethod: 74,
  902. dispidLoadSettingsMethod: 75,
  903. dispidSaveSettingsMethod: 76,
  904. dispidGetDocumentCopyMethod: 77,
  905. dispidAddBindingFromNamedItemMethod: 78,
  906. dispidAddColumnsMethod: 79,
  907. dispidGetDocumentCopyChunkMethod: 80,
  908. dispidReleaseDocumentCopyMethod: 81,
  909. dispidNavigateToMethod: 82,
  910. dispidGetActiveViewMethod: 83,
  911. dispidGetDocumentThemeMethod: 84,
  912. dispidGetOfficeThemeMethod: 85,
  913. dispidGetFilePropertiesMethod: 86,
  914. dispidClearFormatsMethod: 87,
  915. dispidSetTableOptionsMethod: 88,
  916. dispidSetFormatsMethod: 89,
  917. dispidExecuteRichApiRequestMethod: 93,
  918. dispidAppCommandInvocationCompletedMethod: 94,
  919. dispidAddDataPartMethod: 128,
  920. dispidGetDataPartByIdMethod: 129,
  921. dispidGetDataPartsByNamespaceMethod: 130,
  922. dispidGetDataPartXmlMethod: 131,
  923. dispidGetDataPartNodesMethod: 132,
  924. dispidDeleteDataPartMethod: 133,
  925. dispidGetDataNodeValueMethod: 134,
  926. dispidGetDataNodeXmlMethod: 135,
  927. dispidGetDataNodesMethod: 136,
  928. dispidSetDataNodeValueMethod: 137,
  929. dispidSetDataNodeXmlMethod: 138,
  930. dispidAddDataNamespaceMethod: 139,
  931. dispidGetDataUriByPrefixMethod: 140,
  932. dispidGetDataPrefixByUriMethod: 141,
  933. dispidMethodMax: 141,
  934. dispidGetSelectedTaskMethod: 110,
  935. dispidGetSelectedResourceMethod: 111,
  936. dispidGetTaskMethod: 112,
  937. dispidGetResourceFieldMethod: 113,
  938. dispidGetWSSUrlMethod: 114,
  939. dispidGetTaskFieldMethod: 115,
  940. dispidGetProjectFieldMethod: 116,
  941. dispidGetSelectedViewMethod: 117,
  942. dispidGetTaskByIndexMethod: 118,
  943. dispidGetResourceByIndexMethod: 119,
  944. dispidSetTaskFieldMethod: 120,
  945. dispidSetResourceFieldMethod: 121,
  946. dispidGetMaxTaskIndexMethod: 122,
  947. dispidGetMaxResourceIndexMethod: 123
  948. };
  949. OSF.DDA.EventDispId={
  950. dispidEventMin: 0,
  951. dispidInitializeEvent: 0,
  952. dispidSettingsChangedEvent: 1,
  953. dispidDocumentSelectionChangedEvent: 2,
  954. dispidBindingSelectionChangedEvent: 3,
  955. dispidBindingDataChangedEvent: 4,
  956. dispidDocumentOpenEvent: 5,
  957. dispidDocumentCloseEvent: 6,
  958. dispidActiveViewChangedEvent: 7,
  959. dispidDocumentThemeChangedEvent: 8,
  960. dispidOfficeThemeChangedEvent: 9,
  961. dispidActivationStatusChangedEvent: 32,
  962. dispidAppCommandInvokedEvent: 39,
  963. dispidTaskSelectionChangedEvent: 56,
  964. dispidResourceSelectionChangedEvent: 57,
  965. dispidViewSelectionChangedEvent: 58,
  966. dispidDataNodeAddedEvent: 60,
  967. dispidDataNodeReplacedEvent: 61,
  968. dispidDataNodeDeletedEvent: 62,
  969. dispidEventMax: 63
  970. };
  971. OSF.DDA.ErrorCodeManager=(function () {
  972. var _errorMappings={};
  973. return {
  974. getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) {
  975. return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError];
  976. },
  977. addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) {
  978. _errorMappings[errorCode]=errorNameMessage;
  979. },
  980. errorCodes: {
  981. ooeSuccess: 0,
  982. ooeChunkResult: 1,
  983. ooeCoercionTypeNotSupported: 1000,
  984. ooeGetSelectionNotMatchDataType: 1001,
  985. ooeCoercionTypeNotMatchBinding: 1002,
  986. ooeInvalidGetRowColumnCounts: 1003,
  987. ooeSelectionNotSupportCoercionType: 1004,
  988. ooeInvalidGetStartRowColumn: 1005,
  989. ooeNonUniformPartialGetNotSupported: 1006,
  990. ooeGetDataIsTooLarge: 1008,
  991. ooeFileTypeNotSupported: 1009,
  992. ooeGetDataParametersConflict: 1010,
  993. ooeInvalidGetColumns: 1011,
  994. ooeInvalidGetRows: 1012,
  995. ooeInvalidReadForBlankRow: 1013,
  996. ooeUnsupportedDataObject: 2000,
  997. ooeCannotWriteToSelection: 2001,
  998. ooeDataNotMatchSelection: 2002,
  999. ooeOverwriteWorksheetData: 2003,
  1000. ooeDataNotMatchBindingSize: 2004,
  1001. ooeInvalidSetStartRowColumn: 2005,
  1002. ooeInvalidDataFormat: 2006,
  1003. ooeDataNotMatchCoercionType: 2007,
  1004. ooeDataNotMatchBindingType: 2008,
  1005. ooeSetDataIsTooLarge: 2009,
  1006. ooeNonUniformPartialSetNotSupported: 2010,
  1007. ooeInvalidSetColumns: 2011,
  1008. ooeInvalidSetRows: 2012,
  1009. ooeSetDataParametersConflict: 2013,
  1010. ooeCellDataAmountBeyondLimits: 2014,
  1011. ooeSelectionCannotBound: 3000,
  1012. ooeBindingNotExist: 3002,
  1013. ooeBindingToMultipleSelection: 3003,
  1014. ooeInvalidSelectionForBindingType: 3004,
  1015. ooeOperationNotSupportedOnThisBindingType: 3005,
  1016. ooeNamedItemNotFound: 3006,
  1017. ooeMultipleNamedItemFound: 3007,
  1018. ooeInvalidNamedItemForBindingType: 3008,
  1019. ooeUnknownBindingType: 3009,
  1020. ooeOperationNotSupportedOnMatrixData: 3010,
  1021. ooeInvalidColumnsForBinding: 3011,
  1022. ooeSettingNameNotExist: 4000,
  1023. ooeSettingsCannotSave: 4001,
  1024. ooeSettingsAreStale: 4002,
  1025. ooeOperationNotSupported: 5000,
  1026. ooeInternalError: 5001,
  1027. ooeDocumentReadOnly: 5002,
  1028. ooeEventHandlerNotExist: 5003,
  1029. ooeInvalidApiCallInContext: 5004,
  1030. ooeShuttingDown: 5005,
  1031. ooeUnsupportedEnumeration: 5007,
  1032. ooeIndexOutOfRange: 5008,
  1033. ooeBrowserAPINotSupported: 5009,
  1034. ooeInvalidParam: 5010,
  1035. ooeRequestTimeout: 5011,
  1036. ooeTooManyIncompleteRequests: 5100,
  1037. ooeRequestTokenUnavailable: 5101,
  1038. ooeActivityLimitReached: 5102,
  1039. ooeCustomXmlNodeNotFound: 6000,
  1040. ooeCustomXmlError: 6100,
  1041. ooeCustomXmlExceedQuota: 6101,
  1042. ooeCustomXmlOutOfDate: 6102,
  1043. ooeNoCapability: 7000,
  1044. ooeCannotNavTo: 7001,
  1045. ooeSpecifiedIdNotExist: 7002,
  1046. ooeNavOutOfBound: 7004,
  1047. ooeElementMissing: 8000,
  1048. ooeProtectedError: 8001,
  1049. ooeInvalidCellsValue: 8010,
  1050. ooeInvalidTableOptionValue: 8011,
  1051. ooeInvalidFormatValue: 8012,
  1052. ooeRowIndexOutOfRange: 8020,
  1053. ooeColIndexOutOfRange: 8021,
  1054. ooeFormatValueOutOfRange: 8022,
  1055. ooeCellFormatAmountBeyondLimits: 8023,
  1056. ooeMemoryFileLimit: 11000,
  1057. ooeNetworkProblemRetrieveFile: 11001,
  1058. ooeInvalidSliceSize: 11002,
  1059. ooeInvalidCallback: 11101
  1060. },
  1061. initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) {
  1062. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported };
  1063. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported };
  1064. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding };
  1065. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts };
  1066. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType };
  1067. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn };
  1068. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported };
  1069. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge };
  1070. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported };
  1071. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict };
  1072. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns };
  1073. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows };
  1074. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow };
  1075. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject };
  1076. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection };
  1077. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection };
  1078. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData };
  1079. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize };
  1080. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn };
  1081. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat };
  1082. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType };
  1083. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType };
  1084. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge };
  1085. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported };
  1086. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns };
  1087. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows };
  1088. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict };
  1089. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound };
  1090. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist };
  1091. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection };
  1092. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType };
  1093. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType };
  1094. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound };
  1095. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound };
  1096. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType };
  1097. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType };
  1098. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData };
  1099. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding };
  1100. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist };
  1101. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave };
  1102. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale };
  1103. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported };
  1104. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription };
  1105. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly };
  1106. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist };
  1107. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext };
  1108. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown };
  1109. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage };
  1110. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1111. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported };
  1112. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout };
  1113. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests };
  1114. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable };
  1115. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={ name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached };
  1116. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound };
  1117. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1118. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1119. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1120. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1121. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo };
  1122. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist };
  1123. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound };
  1124. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits };
  1125. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing };
  1126. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1127. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue };
  1128. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue };
  1129. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue };
  1130. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange };
  1131. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange };
  1132. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange };
  1133. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits };
  1134. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve };
  1135. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile };
  1136. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported };
  1137. }
  1138. };
  1139. })();
  1140. var OfficeExt;
  1141. (function (OfficeExt) {
  1142. (function (Requirement) {
  1143. var RequirementMatrix=(function () {
  1144. function RequirementMatrix(_setMap) {
  1145. this.isSetSupported=function _isSetSupported(name, minVersion) {
  1146. if (name==undefined) {
  1147. return false;
  1148. }
  1149. if (minVersion==undefined) {
  1150. minVersion=0;
  1151. }
  1152. var setSupportArray=this._setMap;
  1153. var sets=setSupportArray._sets;
  1154. if (sets.hasOwnProperty(name.toLowerCase())) {
  1155. var setMaxVersion=sets[name.toLowerCase()];
  1156. return setMaxVersion > 0 && setMaxVersion >=minVersion;
  1157. } else {
  1158. return false;
  1159. }
  1160. };
  1161. this._setMap=_setMap;
  1162. }
  1163. return RequirementMatrix;
  1164. })();
  1165. Requirement.RequirementMatrix=RequirementMatrix;
  1166. var DefaultSetRequirement=(function () {
  1167. function DefaultSetRequirement(setMap) {
  1168. this._sets=setMap;
  1169. }
  1170. return DefaultSetRequirement;
  1171. })();
  1172. Requirement.DefaultSetRequirement=DefaultSetRequirement;
  1173. var ExcelClientDefaultSetRequirement=(function (_super) {
  1174. __extends(ExcelClientDefaultSetRequirement, _super);
  1175. function ExcelClientDefaultSetRequirement() {
  1176. _super.call(this, {
  1177. "bindingevents": 1.1,
  1178. "documentevents": 1.1,
  1179. "excelapi": 1.1,
  1180. "matrixbindings": 1.1,
  1181. "matrixcoercion": 1.1,
  1182. "selection": 1.1,
  1183. "settings": 1.1,
  1184. "tablebindings": 1.1,
  1185. "tablecoercion": 1.1,
  1186. "textbindings": 1.1,
  1187. "textcoercion": 1.1
  1188. });
  1189. }
  1190. return ExcelClientDefaultSetRequirement;
  1191. })(DefaultSetRequirement);
  1192. Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement;
  1193. var OutlookClientDefaultSetRequirement=(function (_super) {
  1194. __extends(OutlookClientDefaultSetRequirement, _super);
  1195. function OutlookClientDefaultSetRequirement() {
  1196. _super.call(this, {
  1197. "mailbox": 1.3
  1198. });
  1199. }
  1200. return OutlookClientDefaultSetRequirement;
  1201. })(DefaultSetRequirement);
  1202. Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement;
  1203. var WordClientDefaultSetRequirement=(function (_super) {
  1204. __extends(WordClientDefaultSetRequirement, _super);
  1205. function WordClientDefaultSetRequirement() {
  1206. _super.call(this, {
  1207. "bindingevents": 1.1,
  1208. "compressedfile": 1.1,
  1209. "customxmlparts": 1.1,
  1210. "documentevents": 1.1,
  1211. "file": 1.1,
  1212. "htmlcoercion": 1.1,
  1213. "matrixbindings": 1.1,
  1214. "matrixcoercion": 1.1,
  1215. "ooxmlcoercion": 1.1,
  1216. "pdffile": 1.1,
  1217. "selection": 1.1,
  1218. "settings": 1.1,
  1219. "tablebindings": 1.1,
  1220. "tablecoercion": 1.1,
  1221. "textbindings": 1.1,
  1222. "textcoercion": 1.1,
  1223. "textfile": 1.1,
  1224. "wordapi": 1.1
  1225. });
  1226. }
  1227. return WordClientDefaultSetRequirement;
  1228. })(DefaultSetRequirement);
  1229. Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement;
  1230. var PowerpointClientDefaultSetRequirement=(function (_super) {
  1231. __extends(PowerpointClientDefaultSetRequirement, _super);
  1232. function PowerpointClientDefaultSetRequirement() {
  1233. _super.call(this, {
  1234. "activeview": 1.1,
  1235. "compressedfile": 1.1,
  1236. "documentevents": 1.1,
  1237. "file": 1.1,
  1238. "pdffile": 1.1,
  1239. "selection": 1.1,
  1240. "settings": 1.1,
  1241. "textcoercion": 1.1
  1242. });
  1243. }
  1244. return PowerpointClientDefaultSetRequirement;
  1245. })(DefaultSetRequirement);
  1246. Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement;
  1247. var ProjectClientDefaultSetRequirement=(function (_super) {
  1248. __extends(ProjectClientDefaultSetRequirement, _super);
  1249. function ProjectClientDefaultSetRequirement() {
  1250. _super.call(this, {
  1251. "selection": 1.1,
  1252. "textcoercion": 1.1
  1253. });
  1254. }
  1255. return ProjectClientDefaultSetRequirement;
  1256. })(DefaultSetRequirement);
  1257. Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement;
  1258. var ExcelWebDefaultSetRequirement=(function (_super) {
  1259. __extends(ExcelWebDefaultSetRequirement, _super);
  1260. function ExcelWebDefaultSetRequirement() {
  1261. _super.call(this, {
  1262. "bindingevents": 1.1,
  1263. "documentevents": 1.1,
  1264. "matrixbindings": 1.1,
  1265. "matrixcoercion": 1.1,
  1266. "selection": 1.1,
  1267. "settings": 1.1,
  1268. "tablebindings": 1.1,
  1269. "tablecoercion": 1.1,
  1270. "textbindings": 1.1,
  1271. "textcoercion": 1.1,
  1272. "file": 1.1
  1273. });
  1274. }
  1275. return ExcelWebDefaultSetRequirement;
  1276. })(DefaultSetRequirement);
  1277. Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement;
  1278. var WordWebDefaultSetRequirement=(function (_super) {
  1279. __extends(WordWebDefaultSetRequirement, _super);
  1280. function WordWebDefaultSetRequirement() {
  1281. _super.call(this, {
  1282. "customxmlparts": 1.1,
  1283. "documentevents": 1.1,
  1284. "file": 1.1,
  1285. "ooxmlcoercion": 1.1,
  1286. "selection": 1.1,
  1287. "settings": 1.1,
  1288. "textcoercion": 1.1
  1289. });
  1290. }
  1291. return WordWebDefaultSetRequirement;
  1292. })(DefaultSetRequirement);
  1293. Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement;
  1294. var PowerpointWebDefaultSetRequirement=(function (_super) {
  1295. __extends(PowerpointWebDefaultSetRequirement, _super);
  1296. function PowerpointWebDefaultSetRequirement() {
  1297. _super.call(this, {
  1298. "activeview": 1.1,
  1299. "settings": 1.1
  1300. });
  1301. }
  1302. return PowerpointWebDefaultSetRequirement;
  1303. })(DefaultSetRequirement);
  1304. Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement;
  1305. var OutlookWebDefaultSetRequirement=(function (_super) {
  1306. __extends(OutlookWebDefaultSetRequirement, _super);
  1307. function OutlookWebDefaultSetRequirement() {
  1308. _super.call(this, {
  1309. "mailbox": 1.3
  1310. });
  1311. }
  1312. return OutlookWebDefaultSetRequirement;
  1313. })(DefaultSetRequirement);
  1314. Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement;
  1315. var SwayWebDefaultSetRequirement=(function (_super) {
  1316. __extends(SwayWebDefaultSetRequirement, _super);
  1317. function SwayWebDefaultSetRequirement() {
  1318. _super.call(this, {
  1319. "activeview": 1.1,
  1320. "documentevents": 1.1,
  1321. "selection": 1.1,
  1322. "settings": 1.1,
  1323. "textcoercion": 1.1
  1324. });
  1325. }
  1326. return SwayWebDefaultSetRequirement;
  1327. })(DefaultSetRequirement);
  1328. Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement;
  1329. var AccessWebDefaultSetRequirement=(function (_super) {
  1330. __extends(AccessWebDefaultSetRequirement, _super);
  1331. function AccessWebDefaultSetRequirement() {
  1332. _super.call(this, {
  1333. "bindingevents": 1.1,
  1334. "partialtablebindings": 1.1,
  1335. "settings": 1.1,
  1336. "tablebindings": 1.1,
  1337. "tablecoercion": 1.1
  1338. });
  1339. }
  1340. return AccessWebDefaultSetRequirement;
  1341. })(DefaultSetRequirement);
  1342. Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement;
  1343. var ExcelIOSDefaultSetRequirement=(function (_super) {
  1344. __extends(ExcelIOSDefaultSetRequirement, _super);
  1345. function ExcelIOSDefaultSetRequirement() {
  1346. _super.call(this, {
  1347. "bindingevents": 1.1,
  1348. "documentevents": 1.1,
  1349. "matrixbindings": 1.1,
  1350. "matrixcoercion": 1.1,
  1351. "selection": 1.1,
  1352. "settings": 1.1,
  1353. "tablebindings": 1.1,
  1354. "tablecoercion": 1.1,
  1355. "textbindings": 1.1,
  1356. "textcoercion": 1.1
  1357. });
  1358. }
  1359. return ExcelIOSDefaultSetRequirement;
  1360. })(DefaultSetRequirement);
  1361. Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement;
  1362. var WordIOSDefaultSetRequirement=(function (_super) {
  1363. __extends(WordIOSDefaultSetRequirement, _super);
  1364. function WordIOSDefaultSetRequirement() {
  1365. _super.call(this, {
  1366. "bindingevents": 1.1,
  1367. "compressedfile": 1.1,
  1368. "customxmlparts": 1.1,
  1369. "documentevents": 1.1,
  1370. "file": 1.1,
  1371. "htmlcoercion": 1.1,
  1372. "matrixbindings": 1.1,
  1373. "matrixcoercion": 1.1,
  1374. "ooxmlcoercion": 1.1,
  1375. "pdffile": 1.1,
  1376. "selection": 1.1,
  1377. "settings": 1.1,
  1378. "tablebindings": 1.1,
  1379. "tablecoercion": 1.1,
  1380. "textbindings": 1.1,
  1381. "textcoercion": 1.1,
  1382. "textfile": 1.1
  1383. });
  1384. }
  1385. return WordIOSDefaultSetRequirement;
  1386. })(DefaultSetRequirement);
  1387. Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement;
  1388. var PowerpointIOSDefaultSetRequirement=(function (_super) {
  1389. __extends(PowerpointIOSDefaultSetRequirement, _super);
  1390. function PowerpointIOSDefaultSetRequirement() {
  1391. _super.call(this, {
  1392. "activeview": 1.1,
  1393. "compressedfile": 1.1,
  1394. "documentevents": 1.1,
  1395. "file": 1.1,
  1396. "pdffile": 1.1,
  1397. "selection": 1.1,
  1398. "settings": 1.1,
  1399. "textcoercion": 1.1
  1400. });
  1401. }
  1402. return PowerpointIOSDefaultSetRequirement;
  1403. })(DefaultSetRequirement);
  1404. Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement;
  1405. var OutlookIOSDefaultSetRequirement=(function (_super) {
  1406. __extends(OutlookIOSDefaultSetRequirement, _super);
  1407. function OutlookIOSDefaultSetRequirement() {
  1408. _super.call(this, {
  1409. "mailbox": 1.1
  1410. });
  1411. }
  1412. return OutlookIOSDefaultSetRequirement;
  1413. })(DefaultSetRequirement);
  1414. Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement;
  1415. var RequirementsMatrixFactory=(function () {
  1416. function RequirementsMatrixFactory() {
  1417. }
  1418. RequirementsMatrixFactory.initializeOsfDda=function () {
  1419. OSF.OUtil.setNamespace("Requirement", OSF.DDA);
  1420. };
  1421. RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) {
  1422. this.initializeDefaultSetMatrix();
  1423. var defaultRequirementMatrix=undefined;
  1424. if (appContext.get_requirementMatrix() !=undefined && typeof (JSON) !=="undefined") {
  1425. var matrixItem=JSON.parse(appContext.get_requirementMatrix());
  1426. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1427. } else {
  1428. var appMinorVersion=appContext.get_appMinorVersion();
  1429. var appMinorVersionString="";
  1430. if (appMinorVersion < 10) {
  1431. appMinorVersionString="0"+appMinorVersion;
  1432. } else {
  1433. appMinorVersionString=""+appMinorVersion;
  1434. }
  1435. var appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString;
  1436. var appLocator=appContext.get_appName()+"-"+appFullVersion;
  1437. if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) {
  1438. defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]);
  1439. } else {
  1440. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({}));
  1441. }
  1442. }
  1443. return defaultRequirementMatrix;
  1444. };
  1445. RequirementsMatrixFactory.initializeDefaultSetMatrix=function () {
  1446. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement();
  1447. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement();
  1448. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement();
  1449. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement();
  1450. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement();
  1451. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement();
  1452. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement();
  1453. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement();
  1454. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement();
  1455. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement();
  1456. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement();
  1457. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement();
  1458. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement();
  1459. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement();
  1460. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement();
  1461. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement();
  1462. };
  1463. RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00";
  1464. RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00";
  1465. RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00";
  1466. RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00";
  1467. RequirementsMatrixFactory.Excel_WAC_1600="16-16.00";
  1468. RequirementsMatrixFactory.Word_WAC_1600="32-16.00";
  1469. RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00";
  1470. RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01";
  1471. RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00";
  1472. RequirementsMatrixFactory.Access_WAC_1600="256-16.00";
  1473. RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00";
  1474. RequirementsMatrixFactory.Excel_IOS_1600="1024-16.01";
  1475. RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00";
  1476. RequirementsMatrixFactory.Word_IOS_1600="4096-16.00";
  1477. RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00";
  1478. RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00";
  1479. RequirementsMatrixFactory.DefaultSetArrayMatrix={};
  1480. return RequirementsMatrixFactory;
  1481. })();
  1482. Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory;
  1483. })(OfficeExt.Requirement || (OfficeExt.Requirement={}));
  1484. var Requirement=OfficeExt.Requirement;
  1485. })(OfficeExt || (OfficeExt={}));
  1486. OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();
  1487. Microsoft.Office.WebExtension.ApplicationMode={
  1488. WebEditor: "webEditor",
  1489. WebViewer: "webViewer",
  1490. Client: "client"
  1491. };
  1492. Microsoft.Office.WebExtension.DocumentMode={
  1493. ReadOnly: "readOnly",
  1494. ReadWrite: "readWrite"
  1495. };
  1496. OSF.NamespaceManager=(function OSF_NamespaceManager() {
  1497. var _userOffice;
  1498. var _useShortcut=false;
  1499. return {
  1500. enableShortcut: function OSF_NamespaceManager$enableShortcut() {
  1501. if (!_useShortcut) {
  1502. if (window.Office) {
  1503. _userOffice=window.Office;
  1504. } else {
  1505. OSF.OUtil.setNamespace("Office", window);
  1506. }
  1507. window.Office=Microsoft.Office.WebExtension;
  1508. _useShortcut=true;
  1509. }
  1510. },
  1511. disableShortcut: function OSF_NamespaceManager$disableShortcut() {
  1512. if (_useShortcut) {
  1513. if (_userOffice) {
  1514. window.Office=_userOffice;
  1515. } else {
  1516. OSF.OUtil.unsetNamespace("Office", window);
  1517. }
  1518. _useShortcut=false;
  1519. }
  1520. }
  1521. };
  1522. })();
  1523. OSF.NamespaceManager.enableShortcut();
  1524. Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) {
  1525. if (useShortcut) {
  1526. OSF.NamespaceManager.enableShortcut();
  1527. } else {
  1528. OSF.NamespaceManager.disableShortcut();
  1529. }
  1530. };
  1531. Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) {
  1532. var promise;
  1533. if (str && typeof str=="string") {
  1534. var index=str.indexOf("#");
  1535. if (index !=-1) {
  1536. var op=str.substring(0, index);
  1537. var target=str.substring(index+1);
  1538. switch (op) {
  1539. case "binding":
  1540. case "bindings":
  1541. if (target) {
  1542. promise=new OSF.DDA.BindingPromise(target);
  1543. }
  1544. break;
  1545. }
  1546. }
  1547. }
  1548. if (!promise) {
  1549. if (errorCallback) {
  1550. var callbackType=typeof errorCallback;
  1551. if (callbackType=="function") {
  1552. var callArgs={};
  1553. callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback;
  1554. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));
  1555. } else {
  1556. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType);
  1557. }
  1558. }
  1559. } else {
  1560. promise.onFail=errorCallback;
  1561. return promise;
  1562. }
  1563. };
  1564. OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) {
  1565. OSF.OUtil.defineEnumerableProperties(this, {
  1566. "contentLanguage": {
  1567. value: officeAppContext.get_dataLocale()
  1568. },
  1569. "displayLanguage": {
  1570. value: officeAppContext.get_appUILocale()
  1571. },
  1572. "touchEnabled": {
  1573. value: officeAppContext.get_touchEnabled()
  1574. },
  1575. "commerceAllowed": {
  1576. value: officeAppContext.get_commerceAllowed()
  1577. }
  1578. });
  1579. if (document) {
  1580. OSF.OUtil.defineEnumerableProperty(this, "document", {
  1581. value: document
  1582. });
  1583. }
  1584. if (license) {
  1585. OSF.OUtil.defineEnumerableProperty(this, "license", {
  1586. value: license
  1587. });
  1588. }
  1589. if (appOM) {
  1590. var displayName=appOM.displayName || "appOM";
  1591. delete appOM.displayName;
  1592. OSF.OUtil.defineEnumerableProperty(this, displayName, {
  1593. value: appOM
  1594. });
  1595. }
  1596. if (getOfficeTheme) {
  1597. OSF.OUtil.defineEnumerableProperty(this, "officeTheme", {
  1598. get: function () {
  1599. return getOfficeTheme();
  1600. }
  1601. });
  1602. }
  1603. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext);
  1604. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  1605. value: requirements
  1606. });
  1607. };
  1608. OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) {
  1609. OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme);
  1610. if (settings) {
  1611. OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", {
  1612. value: settings
  1613. });
  1614. }
  1615. };
  1616. OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context);
  1617. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) {
  1618. };
  1619. OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) {
  1620. var mode;
  1621. switch (officeAppContext.get_clientMode()) {
  1622. case OSF.ClientMode.ReadOnly:
  1623. mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;
  1624. break;
  1625. case OSF.ClientMode.ReadWrite:
  1626. mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite;
  1627. break;
  1628. }
  1629. ;
  1630. if (settings) {
  1631. OSF.OUtil.defineEnumerableProperty(this, "settings", {
  1632. value: settings
  1633. });
  1634. }
  1635. ;
  1636. OSF.OUtil.defineMutableProperties(this, {
  1637. "mode": {
  1638. value: mode
  1639. },
  1640. "url": {
  1641. value: officeAppContext.get_docUrl()
  1642. }
  1643. });
  1644. };
  1645. OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) {
  1646. OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings);
  1647. if (bindingFacade) {
  1648. OSF.OUtil.defineEnumerableProperty(this, "bindings", {
  1649. get: function OSF_DDA_Document$GetBindings() {
  1650. return bindingFacade;
  1651. }
  1652. });
  1653. }
  1654. var am=OSF.DDA.AsyncMethodNames;
  1655. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  1656. am.GetSelectedDataAsync,
  1657. am.SetSelectedDataAsync
  1658. ]);
  1659. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]));
  1660. };
  1661. OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document);
  1662. OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", {
  1663. get: function Microsoft_Office_WebExtension$GetContext() {
  1664. var context;
  1665. if (OSF && OSF._OfficeAppFactory) {
  1666. context=OSF._OfficeAppFactory.getContext();
  1667. }
  1668. return context;
  1669. }
  1670. });
  1671. OSF.DDA.License=function OSF_DDA_License(eToken) {
  1672. OSF.OUtil.defineEnumerableProperty(this, "value", {
  1673. value: eToken
  1674. });
  1675. };
  1676. OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA);
  1677. OSF.DDA.AsyncResultEnum.Properties={
  1678. Context: "Context",
  1679. Value: "Value",
  1680. Status: "Status",
  1681. Error: "Error"
  1682. };
  1683. Microsoft.Office.WebExtension.AsyncResultStatus={
  1684. Succeeded: "succeeded",
  1685. Failed: "failed"
  1686. };
  1687. OSF.DDA.AsyncResultEnum.ErrorCode={
  1688. Success: 0,
  1689. Failed: 1
  1690. };
  1691. OSF.DDA.AsyncResultEnum.ErrorProperties={
  1692. Name: "Name",
  1693. Message: "Message",
  1694. Code: "Code"
  1695. };
  1696. OSF.DDA.AsyncMethodNames={};
  1697. OSF.DDA.AsyncMethodNames.addNames=function (methodNames) {
  1698. for (var entry in methodNames) {
  1699. var am={};
  1700. OSF.OUtil.defineEnumerableProperties(am, {
  1701. "id": {
  1702. value: entry
  1703. },
  1704. "displayName": {
  1705. value: methodNames[entry]
  1706. }
  1707. });
  1708. OSF.DDA.AsyncMethodNames[entry]=am;
  1709. }
  1710. };
  1711. OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) {
  1712. var requiredCount=requiredParameters.length;
  1713. var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function () {
  1714. return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName);
  1715. });
  1716. function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) {
  1717. for (var name in params) {
  1718. var param=params[name];
  1719. var arg=args[name];
  1720. if (param["enum"]) {
  1721. switch (typeof arg) {
  1722. case "string":
  1723. if (OSF.OUtil.listContainsValue(param["enum"], arg)) {
  1724. break;
  1725. }
  1726. case "undefined":
  1727. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;
  1728. break;
  1729. default:
  1730. throw getInvalidParameterString();
  1731. }
  1732. }
  1733. if (param["types"]) {
  1734. if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) {
  1735. throw getInvalidParameterString();
  1736. }
  1737. }
  1738. }
  1739. }
  1740. ;
  1741. function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) {
  1742. if (userArgs.length < requiredCount) {
  1743. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);
  1744. }
  1745. var requiredArgs=[];
  1746. var index;
  1747. for (index=0; index < requiredCount; index++) {
  1748. requiredArgs.push(userArgs[index]);
  1749. }
  1750. OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs);
  1751. var ret={};
  1752. for (index=0; index < requiredCount; index++) {
  1753. var param=requiredParameters[index];
  1754. var arg=requiredArgs[index];
  1755. if (param.verify) {
  1756. var isValid=param.verify(arg, caller, stateInfo);
  1757. if (!isValid) {
  1758. throw getInvalidParameterString();
  1759. }
  1760. }
  1761. ret[param.name]=arg;
  1762. }
  1763. return ret;
  1764. }
  1765. ;
  1766. function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  1767. if (userArgs.length > requiredCount+2) {
  1768. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  1769. }
  1770. var options, parameterCallback;
  1771. for (var i=userArgs.length - 1; i >=requiredCount; i--) {
  1772. var argument=userArgs[i];
  1773. switch (typeof argument) {
  1774. case "object":
  1775. if (options) {
  1776. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  1777. } else {
  1778. options=argument;
  1779. }
  1780. break;
  1781. case "function":
  1782. if (parameterCallback) {
  1783. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);
  1784. } else {
  1785. parameterCallback=argument;
  1786. }
  1787. break;
  1788. default:
  1789. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  1790. break;
  1791. }
  1792. }
  1793. options=options || {};
  1794. for (var optionName in supportedOptions) {
  1795. if (!OSF.OUtil.listContainsKey(options, optionName)) {
  1796. var value=undefined;
  1797. var option=supportedOptions[optionName];
  1798. if (option.calculate && requiredArgs) {
  1799. value=option.calculate(requiredArgs, caller, stateInfo);
  1800. }
  1801. if (!value && option.defaultValue !==undefined) {
  1802. value=option.defaultValue;
  1803. }
  1804. options[optionName]=value;
  1805. }
  1806. }
  1807. if (parameterCallback) {
  1808. if (options[Microsoft.Office.WebExtension.Parameters.Callback]) {
  1809. throw Strings.OfficeOM.L_RedundantCallbackSpecification;
  1810. } else {
  1811. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  1812. }
  1813. }
  1814. OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options);
  1815. return options;
  1816. }
  1817. ;
  1818. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  1819. var required=OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo);
  1820. var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  1821. var callArgs={};
  1822. for (var r in required) {
  1823. callArgs[r]=required[r];
  1824. }
  1825. for (var o in options) {
  1826. callArgs[o]=options[o];
  1827. }
  1828. for (var s in privateStateCallbacks) {
  1829. callArgs[s]=privateStateCallbacks[s](caller, stateInfo);
  1830. }
  1831. if (checkCallArgs) {
  1832. callArgs=checkCallArgs(callArgs, caller, stateInfo);
  1833. }
  1834. return callArgs;
  1835. };
  1836. this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) {
  1837. var payload;
  1838. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  1839. if (onSucceeded) {
  1840. payload=onSucceeded(response, caller, callArgs);
  1841. } else {
  1842. payload=response;
  1843. }
  1844. } else {
  1845. if (onFailed) {
  1846. payload=onFailed(status, response);
  1847. } else {
  1848. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  1849. }
  1850. }
  1851. return payload;
  1852. };
  1853. this.getCallArgs=function (suppliedArgs) {
  1854. var options, parameterCallback;
  1855. for (var i=suppliedArgs.length - 1; i >=requiredCount; i--) {
  1856. var argument=suppliedArgs[i];
  1857. switch (typeof argument) {
  1858. case "object":
  1859. options=argument;
  1860. break;
  1861. case "function":
  1862. parameterCallback=argument;
  1863. break;
  1864. }
  1865. }
  1866. options=options || {};
  1867. if (parameterCallback) {
  1868. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  1869. }
  1870. return options;
  1871. };
  1872. };
  1873. OSF.DDA.AsyncMethodCallFactory=(function () {
  1874. function createObject(properties) {
  1875. var obj=null;
  1876. if (properties) {
  1877. obj={};
  1878. var len=properties.length;
  1879. for (var i=0; i < len; i++) {
  1880. obj[properties[i].name]=properties[i].value;
  1881. }
  1882. }
  1883. return obj;
  1884. }
  1885. return {
  1886. manufacture: function (params) {
  1887. var supportedOptions=params.supportedOptions ? createObject(params.supportedOptions) : [];
  1888. var privateStateCallbacks=params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : [];
  1889. return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName);
  1890. }
  1891. };
  1892. })();
  1893. OSF.DDA.AsyncMethodCalls={};
  1894. OSF.DDA.AsyncMethodCalls.define=function (callDefinition) {
  1895. OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition);
  1896. };
  1897. OSF.DDA.Error=function OSF_DDA_Error(name, message, code) {
  1898. OSF.OUtil.defineEnumerableProperties(this, {
  1899. "name": {
  1900. value: name
  1901. },
  1902. "message": {
  1903. value: message
  1904. },
  1905. "code": {
  1906. value: code
  1907. }
  1908. });
  1909. };
  1910. OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) {
  1911. OSF.OUtil.defineEnumerableProperties(this, {
  1912. "value": {
  1913. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]
  1914. },
  1915. "status": {
  1916. value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded
  1917. }
  1918. });
  1919. if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) {
  1920. OSF.OUtil.defineEnumerableProperty(this, "asyncContext", {
  1921. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]
  1922. });
  1923. }
  1924. if (errorArgs) {
  1925. OSF.OUtil.defineEnumerableProperty(this, "error", {
  1926. value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])
  1927. });
  1928. }
  1929. };
  1930. OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) {
  1931. var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback];
  1932. if (callback) {
  1933. var asyncInitArgs={};
  1934. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext];
  1935. var errorArgs;
  1936. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  1937. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload;
  1938. } else {
  1939. errorArgs={};
  1940. payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  1941. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  1942. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  1943. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  1944. }
  1945. callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs));
  1946. }
  1947. };
  1948. OSF.DDA.ListType=(function () {
  1949. var listTypes={};
  1950. return {
  1951. setListType: function OSF_DDA_ListType$AddListType(t, prop) {
  1952. listTypes[t]=prop;
  1953. },
  1954. isListType: function OSF_DDA_ListType$IsListType(t) {
  1955. return OSF.OUtil.listContainsKey(listTypes, t);
  1956. },
  1957. getDescriptor: function OSF_DDA_ListType$getDescriptor(t) {
  1958. return listTypes[t];
  1959. }
  1960. };
  1961. })();
  1962. OSF.DDA.HostParameterMap=function (specialProcessor, mappings) {
  1963. var toHostMap="toHost";
  1964. var fromHostMap="fromHost";
  1965. var self="self";
  1966. var dynamicTypes={};
  1967. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={
  1968. toHost: function (data) {
  1969. if (data !=null && data.rows !==undefined) {
  1970. var tableData={};
  1971. tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows;
  1972. tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers;
  1973. data=tableData;
  1974. }
  1975. return data;
  1976. },
  1977. fromHost: function (args) {
  1978. return args;
  1979. }
  1980. };
  1981. dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data];
  1982. function mapValues(preimageSet, mapping) {
  1983. var ret=preimageSet ? {} : undefined;
  1984. for (var entry in preimageSet) {
  1985. var preimage=preimageSet[entry];
  1986. var image;
  1987. if (OSF.DDA.ListType.isListType(entry)) {
  1988. image=[];
  1989. for (var subEntry in preimage) {
  1990. image.push(mapValues(preimage[subEntry], mapping));
  1991. }
  1992. } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) {
  1993. image=dynamicTypes[entry][mapping](preimage);
  1994. } else if (mapping==fromHostMap && specialProcessor.preserveNesting(entry)) {
  1995. image=mapValues(preimage, mapping);
  1996. } else {
  1997. var maps=mappings[entry];
  1998. if (maps) {
  1999. var map=maps[mapping];
  2000. if (map) {
  2001. image=map[preimage];
  2002. if (image===undefined) {
  2003. image=preimage;
  2004. }
  2005. }
  2006. } else {
  2007. image=preimage;
  2008. }
  2009. }
  2010. ret[entry]=image;
  2011. }
  2012. return ret;
  2013. }
  2014. ;
  2015. function generateArguments(imageSet, parameters) {
  2016. var ret;
  2017. for (var param in parameters) {
  2018. var arg;
  2019. if (specialProcessor.isComplexType(param)) {
  2020. arg=generateArguments(imageSet, mappings[param][toHostMap]);
  2021. } else {
  2022. arg=imageSet[param];
  2023. }
  2024. if (arg !=undefined) {
  2025. if (!ret) {
  2026. ret={};
  2027. }
  2028. var index=parameters[param];
  2029. if (index==self) {
  2030. index=param;
  2031. }
  2032. ret[index]=specialProcessor.pack(param, arg);
  2033. }
  2034. }
  2035. return ret;
  2036. }
  2037. ;
  2038. function extractArguments(source, parameters, extracted) {
  2039. if (!extracted) {
  2040. extracted={};
  2041. }
  2042. for (var param in parameters) {
  2043. var index=parameters[param];
  2044. var value;
  2045. if (index==self) {
  2046. value=source;
  2047. } else {
  2048. value=source[index];
  2049. }
  2050. if (value===null || value===undefined) {
  2051. extracted[param]=undefined;
  2052. } else {
  2053. value=specialProcessor.unpack(param, value);
  2054. var map;
  2055. if (specialProcessor.isComplexType(param)) {
  2056. map=mappings[param][fromHostMap];
  2057. if (specialProcessor.preserveNesting(param)) {
  2058. extracted[param]=extractArguments(value, map);
  2059. } else {
  2060. extractArguments(value, map, extracted);
  2061. }
  2062. } else {
  2063. if (OSF.DDA.ListType.isListType(param)) {
  2064. map={};
  2065. var entryDescriptor=OSF.DDA.ListType.getDescriptor(param);
  2066. map[entryDescriptor]=self;
  2067. for (var item in value) {
  2068. value[item]=extractArguments(value[item], map);
  2069. }
  2070. }
  2071. extracted[param]=value;
  2072. }
  2073. }
  2074. }
  2075. return extracted;
  2076. }
  2077. ;
  2078. function applyMap(mapName, preimage, mapping) {
  2079. var parameters=mappings[mapName][mapping];
  2080. var image;
  2081. if (mapping=="toHost") {
  2082. var imageSet=mapValues(preimage, mapping);
  2083. image=generateArguments(imageSet, parameters);
  2084. } else if (mapping=="fromHost") {
  2085. var argumentSet=extractArguments(preimage, parameters);
  2086. image=mapValues(argumentSet, mapping);
  2087. }
  2088. return image;
  2089. }
  2090. ;
  2091. if (!mappings) {
  2092. mappings={};
  2093. }
  2094. this.addMapping=function (mapName, description) {
  2095. var toHost, fromHost;
  2096. if (description.map) {
  2097. toHost=description.map;
  2098. fromHost={};
  2099. for (var preimage in toHost) {
  2100. var image=toHost[preimage];
  2101. if (image==self) {
  2102. image=preimage;
  2103. }
  2104. fromHost[image]=preimage;
  2105. }
  2106. } else {
  2107. toHost=description.toHost;
  2108. fromHost=description.fromHost;
  2109. }
  2110. var pair=mappings[mapName];
  2111. if (pair) {
  2112. var currMap=pair[toHostMap];
  2113. for (var th in currMap)
  2114. toHost[th]=currMap[th];
  2115. currMap=pair[fromHostMap];
  2116. for (var fh in currMap)
  2117. fromHost[fh]=currMap[fh];
  2118. } else {
  2119. pair=mappings[mapName]={};
  2120. }
  2121. pair[toHostMap]=toHost;
  2122. pair[fromHostMap]=fromHost;
  2123. };
  2124. this.toHost=function (mapName, preimage) {
  2125. return applyMap(mapName, preimage, toHostMap);
  2126. };
  2127. this.fromHost=function (mapName, image) {
  2128. return applyMap(mapName, image, fromHostMap);
  2129. };
  2130. this.self=self;
  2131. this.addComplexType=function (ct) {
  2132. specialProcessor.addComplexType(ct);
  2133. };
  2134. this.getDynamicType=function (dt) {
  2135. return specialProcessor.getDynamicType(dt);
  2136. };
  2137. this.setDynamicType=function (dt, handler) {
  2138. specialProcessor.setDynamicType(dt, handler);
  2139. };
  2140. this.dynamicTypes=dynamicTypes;
  2141. this.doMapValues=function (preimageSet, mapping) {
  2142. return mapValues(preimageSet, mapping);
  2143. };
  2144. };
  2145. OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) {
  2146. this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) {
  2147. complexTypes.push(ct);
  2148. };
  2149. this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) {
  2150. return dynamicTypes[dt];
  2151. };
  2152. this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) {
  2153. dynamicTypes[dt]=handler;
  2154. };
  2155. this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) {
  2156. return OSF.OUtil.listContainsValue(complexTypes, t);
  2157. };
  2158. this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) {
  2159. return OSF.OUtil.listContainsKey(dynamicTypes, p);
  2160. };
  2161. this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) {
  2162. var pn=[];
  2163. if (OSF.DDA.PropertyDescriptors)
  2164. pn.push(OSF.DDA.PropertyDescriptors.Subset);
  2165. if (OSF.DDA.DataNodeEventProperties) {
  2166. pn=pn.concat([
  2167. OSF.DDA.DataNodeEventProperties.OldNode,
  2168. OSF.DDA.DataNodeEventProperties.NewNode,
  2169. OSF.DDA.DataNodeEventProperties.NextSiblingNode
  2170. ]);
  2171. }
  2172. return OSF.OUtil.listContainsValue(pn, p);
  2173. };
  2174. this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) {
  2175. var value;
  2176. if (this.isDynamicType(param)) {
  2177. value=dynamicTypes[param].toHost(arg);
  2178. } else {
  2179. value=arg;
  2180. }
  2181. return value;
  2182. };
  2183. this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) {
  2184. var value;
  2185. if (this.isDynamicType(param)) {
  2186. value=dynamicTypes[param].fromHost(arg);
  2187. } else {
  2188. value=arg;
  2189. }
  2190. return value;
  2191. };
  2192. };
  2193. OSF.DDA.getDecoratedParameterMap=function (specialProcessor, initialDefs) {
  2194. var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor);
  2195. var self=parameterMap.self;
  2196. function createObject(properties) {
  2197. var obj=null;
  2198. if (properties) {
  2199. obj={};
  2200. var len=properties.length;
  2201. for (var i=0; i < len; i++) {
  2202. obj[properties[i].name]=properties[i].value;
  2203. }
  2204. }
  2205. return obj;
  2206. }
  2207. parameterMap.define=function define(definition) {
  2208. var args={};
  2209. var toHost=createObject(definition.toHost);
  2210. if (definition.invertible) {
  2211. args.map=toHost;
  2212. } else if (definition.canonical) {
  2213. args.toHost=args.fromHost=toHost;
  2214. } else {
  2215. args.toHost=toHost;
  2216. args.fromHost=createObject(definition.fromHost);
  2217. }
  2218. parameterMap.addMapping(definition.type, args);
  2219. if (definition.isComplexType)
  2220. parameterMap.addComplexType(definition.type);
  2221. };
  2222. for (var id in initialDefs)
  2223. parameterMap.define(initialDefs[id]);
  2224. return parameterMap;
  2225. };
  2226. OSF.OUtil.setNamespace("DispIdHost", OSF.DDA);
  2227. OSF.DDA.DispIdHost.Methods={
  2228. InvokeMethod: "invokeMethod",
  2229. AddEventHandler: "addEventHandler",
  2230. RemoveEventHandler: "removeEventHandler"
  2231. };
  2232. OSF.DDA.DispIdHost.Delegates={
  2233. ExecuteAsync: "executeAsync",
  2234. RegisterEventAsync: "registerEventAsync",
  2235. UnregisterEventAsync: "unregisterEventAsync",
  2236. ParameterMap: "parameterMap"
  2237. };
  2238. OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) {
  2239. var dispIdMap={};
  2240. var jsom=OSF.DDA.AsyncMethodNames;
  2241. var did=OSF.DDA.MethodDispId;
  2242. var methodMap={
  2243. "GoToByIdAsync": did.dispidNavigateToMethod,
  2244. "GetSelectedDataAsync": did.dispidGetSelectedDataMethod,
  2245. "SetSelectedDataAsync": did.dispidSetSelectedDataMethod,
  2246. "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod,
  2247. "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod,
  2248. "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod,
  2249. "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod,
  2250. "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod,
  2251. "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod,
  2252. "GetAllAsync": did.dispidGetAllBindingsMethod,
  2253. "GetByIdAsync": did.dispidGetBindingMethod,
  2254. "ReleaseByIdAsync": did.dispidReleaseBindingMethod,
  2255. "GetDataAsync": did.dispidGetBindingDataMethod,
  2256. "SetDataAsync": did.dispidSetBindingDataMethod,
  2257. "AddRowsAsync": did.dispidAddRowsMethod,
  2258. "AddColumnsAsync": did.dispidAddColumnsMethod,
  2259. "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod,
  2260. "RefreshAsync": did.dispidLoadSettingsMethod,
  2261. "SaveAsync": did.dispidSaveSettingsMethod,
  2262. "GetActiveViewAsync": did.dispidGetActiveViewMethod,
  2263. "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod,
  2264. "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod,
  2265. "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod,
  2266. "ClearFormatsAsync": did.dispidClearFormatsMethod,
  2267. "SetTableOptionsAsync": did.dispidSetTableOptionsMethod,
  2268. "SetFormatsAsync": did.dispidSetFormatsMethod,
  2269. "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod,
  2270. "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod,
  2271. "AddDataPartAsync": did.dispidAddDataPartMethod,
  2272. "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod,
  2273. "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod,
  2274. "GetPartXmlAsync": did.dispidGetDataPartXmlMethod,
  2275. "GetPartNodesAsync": did.dispidGetDataPartNodesMethod,
  2276. "DeleteDataPartAsync": did.dispidDeleteDataPartMethod,
  2277. "GetNodeValueAsync": did.dispidGetDataNodeValueMethod,
  2278. "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod,
  2279. "GetRelativeNodesAsync": did.dispidGetDataNodesMethod,
  2280. "SetNodeValueAsync": did.dispidSetDataNodeValueMethod,
  2281. "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod,
  2282. "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod,
  2283. "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod,
  2284. "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod,
  2285. "GetSelectedTask": did.dispidGetSelectedTaskMethod,
  2286. "GetTask": did.dispidGetTaskMethod,
  2287. "GetWSSUrl": did.dispidGetWSSUrlMethod,
  2288. "GetTaskField": did.dispidGetTaskFieldMethod,
  2289. "GetSelectedResource": did.dispidGetSelectedResourceMethod,
  2290. "GetResourceField": did.dispidGetResourceFieldMethod,
  2291. "GetProjectField": did.dispidGetProjectFieldMethod,
  2292. "GetSelectedView": did.dispidGetSelectedViewMethod,
  2293. "GetTaskByIndex": did.dispidGetTaskByIndexMethod,
  2294. "GetResourceByIndex": did.dispidGetResourceByIndexMethod,
  2295. "SetTaskField": did.dispidSetTaskFieldMethod,
  2296. "SetResourceField": did.dispidSetResourceFieldMethod,
  2297. "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod,
  2298. "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod
  2299. };
  2300. for (var method in methodMap) {
  2301. if (jsom[method]) {
  2302. dispIdMap[jsom[method].id]=methodMap[method];
  2303. }
  2304. }
  2305. jsom=Microsoft.Office.WebExtension.EventType;
  2306. did=OSF.DDA.EventDispId;
  2307. var eventMap={
  2308. "SettingsChanged": did.dispidSettingsChangedEvent,
  2309. "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent,
  2310. "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent,
  2311. "BindingDataChanged": did.dispidBindingDataChangedEvent,
  2312. "ActiveViewChanged": did.dispidActiveViewChangedEvent,
  2313. "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent,
  2314. "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent,
  2315. "AppCommandInvoked": did.dispidAppCommandInvokedEvent,
  2316. "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent,
  2317. "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent,
  2318. "ViewSelectionChanged": did.dispidViewSelectionChangedEvent,
  2319. "DataNodeInserted": did.dispidDataNodeAddedEvent,
  2320. "DataNodeReplaced": did.dispidDataNodeReplacedEvent,
  2321. "DataNodeDeleted": did.dispidDataNodeDeletedEvent
  2322. };
  2323. for (var event in eventMap) {
  2324. if (jsom[event]) {
  2325. dispIdMap[jsom[event]]=eventMap[event];
  2326. }
  2327. }
  2328. function onException(ex, asyncMethodCall, suppliedArgs, callArgs) {
  2329. if (typeof ex=="number") {
  2330. if (!callArgs) {
  2331. callArgs=asyncMethodCall.getCallArgs(suppliedArgs);
  2332. }
  2333. OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex));
  2334. } else {
  2335. throw ex;
  2336. }
  2337. }
  2338. ;
  2339. this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) {
  2340. var callArgs;
  2341. try {
  2342. var methodName=method.id;
  2343. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName];
  2344. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState);
  2345. var dispId=dispIdMap[methodName];
  2346. var delegate=getDelegateMethods(methodName);
  2347. var hostCallArgs;
  2348. if (parameterMap.toHost) {
  2349. hostCallArgs=parameterMap.toHost(dispId, callArgs);
  2350. } else {
  2351. hostCallArgs=callArgs;
  2352. }
  2353. delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({
  2354. "dispId": dispId,
  2355. "hostCallArgs": hostCallArgs,
  2356. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() {
  2357. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall);
  2358. },
  2359. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() {
  2360. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse);
  2361. },
  2362. "onComplete": function (status, hostResponseArgs) {
  2363. var responseArgs;
  2364. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2365. if (parameterMap.fromHost) {
  2366. responseArgs=parameterMap.fromHost(dispId, hostResponseArgs);
  2367. } else {
  2368. responseArgs=hostResponseArgs;
  2369. }
  2370. } else {
  2371. responseArgs=hostResponseArgs;
  2372. }
  2373. var payload=asyncMethodCall.processResponse(status, responseArgs, caller, callArgs);
  2374. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  2375. }
  2376. });
  2377. } catch (ex) {
  2378. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2379. }
  2380. };
  2381. this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) {
  2382. var callArgs;
  2383. var eventType, handler;
  2384. function onEnsureRegistration(status) {
  2385. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2386. var added=eventDispatch.addEventHandler(eventType, handler);
  2387. if (!added) {
  2388. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed;
  2389. }
  2390. }
  2391. var error;
  2392. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2393. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2394. }
  2395. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2396. }
  2397. try {
  2398. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];
  2399. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2400. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  2401. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  2402. if (eventDispatch.getEventHandlerCount(eventType)==0) {
  2403. var dispId=dispIdMap[eventType];
  2404. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  2405. invoker({
  2406. "eventType": eventType,
  2407. "dispId": dispId,
  2408. "targetId": caller.id || "",
  2409. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() {
  2410. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall);
  2411. },
  2412. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() {
  2413. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse);
  2414. },
  2415. "onComplete": onEnsureRegistration,
  2416. "onEvent": function handleEvent(hostArgs) {
  2417. var args=parameterMap.fromHost(dispId, hostArgs);
  2418. eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args));
  2419. }
  2420. });
  2421. } else {
  2422. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  2423. }
  2424. } catch (ex) {
  2425. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2426. }
  2427. };
  2428. this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) {
  2429. var callArgs;
  2430. var eventType, handler;
  2431. function onEnsureRegistration(status) {
  2432. var error;
  2433. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2434. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2435. }
  2436. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2437. }
  2438. try {
  2439. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];
  2440. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2441. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  2442. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  2443. var status, removeSuccess;
  2444. if (handler===null) {
  2445. removeSuccess=eventDispatch.clearEventHandlers(eventType);
  2446. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  2447. } else {
  2448. removeSuccess=eventDispatch.removeEventHandler(eventType, handler);
  2449. status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist;
  2450. }
  2451. if (removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) {
  2452. var dispId=dispIdMap[eventType];
  2453. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  2454. invoker({
  2455. "eventType": eventType,
  2456. "dispId": dispId,
  2457. "targetId": caller.id || "",
  2458. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() {
  2459. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall);
  2460. },
  2461. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() {
  2462. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse);
  2463. },
  2464. "onComplete": onEnsureRegistration
  2465. });
  2466. } else {
  2467. onEnsureRegistration(status);
  2468. }
  2469. } catch (ex) {
  2470. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2471. }
  2472. };
  2473. };
  2474. OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) {
  2475. for (var entry in asyncMethodNames) {
  2476. var method=asyncMethodNames[entry];
  2477. var name=method.displayName;
  2478. if (!target[name]) {
  2479. OSF.OUtil.defineEnumerableProperty(target, name, {
  2480. value: (function (asyncMethod) {
  2481. return function () {
  2482. var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];
  2483. invokeMethod(asyncMethod, arguments, target, privateState);
  2484. };
  2485. })(method)
  2486. });
  2487. }
  2488. }
  2489. };
  2490. OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) {
  2491. var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  2492. var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;
  2493. if (!target[add]) {
  2494. OSF.OUtil.defineEnumerableProperty(target, add, {
  2495. value: function () {
  2496. var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];
  2497. addEventHandler(arguments, eventDispatch, target);
  2498. }
  2499. });
  2500. }
  2501. if (!target[remove]) {
  2502. OSF.OUtil.defineEnumerableProperty(target, remove, {
  2503. value: function () {
  2504. var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];
  2505. removeEventHandler(arguments, eventDispatch, target);
  2506. }
  2507. });
  2508. }
  2509. };
  2510. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  2511. if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) {
  2512. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js';
  2513. OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() {
  2514. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  2515. throw 'Not able to load MicrosoftAjax.js.';
  2516. }
  2517. });
  2518. }
  2519. }
  2520. OSF.OUtil.setNamespace("SafeArray", OSF.DDA);
  2521. OSF.DDA.SafeArray.Response={
  2522. Status: 0,
  2523. Payload: 1
  2524. };
  2525. OSF.DDA.SafeArray.UniqueArguments={
  2526. Offset: "offset",
  2527. Run: "run",
  2528. BindingSpecificData: "bindingSpecificData",
  2529. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  2530. };
  2531. OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray);
  2532. OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) {
  2533. var status;
  2534. var number=ex.number;
  2535. if (number) {
  2536. switch (number) {
  2537. case -2146828218:
  2538. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  2539. break;
  2540. case -2146827850:
  2541. default:
  2542. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2543. break;
  2544. }
  2545. }
  2546. if (args.onComplete) {
  2547. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  2548. }
  2549. };
  2550. OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() {
  2551. function _2DVBArrayToJaggedArray(vbArr) {
  2552. var ret;
  2553. try {
  2554. var rows=vbArr.ubound(1);
  2555. var cols=vbArr.ubound(2);
  2556. vbArr=vbArr.toArray();
  2557. if (rows==1 && cols==1) {
  2558. ret=[vbArr];
  2559. } else {
  2560. ret=[];
  2561. for (var row=0; row < rows; row++) {
  2562. var rowArr=[];
  2563. for (var col=0; col < cols; col++) {
  2564. var datum=vbArr[row * cols+col];
  2565. if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) {
  2566. rowArr.push(datum);
  2567. }
  2568. }
  2569. if (rowArr.length > 0) {
  2570. ret.push(rowArr);
  2571. }
  2572. }
  2573. }
  2574. } catch (ex) {
  2575. }
  2576. return ret;
  2577. }
  2578. var complexTypes=[];
  2579. var dynamicTypes={};
  2580. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () {
  2581. var tableRows=0;
  2582. var tableHeaders=1;
  2583. return {
  2584. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) {
  2585. if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) {
  2586. var tableData=[];
  2587. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  2588. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  2589. data=tableData;
  2590. }
  2591. return data;
  2592. },
  2593. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  2594. var ret;
  2595. if (hostArgs.toArray) {
  2596. var dimensions=hostArgs.dimensions();
  2597. if (dimensions===2) {
  2598. ret=_2DVBArrayToJaggedArray(hostArgs);
  2599. } else {
  2600. var array=hostArgs.toArray();
  2601. if (array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) {
  2602. ret={};
  2603. ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]);
  2604. ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]);
  2605. } else {
  2606. ret=array;
  2607. }
  2608. }
  2609. } else {
  2610. ret=hostArgs;
  2611. }
  2612. return ret;
  2613. }
  2614. };
  2615. })();
  2616. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  2617. this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) {
  2618. var value;
  2619. if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) {
  2620. var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray;
  2621. value=toArraySupported ? arg.toArray() : arg || {};
  2622. } else if (this.isDynamicType(param)) {
  2623. value=dynamicTypes[param].fromHost(arg);
  2624. } else {
  2625. value=arg;
  2626. }
  2627. return value;
  2628. };
  2629. };
  2630. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  2631. OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [
  2632. {
  2633. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  2634. toHost: [
  2635. { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 },
  2636. { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 }
  2637. ]
  2638. },
  2639. {
  2640. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  2641. toHost: [
  2642. { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 }
  2643. ]
  2644. }
  2645. ]);
  2646. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  2647. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  2648. fromHost: [
  2649. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 },
  2650. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 }
  2651. ]
  2652. });
  2653. OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) {
  2654. function toArray(args) {
  2655. var arrArgs=args;
  2656. if (OSF.OUtil.isArray(args)) {
  2657. var len=arrArgs.length;
  2658. for (var i=0; i < len; i++) {
  2659. arrArgs[i]=toArray(arrArgs[i]);
  2660. }
  2661. } else if (OSF.OUtil.isDate(args)) {
  2662. arrArgs=args.getVarDate();
  2663. } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) {
  2664. arrArgs=[];
  2665. for (var index in args) {
  2666. if (!OSF.OUtil.isFunction(args[index])) {
  2667. arrArgs[index]=toArray(args[index]);
  2668. }
  2669. }
  2670. }
  2671. return arrArgs;
  2672. }
  2673. function fromSafeArray(value) {
  2674. var ret=value;
  2675. if (value !=null && value.toArray) {
  2676. var arrayResult=value.toArray();
  2677. for (var i=0; i < arrayResult.length; i++) {
  2678. arrayResult[i]=fromSafeArray(arrayResult[i]);
  2679. }
  2680. ret=arrayResult;
  2681. }
  2682. return ret;
  2683. }
  2684. try {
  2685. if (args.onCalling) {
  2686. args.onCalling();
  2687. }
  2688. var startTime=(new Date()).getTime();
  2689. OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) {
  2690. var result=hostResponseArgs.toArray();
  2691. var status=result[OSF.DDA.SafeArray.Response.Status];
  2692. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) {
  2693. var payload=result[OSF.DDA.SafeArray.Response.Payload];
  2694. payload=fromSafeArray(payload);
  2695. if (payload !=null) {
  2696. if (!args._chunkResultData) {
  2697. args._chunkResultData=new Array();
  2698. }
  2699. args._chunkResultData[payload[0]]=payload[1];
  2700. }
  2701. } else {
  2702. if (args.onReceiving) {
  2703. args.onReceiving();
  2704. }
  2705. if (args.onComplete) {
  2706. var payload;
  2707. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2708. if (result.length > 2) {
  2709. payload=[];
  2710. for (var i=1; i < result.length; i++)
  2711. payload[i - 1]=result[i];
  2712. } else {
  2713. payload=result[OSF.DDA.SafeArray.Response.Payload];
  2714. }
  2715. if (args._chunkResultData) {
  2716. payload=fromSafeArray(payload);
  2717. if (payload !=null) {
  2718. var expectedChunkCount=payload[payload.length - 1];
  2719. if (args._chunkResultData.length==expectedChunkCount) {
  2720. payload[payload.length - 1]=args._chunkResultData;
  2721. } else {
  2722. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2723. }
  2724. }
  2725. }
  2726. } else {
  2727. payload=result[OSF.DDA.SafeArray.Response.Payload];
  2728. }
  2729. args.onComplete(status, payload);
  2730. }
  2731. if (OSF.AppTelemetry) {
  2732. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status);
  2733. }
  2734. }
  2735. });
  2736. } catch (ex) {
  2737. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  2738. }
  2739. };
  2740. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) {
  2741. var startTime=(new Date()).getTime();
  2742. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) {
  2743. if (args.onReceiving) {
  2744. args.onReceiving();
  2745. }
  2746. var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  2747. if (args.onComplete) {
  2748. args.onComplete(status);
  2749. }
  2750. if (OSF.AppTelemetry) {
  2751. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  2752. }
  2753. };
  2754. };
  2755. OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) {
  2756. if (args.onCalling) {
  2757. args.onCalling();
  2758. }
  2759. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  2760. try {
  2761. OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  2762. if (args.onEvent) {
  2763. args.onEvent(payload);
  2764. }
  2765. if (OSF.AppTelemetry) {
  2766. OSF.AppTelemetry.onEventDone(args.dispId);
  2767. }
  2768. }, callback);
  2769. } catch (ex) {
  2770. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  2771. }
  2772. };
  2773. OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) {
  2774. if (args.onCalling) {
  2775. args.onCalling();
  2776. }
  2777. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  2778. try {
  2779. OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback);
  2780. } catch (ex) {
  2781. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  2782. }
  2783. };
  2784. OSF.ClientMode={
  2785. ReadWrite: 0,
  2786. ReadOnly: 1
  2787. };
  2788. OSF.DDA.RichInitializationReason={
  2789. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  2790. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  2791. };
  2792. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) {
  2793. this._hostInfo=hostInfo;
  2794. this._webAppState=webAppState;
  2795. this._context=context;
  2796. this._settings=settings;
  2797. this._hostFacade=hostFacade;
  2798. this._initializeSettings=this.initializeSettings;
  2799. };
  2800. OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) {
  2801. var settings;
  2802. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  2803. if (osfSessionStorage) {
  2804. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  2805. if (storageSettings) {
  2806. serializedSettings=(typeof (JSON) !=="undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true);
  2807. } else {
  2808. storageSettings=(typeof (JSON) !=="undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings);
  2809. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  2810. }
  2811. }
  2812. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  2813. if (refreshSupported) {
  2814. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  2815. } else {
  2816. settings=new OSF.DDA.Settings(deserializedSettings);
  2817. }
  2818. return settings;
  2819. };
  2820. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() {
  2821. };
  2822. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) {
  2823. this.prepareApiSurface(appContext);
  2824. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext));
  2825. };
  2826. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) {
  2827. var license=new OSF.DDA.License(appContext.get_eToken());
  2828. var getOfficeThemeHandler=(OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null;
  2829. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler));
  2830. var getDelegateMethods, parameterMap;
  2831. getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods;
  2832. parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  2833. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap));
  2834. };
  2835. OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) {
  2836. return OSF.DDA.RichInitializationReason[appContext.get_reason()];
  2837. };
  2838. OSF.DDA.DispIdHost.getClientDelegateMethods=function (actionId) {
  2839. var delegateMethods={};
  2840. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  2841. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  2842. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  2843. if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id) {
  2844. var readSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  2845. return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving);
  2846. };
  2847. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings);
  2848. }
  2849. if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id) {
  2850. var writeSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  2851. return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving);
  2852. };
  2853. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings);
  2854. }
  2855. return delegateMethods;
  2856. };
  2857. var OSFRichclient;
  2858. (function (OSFRichclient) {
  2859. var RichClientHostController=(function () {
  2860. function RichClientHostController() {
  2861. }
  2862. RichClientHostController.prototype.execute=function (id, params, callback) {
  2863. window.external.Execute(id, params, callback);
  2864. };
  2865. RichClientHostController.prototype.registerEvent=function (id, targetId, handler, callback) {
  2866. window.external.RegisterEvent(id, targetId, handler, callback);
  2867. };
  2868. RichClientHostController.prototype.unregisterEvent=function (id, targetId, callback) {
  2869. window.external.UnregisterEvent(id, targetId, callback);
  2870. };
  2871. return RichClientHostController;
  2872. })();
  2873. OSFRichclient.RichClientHostController=RichClientHostController;
  2874. })(OSFRichclient || (OSFRichclient={}));
  2875. OSF.ClientHostController=new OSFRichclient.RichClientHostController();
  2876. var OfficeExt;
  2877. (function (OfficeExt) {
  2878. (function (OfficeTheme) {
  2879. var OfficeThemeManager=(function () {
  2880. function OfficeThemeManager() {
  2881. this._osfOfficeTheme=null;
  2882. this._osfOfficeThemeTimeStamp=null;
  2883. }
  2884. OfficeThemeManager.prototype.getOfficeTheme=function () {
  2885. if (OSF.DDA._OsfControlContext) {
  2886. if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) {
  2887. if (OSF.AppTelemetry) {
  2888. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0);
  2889. }
  2890. } else {
  2891. var startTime=(new Date()).getTime();
  2892. var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo();
  2893. var endTime=(new Date()).getTime();
  2894. if (OSF.AppTelemetry) {
  2895. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime));
  2896. }
  2897. this._osfOfficeTheme=JSON.parse(osfOfficeTheme);
  2898. for (var color in this._osfOfficeTheme) {
  2899. this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]);
  2900. }
  2901. this._osfOfficeThemeTimeStamp=endTime;
  2902. }
  2903. return this._osfOfficeTheme;
  2904. }
  2905. };
  2906. OfficeThemeManager.instance=function () {
  2907. if (OfficeThemeManager._instance==null) {
  2908. OfficeThemeManager._instance=new OfficeThemeManager();
  2909. }
  2910. return OfficeThemeManager._instance;
  2911. };
  2912. OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5000;
  2913. OfficeThemeManager._instance=null;
  2914. return OfficeThemeManager;
  2915. })();
  2916. OfficeTheme.OfficeThemeManager=OfficeThemeManager;
  2917. OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA);
  2918. OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme;
  2919. })(OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={}));
  2920. var OfficeTheme=OfficeExt.OfficeTheme;
  2921. })(OfficeExt || (OfficeExt={}));
  2922. OSF.DDA.ClientSettingsManager={
  2923. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) {
  2924. return function (args) {
  2925. var status, response;
  2926. try {
  2927. response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving);
  2928. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  2929. } catch (ex) {
  2930. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2931. response={ name: Strings.OfficeOM.L_InternalError, message: ex };
  2932. }
  2933. if (args.onComplete) {
  2934. args.onComplete(status, response);
  2935. }
  2936. };
  2937. },
  2938. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) {
  2939. var keys=[];
  2940. var values=[];
  2941. if (onCalling) {
  2942. onCalling();
  2943. }
  2944. OSF.DDA._OsfControlContext.GetSettings().Read(keys, values);
  2945. if (onReceiving) {
  2946. onReceiving();
  2947. }
  2948. var serializedSettings={};
  2949. for (var index=0; index < keys.length; index++) {
  2950. serializedSettings[keys[index]]=values[index];
  2951. }
  2952. return serializedSettings;
  2953. },
  2954. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) {
  2955. var keys=[];
  2956. var values=[];
  2957. for (var key in serializedSettings) {
  2958. keys.push(key);
  2959. values.push(serializedSettings[key]);
  2960. }
  2961. if (onCalling) {
  2962. onCalling();
  2963. }
  2964. OSF.DDA._OsfControlContext.GetSettings().Write(keys, values);
  2965. if (onReceiving) {
  2966. onReceiving();
  2967. }
  2968. }
  2969. };
  2970. OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported) {
  2971. var serializedSettings=OSF.DDA.ClientSettingsManager.read();
  2972. var settings=this.deserializeSettings(serializedSettings, refreshSupported);
  2973. return settings;
  2974. };
  2975. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
  2976. var returnedContext;
  2977. var context=OSF.DDA._OsfControlContext=window.external.GetContext();
  2978. var appType=context.GetAppType();
  2979. var appTypeSupported=false;
  2980. for (var appEntry in OSF.AppName) {
  2981. if (OSF.AppName[appEntry]==appType) {
  2982. appTypeSupported=true;
  2983. break;
  2984. }
  2985. }
  2986. if (!appTypeSupported) {
  2987. throw "Unsupported client type "+appType;
  2988. }
  2989. var id=context.GetSolutionRef();
  2990. var version=context.GetAppVersionMajor();
  2991. var minorVersion=context.GetAppVersionMinor();
  2992. var UILocale=context.GetAppUILocale();
  2993. var dataLocale=context.GetAppDataLocale();
  2994. var docUrl=context.GetDocUrl();
  2995. var clientMode=context.GetAppCapabilities();
  2996. var reason=context.GetActivationMode();
  2997. var osfControlType=context.GetControlIntegrationLevel();
  2998. var settings=[];
  2999. var eToken;
  3000. try {
  3001. eToken=context.GetSolutionToken();
  3002. } catch (ex) {
  3003. }
  3004. var correlationId;
  3005. if (typeof context.GetCorrelationId !=="undefined") {
  3006. correlationId=context.GetCorrelationId();
  3007. }
  3008. var appInstanceId;
  3009. if (typeof context.GetInstanceId !=="undefined") {
  3010. appInstanceId=context.GetInstanceId();
  3011. }
  3012. var touchEnabled;
  3013. if (typeof context.GetTouchEnabled !=="undefined") {
  3014. touchEnabled=context.GetTouchEnabled();
  3015. }
  3016. var commerceAllowed;
  3017. if (typeof context.GetCommerceAllowed !=="undefined") {
  3018. commerceAllowed=context.GetCommerceAllowed();
  3019. }
  3020. var requirementMatrix;
  3021. if (typeof context.GetSupportedMatrix !=="undefined") {
  3022. requirementMatrix=context.GetSupportedMatrix();
  3023. }
  3024. eToken=eToken ? eToken.toString() : "";
  3025. returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix);
  3026. if (OSF.AppTelemetry) {
  3027. OSF.AppTelemetry.initialize(returnedContext);
  3028. }
  3029. gotAppContext(returnedContext);
  3030. };
  3031. var OSFLog;
  3032. (function (OSFLog) {
  3033. var BaseUsageData=(function () {
  3034. function BaseUsageData(table) {
  3035. this._table=table;
  3036. this._fields={};
  3037. }
  3038. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  3039. get: function () {
  3040. return this._fields;
  3041. },
  3042. enumerable: true,
  3043. configurable: true
  3044. });
  3045. Object.defineProperty(BaseUsageData.prototype, "Table", {
  3046. get: function () {
  3047. return this._table;
  3048. },
  3049. enumerable: true,
  3050. configurable: true
  3051. });
  3052. BaseUsageData.prototype.SerializeFields=function () {
  3053. };
  3054. BaseUsageData.prototype.SetSerializedField=function (key, value) {
  3055. if (typeof (value) !=="undefined" && value !==null) {
  3056. this._serializedFields[key]=value.toString();
  3057. }
  3058. };
  3059. BaseUsageData.prototype.SerializeRow=function () {
  3060. this._serializedFields={};
  3061. this.SetSerializedField("Table", this._table);
  3062. this.SerializeFields();
  3063. return JSON.stringify(this._serializedFields);
  3064. };
  3065. return BaseUsageData;
  3066. })();
  3067. OSFLog.BaseUsageData=BaseUsageData;
  3068. var AppActivatedUsageData=(function (_super) {
  3069. __extends(AppActivatedUsageData, _super);
  3070. function AppActivatedUsageData() {
  3071. _super.call(this, "AppActivated");
  3072. }
  3073. Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", {
  3074. get: function () {
  3075. return this.Fields["CorrelationId"];
  3076. },
  3077. set: function (value) {
  3078. this.Fields["CorrelationId"]=value;
  3079. },
  3080. enumerable: true,
  3081. configurable: true
  3082. });
  3083. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  3084. get: function () {
  3085. return this.Fields["SessionId"];
  3086. },
  3087. set: function (value) {
  3088. this.Fields["SessionId"]=value;
  3089. },
  3090. enumerable: true,
  3091. configurable: true
  3092. });
  3093. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  3094. get: function () {
  3095. return this.Fields["AppId"];
  3096. },
  3097. set: function (value) {
  3098. this.Fields["AppId"]=value;
  3099. },
  3100. enumerable: true,
  3101. configurable: true
  3102. });
  3103. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  3104. get: function () {
  3105. return this.Fields["AppURL"];
  3106. },
  3107. set: function (value) {
  3108. this.Fields["AppURL"]=value;
  3109. },
  3110. enumerable: true,
  3111. configurable: true
  3112. });
  3113. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  3114. get: function () {
  3115. return this.Fields["AssetId"];
  3116. },
  3117. set: function (value) {
  3118. this.Fields["AssetId"]=value;
  3119. },
  3120. enumerable: true,
  3121. configurable: true
  3122. });
  3123. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  3124. get: function () {
  3125. return this.Fields["Browser"];
  3126. },
  3127. set: function (value) {
  3128. this.Fields["Browser"]=value;
  3129. },
  3130. enumerable: true,
  3131. configurable: true
  3132. });
  3133. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  3134. get: function () {
  3135. return this.Fields["UserId"];
  3136. },
  3137. set: function (value) {
  3138. this.Fields["UserId"]=value;
  3139. },
  3140. enumerable: true,
  3141. configurable: true
  3142. });
  3143. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  3144. get: function () {
  3145. return this.Fields["Host"];
  3146. },
  3147. set: function (value) {
  3148. this.Fields["Host"]=value;
  3149. },
  3150. enumerable: true,
  3151. configurable: true
  3152. });
  3153. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  3154. get: function () {
  3155. return this.Fields["HostVersion"];
  3156. },
  3157. set: function (value) {
  3158. this.Fields["HostVersion"]=value;
  3159. },
  3160. enumerable: true,
  3161. configurable: true
  3162. });
  3163. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  3164. get: function () {
  3165. return this.Fields["ClientId"];
  3166. },
  3167. set: function (value) {
  3168. this.Fields["ClientId"]=value;
  3169. },
  3170. enumerable: true,
  3171. configurable: true
  3172. });
  3173. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  3174. get: function () {
  3175. return this.Fields["AppSizeWidth"];
  3176. },
  3177. set: function (value) {
  3178. this.Fields["AppSizeWidth"]=value;
  3179. },
  3180. enumerable: true,
  3181. configurable: true
  3182. });
  3183. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  3184. get: function () {
  3185. return this.Fields["AppSizeHeight"];
  3186. },
  3187. set: function (value) {
  3188. this.Fields["AppSizeHeight"]=value;
  3189. },
  3190. enumerable: true,
  3191. configurable: true
  3192. });
  3193. AppActivatedUsageData.prototype.SerializeFields=function () {
  3194. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3195. this.SetSerializedField("SessionId", this.SessionId);
  3196. this.SetSerializedField("AppId", this.AppId);
  3197. this.SetSerializedField("AppURL", this.AppURL);
  3198. this.SetSerializedField("AssetId", this.AssetId);
  3199. this.SetSerializedField("Browser", this.Browser);
  3200. this.SetSerializedField("UserId", this.UserId);
  3201. this.SetSerializedField("Host", this.Host);
  3202. this.SetSerializedField("HostVersion", this.HostVersion);
  3203. this.SetSerializedField("ClientId", this.ClientId);
  3204. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);
  3205. this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  3206. };
  3207. return AppActivatedUsageData;
  3208. })(BaseUsageData);
  3209. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  3210. var ScriptLoadUsageData=(function (_super) {
  3211. __extends(ScriptLoadUsageData, _super);
  3212. function ScriptLoadUsageData() {
  3213. _super.call(this, "ScriptLoad");
  3214. }
  3215. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  3216. get: function () {
  3217. return this.Fields["CorrelationId"];
  3218. },
  3219. set: function (value) {
  3220. this.Fields["CorrelationId"]=value;
  3221. },
  3222. enumerable: true,
  3223. configurable: true
  3224. });
  3225. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  3226. get: function () {
  3227. return this.Fields["SessionId"];
  3228. },
  3229. set: function (value) {
  3230. this.Fields["SessionId"]=value;
  3231. },
  3232. enumerable: true,
  3233. configurable: true
  3234. });
  3235. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  3236. get: function () {
  3237. return this.Fields["ScriptId"];
  3238. },
  3239. set: function (value) {
  3240. this.Fields["ScriptId"]=value;
  3241. },
  3242. enumerable: true,
  3243. configurable: true
  3244. });
  3245. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  3246. get: function () {
  3247. return this.Fields["StartTime"];
  3248. },
  3249. set: function (value) {
  3250. this.Fields["StartTime"]=value;
  3251. },
  3252. enumerable: true,
  3253. configurable: true
  3254. });
  3255. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  3256. get: function () {
  3257. return this.Fields["ResponseTime"];
  3258. },
  3259. set: function (value) {
  3260. this.Fields["ResponseTime"]=value;
  3261. },
  3262. enumerable: true,
  3263. configurable: true
  3264. });
  3265. ScriptLoadUsageData.prototype.SerializeFields=function () {
  3266. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3267. this.SetSerializedField("SessionId", this.SessionId);
  3268. this.SetSerializedField("ScriptId", this.ScriptId);
  3269. this.SetSerializedField("StartTime", this.StartTime);
  3270. this.SetSerializedField("ResponseTime", this.ResponseTime);
  3271. };
  3272. return ScriptLoadUsageData;
  3273. })(BaseUsageData);
  3274. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  3275. var AppClosedUsageData=(function (_super) {
  3276. __extends(AppClosedUsageData, _super);
  3277. function AppClosedUsageData() {
  3278. _super.call(this, "AppClosed");
  3279. }
  3280. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  3281. get: function () {
  3282. return this.Fields["CorrelationId"];
  3283. },
  3284. set: function (value) {
  3285. this.Fields["CorrelationId"]=value;
  3286. },
  3287. enumerable: true,
  3288. configurable: true
  3289. });
  3290. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  3291. get: function () {
  3292. return this.Fields["SessionId"];
  3293. },
  3294. set: function (value) {
  3295. this.Fields["SessionId"]=value;
  3296. },
  3297. enumerable: true,
  3298. configurable: true
  3299. });
  3300. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  3301. get: function () {
  3302. return this.Fields["FocusTime"];
  3303. },
  3304. set: function (value) {
  3305. this.Fields["FocusTime"]=value;
  3306. },
  3307. enumerable: true,
  3308. configurable: true
  3309. });
  3310. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  3311. get: function () {
  3312. return this.Fields["AppSizeFinalWidth"];
  3313. },
  3314. set: function (value) {
  3315. this.Fields["AppSizeFinalWidth"]=value;
  3316. },
  3317. enumerable: true,
  3318. configurable: true
  3319. });
  3320. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  3321. get: function () {
  3322. return this.Fields["AppSizeFinalHeight"];
  3323. },
  3324. set: function (value) {
  3325. this.Fields["AppSizeFinalHeight"]=value;
  3326. },
  3327. enumerable: true,
  3328. configurable: true
  3329. });
  3330. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  3331. get: function () {
  3332. return this.Fields["OpenTime"];
  3333. },
  3334. set: function (value) {
  3335. this.Fields["OpenTime"]=value;
  3336. },
  3337. enumerable: true,
  3338. configurable: true
  3339. });
  3340. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  3341. get: function () {
  3342. return this.Fields["CloseMethod"];
  3343. },
  3344. set: function (value) {
  3345. this.Fields["CloseMethod"]=value;
  3346. },
  3347. enumerable: true,
  3348. configurable: true
  3349. });
  3350. AppClosedUsageData.prototype.SerializeFields=function () {
  3351. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3352. this.SetSerializedField("SessionId", this.SessionId);
  3353. this.SetSerializedField("FocusTime", this.FocusTime);
  3354. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  3355. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  3356. this.SetSerializedField("OpenTime", this.OpenTime);
  3357. this.SetSerializedField("CloseMethod", this.CloseMethod);
  3358. };
  3359. return AppClosedUsageData;
  3360. })(BaseUsageData);
  3361. OSFLog.AppClosedUsageData=AppClosedUsageData;
  3362. var APIUsageUsageData=(function (_super) {
  3363. __extends(APIUsageUsageData, _super);
  3364. function APIUsageUsageData() {
  3365. _super.call(this, "APIUsage");
  3366. }
  3367. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  3368. get: function () {
  3369. return this.Fields["CorrelationId"];
  3370. },
  3371. set: function (value) {
  3372. this.Fields["CorrelationId"]=value;
  3373. },
  3374. enumerable: true,
  3375. configurable: true
  3376. });
  3377. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  3378. get: function () {
  3379. return this.Fields["SessionId"];
  3380. },
  3381. set: function (value) {
  3382. this.Fields["SessionId"]=value;
  3383. },
  3384. enumerable: true,
  3385. configurable: true
  3386. });
  3387. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  3388. get: function () {
  3389. return this.Fields["APIType"];
  3390. },
  3391. set: function (value) {
  3392. this.Fields["APIType"]=value;
  3393. },
  3394. enumerable: true,
  3395. configurable: true
  3396. });
  3397. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  3398. get: function () {
  3399. return this.Fields["APIID"];
  3400. },
  3401. set: function (value) {
  3402. this.Fields["APIID"]=value;
  3403. },
  3404. enumerable: true,
  3405. configurable: true
  3406. });
  3407. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  3408. get: function () {
  3409. return this.Fields["Parameters"];
  3410. },
  3411. set: function (value) {
  3412. this.Fields["Parameters"]=value;
  3413. },
  3414. enumerable: true,
  3415. configurable: true
  3416. });
  3417. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  3418. get: function () {
  3419. return this.Fields["ResponseTime"];
  3420. },
  3421. set: function (value) {
  3422. this.Fields["ResponseTime"]=value;
  3423. },
  3424. enumerable: true,
  3425. configurable: true
  3426. });
  3427. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  3428. get: function () {
  3429. return this.Fields["ErrorType"];
  3430. },
  3431. set: function (value) {
  3432. this.Fields["ErrorType"]=value;
  3433. },
  3434. enumerable: true,
  3435. configurable: true
  3436. });
  3437. APIUsageUsageData.prototype.SerializeFields=function () {
  3438. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3439. this.SetSerializedField("SessionId", this.SessionId);
  3440. this.SetSerializedField("APIType", this.APIType);
  3441. this.SetSerializedField("APIID", this.APIID);
  3442. this.SetSerializedField("Parameters", this.Parameters);
  3443. this.SetSerializedField("ResponseTime", this.ResponseTime);
  3444. this.SetSerializedField("ErrorType", this.ErrorType);
  3445. };
  3446. return APIUsageUsageData;
  3447. })(BaseUsageData);
  3448. OSFLog.APIUsageUsageData=APIUsageUsageData;
  3449. var AppInitializationUsageData=(function (_super) {
  3450. __extends(AppInitializationUsageData, _super);
  3451. function AppInitializationUsageData() {
  3452. _super.call(this, "AppInitialization");
  3453. }
  3454. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  3455. get: function () {
  3456. return this.Fields["CorrelationId"];
  3457. },
  3458. set: function (value) {
  3459. this.Fields["CorrelationId"]=value;
  3460. },
  3461. enumerable: true,
  3462. configurable: true
  3463. });
  3464. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  3465. get: function () {
  3466. return this.Fields["SessionId"];
  3467. },
  3468. set: function (value) {
  3469. this.Fields["SessionId"]=value;
  3470. },
  3471. enumerable: true,
  3472. configurable: true
  3473. });
  3474. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  3475. get: function () {
  3476. return this.Fields["SuccessCode"];
  3477. },
  3478. set: function (value) {
  3479. this.Fields["SuccessCode"]=value;
  3480. },
  3481. enumerable: true,
  3482. configurable: true
  3483. });
  3484. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  3485. get: function () {
  3486. return this.Fields["Message"];
  3487. },
  3488. set: function (value) {
  3489. this.Fields["Message"]=value;
  3490. },
  3491. enumerable: true,
  3492. configurable: true
  3493. });
  3494. AppInitializationUsageData.prototype.SerializeFields=function () {
  3495. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3496. this.SetSerializedField("SessionId", this.SessionId);
  3497. this.SetSerializedField("SuccessCode", this.SuccessCode);
  3498. this.SetSerializedField("Message", this.Message);
  3499. };
  3500. return AppInitializationUsageData;
  3501. })(BaseUsageData);
  3502. OSFLog.AppInitializationUsageData=AppInitializationUsageData;
  3503. })(OSFLog || (OSFLog={}));
  3504. var Logger;
  3505. (function (Logger) {
  3506. "use strict";
  3507. (function (TraceLevel) {
  3508. TraceLevel[TraceLevel["info"]=0]="info";
  3509. TraceLevel[TraceLevel["warning"]=1]="warning";
  3510. TraceLevel[TraceLevel["error"]=2]="error";
  3511. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  3512. var TraceLevel=Logger.TraceLevel;
  3513. (function (SendFlag) {
  3514. SendFlag[SendFlag["none"]=0]="none";
  3515. SendFlag[SendFlag["flush"]=1]="flush";
  3516. })(Logger.SendFlag || (Logger.SendFlag={}));
  3517. var SendFlag=Logger.SendFlag;
  3518. function allowUploadingData() {
  3519. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  3520. OSF.Logger.ulsEndpoint.loadProxyFrame();
  3521. }
  3522. }
  3523. Logger.allowUploadingData=allowUploadingData;
  3524. function sendLog(traceLevel, message, flag) {
  3525. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  3526. var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  3527. var logs=JSON.stringify(jsonObj);
  3528. OSF.Logger.ulsEndpoint.writeLog(logs);
  3529. }
  3530. }
  3531. Logger.sendLog=sendLog;
  3532. function creatULSEndpoint() {
  3533. try {
  3534. return new ULSEndpointProxy();
  3535. } catch (e) {
  3536. return null;
  3537. }
  3538. }
  3539. var ULSEndpointProxy=(function () {
  3540. function ULSEndpointProxy() {
  3541. var _this=this;
  3542. this.proxyFrame=null;
  3543. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  3544. this.buffer=[];
  3545. this.proxyFrameReady=false;
  3546. OSF.OUtil.addEventListener(window, "message", function (e) {
  3547. return _this.tellProxyFrameReady(e);
  3548. });
  3549. setTimeout(function () {
  3550. _this.loadProxyFrame();
  3551. }, 3000);
  3552. }
  3553. ULSEndpointProxy.prototype.writeLog=function (log) {
  3554. if (this.proxyFrameReady===true) {
  3555. this.proxyFrame.contentWindow.postMessage(log, "*");
  3556. } else {
  3557. if (this.buffer.length < 128) {
  3558. this.buffer.push(log);
  3559. }
  3560. }
  3561. };
  3562. ULSEndpointProxy.prototype.loadProxyFrame=function () {
  3563. if (this.proxyFrame==null) {
  3564. this.proxyFrame=document.createElement("iframe");
  3565. this.proxyFrame.setAttribute("style", "display:none");
  3566. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  3567. document.head.appendChild(this.proxyFrame);
  3568. }
  3569. };
  3570. ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) {
  3571. var _this=this;
  3572. if (e.data==="ProxyFrameReadyToLog") {
  3573. this.proxyFrameReady=true;
  3574. for (var i=0; i < this.buffer.length; i++) {
  3575. this.writeLog(this.buffer[i]);
  3576. }
  3577. this.buffer.length=0;
  3578. OSF.OUtil.removeEventListener(window, "message", function (e) {
  3579. return _this.tellProxyFrameReady(e);
  3580. });
  3581. } else if (e.data==="ProxyFrameReadyToInit") {
  3582. var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  3583. var initStr=JSON.stringify(initJson);
  3584. this.proxyFrame.contentWindow.postMessage(initStr, "*");
  3585. }
  3586. };
  3587. return ULSEndpointProxy;
  3588. })();
  3589. if (!OSF.Logger) {
  3590. OSF.Logger=Logger;
  3591. }
  3592. Logger.ulsEndpoint=creatULSEndpoint();
  3593. })(Logger || (Logger={}));
  3594. var OSFAppTelemetry;
  3595. (function (OSFAppTelemetry) {
  3596. "use strict";
  3597. var appInfo;
  3598. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  3599. var osfControlAppCorrelationId="";
  3600. ;
  3601. var AppInfo=(function () {
  3602. function AppInfo() {
  3603. }
  3604. return AppInfo;
  3605. })();
  3606. var Event=(function () {
  3607. function Event(name, handler) {
  3608. this.name=name;
  3609. this.handler=handler;
  3610. }
  3611. return Event;
  3612. })();
  3613. var AppStorage=(function () {
  3614. function AppStorage() {
  3615. this.clientIDKey="Office API client";
  3616. this.logIdSetKey="Office App Log Id Set";
  3617. }
  3618. AppStorage.prototype.getClientId=function () {
  3619. var clientId=this.getValue(this.clientIDKey);
  3620. if (!clientId || clientId.length <=0 || clientId.length > 40) {
  3621. clientId=OSF.OUtil.Guid.generateNewGuid();
  3622. this.setValue(this.clientIDKey, clientId);
  3623. }
  3624. return clientId;
  3625. };
  3626. AppStorage.prototype.saveLog=function (logId, log) {
  3627. var logIdSet=this.getValue(this.logIdSetKey);
  3628. logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId;
  3629. this.setValue(this.logIdSetKey, logIdSet);
  3630. this.setValue(logId, log);
  3631. };
  3632. AppStorage.prototype.enumerateLog=function (callback, clean) {
  3633. var logIdSet=this.getValue(this.logIdSetKey);
  3634. if (logIdSet) {
  3635. var ids=logIdSet.split(";");
  3636. for (var id in ids) {
  3637. var logId=ids[id];
  3638. var log=this.getValue(logId);
  3639. if (log) {
  3640. if (callback) {
  3641. callback(logId, log);
  3642. }
  3643. if (clean) {
  3644. this.remove(logId);
  3645. }
  3646. }
  3647. }
  3648. if (clean) {
  3649. this.remove(this.logIdSetKey);
  3650. }
  3651. }
  3652. };
  3653. AppStorage.prototype.getValue=function (key) {
  3654. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  3655. var value="";
  3656. if (osfLocalStorage) {
  3657. value=osfLocalStorage.getItem(key);
  3658. }
  3659. return value;
  3660. };
  3661. AppStorage.prototype.setValue=function (key, value) {
  3662. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  3663. if (osfLocalStorage) {
  3664. osfLocalStorage.setItem(key, value);
  3665. }
  3666. };
  3667. AppStorage.prototype.remove=function (key) {
  3668. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  3669. if (osfLocalStorage) {
  3670. try {
  3671. osfLocalStorage.removeItem(key);
  3672. } catch (ex) {
  3673. }
  3674. }
  3675. };
  3676. return AppStorage;
  3677. })();
  3678. var AppLogger=(function () {
  3679. function AppLogger() {
  3680. }
  3681. AppLogger.prototype.LogData=function (data) {
  3682. if (!OSF.Logger) {
  3683. return;
  3684. }
  3685. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  3686. };
  3687. AppLogger.prototype.LogRawData=function (log) {
  3688. if (!OSF.Logger) {
  3689. return;
  3690. }
  3691. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  3692. };
  3693. return AppLogger;
  3694. })();
  3695. function initialize(context) {
  3696. if (!OSF.Logger) {
  3697. return;
  3698. }
  3699. if (appInfo) {
  3700. return;
  3701. }
  3702. appInfo=new AppInfo();
  3703. appInfo.hostVersion=context.get_appVersion();
  3704. appInfo.appId=context.get_id();
  3705. appInfo.host=context.get_appName();
  3706. appInfo.browser=window.navigator.userAgent;
  3707. appInfo.correlationId=context.get_correlationId();
  3708. appInfo.clientId=(new AppStorage()).getClientId();
  3709. var index=location.href.indexOf("?");
  3710. appInfo.appURL=(index==-1) ? location.href : location.href.substring(0, index);
  3711. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  3712. var xmlContent;
  3713. var parser;
  3714. var xmlDoc;
  3715. appInfo.assetId="";
  3716. appInfo.userId="";
  3717. try {
  3718. xmlContent=decodeURIComponent(token);
  3719. parser=new DOMParser();
  3720. xmlDoc=parser.parseFromString(xmlContent, "text/xml");
  3721. appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;
  3722. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  3723. } catch (e) {
  3724. } finally {
  3725. xmlContent=null;
  3726. xmlDoc=null;
  3727. parser=null;
  3728. }
  3729. })(context.get_eToken(), appInfo);
  3730. (function handleLifecycle() {
  3731. var startTime=new Date();
  3732. var lastFocus=null;
  3733. var focusTime=0;
  3734. var finished=false;
  3735. var adjustFocusTime=function () {
  3736. if (document.hasFocus()) {
  3737. if (lastFocus==null) {
  3738. lastFocus=new Date();
  3739. }
  3740. } else if (lastFocus) {
  3741. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  3742. lastFocus=null;
  3743. }
  3744. };
  3745. var eventList=[];
  3746. eventList.push(new Event("focus", adjustFocusTime));
  3747. eventList.push(new Event("blur", adjustFocusTime));
  3748. eventList.push(new Event("focusout", adjustFocusTime));
  3749. eventList.push(new Event("focusin", adjustFocusTime));
  3750. var exitFunction=function () {
  3751. for (var i=0; i < eventList.length; i++) {
  3752. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  3753. }
  3754. eventList.length=0;
  3755. if (!finished) {
  3756. if (document.hasFocus() && lastFocus) {
  3757. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  3758. lastFocus=null;
  3759. }
  3760. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  3761. finished=true;
  3762. }
  3763. };
  3764. eventList.push(new Event("beforeunload", exitFunction));
  3765. eventList.push(new Event("unload", exitFunction));
  3766. for (var i=0; i < eventList.length; i++) {
  3767. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  3768. }
  3769. adjustFocusTime();
  3770. })();
  3771. OSFAppTelemetry.onAppActivated();
  3772. }
  3773. OSFAppTelemetry.initialize=initialize;
  3774. function onAppActivated() {
  3775. if (!appInfo) {
  3776. return;
  3777. }
  3778. (new AppStorage()).enumerateLog(function (id, log) {
  3779. return (new AppLogger()).LogRawData(log);
  3780. }, true);
  3781. var data=new OSFLog.AppActivatedUsageData();
  3782. data.SessionId=sessionId;
  3783. data.AppId=appInfo.appId;
  3784. data.AssetId=appInfo.assetId;
  3785. data.AppURL=appInfo.appURL;
  3786. data.UserId=appInfo.userId;
  3787. data.ClientId=appInfo.clientId;
  3788. data.Browser=appInfo.browser;
  3789. data.Host=appInfo.host;
  3790. data.HostVersion=appInfo.hostVersion;
  3791. data.CorrelationId=appInfo.correlationId;
  3792. data.AppSizeWidth=window.innerWidth;
  3793. data.AppSizeHeight=window.innerHeight;
  3794. (new AppLogger()).LogData(data);
  3795. setTimeout(function () {
  3796. if (!OSF.Logger) {
  3797. return;
  3798. }
  3799. OSF.Logger.allowUploadingData();
  3800. }, 100);
  3801. }
  3802. OSFAppTelemetry.onAppActivated=onAppActivated;
  3803. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  3804. var data=new OSFLog.ScriptLoadUsageData();
  3805. data.CorrelationId=appCorrelationId;
  3806. data.SessionId=sessionId;
  3807. data.ScriptId=scriptId;
  3808. data.StartTime=msStartTime;
  3809. data.ResponseTime=msResponseTime;
  3810. (new AppLogger()).LogData(data);
  3811. }
  3812. OSFAppTelemetry.onScriptDone=onScriptDone;
  3813. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  3814. if (!appInfo) {
  3815. return;
  3816. }
  3817. var data=new OSFLog.APIUsageUsageData();
  3818. data.CorrelationId=osfControlAppCorrelationId;
  3819. data.SessionId=sessionId;
  3820. data.APIType=apiType;
  3821. data.APIID=id;
  3822. data.Parameters=parameters;
  3823. data.ResponseTime=msResponseTime;
  3824. data.ErrorType=errorType;
  3825. (new AppLogger()).LogData(data);
  3826. }
  3827. OSFAppTelemetry.onCallDone=onCallDone;
  3828. ;
  3829. function onMethodDone(id, args, msResponseTime, errorType) {
  3830. var parameters=null;
  3831. if (args) {
  3832. if (typeof args=="number") {
  3833. parameters=String(args);
  3834. } else if (typeof args==="object") {
  3835. for (var index in args) {
  3836. if (parameters !==null) {
  3837. parameters+=",";
  3838. } else {
  3839. parameters="";
  3840. }
  3841. if (typeof args[index]=="number") {
  3842. parameters+=String(args[index]);
  3843. }
  3844. }
  3845. } else {
  3846. parameters="";
  3847. }
  3848. }
  3849. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  3850. }
  3851. OSFAppTelemetry.onMethodDone=onMethodDone;
  3852. function onPropertyDone(propertyName, msResponseTime) {
  3853. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  3854. }
  3855. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  3856. function onEventDone(id, errorType) {
  3857. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  3858. }
  3859. OSFAppTelemetry.onEventDone=onEventDone;
  3860. function onRegisterDone(register, id, msResponseTime, errorType) {
  3861. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  3862. }
  3863. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  3864. function onAppClosed(openTime, focusTime) {
  3865. if (!appInfo) {
  3866. return;
  3867. }
  3868. var data=new OSFLog.AppClosedUsageData();
  3869. data.CorrelationId=osfControlAppCorrelationId;
  3870. data.SessionId=sessionId;
  3871. data.FocusTime=focusTime;
  3872. data.OpenTime=openTime;
  3873. data.AppSizeFinalWidth=window.innerWidth;
  3874. data.AppSizeFinalHeight=window.innerHeight;
  3875. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  3876. }
  3877. OSFAppTelemetry.onAppClosed=onAppClosed;
  3878. function setOsfControlAppCorrelationId(correlationId) {
  3879. osfControlAppCorrelationId=correlationId;
  3880. }
  3881. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  3882. function doAppInitializationLogging(isException, message) {
  3883. var data=new OSFLog.AppInitializationUsageData();
  3884. data.CorrelationId=osfControlAppCorrelationId;
  3885. data.SessionId=sessionId;
  3886. data.SuccessCode=isException ? 1 : 0;
  3887. data.Message=message;
  3888. (new AppLogger()).LogData(data);
  3889. }
  3890. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  3891. function logAppCommonMessage(message) {
  3892. doAppInitializationLogging(false, message);
  3893. }
  3894. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  3895. function logAppException(errorMessage) {
  3896. doAppInitializationLogging(true, errorMessage);
  3897. }
  3898. OSFAppTelemetry.logAppException=logAppException;
  3899. OSF.AppTelemetry=OSFAppTelemetry;
  3900. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  3901. Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) {
  3902. function fixData(data) {
  3903. if (data==null || data==undefined) {
  3904. return null;
  3905. }
  3906. try {
  3907. for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  3908. data=[data];
  3909. }
  3910. return data;
  3911. } catch (ex) {
  3912. }
  3913. }
  3914. ;
  3915. OSF.OUtil.defineEnumerableProperties(this, {
  3916. "headers": {
  3917. get: function () {
  3918. return headers;
  3919. },
  3920. set: function (value) {
  3921. headers=fixData(value);
  3922. }
  3923. },
  3924. "rows": {
  3925. get: function () {
  3926. return rows;
  3927. },
  3928. set: function (value) {
  3929. rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ? [] : fixData(value);
  3930. }
  3931. }
  3932. });
  3933. this.headers=headers;
  3934. this.rows=rows;
  3935. };
  3936. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  3937. OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  3938. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  3939. };
  3940. Microsoft.Office.WebExtension.CoercionType={
  3941. Text: "text",
  3942. Matrix: "matrix",
  3943. Table: "table"
  3944. };
  3945. OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() {
  3946. return {
  3947. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  3948. if (OSF.OUtil.isArray(obj)) {
  3949. var dim=0;
  3950. for (var index=0; index < obj.length; index++) {
  3951. dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  3952. }
  3953. return dim+1;
  3954. } else {
  3955. return 0;
  3956. }
  3957. },
  3958. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  3959. switch (bindingType) {
  3960. case Microsoft.Office.WebExtension.BindingType.Matrix:
  3961. return Microsoft.Office.WebExtension.CoercionType.Matrix;
  3962. case Microsoft.Office.WebExtension.BindingType.Table:
  3963. return Microsoft.Office.WebExtension.CoercionType.Table;
  3964. case Microsoft.Office.WebExtension.BindingType.Text:
  3965. default:
  3966. return Microsoft.Office.WebExtension.CoercionType.Text;
  3967. }
  3968. },
  3969. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  3970. switch (coercionType) {
  3971. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  3972. return Microsoft.Office.WebExtension.BindingType.Matrix;
  3973. case Microsoft.Office.WebExtension.CoercionType.Table:
  3974. return Microsoft.Office.WebExtension.BindingType.Table;
  3975. case Microsoft.Office.WebExtension.CoercionType.Text:
  3976. case Microsoft.Office.WebExtension.CoercionType.Html:
  3977. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  3978. default:
  3979. return Microsoft.Office.WebExtension.BindingType.Text;
  3980. }
  3981. },
  3982. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  3983. if (data==null || data==undefined)
  3984. return null;
  3985. var sourceType=null;
  3986. var runtimeType=typeof data;
  3987. if (data.rows !==undefined) {
  3988. sourceType=Microsoft.Office.WebExtension.CoercionType.Table;
  3989. } else if (OSF.OUtil.isArray(data)) {
  3990. sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix;
  3991. } else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) {
  3992. sourceType=Microsoft.Office.WebExtension.CoercionType.Text;
  3993. } else {
  3994. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  3995. }
  3996. return sourceType;
  3997. },
  3998. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  3999. sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  4000. if (sourceType && sourceType !=destinationType) {
  4001. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  4002. data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  4003. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  4004. }
  4005. return data;
  4006. },
  4007. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  4008. if (matrix.length==1 && matrix[0].length==1)
  4009. return ""+matrix[0][0];
  4010. var val="";
  4011. for (var i=0; i < matrix.length; i++) {
  4012. val+=matrix[i].join("\t")+"\n";
  4013. }
  4014. return val.substring(0, val.length - 1);
  4015. },
  4016. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  4017. var ret=text.split("\n");
  4018. for (var i=0; i < ret.length; i++)
  4019. ret[i]=ret[i].split("\t");
  4020. return ret;
  4021. },
  4022. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  4023. var headers="";
  4024. if (table.headers !=null) {
  4025. headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n";
  4026. }
  4027. var rows=OSF.DDA.DataCoercion._matrixToText(table.rows);
  4028. if (rows=="") {
  4029. headers=headers.substring(0, headers.length - 1);
  4030. }
  4031. return headers+rows;
  4032. },
  4033. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  4034. var matrix=table.rows;
  4035. if (table.headers !=null) {
  4036. matrix.unshift(table.headers);
  4037. }
  4038. return matrix;
  4039. },
  4040. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  4041. var value;
  4042. switch (coercionType) {
  4043. case Microsoft.Office.WebExtension.CoercionType.Table:
  4044. value=table;
  4045. break;
  4046. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  4047. value=OSF.DDA.DataCoercion._tableToMatrix(table);
  4048. break;
  4049. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  4050. value=null;
  4051. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  4052. value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  4053. }
  4054. if (value==null) {
  4055. value=OSF.DDA.DataCoercion._tableToText(table);
  4056. }
  4057. break;
  4058. case Microsoft.Office.WebExtension.CoercionType.Text:
  4059. case Microsoft.Office.WebExtension.CoercionType.Html:
  4060. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  4061. default:
  4062. value=OSF.DDA.DataCoercion._tableToText(table);
  4063. break;
  4064. }
  4065. return value;
  4066. },
  4067. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  4068. if (sourceType==undefined) {
  4069. sourceType=OSF.DDA.DataCoercion.determineCoercionType(data);
  4070. }
  4071. var value;
  4072. switch (sourceType) {
  4073. case Microsoft.Office.WebExtension.CoercionType.Table:
  4074. value=data;
  4075. break;
  4076. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  4077. value=new Microsoft.Office.WebExtension.TableData(data);
  4078. break;
  4079. case Microsoft.Office.WebExtension.CoercionType.Text:
  4080. case Microsoft.Office.WebExtension.CoercionType.Html:
  4081. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  4082. default:
  4083. value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  4084. break;
  4085. }
  4086. return value;
  4087. }
  4088. };
  4089. })();
  4090. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4091. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  4092. toHost: [
  4093. { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 },
  4094. { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 },
  4095. { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 }
  4096. ]
  4097. });
  4098. OSF.DDA.AsyncMethodNames.addNames({
  4099. GetSelectedDataAsync: "getSelectedDataAsync",
  4100. SetSelectedDataAsync: "setSelectedDataAsync"
  4101. });
  4102. (function () {
  4103. function processData(dataDescriptor, caller, callArgs) {
  4104. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  4105. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  4106. data=OSF.DDA.OMFactory.manufactureTableData(data);
  4107. }
  4108. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  4109. return data==undefined ? null : data;
  4110. }
  4111. OSF.DDA.AsyncMethodCalls.define({
  4112. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  4113. requiredArguments: [
  4114. {
  4115. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  4116. "enum": Microsoft.Office.WebExtension.CoercionType
  4117. }
  4118. ],
  4119. supportedOptions: [
  4120. {
  4121. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  4122. value: {
  4123. "enum": Microsoft.Office.WebExtension.ValueFormat,
  4124. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  4125. }
  4126. },
  4127. {
  4128. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  4129. value: {
  4130. "enum": Microsoft.Office.WebExtension.FilterType,
  4131. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  4132. }
  4133. }
  4134. ],
  4135. privateStateCallbacks: [],
  4136. onSucceeded: processData
  4137. });
  4138. OSF.DDA.AsyncMethodCalls.define({
  4139. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  4140. requiredArguments: [
  4141. {
  4142. "name": Microsoft.Office.WebExtension.Parameters.Data,
  4143. "types": ["string", "object", "number", "boolean"]
  4144. }
  4145. ],
  4146. supportedOptions: [
  4147. {
  4148. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  4149. value: {
  4150. "enum": Microsoft.Office.WebExtension.CoercionType,
  4151. "calculate": function (requiredArgs) {
  4152. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  4153. }
  4154. }
  4155. },
  4156. {
  4157. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  4158. value: {
  4159. "types": ["number", "boolean"],
  4160. "defaultValue": false
  4161. }
  4162. },
  4163. {
  4164. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  4165. value: {
  4166. "types": ["number", "boolean"],
  4167. "defaultValue": false
  4168. }
  4169. },
  4170. {
  4171. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  4172. value: {
  4173. "types": ["number", "boolean"],
  4174. "defaultValue": false
  4175. }
  4176. },
  4177. {
  4178. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  4179. value: {
  4180. "types": ["number", "boolean"],
  4181. "defaultValue": false
  4182. }
  4183. }
  4184. ],
  4185. privateStateCallbacks: []
  4186. });
  4187. })();
  4188. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4189. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  4190. fromHost: [
  4191. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  4192. ],
  4193. toHost: [
  4194. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  4195. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 },
  4196. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 }
  4197. ]
  4198. });
  4199. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4200. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  4201. toHost: [
  4202. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  4203. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  4204. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 },
  4205. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 },
  4206. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 },
  4207. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 }
  4208. ]
  4209. });
  4210. OSF.DDA.SettingsManager={
  4211. SerializedSettings: "serializedSettings",
  4212. DateJSONPrefix: "Date(",
  4213. DataJSONSuffix: ")",
  4214. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  4215. var ret={};
  4216. for (var key in settingsCollection) {
  4217. var value=settingsCollection[key];
  4218. try {
  4219. if (JSON) {
  4220. value=JSON.stringify(value, function dateReplacer(k, v) {
  4221. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v;
  4222. });
  4223. } else {
  4224. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  4225. }
  4226. ret[key]=value;
  4227. } catch (ex) {
  4228. }
  4229. }
  4230. return ret;
  4231. },
  4232. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  4233. var ret={};
  4234. serializedSettings=serializedSettings || {};
  4235. for (var key in serializedSettings) {
  4236. var value=serializedSettings[key];
  4237. try {
  4238. if (JSON) {
  4239. value=JSON.parse(value, function dateReviver(k, v) {
  4240. var d;
  4241. if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) {
  4242. d=new Date(parseInt(v.slice(5, -1)));
  4243. if (d) {
  4244. return d;
  4245. }
  4246. }
  4247. return v;
  4248. });
  4249. } else {
  4250. value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  4251. }
  4252. ret[key]=value;
  4253. } catch (ex) {
  4254. }
  4255. }
  4256. return ret;
  4257. }
  4258. };
  4259. OSF.DDA.Settings=function OSF_DDA_Settings(settings) {
  4260. settings=settings || {};
  4261. var cacheSessionSettings=function (settings) {
  4262. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  4263. if (osfSessionStorage) {
  4264. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings);
  4265. var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  4266. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  4267. }
  4268. };
  4269. OSF.OUtil.defineEnumerableProperties(this, {
  4270. "get": {
  4271. value: function OSF_DDA_Settings$get(name) {
  4272. var e=Function._validateParams(arguments, [
  4273. { name: "name", type: String, mayBeNull: false }
  4274. ]);
  4275. if (e)
  4276. throw e;
  4277. var setting=settings[name];
  4278. return typeof (setting)==='undefined' ? null : setting;
  4279. }
  4280. },
  4281. "set": {
  4282. value: function OSF_DDA_Settings$set(name, value) {
  4283. var e=Function._validateParams(arguments, [
  4284. { name: "name", type: String, mayBeNull: false },
  4285. { name: "value", mayBeNull: true }
  4286. ]);
  4287. if (e)
  4288. throw e;
  4289. settings[name]=value;
  4290. cacheSessionSettings(settings);
  4291. }
  4292. },
  4293. "remove": {
  4294. value: function OSF_DDA_Settings$remove(name) {
  4295. var e=Function._validateParams(arguments, [
  4296. { name: "name", type: String, mayBeNull: false }
  4297. ]);
  4298. if (e)
  4299. throw e;
  4300. delete settings[name];
  4301. cacheSessionSettings(settings);
  4302. }
  4303. }
  4304. });
  4305. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  4306. };
  4307. OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) {
  4308. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  4309. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  4310. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  4311. };
  4312. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  4313. Microsoft.Office.WebExtension.EventType={};
  4314. OSF.EventDispatch=function OSF_EventDispatch(eventTypes) {
  4315. this._eventHandlers={};
  4316. for (var entry in eventTypes) {
  4317. var eventType=eventTypes[entry];
  4318. this._eventHandlers[eventType]=[];
  4319. }
  4320. };
  4321. OSF.EventDispatch.prototype={
  4322. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  4323. var events=[];
  4324. for (var eventName in this._eventHandlers)
  4325. events.push(eventName);
  4326. return events;
  4327. },
  4328. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  4329. var isSupported=false;
  4330. for (var eventName in this._eventHandlers) {
  4331. if (event==eventName) {
  4332. isSupported=true;
  4333. break;
  4334. }
  4335. }
  4336. return isSupported;
  4337. },
  4338. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  4339. var handlers=this._eventHandlers[eventType];
  4340. if (handlers && handlers.length > 0) {
  4341. for (var h in handlers) {
  4342. if (handlers[h]===handler)
  4343. return true;
  4344. }
  4345. }
  4346. return false;
  4347. },
  4348. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  4349. if (typeof handler !="function") {
  4350. return false;
  4351. }
  4352. var handlers=this._eventHandlers[eventType];
  4353. if (handlers && !this.hasEventHandler(eventType, handler)) {
  4354. handlers.push(handler);
  4355. return true;
  4356. } else {
  4357. return false;
  4358. }
  4359. },
  4360. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  4361. var handlers=this._eventHandlers[eventType];
  4362. if (handlers && handlers.length > 0) {
  4363. for (var index=0; index < handlers.length; index++) {
  4364. if (handlers[index]===handler) {
  4365. handlers.splice(index, 1);
  4366. return true;
  4367. }
  4368. }
  4369. }
  4370. return false;
  4371. },
  4372. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  4373. if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) {
  4374. this._eventHandlers[eventType]=[];
  4375. return true;
  4376. }
  4377. return false;
  4378. },
  4379. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  4380. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1;
  4381. },
  4382. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  4383. if (eventArgs.type==undefined)
  4384. return false;
  4385. var eventType=eventArgs.type;
  4386. if (eventType && this._eventHandlers[eventType]) {
  4387. var eventHandlers=this._eventHandlers[eventType];
  4388. for (var handler in eventHandlers)
  4389. eventHandlers[handler](eventArgs);
  4390. return true;
  4391. } else {
  4392. return false;
  4393. }
  4394. }
  4395. };
  4396. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  4397. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  4398. var args;
  4399. switch (eventType) {
  4400. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  4401. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  4402. break;
  4403. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  4404. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  4405. break;
  4406. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  4407. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  4408. break;
  4409. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  4410. args=new OSF.DDA.SettingsChangedEventArgs(target);
  4411. break;
  4412. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  4413. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  4414. break;
  4415. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  4416. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  4417. break;
  4418. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  4419. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  4420. break;
  4421. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  4422. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  4423. break;
  4424. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  4425. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4426. break;
  4427. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  4428. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4429. break;
  4430. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  4431. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4432. break;
  4433. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  4434. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  4435. break;
  4436. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  4437. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  4438. break;
  4439. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  4440. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  4441. break;
  4442. default:
  4443. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  4444. }
  4445. return args;
  4446. };
  4447. OSF.DDA.AsyncMethodNames.addNames({
  4448. AddHandlerAsync: "addHandlerAsync",
  4449. RemoveHandlerAsync: "removeHandlerAsync"
  4450. });
  4451. OSF.DDA.AsyncMethodCalls.define({
  4452. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  4453. requiredArguments: [
  4454. {
  4455. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  4456. "enum": Microsoft.Office.WebExtension.EventType,
  4457. "verify": function (eventType, caller, eventDispatch) {
  4458. return eventDispatch.supportsEvent(eventType);
  4459. }
  4460. },
  4461. {
  4462. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  4463. "types": ["function"]
  4464. }
  4465. ],
  4466. supportedOptions: [],
  4467. privateStateCallbacks: []
  4468. });
  4469. OSF.DDA.AsyncMethodCalls.define({
  4470. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  4471. requiredArguments: [
  4472. {
  4473. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  4474. "enum": Microsoft.Office.WebExtension.EventType,
  4475. "verify": function (eventType, caller, eventDispatch) {
  4476. return eventDispatch.supportsEvent(eventType);
  4477. }
  4478. }
  4479. ],
  4480. supportedOptions: [
  4481. {
  4482. name: Microsoft.Office.WebExtension.Parameters.Handler,
  4483. value: {
  4484. "types": ["function", "object"],
  4485. "defaultValue": null
  4486. }
  4487. }
  4488. ],
  4489. privateStateCallbacks: []
  4490. });
  4491. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  4492. SettingsChanged: "settingsChanged"
  4493. });
  4494. OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  4495. OSF.OUtil.defineEnumerableProperties(this, {
  4496. "type": {
  4497. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  4498. },
  4499. "settings": {
  4500. value: settingsInstance
  4501. }
  4502. });
  4503. };
  4504. OSF.DDA.AsyncMethodNames.addNames({
  4505. RefreshAsync: "refreshAsync",
  4506. SaveAsync: "saveAsync"
  4507. });
  4508. OSF.DDA.AsyncMethodCalls.define({
  4509. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  4510. requiredArguments: [],
  4511. supportedOptions: [],
  4512. privateStateCallbacks: [],
  4513. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) {
  4514. var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  4515. var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  4516. return newSettings;
  4517. }
  4518. });
  4519. OSF.DDA.AsyncMethodCalls.define({
  4520. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  4521. requiredArguments: [],
  4522. supportedOptions: [
  4523. {
  4524. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  4525. value: {
  4526. "types": ["boolean"],
  4527. "defaultValue": true
  4528. }
  4529. }
  4530. ],
  4531. privateStateCallbacks: [
  4532. {
  4533. name: OSF.DDA.SettingsManager.SerializedSettings,
  4534. value: function serializeSettings(settingsInstance, settingsCollection) {
  4535. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  4536. }
  4537. }
  4538. ]
  4539. });
  4540. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4541. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  4542. fromHost: [
  4543. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  4544. ]
  4545. });
  4546. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4547. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  4548. toHost: [
  4549. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings },
  4550. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale }
  4551. ]
  4552. });
  4553. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  4554. Microsoft.Office.WebExtension.BindingType={
  4555. Table: "table",
  4556. Text: "text",
  4557. Matrix: "matrix"
  4558. };
  4559. OSF.DDA.BindingProperties={
  4560. Id: "BindingId",
  4561. Type: Microsoft.Office.WebExtension.Parameters.BindingType
  4562. };
  4563. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" });
  4564. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  4565. Subset: "subset",
  4566. BindingProperties: "BindingProperties"
  4567. });
  4568. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties);
  4569. OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) {
  4570. this._id=bindingId;
  4571. OSF.OUtil.defineEnumerableProperty(this, "onFail", {
  4572. get: function () {
  4573. return errorCallback;
  4574. },
  4575. set: function (onError) {
  4576. var t=typeof onError;
  4577. if (t !="undefined" && t !="function") {
  4578. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t);
  4579. }
  4580. errorCallback=onError;
  4581. }
  4582. });
  4583. };
  4584. OSF.DDA.BindingPromise.prototype={
  4585. _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) {
  4586. if (this.binding) {
  4587. if (onComplete)
  4588. onComplete(this.binding);
  4589. } else {
  4590. if (!this._binding) {
  4591. var me=this;
  4592. Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) {
  4593. if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) {
  4594. OSF.OUtil.defineEnumerableProperty(me, "binding", {
  4595. value: asyncResult.value
  4596. });
  4597. if (onComplete)
  4598. onComplete(me.binding);
  4599. } else {
  4600. if (me.onFail)
  4601. me.onFail(asyncResult);
  4602. }
  4603. });
  4604. }
  4605. }
  4606. return this;
  4607. },
  4608. getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() {
  4609. var args=arguments;
  4610. this._fetch(function onComplete(binding) {
  4611. binding.getDataAsync.apply(binding, args);
  4612. });
  4613. return this;
  4614. },
  4615. setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() {
  4616. var args=arguments;
  4617. this._fetch(function onComplete(binding) {
  4618. binding.setDataAsync.apply(binding, args);
  4619. });
  4620. return this;
  4621. },
  4622. addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() {
  4623. var args=arguments;
  4624. this._fetch(function onComplete(binding) {
  4625. binding.addHandlerAsync.apply(binding, args);
  4626. });
  4627. return this;
  4628. },
  4629. removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() {
  4630. var args=arguments;
  4631. this._fetch(function onComplete(binding) {
  4632. binding.removeHandlerAsync.apply(binding, args);
  4633. });
  4634. return this;
  4635. }
  4636. };
  4637. OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) {
  4638. this._eventDispatches=[];
  4639. OSF.OUtil.defineEnumerableProperty(this, "document", {
  4640. value: docInstance
  4641. });
  4642. var am=OSF.DDA.AsyncMethodNames;
  4643. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  4644. am.AddFromSelectionAsync,
  4645. am.AddFromNamedItemAsync,
  4646. am.GetAllAsync,
  4647. am.GetByIdAsync,
  4648. am.ReleaseByIdAsync
  4649. ]);
  4650. };
  4651. OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) {
  4652. OSF.OUtil.defineEnumerableProperties(this, {
  4653. "document": { value: docInstance },
  4654. "id": { value: id }
  4655. });
  4656. };
  4657. OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) {
  4658. OSF.OUtil.defineEnumerableProperties(this, {
  4659. "document": {
  4660. value: docInstance
  4661. },
  4662. "id": {
  4663. value: id
  4664. }
  4665. });
  4666. var am=OSF.DDA.AsyncMethodNames;
  4667. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  4668. am.GetDataAsync,
  4669. am.SetDataAsync
  4670. ]);
  4671. var et=Microsoft.Office.WebExtension.EventType;
  4672. var bindingEventDispatches=docInstance.bindings._eventDispatches;
  4673. if (!bindingEventDispatches[id]) {
  4674. bindingEventDispatches[id]=new OSF.EventDispatch([
  4675. et.BindingSelectionChanged,
  4676. et.BindingDataChanged
  4677. ]);
  4678. }
  4679. var eventDispatch=bindingEventDispatches[id];
  4680. OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch);
  4681. };
  4682. OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() {
  4683. return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime();
  4684. };
  4685. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  4686. OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) {
  4687. var id=bindingProperties[OSF.DDA.BindingProperties.Id];
  4688. var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount];
  4689. var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount];
  4690. var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders];
  4691. var binding;
  4692. switch (bindingProperties[OSF.DDA.BindingProperties.Type]) {
  4693. case Microsoft.Office.WebExtension.BindingType.Text:
  4694. binding=new OSF.DDA.TextBinding(id, containingDocument);
  4695. break;
  4696. case Microsoft.Office.WebExtension.BindingType.Matrix:
  4697. binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols);
  4698. break;
  4699. case Microsoft.Office.WebExtension.BindingType.Table:
  4700. var isExcelApp=function () {
  4701. return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument);
  4702. };
  4703. var tableBindingObject;
  4704. if (isExcelApp() && OSF.DDA.ExcelTableBinding) {
  4705. tableBindingObject=OSF.DDA.ExcelTableBinding;
  4706. } else {
  4707. tableBindingObject=OSF.DDA.TableBinding;
  4708. }
  4709. binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders);
  4710. break;
  4711. default:
  4712. binding=new OSF.DDA.UnknownBinding(id, containingDocument);
  4713. }
  4714. return binding;
  4715. };
  4716. OSF.DDA.AsyncMethodNames.addNames({
  4717. AddFromSelectionAsync: "addFromSelectionAsync",
  4718. AddFromNamedItemAsync: "addFromNamedItemAsync",
  4719. GetAllAsync: "getAllAsync",
  4720. GetByIdAsync: "getByIdAsync",
  4721. ReleaseByIdAsync: "releaseByIdAsync",
  4722. GetDataAsync: "getDataAsync",
  4723. SetDataAsync: "setDataAsync"
  4724. });
  4725. (function () {
  4726. function processBinding(bindingDescriptor) {
  4727. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  4728. }
  4729. function getObjectId(obj) {
  4730. return obj.id;
  4731. }
  4732. function processData(dataDescriptor, caller, callArgs) {
  4733. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  4734. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  4735. data=OSF.DDA.OMFactory.manufactureTableData(data);
  4736. }
  4737. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  4738. return data==undefined ? null : data;
  4739. }
  4740. OSF.DDA.AsyncMethodCalls.define({
  4741. method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,
  4742. requiredArguments: [
  4743. {
  4744. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  4745. "enum": Microsoft.Office.WebExtension.BindingType
  4746. }
  4747. ],
  4748. supportedOptions: [
  4749. {
  4750. name: Microsoft.Office.WebExtension.Parameters.Id,
  4751. value: {
  4752. "types": ["string"],
  4753. "calculate": OSF.DDA.generateBindingId
  4754. }
  4755. },
  4756. {
  4757. name: Microsoft.Office.WebExtension.Parameters.Columns,
  4758. value: {
  4759. "types": ["object"],
  4760. "defaultValue": null
  4761. }
  4762. }
  4763. ],
  4764. privateStateCallbacks: [],
  4765. onSucceeded: processBinding
  4766. });
  4767. OSF.DDA.AsyncMethodCalls.define({
  4768. method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,
  4769. requiredArguments: [
  4770. {
  4771. "name": Microsoft.Office.WebExtension.Parameters.ItemName,
  4772. "types": ["string"]
  4773. },
  4774. {
  4775. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  4776. "enum": Microsoft.Office.WebExtension.BindingType
  4777. }
  4778. ],
  4779. supportedOptions: [
  4780. {
  4781. name: Microsoft.Office.WebExtension.Parameters.Id,
  4782. value: {
  4783. "types": ["string"],
  4784. "calculate": OSF.DDA.generateBindingId
  4785. }
  4786. },
  4787. {
  4788. name: Microsoft.Office.WebExtension.Parameters.Columns,
  4789. value: {
  4790. "types": ["object"],
  4791. "defaultValue": null
  4792. }
  4793. }
  4794. ],
  4795. privateStateCallbacks: [
  4796. {
  4797. name: Microsoft.Office.WebExtension.Parameters.FailOnCollision,
  4798. value: function () {
  4799. return true;
  4800. }
  4801. }
  4802. ],
  4803. onSucceeded: processBinding
  4804. });
  4805. OSF.DDA.AsyncMethodCalls.define({
  4806. method: OSF.DDA.AsyncMethodNames.GetAllAsync,
  4807. requiredArguments: [],
  4808. supportedOptions: [],
  4809. privateStateCallbacks: [],
  4810. onSucceeded: function (response) {
  4811. return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding);
  4812. }
  4813. });
  4814. OSF.DDA.AsyncMethodCalls.define({
  4815. method: OSF.DDA.AsyncMethodNames.GetByIdAsync,
  4816. requiredArguments: [
  4817. {
  4818. "name": Microsoft.Office.WebExtension.Parameters.Id,
  4819. "types": ["string"]
  4820. }
  4821. ],
  4822. supportedOptions: [],
  4823. privateStateCallbacks: [],
  4824. onSucceeded: processBinding
  4825. });
  4826. OSF.DDA.AsyncMethodCalls.define({
  4827. method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,
  4828. requiredArguments: [
  4829. {
  4830. "name": Microsoft.Office.WebExtension.Parameters.Id,
  4831. "types": ["string"]
  4832. }
  4833. ],
  4834. supportedOptions: [],
  4835. privateStateCallbacks: [],
  4836. onSucceeded: function (response, caller, callArgs) {
  4837. var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id];
  4838. delete caller._eventDispatches[id];
  4839. }
  4840. });
  4841. OSF.DDA.AsyncMethodCalls.define({
  4842. method: OSF.DDA.AsyncMethodNames.GetDataAsync,
  4843. requiredArguments: [],
  4844. supportedOptions: [
  4845. {
  4846. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  4847. value: {
  4848. "enum": Microsoft.Office.WebExtension.CoercionType,
  4849. "calculate": function (requiredArgs, binding) {
  4850. return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type);
  4851. }
  4852. }
  4853. },
  4854. {
  4855. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  4856. value: {
  4857. "enum": Microsoft.Office.WebExtension.ValueFormat,
  4858. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  4859. }
  4860. },
  4861. {
  4862. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  4863. value: {
  4864. "enum": Microsoft.Office.WebExtension.FilterType,
  4865. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  4866. }
  4867. },
  4868. {
  4869. name: Microsoft.Office.WebExtension.Parameters.Rows,
  4870. value: {
  4871. "types": ["object", "string"],
  4872. "defaultValue": null
  4873. }
  4874. },
  4875. {
  4876. name: Microsoft.Office.WebExtension.Parameters.Columns,
  4877. value: {
  4878. "types": ["object"],
  4879. "defaultValue": null
  4880. }
  4881. },
  4882. {
  4883. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  4884. value: {
  4885. "types": ["number"],
  4886. "defaultValue": 0
  4887. }
  4888. },
  4889. {
  4890. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  4891. value: {
  4892. "types": ["number"],
  4893. "defaultValue": 0
  4894. }
  4895. },
  4896. {
  4897. name: Microsoft.Office.WebExtension.Parameters.RowCount,
  4898. value: {
  4899. "types": ["number"],
  4900. "defaultValue": 0
  4901. }
  4902. },
  4903. {
  4904. name: Microsoft.Office.WebExtension.Parameters.ColumnCount,
  4905. value: {
  4906. "types": ["number"],
  4907. "defaultValue": 0
  4908. }
  4909. }
  4910. ],
  4911. checkCallArgs: function (callArgs, caller, stateInfo) {
  4912. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) {
  4913. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  4914. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  4915. delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount];
  4916. delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount];
  4917. }
  4918. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) {
  4919. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  4920. }
  4921. return callArgs;
  4922. },
  4923. privateStateCallbacks: [
  4924. {
  4925. name: Microsoft.Office.WebExtension.Parameters.Id,
  4926. value: getObjectId
  4927. }
  4928. ],
  4929. onSucceeded: processData
  4930. });
  4931. OSF.DDA.AsyncMethodCalls.define({
  4932. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  4933. requiredArguments: [
  4934. {
  4935. "name": Microsoft.Office.WebExtension.Parameters.Data,
  4936. "types": ["string", "object", "number", "boolean"]
  4937. }
  4938. ],
  4939. supportedOptions: [
  4940. {
  4941. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  4942. value: {
  4943. "enum": Microsoft.Office.WebExtension.CoercionType,
  4944. "calculate": function (requiredArgs) {
  4945. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  4946. }
  4947. }
  4948. },
  4949. {
  4950. name: Microsoft.Office.WebExtension.Parameters.Rows,
  4951. value: {
  4952. "types": ["object", "string"],
  4953. "defaultValue": null
  4954. }
  4955. },
  4956. {
  4957. name: Microsoft.Office.WebExtension.Parameters.Columns,
  4958. value: {
  4959. "types": ["object"],
  4960. "defaultValue": null
  4961. }
  4962. },
  4963. {
  4964. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  4965. value: {
  4966. "types": ["number"],
  4967. "defaultValue": 0
  4968. }
  4969. },
  4970. {
  4971. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  4972. value: {
  4973. "types": ["number"],
  4974. "defaultValue": 0
  4975. }
  4976. }
  4977. ],
  4978. checkCallArgs: function (callArgs, caller, stateInfo) {
  4979. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) {
  4980. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  4981. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  4982. }
  4983. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) {
  4984. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  4985. }
  4986. return callArgs;
  4987. },
  4988. privateStateCallbacks: [
  4989. {
  4990. name: Microsoft.Office.WebExtension.Parameters.Id,
  4991. value: getObjectId
  4992. }
  4993. ]
  4994. });
  4995. })();
  4996. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  4997. RowCount: "BindingRowCount",
  4998. ColumnCount: "BindingColumnCount",
  4999. HasHeaders: "HasHeaders"
  5000. });
  5001. OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) {
  5002. OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance);
  5003. OSF.OUtil.defineEnumerableProperties(this, {
  5004. "type": {
  5005. value: Microsoft.Office.WebExtension.BindingType.Matrix
  5006. },
  5007. "rowCount": {
  5008. value: rows ? rows : 0
  5009. },
  5010. "columnCount": {
  5011. value: cols ? cols : 0
  5012. }
  5013. });
  5014. };
  5015. OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding);
  5016. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5017. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  5018. fromHost: [
  5019. { name: OSF.DDA.BindingProperties.Id, value: 0 },
  5020. { name: OSF.DDA.BindingProperties.Type, value: 1 },
  5021. { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 }
  5022. ],
  5023. isComplexType: true
  5024. });
  5025. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5026. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  5027. toHost: [
  5028. { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 },
  5029. { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 },
  5030. { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 }
  5031. ],
  5032. invertible: true
  5033. });
  5034. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5035. type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,
  5036. fromHost: [
  5037. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5038. ],
  5039. toHost: [
  5040. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5041. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 }
  5042. ]
  5043. });
  5044. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5045. type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,
  5046. fromHost: [
  5047. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5048. ],
  5049. toHost: [
  5050. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 },
  5051. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 },
  5052. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 },
  5053. { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 }
  5054. ]
  5055. });
  5056. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5057. type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod,
  5058. toHost: [
  5059. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  5060. ]
  5061. });
  5062. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5063. type: OSF.DDA.MethodDispId.dispidGetBindingMethod,
  5064. fromHost: [
  5065. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5066. ],
  5067. toHost: [
  5068. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  5069. ]
  5070. });
  5071. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5072. type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,
  5073. fromHost: [
  5074. { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5075. ]
  5076. });
  5077. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5078. type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod,
  5079. fromHost: [
  5080. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5081. ],
  5082. toHost: [
  5083. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5084. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  5085. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 },
  5086. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 },
  5087. { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 }
  5088. ]
  5089. });
  5090. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5091. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  5092. toHost: [
  5093. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5094. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  5095. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  5096. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }
  5097. ]
  5098. });
  5099. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5100. type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,
  5101. fromHost: [
  5102. { name: OSF.DDA.BindingProperties.RowCount, value: 0 },
  5103. { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 },
  5104. { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 }
  5105. ],
  5106. isComplexType: true
  5107. });
  5108. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5109. type: OSF.DDA.PropertyDescriptors.Subset,
  5110. toHost: [
  5111. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 },
  5112. { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 }
  5113. ],
  5114. canonical: true,
  5115. isComplexType: true
  5116. });
  5117. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5118. type: OSF.DDA.SafeArray.UniqueArguments.Offset,
  5119. toHost: [
  5120. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 },
  5121. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 }
  5122. ],
  5123. canonical: true,
  5124. isComplexType: true
  5125. });
  5126. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5127. type: OSF.DDA.SafeArray.UniqueArguments.Run,
  5128. toHost: [
  5129. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 },
  5130. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 }
  5131. ],
  5132. canonical: true,
  5133. isComplexType: true
  5134. });
  5135. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5136. type: OSF.DDA.MethodDispId.dispidAddRowsMethod,
  5137. toHost: [
  5138. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5139. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  5140. ]
  5141. });
  5142. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5143. type: OSF.DDA.MethodDispId.dispidAddColumnsMethod,
  5144. toHost: [
  5145. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5146. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  5147. ]
  5148. });
  5149. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5150. type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod,
  5151. toHost: [
  5152. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  5153. ]
  5154. });
  5155. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" });
  5156. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  5157. RowCount: "BindingRowCount",
  5158. ColumnCount: "BindingColumnCount",
  5159. HasHeaders: "HasHeaders"
  5160. });
  5161. OSF.DDA.TableDataProperties={
  5162. TableRows: "TableRows",
  5163. TableHeaders: "TableHeaders"
  5164. };
  5165. OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) {
  5166. OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance);
  5167. OSF.OUtil.defineEnumerableProperties(this, {
  5168. "type": {
  5169. value: Microsoft.Office.WebExtension.BindingType.Table
  5170. },
  5171. "rowCount": {
  5172. value: rows ? rows : 0
  5173. },
  5174. "columnCount": {
  5175. value: cols ? cols : 0
  5176. },
  5177. "hasHeaders": {
  5178. value: hasHeaders ? hasHeaders : false
  5179. }
  5180. });
  5181. var am=OSF.DDA.AsyncMethodNames;
  5182. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5183. am.AddRowsAsync,
  5184. am.AddColumnsAsync,
  5185. am.DeleteAllDataValuesAsync
  5186. ]);
  5187. };
  5188. OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding);
  5189. OSF.DDA.AsyncMethodNames.addNames({
  5190. AddRowsAsync: "addRowsAsync",
  5191. AddColumnsAsync: "addColumnsAsync",
  5192. DeleteAllDataValuesAsync: "deleteAllDataValuesAsync"
  5193. });
  5194. (function () {
  5195. function getObjectId(obj) {
  5196. return obj.id;
  5197. }
  5198. OSF.DDA.AsyncMethodCalls.define({
  5199. method: OSF.DDA.AsyncMethodNames.AddRowsAsync,
  5200. requiredArguments: [
  5201. {
  5202. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5203. "types": ["object"]
  5204. }
  5205. ],
  5206. supportedOptions: [],
  5207. privateStateCallbacks: [
  5208. {
  5209. name: Microsoft.Office.WebExtension.Parameters.Id,
  5210. value: getObjectId
  5211. }
  5212. ]
  5213. });
  5214. OSF.DDA.AsyncMethodCalls.define({
  5215. method: OSF.DDA.AsyncMethodNames.AddColumnsAsync,
  5216. requiredArguments: [
  5217. {
  5218. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5219. "types": ["object"]
  5220. }
  5221. ],
  5222. supportedOptions: [],
  5223. privateStateCallbacks: [
  5224. {
  5225. name: Microsoft.Office.WebExtension.Parameters.Id,
  5226. value: getObjectId
  5227. }
  5228. ]
  5229. });
  5230. OSF.DDA.AsyncMethodCalls.define({
  5231. method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,
  5232. requiredArguments: [],
  5233. supportedOptions: [],
  5234. privateStateCallbacks: [
  5235. {
  5236. name: Microsoft.Office.WebExtension.Parameters.Id,
  5237. value: getObjectId
  5238. }
  5239. ]
  5240. });
  5241. })();
  5242. OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) {
  5243. OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance);
  5244. OSF.OUtil.defineEnumerableProperty(this, "type", {
  5245. value: Microsoft.Office.WebExtension.BindingType.Text
  5246. });
  5247. };
  5248. OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding);
  5249. OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" });
  5250. OSF.DDA.AsyncMethodCalls.define({
  5251. method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync,
  5252. requiredArguments: [
  5253. {
  5254. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  5255. "enum": Microsoft.Office.WebExtension.BindingType
  5256. }
  5257. ],
  5258. supportedOptions: [
  5259. {
  5260. name: Microsoft.Office.WebExtension.Parameters.Id,
  5261. value: {
  5262. "types": ["string"],
  5263. "calculate": OSF.DDA.generateBindingId
  5264. }
  5265. },
  5266. {
  5267. name: Microsoft.Office.WebExtension.Parameters.PromptText,
  5268. value: {
  5269. "types": ["string"],
  5270. "calculate": function () {
  5271. return Strings.OfficeOM.L_AddBindingFromPromptDefaultText;
  5272. }
  5273. }
  5274. },
  5275. {
  5276. name: Microsoft.Office.WebExtension.Parameters.SampleData,
  5277. value: {
  5278. "types": ["object"],
  5279. "defaultValue": null
  5280. }
  5281. }
  5282. ],
  5283. privateStateCallbacks: [],
  5284. onSucceeded: function (bindingDescriptor) {
  5285. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  5286. }
  5287. });
  5288. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5289. type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,
  5290. fromHost: [
  5291. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5292. ],
  5293. toHost: [
  5294. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5295. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 },
  5296. { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: 2 }
  5297. ]
  5298. });
  5299. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" });
  5300. OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) {
  5301. OSF.OUtil.defineEnumerableProperties(this, {
  5302. "type": {
  5303. value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged
  5304. },
  5305. "document": {
  5306. value: docInstance
  5307. }
  5308. });
  5309. };
  5310. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent });
  5311. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5312. BindingSelectionChanged: "bindingSelectionChanged",
  5313. BindingDataChanged: "bindingDataChanged"
  5314. });
  5315. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" });
  5316. OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) {
  5317. OSF.OUtil.defineEnumerableProperties(this, {
  5318. "type": {
  5319. value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged
  5320. },
  5321. "binding": {
  5322. value: bindingInstance
  5323. }
  5324. });
  5325. for (var prop in subset) {
  5326. OSF.OUtil.defineEnumerableProperty(this, prop, {
  5327. value: subset[prop]
  5328. });
  5329. }
  5330. };
  5331. OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) {
  5332. OSF.OUtil.defineEnumerableProperties(this, {
  5333. "type": {
  5334. value: Microsoft.Office.WebExtension.EventType.BindingDataChanged
  5335. },
  5336. "binding": {
  5337. value: bindingInstance
  5338. }
  5339. });
  5340. };
  5341. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5342. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  5343. fromHost: [
  5344. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 },
  5345. { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 }
  5346. ],
  5347. isComplexType: true
  5348. });
  5349. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5350. type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,
  5351. fromHost: [
  5352. { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5353. ],
  5354. isComplexType: true
  5355. });
  5356. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5357. type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent,
  5358. fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  5359. });
  5360. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" });
  5361. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5362. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  5363. toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }]
  5364. });
  5365. Microsoft.Office.WebExtension.GoToType={
  5366. Binding: "binding",
  5367. NamedItem: "namedItem",
  5368. Slide: "slide",
  5369. Index: "index"
  5370. };
  5371. Microsoft.Office.WebExtension.SelectionMode={
  5372. Default: "default",
  5373. Selected: "selected",
  5374. None: "none"
  5375. };
  5376. Microsoft.Office.WebExtension.Index={
  5377. First: "first",
  5378. Last: "last",
  5379. Next: "next",
  5380. Previous: "previous"
  5381. };
  5382. OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" });
  5383. OSF.DDA.AsyncMethodCalls.define({
  5384. method: OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  5385. requiredArguments: [
  5386. {
  5387. "name": Microsoft.Office.WebExtension.Parameters.Id,
  5388. "types": ["string", "number"]
  5389. },
  5390. {
  5391. "name": Microsoft.Office.WebExtension.Parameters.GoToType,
  5392. "enum": Microsoft.Office.WebExtension.GoToType
  5393. }
  5394. ],
  5395. supportedOptions: [
  5396. {
  5397. name: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  5398. value: {
  5399. "enum": Microsoft.Office.WebExtension.SelectionMode,
  5400. "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default
  5401. }
  5402. }
  5403. ]
  5404. });
  5405. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5406. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  5407. toHost: [
  5408. { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 },
  5409. { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 },
  5410. { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 },
  5411. { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 }
  5412. ]
  5413. });
  5414. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5415. type: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  5416. toHost: [
  5417. { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 },
  5418. { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 },
  5419. { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 }
  5420. ]
  5421. });
  5422. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5423. type: OSF.DDA.MethodDispId.dispidNavigateToMethod,
  5424. toHost: [
  5425. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5426. { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 },
  5427. { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 }
  5428. ]
  5429. });
  5430. OSF.DDA.AsyncMethodNames.addNames({
  5431. ExecuteRichApiRequestAsync: "executeRichApiRequestAsync"
  5432. });
  5433. OSF.DDA.AsyncMethodCalls.define({
  5434. method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,
  5435. requiredArguments: [
  5436. {
  5437. name: Microsoft.Office.WebExtension.Parameters.Data,
  5438. types: ["object"]
  5439. }
  5440. ],
  5441. supportedOptions: []
  5442. });
  5443. OSF.OUtil.setNamespace("RichApi", OSF.DDA);
  5444. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5445. type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,
  5446. toHost: [
  5447. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }
  5448. ],
  5449. fromHost: [
  5450. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5451. ]
  5452. });
  5453. OSF.DDA.FilePropertiesDescriptor={
  5454. Url: "Url"
  5455. };
  5456. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5457. FilePropertiesDescriptor: "FilePropertiesDescriptor"
  5458. });
  5459. Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) {
  5460. OSF.OUtil.defineEnumerableProperties(this, {
  5461. "url": {
  5462. value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url]
  5463. }
  5464. });
  5465. };
  5466. OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" });
  5467. OSF.DDA.AsyncMethodCalls.define({
  5468. method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,
  5469. fromHost: [
  5470. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 }
  5471. ],
  5472. requiredArguments: [],
  5473. supportedOptions: [],
  5474. onSucceeded: function (filePropertiesDescriptor, caller, callArgs) {
  5475. return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor);
  5476. }
  5477. });
  5478. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5479. type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  5480. fromHost: [
  5481. { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 }
  5482. ],
  5483. isComplexType: true
  5484. });
  5485. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5486. type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,
  5487. fromHost: [
  5488. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5489. ]
  5490. });
  5491. OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) {
  5492. var am=OSF.DDA.AsyncMethodNames;
  5493. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5494. am.ClearFormatsAsync,
  5495. am.SetTableOptionsAsync,
  5496. am.SetFormatsAsync
  5497. ]);
  5498. OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders);
  5499. OSF.OUtil.finalizeProperties(this);
  5500. };
  5501. OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding);
  5502. (function () {
  5503. OSF.DDA.AsyncMethodCalls.define({
  5504. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  5505. requiredArguments: [
  5506. {
  5507. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5508. "types": ["string", "object", "number", "boolean"]
  5509. }
  5510. ],
  5511. supportedOptions: [
  5512. {
  5513. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5514. value: {
  5515. "enum": Microsoft.Office.WebExtension.CoercionType,
  5516. "calculate": function (requiredArgs) {
  5517. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  5518. }
  5519. }
  5520. },
  5521. {
  5522. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  5523. value: {
  5524. "types": ["object"],
  5525. "defaultValue": []
  5526. }
  5527. },
  5528. {
  5529. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  5530. value: {
  5531. "types": ["object"],
  5532. "defaultValue": []
  5533. }
  5534. }
  5535. ],
  5536. privateStateCallbacks: []
  5537. });
  5538. OSF.DDA.AsyncMethodCalls.define({
  5539. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  5540. requiredArguments: [
  5541. {
  5542. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5543. "types": ["string", "object", "number", "boolean"]
  5544. }
  5545. ],
  5546. supportedOptions: [
  5547. {
  5548. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5549. value: {
  5550. "enum": Microsoft.Office.WebExtension.CoercionType,
  5551. "calculate": function (requiredArgs) {
  5552. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  5553. }
  5554. }
  5555. },
  5556. {
  5557. name: Microsoft.Office.WebExtension.Parameters.Rows,
  5558. value: {
  5559. "types": ["object", "string"],
  5560. "defaultValue": null
  5561. }
  5562. },
  5563. {
  5564. name: Microsoft.Office.WebExtension.Parameters.Columns,
  5565. value: {
  5566. "types": ["object"],
  5567. "defaultValue": null
  5568. }
  5569. },
  5570. {
  5571. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  5572. value: {
  5573. "types": ["number"],
  5574. "defaultValue": 0
  5575. }
  5576. },
  5577. {
  5578. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  5579. value: {
  5580. "types": ["number"],
  5581. "defaultValue": 0
  5582. }
  5583. },
  5584. {
  5585. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  5586. value: {
  5587. "types": ["object"],
  5588. "defaultValue": []
  5589. }
  5590. },
  5591. {
  5592. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  5593. value: {
  5594. "types": ["object"],
  5595. "defaultValue": []
  5596. }
  5597. }
  5598. ],
  5599. checkCallArgs: function (callArgs, caller, stateInfo) {
  5600. var Parameters=Microsoft.Office.WebExtension.Parameters;
  5601. if (callArgs[Parameters.StartRow]==0 && callArgs[Parameters.StartColumn]==0 && OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 && OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) {
  5602. delete callArgs[Parameters.StartRow];
  5603. delete callArgs[Parameters.StartColumn];
  5604. delete callArgs[Parameters.CellFormat];
  5605. delete callArgs[Parameters.TableOptions];
  5606. }
  5607. if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) || (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) || callArgs[Parameters.CellFormat] || callArgs[Parameters.TableOptions])) {
  5608. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  5609. }
  5610. return callArgs;
  5611. },
  5612. privateStateCallbacks: [
  5613. {
  5614. name: Microsoft.Office.WebExtension.Parameters.Id,
  5615. value: function (obj) {
  5616. return obj.id;
  5617. }
  5618. }
  5619. ]
  5620. });
  5621. OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() {
  5622. var args=arguments;
  5623. this._fetch(function onComplete(binding) {
  5624. binding.setTableOptionsAsync.apply(binding, args);
  5625. });
  5626. return this;
  5627. }, OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() {
  5628. var args=arguments;
  5629. this._fetch(function onComplete(binding) {
  5630. binding.setFormatsAsync.apply(binding, args);
  5631. });
  5632. return this;
  5633. }, OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() {
  5634. var args=arguments;
  5635. this._fetch(function onComplete(binding) {
  5636. binding.clearFormatsAsync.apply(binding, args);
  5637. });
  5638. return this;
  5639. };
  5640. })();
  5641. (function () {
  5642. function getObjectId(obj) {
  5643. return obj.id;
  5644. }
  5645. OSF.DDA.AsyncMethodNames.addNames({
  5646. ClearFormatsAsync: "clearFormatsAsync",
  5647. SetTableOptionsAsync: "setTableOptionsAsync",
  5648. SetFormatsAsync: "setFormatsAsync"
  5649. });
  5650. OSF.DDA.AsyncMethodCalls.define({
  5651. method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync,
  5652. requiredArguments: [],
  5653. supportedOptions: [],
  5654. privateStateCallbacks: [
  5655. {
  5656. name: Microsoft.Office.WebExtension.Parameters.Id,
  5657. value: getObjectId
  5658. }
  5659. ]
  5660. });
  5661. OSF.DDA.AsyncMethodCalls.define({
  5662. method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,
  5663. requiredArguments: [
  5664. {
  5665. "name": Microsoft.Office.WebExtension.Parameters.TableOptions,
  5666. "defaultValue": []
  5667. }
  5668. ],
  5669. privateStateCallbacks: [
  5670. {
  5671. name: Microsoft.Office.WebExtension.Parameters.Id,
  5672. value: getObjectId
  5673. }
  5674. ]
  5675. });
  5676. OSF.DDA.AsyncMethodCalls.define({
  5677. method: OSF.DDA.AsyncMethodNames.SetFormatsAsync,
  5678. requiredArguments: [
  5679. {
  5680. "name": Microsoft.Office.WebExtension.Parameters.CellFormat,
  5681. "defaultValue": []
  5682. }
  5683. ],
  5684. privateStateCallbacks: [
  5685. {
  5686. name: Microsoft.Office.WebExtension.Parameters.Id,
  5687. value: getObjectId
  5688. }
  5689. ]
  5690. });
  5691. })();
  5692. Microsoft.Office.WebExtension.Table={
  5693. All: 0,
  5694. Data: 1,
  5695. Headers: 2
  5696. };
  5697. (function () {
  5698. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5699. type: OSF.DDA.MethodDispId.dispidClearFormatsMethod,
  5700. toHost: [
  5701. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  5702. ]
  5703. });
  5704. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5705. type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,
  5706. toHost: [
  5707. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5708. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 1 }
  5709. ]
  5710. });
  5711. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5712. type: OSF.DDA.MethodDispId.dispidSetFormatsMethod,
  5713. toHost: [
  5714. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5715. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 1 }
  5716. ]
  5717. });
  5718. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5719. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  5720. toHost: [
  5721. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5722. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  5723. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 },
  5724. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 }
  5725. ]
  5726. });
  5727. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5728. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  5729. toHost: [
  5730. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5731. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  5732. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  5733. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 },
  5734. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 },
  5735. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 }
  5736. ]
  5737. });
  5738. var tableOptionProperties={
  5739. headerRow: 0,
  5740. bandedRows: 1,
  5741. firstColumn: 2,
  5742. lastColumn: 3,
  5743. bandedColumns: 4,
  5744. filterButton: 5,
  5745. style: 6,
  5746. totalRow: 7
  5747. };
  5748. var cellProperties={
  5749. row: 0,
  5750. column: 1
  5751. };
  5752. var formatProperties={
  5753. alignHorizontal: { text: "alignHorizontal", type: 1 },
  5754. alignVertical: { text: "alignVertical", type: 2 },
  5755. backgroundColor: { text: "backgroundColor", type: 101 },
  5756. borderStyle: { text: "borderStyle", type: 201 },
  5757. borderColor: { text: "borderColor", type: 202 },
  5758. borderTopStyle: { text: "borderTopStyle", type: 203 },
  5759. borderTopColor: { text: "borderTopColor", type: 204 },
  5760. borderBottomStyle: { text: "borderBottomStyle", type: 205 },
  5761. borderBottomColor: { text: "borderBottomColor", type: 206 },
  5762. borderLeftStyle: { text: "borderLeftStyle", type: 207 },
  5763. borderLeftColor: { text: "borderLeftColor", type: 208 },
  5764. borderRightStyle: { text: "borderRightStyle", type: 209 },
  5765. borderRightColor: { text: "borderRightColor", type: 210 },
  5766. borderOutlineStyle: { text: "borderOutlineStyle", type: 211 },
  5767. borderOutlineColor: { text: "borderOutlineColor", type: 212 },
  5768. borderInlineStyle: { text: "borderInlineStyle", type: 213 },
  5769. borderInlineColor: { text: "borderInlineColor", type: 214 },
  5770. fontFamily: { text: "fontFamily", type: 301 },
  5771. fontStyle: { text: "fontStyle", type: 302 },
  5772. fontSize: { text: "fontSize", type: 303 },
  5773. fontUnderlineStyle: { text: "fontUnderlineStyle", type: 304 },
  5774. fontColor: { text: "fontColor", type: 305 },
  5775. fontDirection: { text: "fontDirection", type: 306 },
  5776. fontStrikethrough: { text: "fontStrikethrough", type: 307 },
  5777. fontSuperscript: { text: "fontSuperscript", type: 308 },
  5778. fontSubscript: { text: "fontSubscript", type: 309 },
  5779. fontNormal: { text: "fontNormal", type: 310 },
  5780. indentLeft: { text: "indentLeft", type: 401 },
  5781. indentRight: { text: "indentRight", type: 402 },
  5782. numberFormat: { text: "numberFormat", type: 501 },
  5783. width: { text: "width", type: 701 },
  5784. height: { text: "height", type: 702 },
  5785. wrapping: { text: "wrapping", type: 703 }
  5786. };
  5787. var borderStyleSet=[
  5788. { name: "none", value: 0 },
  5789. { name: "thin", value: 1 },
  5790. { name: "medium", value: 2 },
  5791. { name: "dashed", value: 3 },
  5792. { name: "dotted", value: 4 },
  5793. { name: "thick", value: 5 },
  5794. { name: "double", value: 6 },
  5795. { name: "hair", value: 7 },
  5796. { name: "medium dashed", value: 8 },
  5797. { name: "dash dot", value: 9 },
  5798. { name: "medium dash dot", value: 10 },
  5799. { name: "dash dot dot", value: 11 },
  5800. { name: "medium dash dot dot", value: 12 },
  5801. { name: "slant dash dot", value: 13 }
  5802. ];
  5803. var colorSet=[
  5804. { name: "none", value: 0 },
  5805. { name: "black", value: 1 },
  5806. { name: "blue", value: 2 },
  5807. { name: "gray", value: 3 },
  5808. { name: "green", value: 4 },
  5809. { name: "orange", value: 5 },
  5810. { name: "pink", value: 6 },
  5811. { name: "purple", value: 7 },
  5812. { name: "red", value: 8 },
  5813. { name: "teal", value: 9 },
  5814. { name: "turquoise", value: 10 },
  5815. { name: "violet", value: 11 },
  5816. { name: "white", value: 12 },
  5817. { name: "yellow", value: 13 },
  5818. { name: "automatic", value: 14 }
  5819. ];
  5820. var ns=OSF.DDA.SafeArray.Delegate.ParameterMap;
  5821. ns.define({
  5822. type: formatProperties.alignHorizontal.text,
  5823. toHost: [
  5824. { name: "general", value: 0 },
  5825. { name: "left", value: 1 },
  5826. { name: "center", value: 2 },
  5827. { name: "right", value: 3 },
  5828. { name: "fill", value: 4 },
  5829. { name: "justify", value: 5 },
  5830. { name: "center across selection", value: 6 },
  5831. { name: "distributed", value: 7 }
  5832. ] });
  5833. ns.define({
  5834. type: formatProperties.alignVertical.text,
  5835. toHost: [
  5836. { name: "top", value: 0 },
  5837. { name: "center", value: 1 },
  5838. { name: "bottom", value: 2 },
  5839. { name: "justify", value: 3 },
  5840. { name: "distributed", value: 4 }
  5841. ] });
  5842. ns.define({
  5843. type: formatProperties.backgroundColor.text,
  5844. toHost: colorSet
  5845. });
  5846. ns.define({
  5847. type: formatProperties.borderStyle.text,
  5848. toHost: borderStyleSet
  5849. });
  5850. ns.define({
  5851. type: formatProperties.borderColor.text,
  5852. toHost: colorSet
  5853. });
  5854. ns.define({
  5855. type: formatProperties.borderTopStyle.text,
  5856. toHost: borderStyleSet
  5857. });
  5858. ns.define({
  5859. type: formatProperties.borderTopColor.text,
  5860. toHost: colorSet
  5861. });
  5862. ns.define({
  5863. type: formatProperties.borderBottomStyle.text,
  5864. toHost: borderStyleSet
  5865. });
  5866. ns.define({
  5867. type: formatProperties.borderBottomColor.text,
  5868. toHost: colorSet
  5869. });
  5870. ns.define({
  5871. type: formatProperties.borderLeftStyle.text,
  5872. toHost: borderStyleSet
  5873. });
  5874. ns.define({
  5875. type: formatProperties.borderLeftColor.text,
  5876. toHost: colorSet
  5877. });
  5878. ns.define({
  5879. type: formatProperties.borderRightStyle.text,
  5880. toHost: borderStyleSet
  5881. });
  5882. ns.define({
  5883. type: formatProperties.borderRightColor.text,
  5884. toHost: colorSet
  5885. });
  5886. ns.define({
  5887. type: formatProperties.borderOutlineStyle.text,
  5888. toHost: borderStyleSet
  5889. });
  5890. ns.define({
  5891. type: formatProperties.borderOutlineColor.text,
  5892. toHost: colorSet
  5893. });
  5894. ns.define({
  5895. type: formatProperties.borderInlineStyle.text,
  5896. toHost: borderStyleSet
  5897. });
  5898. ns.define({
  5899. type: formatProperties.borderInlineColor.text,
  5900. toHost: colorSet
  5901. });
  5902. ns.define({
  5903. type: formatProperties.fontStyle.text,
  5904. toHost: [
  5905. { name: "regular", value: 0 },
  5906. { name: "italic", value: 1 },
  5907. { name: "bold", value: 2 },
  5908. { name: "bold italic", value: 3 }
  5909. ] });
  5910. ns.define({
  5911. type: formatProperties.fontUnderlineStyle.text,
  5912. toHost: [
  5913. { name: "none", value: 0 },
  5914. { name: "single", value: 1 },
  5915. { name: "double", value: 2 },
  5916. { name: "single accounting", value: 3 },
  5917. { name: "double accounting", value: 4 }
  5918. ] });
  5919. ns.define({
  5920. type: formatProperties.fontColor.text,
  5921. toHost: colorSet
  5922. });
  5923. ns.define({
  5924. type: formatProperties.fontDirection.text,
  5925. toHost: [
  5926. { name: "context", value: 0 },
  5927. { name: "left-to-right", value: 1 },
  5928. { name: "right-to-left", value: 2 }
  5929. ] });
  5930. ns.define({
  5931. type: formatProperties.width.text,
  5932. toHost: [
  5933. { name: "auto fit", value: -1 }
  5934. ] });
  5935. ns.define({
  5936. type: formatProperties.height.text,
  5937. toHost: [
  5938. { name: "auto fit", value: -1 }
  5939. ] });
  5940. ns.define({
  5941. type: Microsoft.Office.WebExtension.Parameters.TableOptions,
  5942. toHost: [
  5943. { name: "headerRow", value: 0 },
  5944. { name: "bandedRows", value: 1 },
  5945. { name: "firstColumn", value: 2 },
  5946. { name: "lastColumn", value: 3 },
  5947. { name: "bandedColumns", value: 4 },
  5948. { name: "filterButton", value: 5 },
  5949. { name: "style", value: 6 },
  5950. { name: "totalRow", value: 7 }
  5951. ] });
  5952. ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={
  5953. toHost: function (data) {
  5954. for (var entry in data) {
  5955. if (data[entry].format) {
  5956. data[entry].format=ns.doMapValues(data[entry].format, "toHost");
  5957. }
  5958. }
  5959. return data;
  5960. },
  5961. fromHost: function (args) {
  5962. return args;
  5963. }
  5964. };
  5965. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat, {
  5966. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) {
  5967. var textCells="cells";
  5968. var textFormat="format";
  5969. var posCells=0;
  5970. var posFormat=1;
  5971. var ret=[];
  5972. for (var index in cellFormats) {
  5973. var cfOld=cellFormats[index];
  5974. var cfNew=[];
  5975. if (typeof (cfOld[textCells]) !=='undefined') {
  5976. var cellsOld=cfOld[textCells];
  5977. var cellsNew;
  5978. if (typeof cfOld[textCells]==="object") {
  5979. cellsNew=[];
  5980. for (var entry in cellsOld) {
  5981. if (typeof (cellProperties[entry]) !=='undefined') {
  5982. cellsNew[cellProperties[entry]]=cellsOld[entry];
  5983. }
  5984. }
  5985. } else {
  5986. cellsNew=cellsOld;
  5987. }
  5988. cfNew[posCells]=cellsNew;
  5989. }
  5990. if (cfOld[textFormat]) {
  5991. var formatOld=cfOld[textFormat];
  5992. var formatNew=[];
  5993. for (var entry2 in formatOld) {
  5994. if (typeof (formatProperties[entry2]) !=='undefined') {
  5995. formatNew.push([
  5996. formatProperties[entry2].type,
  5997. formatOld[entry2]
  5998. ]);
  5999. }
  6000. }
  6001. cfNew[posFormat]=formatNew;
  6002. }
  6003. ret[index]=cfNew;
  6004. }
  6005. return ret;
  6006. },
  6007. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) {
  6008. return hostArgs;
  6009. }
  6010. });
  6011. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions, {
  6012. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) {
  6013. var ret=[];
  6014. for (var entry in tableOptions) {
  6015. if (typeof (tableOptionProperties[entry]) !=='undefined') {
  6016. ret[tableOptionProperties[entry]]=tableOptions[entry];
  6017. }
  6018. }
  6019. return ret;
  6020. },
  6021. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) {
  6022. return hostArgs;
  6023. }
  6024. });
  6025. })();
  6026. OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) {
  6027. var bf=new OSF.DDA.BindingFacade(this);
  6028. OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);
  6029. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]);
  6030. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);
  6031. OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings);
  6032. OSF.OUtil.finalizeProperties(this);
  6033. };
  6034. OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument);
  6035. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  6036. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  6037. appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(false));
  6038. OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);
  6039. appReady();
  6040. };
  6041. var OfficeExtension;
  6042. (function (OfficeExtension) {
  6043. var Action=(function () {
  6044. function Action(actionInfo, isWriteOperation) {
  6045. this.m_actionInfo=actionInfo;
  6046. this.m_isWriteOperation=isWriteOperation;
  6047. }
  6048. Object.defineProperty(Action.prototype, "actionInfo", {
  6049. get: function () {
  6050. return this.m_actionInfo;
  6051. },
  6052. enumerable: true,
  6053. configurable: true
  6054. });
  6055. Object.defineProperty(Action.prototype, "isWriteOperation", {
  6056. get: function () {
  6057. return this.m_isWriteOperation;
  6058. },
  6059. enumerable: true,
  6060. configurable: true
  6061. });
  6062. return Action;
  6063. })();
  6064. OfficeExtension.Action=Action;
  6065. })(OfficeExtension || (OfficeExtension={}));
  6066. var OfficeExtension;
  6067. (function (OfficeExtension) {
  6068. var ActionFactory=(function () {
  6069. function ActionFactory() {
  6070. }
  6071. ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) {
  6072. OfficeExtension.Utility.validateObjectPath(parent);
  6073. var actionInfo={
  6074. Id: context._nextId(),
  6075. ActionType: 4 ,
  6076. Name: propertyName,
  6077. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  6078. ArgumentInfo: {}
  6079. };
  6080. var args=[value];
  6081. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  6082. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  6083. var ret=new OfficeExtension.Action(actionInfo, true);
  6084. context._pendingRequest.addAction(ret);
  6085. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  6086. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  6087. return ret;
  6088. };
  6089. ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) {
  6090. OfficeExtension.Utility.validateObjectPath(parent);
  6091. var actionInfo={
  6092. Id: context._nextId(),
  6093. ActionType: 3 ,
  6094. Name: methodName,
  6095. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  6096. ArgumentInfo: {}
  6097. };
  6098. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  6099. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  6100. var isWriteOperation=operationType !=1 ;
  6101. var ret=new OfficeExtension.Action(actionInfo, isWriteOperation);
  6102. context._pendingRequest.addAction(ret);
  6103. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  6104. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  6105. return ret;
  6106. };
  6107. ActionFactory.createQueryAction=function (context, parent, queryOption) {
  6108. OfficeExtension.Utility.validateObjectPath(parent);
  6109. var actionInfo={
  6110. Id: context._nextId(),
  6111. ActionType: 2 ,
  6112. Name: "",
  6113. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  6114. };
  6115. actionInfo.QueryInfo=queryOption;
  6116. var ret=new OfficeExtension.Action(actionInfo, false);
  6117. context._pendingRequest.addAction(ret);
  6118. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  6119. return ret;
  6120. };
  6121. ActionFactory.createInstantiateAction=function (context, obj) {
  6122. OfficeExtension.Utility.validateObjectPath(obj);
  6123. var actionInfo={
  6124. Id: context._nextId(),
  6125. ActionType: 1 ,
  6126. Name: "",
  6127. ObjectPathId: obj._objectPath.objectPathInfo.Id
  6128. };
  6129. var ret=new OfficeExtension.Action(actionInfo, false);
  6130. context._pendingRequest.addAction(ret);
  6131. context._pendingRequest.addReferencedObjectPath(obj._objectPath);
  6132. context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj));
  6133. return ret;
  6134. };
  6135. ActionFactory.createTraceAction=function (context, message) {
  6136. var actionInfo={
  6137. Id: context._nextId(),
  6138. ActionType: 5 ,
  6139. Name: "Trace",
  6140. ObjectPathId: 0
  6141. };
  6142. var ret=new OfficeExtension.Action(actionInfo, false);
  6143. context._pendingRequest.addAction(ret);
  6144. context._pendingRequest.addTrace(actionInfo.Id, message);
  6145. return ret;
  6146. };
  6147. return ActionFactory;
  6148. })();
  6149. OfficeExtension.ActionFactory=ActionFactory;
  6150. })(OfficeExtension || (OfficeExtension={}));
  6151. var OfficeExtension;
  6152. (function (OfficeExtension) {
  6153. var ClientObject=(function () {
  6154. function ClientObject(context, objectPath) {
  6155. OfficeExtension.Utility.checkArgumentNull(context, "context");
  6156. this.m_context=context;
  6157. this.m_objectPath=objectPath;
  6158. if (this.m_objectPath) {
  6159. if (!context._processingResult) {
  6160. OfficeExtension.ActionFactory.createInstantiateAction(context, this);
  6161. if ((context._autoCleanup) && (this._KeepReference)) {
  6162. context.trackedObjects._autoAdd(this);
  6163. }
  6164. }
  6165. }
  6166. }
  6167. Object.defineProperty(ClientObject.prototype, "context", {
  6168. get: function () {
  6169. return this.m_context;
  6170. },
  6171. enumerable: true,
  6172. configurable: true
  6173. });
  6174. Object.defineProperty(ClientObject.prototype, "_objectPath", {
  6175. get: function () {
  6176. return this.m_objectPath;
  6177. },
  6178. set: function (value) {
  6179. this.m_objectPath=value;
  6180. },
  6181. enumerable: true,
  6182. configurable: true
  6183. });
  6184. ClientObject.prototype._handleResult=function (value) {
  6185. };
  6186. return ClientObject;
  6187. })();
  6188. OfficeExtension.ClientObject=ClientObject;
  6189. })(OfficeExtension || (OfficeExtension={}));
  6190. var OfficeExtension;
  6191. (function (OfficeExtension) {
  6192. var ClientRequest=(function () {
  6193. function ClientRequest(context) {
  6194. this.m_context=context;
  6195. this.m_actions=[];
  6196. this.m_actionResultHandler={};
  6197. this.m_referencedObjectPaths={};
  6198. this.m_flags=0 ;
  6199. this.m_traceInfos={};
  6200. }
  6201. Object.defineProperty(ClientRequest.prototype, "flags", {
  6202. get: function () {
  6203. return this.m_flags;
  6204. },
  6205. enumerable: true,
  6206. configurable: true
  6207. });
  6208. Object.defineProperty(ClientRequest.prototype, "traceInfos", {
  6209. get: function () {
  6210. return this.m_traceInfos;
  6211. },
  6212. enumerable: true,
  6213. configurable: true
  6214. });
  6215. ClientRequest.prototype.addAction=function (action) {
  6216. if (action.isWriteOperation) {
  6217. this.m_flags=this.m_flags | 1 ;
  6218. }
  6219. this.m_actions.push(action);
  6220. };
  6221. Object.defineProperty(ClientRequest.prototype, "hasActions", {
  6222. get: function () {
  6223. return this.m_actions.length > 0;
  6224. },
  6225. enumerable: true,
  6226. configurable: true
  6227. });
  6228. ClientRequest.prototype.addTrace=function (actionId, message) {
  6229. this.m_traceInfos[actionId]=message;
  6230. };
  6231. ClientRequest.prototype.addReferencedObjectPath=function (objectPath) {
  6232. if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) {
  6233. return;
  6234. }
  6235. if (!objectPath.isValid) {
  6236. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath));
  6237. }
  6238. while (objectPath) {
  6239. if (objectPath.isWriteOperation) {
  6240. this.m_flags=this.m_flags | 1 ;
  6241. }
  6242. this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath;
  6243. if (objectPath.objectPathInfo.ObjectPathType==3 ) {
  6244. this.addReferencedObjectPaths(objectPath.argumentObjectPaths);
  6245. }
  6246. objectPath=objectPath.parentObjectPath;
  6247. }
  6248. };
  6249. ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) {
  6250. if (objectPaths) {
  6251. for (var i=0; i < objectPaths.length; i++) {
  6252. this.addReferencedObjectPath(objectPaths[i]);
  6253. }
  6254. }
  6255. };
  6256. ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) {
  6257. this.m_actionResultHandler[action.actionInfo.Id]=resultHandler;
  6258. };
  6259. ClientRequest.prototype.buildRequestMessageBody=function () {
  6260. var objectPaths={};
  6261. for (var i in this.m_referencedObjectPaths) {
  6262. objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo;
  6263. }
  6264. var actions=[];
  6265. for (var index=0; index < this.m_actions.length; index++) {
  6266. actions.push(this.m_actions[index].actionInfo);
  6267. }
  6268. var ret={
  6269. Actions: actions,
  6270. ObjectPaths: objectPaths
  6271. };
  6272. return ret;
  6273. };
  6274. ClientRequest.prototype.processResponse=function (msg) {
  6275. if (msg && msg.Results) {
  6276. for (var i=0; i < msg.Results.length; i++) {
  6277. var actionResult=msg.Results[i];
  6278. var handler=this.m_actionResultHandler[actionResult.ActionId];
  6279. if (handler) {
  6280. handler._handleResult(actionResult.Value);
  6281. }
  6282. }
  6283. }
  6284. };
  6285. ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () {
  6286. for (var i in this.m_referencedObjectPaths) {
  6287. if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) {
  6288. this.m_referencedObjectPaths[i].isValid=false;
  6289. }
  6290. }
  6291. };
  6292. return ClientRequest;
  6293. })();
  6294. OfficeExtension.ClientRequest=ClientRequest;
  6295. })(OfficeExtension || (OfficeExtension={}));
  6296. var OfficeExtension;
  6297. (function (OfficeExtension) {
  6298. var ClientRequestContext=(function () {
  6299. function ClientRequestContext(url) {
  6300. this.m_nextId=0;
  6301. this.m_url=url;
  6302. if (OfficeExtension.Utility.isNullOrEmptyString(this.m_url)) {
  6303. this.m_url=OfficeExtension.Constants.localDocument;
  6304. }
  6305. this._processingResult=false;
  6306. this._customData=OfficeExtension.Constants.iterativeExecutor;
  6307. this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  6308. this.sync=this.sync.bind(this);
  6309. }
  6310. Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", {
  6311. get: function () {
  6312. if (this.m_pendingRequest==null) {
  6313. this.m_pendingRequest=new OfficeExtension.ClientRequest(this);
  6314. }
  6315. return this.m_pendingRequest;
  6316. },
  6317. enumerable: true,
  6318. configurable: true
  6319. });
  6320. Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", {
  6321. get: function () {
  6322. if (!this.m_trackedObjects) {
  6323. this.m_trackedObjects=new OfficeExtension.TrackedObjects(this);
  6324. }
  6325. return this.m_trackedObjects;
  6326. },
  6327. enumerable: true,
  6328. configurable: true
  6329. });
  6330. ClientRequestContext.prototype.load=function (clientObj, option) {
  6331. OfficeExtension.Utility.validateContext(this, clientObj);
  6332. var queryOption={};
  6333. if (typeof (option)=="string") {
  6334. var select=option;
  6335. queryOption.Select=this.parseSelectExpand(select);
  6336. }
  6337. else if (Array.isArray(option)) {
  6338. queryOption.Select=option;
  6339. }
  6340. else if (typeof (option)=="object") {
  6341. var loadOption=option;
  6342. if (typeof (loadOption.select)=="string") {
  6343. queryOption.Select=this.parseSelectExpand(loadOption.select);
  6344. }
  6345. else if (Array.isArray(loadOption.select)) {
  6346. queryOption.Select=loadOption.select;
  6347. }
  6348. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) {
  6349. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select");
  6350. }
  6351. if (typeof (loadOption.expand)=="string") {
  6352. queryOption.Expand=this.parseSelectExpand(loadOption.expand);
  6353. }
  6354. else if (Array.isArray(loadOption.expand)) {
  6355. queryOption.Expand=loadOption.expand;
  6356. }
  6357. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) {
  6358. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand");
  6359. }
  6360. if (typeof (loadOption.top)=="number") {
  6361. queryOption.Top=loadOption.top;
  6362. }
  6363. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) {
  6364. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top");
  6365. }
  6366. if (typeof (loadOption.skip)=="number") {
  6367. queryOption.Skip=loadOption.skip;
  6368. }
  6369. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) {
  6370. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip");
  6371. }
  6372. }
  6373. else if (!OfficeExtension.Utility.isNullOrUndefined(option)) {
  6374. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option");
  6375. }
  6376. var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption);
  6377. this._pendingRequest.addActionResultHandler(action, clientObj);
  6378. };
  6379. ClientRequestContext.prototype.trace=function (message) {
  6380. OfficeExtension.ActionFactory.createTraceAction(this, message);
  6381. };
  6382. ClientRequestContext.prototype.parseSelectExpand=function (select) {
  6383. var args=[];
  6384. if (!OfficeExtension.Utility.isNullOrEmptyString(select)) {
  6385. var propertyNames=select.split(",");
  6386. for (var i=0; i < propertyNames.length; i++) {
  6387. var propertyName=propertyNames[i];
  6388. propertyName=propertyName.trim();
  6389. args.push(propertyName);
  6390. }
  6391. }
  6392. return args;
  6393. };
  6394. ClientRequestContext.prototype.syncPrivate=function (doneCallback, failCallback) {
  6395. var req=this._pendingRequest;
  6396. if (!req.hasActions) {
  6397. doneCallback();
  6398. return;
  6399. }
  6400. this.m_pendingRequest=null;
  6401. var msgBody=req.buildRequestMessageBody();
  6402. var requestFlags=req.flags;
  6403. var requestExecutor=this._requestExecutor;
  6404. if (!requestExecutor) {
  6405. requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  6406. }
  6407. var requestExecutorRequestMessage={
  6408. Url: this.m_url,
  6409. Headers: null,
  6410. Body: msgBody
  6411. };
  6412. req.invalidatePendingInvalidObjectPaths();
  6413. var thisObj=this;
  6414. requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage, function (response) {
  6415. var error;
  6416. var traceMessages=new Array();
  6417. if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) {
  6418. error=new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {});
  6419. }
  6420. else if (response.Body && response.Body.Error) {
  6421. error=new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, {
  6422. errorLocation: response.Body.Error.Location
  6423. });
  6424. }
  6425. if (response.Body && response.Body.TraceIds) {
  6426. var traceMessageMap=req.traceInfos;
  6427. for (var i=0; i < response.Body.TraceIds.length; i++) {
  6428. var traceId=response.Body.TraceIds[i];
  6429. var message=traceMessageMap[traceId];
  6430. traceMessages.push(message);
  6431. }
  6432. }
  6433. if (error) {
  6434. failCallback(error);
  6435. return;
  6436. }
  6437. else {
  6438. thisObj._processingResult=true;
  6439. try {
  6440. req.processResponse(response.Body);
  6441. }
  6442. finally {
  6443. thisObj._processingResult=false;
  6444. }
  6445. doneCallback();
  6446. return;
  6447. }
  6448. });
  6449. };
  6450. ClientRequestContext.prototype.sync=function (passThroughValue) {
  6451. var _this=this;
  6452. OfficeExtension._EnsurePromise();
  6453. return new OfficeExtension['Promise'](function (resolve, reject) {
  6454. _this.syncPrivate(function () {
  6455. resolve(passThroughValue);
  6456. }, function (error) {
  6457. reject(error);
  6458. });
  6459. });
  6460. };
  6461. ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  6462. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  6463. if (retryDelay===void 0) { retryDelay=5000; }
  6464. OfficeExtension._EnsurePromise();
  6465. var starterPromise=new OfficeExtension['Promise'](function (resolve, reject) {
  6466. resolve();
  6467. });
  6468. var ctx;
  6469. var succeeded=false;
  6470. var resultOrError;
  6471. return starterPromise.then(function () {
  6472. ctx=ctxInitializer();
  6473. ctx._autoCleanup=true;
  6474. var batchResult=batch(ctx);
  6475. if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) {
  6476. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise);
  6477. }
  6478. return batchResult;
  6479. }).then(function (batchResult) {
  6480. return ctx.sync(batchResult);
  6481. }).then(function (result) {
  6482. succeeded=true;
  6483. resultOrError=result;
  6484. }).catch(function (error) {
  6485. resultOrError=error;
  6486. }).then(function () {
  6487. var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList();
  6488. ctx._autoCleanup=false;
  6489. for (var key in itemsToRemove) {
  6490. itemsToRemove[key]._objectPath.isValid=false;
  6491. }
  6492. var cleanupCounter=0;
  6493. attemptCleanup();
  6494. function attemptCleanup() {
  6495. cleanupCounter++;
  6496. for (var key in itemsToRemove) {
  6497. ctx.trackedObjects.remove(itemsToRemove[key]);
  6498. }
  6499. ctx.sync().then(function () {
  6500. if (onCleanupSuccess) {
  6501. onCleanupSuccess(cleanupCounter);
  6502. }
  6503. }).catch(function () {
  6504. if (onCleanupFailure) {
  6505. onCleanupFailure(cleanupCounter);
  6506. }
  6507. if (cleanupCounter < numCleanupAttempts) {
  6508. setTimeout(function () {
  6509. attemptCleanup();
  6510. }, retryDelay);
  6511. }
  6512. });
  6513. }
  6514. }).then(function () {
  6515. if (succeeded) {
  6516. return resultOrError;
  6517. }
  6518. else {
  6519. throw resultOrError;
  6520. }
  6521. });
  6522. };
  6523. ClientRequestContext.prototype._nextId=function () {
  6524. return++this.m_nextId;
  6525. };
  6526. return ClientRequestContext;
  6527. })();
  6528. OfficeExtension.ClientRequestContext=ClientRequestContext;
  6529. })(OfficeExtension || (OfficeExtension={}));
  6530. var OfficeExtension;
  6531. (function (OfficeExtension) {
  6532. (function (ClientRequestFlags) {
  6533. ClientRequestFlags[ClientRequestFlags["None"]=0]="None";
  6534. ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation";
  6535. })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={}));
  6536. var ClientRequestFlags=OfficeExtension.ClientRequestFlags;
  6537. })(OfficeExtension || (OfficeExtension={}));
  6538. var OfficeExtension;
  6539. (function (OfficeExtension) {
  6540. var ClientResult=(function () {
  6541. function ClientResult() {
  6542. }
  6543. Object.defineProperty(ClientResult.prototype, "value", {
  6544. get: function () {
  6545. return this.m_value;
  6546. },
  6547. enumerable: true,
  6548. configurable: true
  6549. });
  6550. ClientResult.prototype._handleResult=function (value) {
  6551. this.m_value=value;
  6552. };
  6553. return ClientResult;
  6554. })();
  6555. OfficeExtension.ClientResult=ClientResult;
  6556. })(OfficeExtension || (OfficeExtension={}));
  6557. var OfficeExtension;
  6558. (function (OfficeExtension) {
  6559. var Constants=(function () {
  6560. function Constants() {
  6561. }
  6562. Constants.getItemAt="GetItemAt";
  6563. Constants.id="Id";
  6564. Constants.idPrivate="_Id";
  6565. Constants.index="_Index";
  6566. Constants.items="_Items";
  6567. Constants.iterativeExecutor="IterativeExecutor";
  6568. Constants.localDocument="http://document.localhost/";
  6569. Constants.localDocumentApiPrefix="http://document.localhost/_api/";
  6570. Constants.referenceId="_ReferenceId";
  6571. return Constants;
  6572. })();
  6573. OfficeExtension.Constants=Constants;
  6574. })(OfficeExtension || (OfficeExtension={}));
  6575. var __extends=this.__extends || function (d, b) {
  6576. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  6577. function __() { this.constructor=d; }
  6578. __.prototype=b.prototype;
  6579. d.prototype=new __();
  6580. };
  6581. var OfficeExtension;
  6582. (function (OfficeExtension) {
  6583. var _Internal;
  6584. (function (_Internal) {
  6585. var RuntimeError=(function (_super) {
  6586. __extends(RuntimeError, _super);
  6587. function RuntimeError(code, message, traceMessages, debugInfo) {
  6588. _super.call(this, message);
  6589. this.name="OfficeExtension.Error";
  6590. this.code=code;
  6591. this.message=message;
  6592. this.traceMessages=traceMessages;
  6593. this.debugInfo=debugInfo;
  6594. }
  6595. RuntimeError.prototype.toString=function () {
  6596. return this.code+': '+this.message;
  6597. };
  6598. return RuntimeError;
  6599. })(Error);
  6600. _Internal.RuntimeError=RuntimeError;
  6601. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  6602. OfficeExtension.Error=OfficeExtension._Internal.RuntimeError;
  6603. })(OfficeExtension || (OfficeExtension={}));
  6604. var OfficeExtension;
  6605. (function (OfficeExtension) {
  6606. var ErrorCodes=(function () {
  6607. function ErrorCodes() {
  6608. }
  6609. ErrorCodes.accessDenied="AccessDenied";
  6610. ErrorCodes.generalException="GeneralException";
  6611. ErrorCodes.activityLimitReached="ActivityLimitReached";
  6612. return ErrorCodes;
  6613. })();
  6614. OfficeExtension.ErrorCodes=ErrorCodes;
  6615. })(OfficeExtension || (OfficeExtension={}));
  6616. var OfficeExtension;
  6617. (function (OfficeExtension) {
  6618. var InstantiateActionResultHandler=(function () {
  6619. function InstantiateActionResultHandler(clientObject) {
  6620. this.m_clientObject=clientObject;
  6621. }
  6622. InstantiateActionResultHandler.prototype._handleResult=function (value) {
  6623. OfficeExtension.Utility.fixObjectPathIfNecessary(this.m_clientObject, value);
  6624. if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this.m_clientObject._initReferenceId) {
  6625. this.m_clientObject._initReferenceId(value[OfficeExtension.Constants.referenceId]);
  6626. }
  6627. };
  6628. return InstantiateActionResultHandler;
  6629. })();
  6630. OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler;
  6631. })(OfficeExtension || (OfficeExtension={}));
  6632. var OfficeExtension;
  6633. (function (OfficeExtension) {
  6634. (function (RichApiRequestMessageIndex) {
  6635. RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData";
  6636. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method";
  6637. RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery";
  6638. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers";
  6639. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body";
  6640. RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission";
  6641. RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags";
  6642. })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={}));
  6643. var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex;
  6644. (function (RichApiResponseMessageIndex) {
  6645. RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode";
  6646. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers";
  6647. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body";
  6648. })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={}));
  6649. var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex;
  6650. ;
  6651. (function (ActionType) {
  6652. ActionType[ActionType["Instantiate"]=1]="Instantiate";
  6653. ActionType[ActionType["Query"]=2]="Query";
  6654. ActionType[ActionType["Method"]=3]="Method";
  6655. ActionType[ActionType["SetProperty"]=4]="SetProperty";
  6656. ActionType[ActionType["Trace"]=5]="Trace";
  6657. })(OfficeExtension.ActionType || (OfficeExtension.ActionType={}));
  6658. var ActionType=OfficeExtension.ActionType;
  6659. (function (ObjectPathType) {
  6660. ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject";
  6661. ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject";
  6662. ObjectPathType[ObjectPathType["Method"]=3]="Method";
  6663. ObjectPathType[ObjectPathType["Property"]=4]="Property";
  6664. ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer";
  6665. ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId";
  6666. })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={}));
  6667. var ObjectPathType=OfficeExtension.ObjectPathType;
  6668. })(OfficeExtension || (OfficeExtension={}));
  6669. var OfficeExtension;
  6670. (function (OfficeExtension) {
  6671. var ObjectPath=(function () {
  6672. function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) {
  6673. this.m_objectPathInfo=objectPathInfo;
  6674. this.m_parentObjectPath=parentObjectPath;
  6675. this.m_isWriteOperation=false;
  6676. this.m_isCollection=isCollection;
  6677. this.m_isInvalidAfterRequest=isInvalidAfterRequest;
  6678. this.m_isValid=true;
  6679. }
  6680. Object.defineProperty(ObjectPath.prototype, "objectPathInfo", {
  6681. get: function () {
  6682. return this.m_objectPathInfo;
  6683. },
  6684. enumerable: true,
  6685. configurable: true
  6686. });
  6687. Object.defineProperty(ObjectPath.prototype, "isWriteOperation", {
  6688. get: function () {
  6689. return this.m_isWriteOperation;
  6690. },
  6691. set: function (value) {
  6692. this.m_isWriteOperation=value;
  6693. },
  6694. enumerable: true,
  6695. configurable: true
  6696. });
  6697. Object.defineProperty(ObjectPath.prototype, "isCollection", {
  6698. get: function () {
  6699. return this.m_isCollection;
  6700. },
  6701. enumerable: true,
  6702. configurable: true
  6703. });
  6704. Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", {
  6705. get: function () {
  6706. return this.m_isInvalidAfterRequest;
  6707. },
  6708. enumerable: true,
  6709. configurable: true
  6710. });
  6711. Object.defineProperty(ObjectPath.prototype, "parentObjectPath", {
  6712. get: function () {
  6713. return this.m_parentObjectPath;
  6714. },
  6715. enumerable: true,
  6716. configurable: true
  6717. });
  6718. Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", {
  6719. get: function () {
  6720. return this.m_argumentObjectPaths;
  6721. },
  6722. set: function (value) {
  6723. this.m_argumentObjectPaths=value;
  6724. },
  6725. enumerable: true,
  6726. configurable: true
  6727. });
  6728. Object.defineProperty(ObjectPath.prototype, "isValid", {
  6729. get: function () {
  6730. return this.m_isValid;
  6731. },
  6732. set: function (value) {
  6733. this.m_isValid=value;
  6734. },
  6735. enumerable: true,
  6736. configurable: true
  6737. });
  6738. ObjectPath.prototype.updateUsingObjectData=function (value) {
  6739. var referenceId=value[OfficeExtension.Constants.referenceId];
  6740. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  6741. this.m_isInvalidAfterRequest=false;
  6742. this.m_isValid=true;
  6743. this.m_objectPathInfo.ObjectPathType=6 ;
  6744. this.m_objectPathInfo.Name=referenceId;
  6745. this.m_objectPathInfo.ArgumentInfo={};
  6746. this.m_parentObjectPath=null;
  6747. this.m_argumentObjectPaths=null;
  6748. return;
  6749. }
  6750. if (this.parentObjectPath && this.parentObjectPath.isCollection) {
  6751. var id=value[OfficeExtension.Constants.id];
  6752. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  6753. id=value[OfficeExtension.Constants.idPrivate];
  6754. }
  6755. if (!OfficeExtension.Utility.isNullOrUndefined(id)) {
  6756. this.m_isInvalidAfterRequest=false;
  6757. this.m_isValid=true;
  6758. this.m_objectPathInfo.ObjectPathType=5 ;
  6759. this.m_objectPathInfo.Name="";
  6760. this.m_objectPathInfo.ArgumentInfo={};
  6761. this.m_objectPathInfo.ArgumentInfo.Arguments=[id];
  6762. this.m_argumentObjectPaths=null;
  6763. return;
  6764. }
  6765. }
  6766. };
  6767. return ObjectPath;
  6768. })();
  6769. OfficeExtension.ObjectPath=ObjectPath;
  6770. })(OfficeExtension || (OfficeExtension={}));
  6771. var OfficeExtension;
  6772. (function (OfficeExtension) {
  6773. var ObjectPathFactory=(function () {
  6774. function ObjectPathFactory() {
  6775. }
  6776. ObjectPathFactory.createGlobalObjectObjectPath=function (context) {
  6777. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" };
  6778. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  6779. };
  6780. ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) {
  6781. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName };
  6782. return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false);
  6783. };
  6784. ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) {
  6785. var objectPathInfo={
  6786. Id: context._nextId(),
  6787. ObjectPathType: 4 ,
  6788. Name: propertyName,
  6789. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  6790. };
  6791. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  6792. };
  6793. ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) {
  6794. var objectPathInfo={
  6795. Id: context._nextId(),
  6796. ObjectPathType: 5 ,
  6797. Name: "",
  6798. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  6799. ArgumentInfo: {}
  6800. };
  6801. objectPathInfo.ArgumentInfo.Arguments=args;
  6802. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  6803. };
  6804. ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) {
  6805. var objectPathInfo={
  6806. Id: context._nextId(),
  6807. ObjectPathType: 5 ,
  6808. Name: "",
  6809. ParentObjectPathId: parentObjectPath.objectPathInfo.Id,
  6810. ArgumentInfo: {}
  6811. };
  6812. objectPathInfo.ArgumentInfo.Arguments=args;
  6813. return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false);
  6814. };
  6815. ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest) {
  6816. var objectPathInfo={
  6817. Id: context._nextId(),
  6818. ObjectPathType: 3 ,
  6819. Name: methodName,
  6820. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  6821. ArgumentInfo: {}
  6822. };
  6823. var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args);
  6824. var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  6825. ret.argumentObjectPaths=argumentObjectPaths;
  6826. ret.isWriteOperation=(operationType !=1 );
  6827. return ret;
  6828. };
  6829. ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) {
  6830. var id=childItem[OfficeExtension.Constants.id];
  6831. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  6832. id=childItem[OfficeExtension.Constants.idPrivate];
  6833. }
  6834. var objectPathInfo=objectPathInfo={
  6835. Id: context._nextId(),
  6836. ObjectPathType: 5 ,
  6837. Name: "",
  6838. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  6839. ArgumentInfo: {}
  6840. };
  6841. objectPathInfo.ArgumentInfo.Arguments=[id];
  6842. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  6843. };
  6844. ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) {
  6845. var indexFromServer=childItem[OfficeExtension.Constants.index];
  6846. if (indexFromServer) {
  6847. index=indexFromServer;
  6848. }
  6849. var objectPathInfo={
  6850. Id: context._nextId(),
  6851. ObjectPathType: 3 ,
  6852. Name: OfficeExtension.Constants.getItemAt,
  6853. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  6854. ArgumentInfo: {}
  6855. };
  6856. objectPathInfo.ArgumentInfo.Arguments=[index];
  6857. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  6858. };
  6859. ObjectPathFactory.createReferenceIdObjectPath=function (context, referenceId) {
  6860. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 6 , Name: referenceId };
  6861. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  6862. };
  6863. return ObjectPathFactory;
  6864. })();
  6865. OfficeExtension.ObjectPathFactory=ObjectPathFactory;
  6866. })(OfficeExtension || (OfficeExtension={}));
  6867. var OfficeExtension;
  6868. (function (OfficeExtension) {
  6869. var OfficeJsRequestExecutor=(function () {
  6870. function OfficeJsRequestExecutor() {
  6871. }
  6872. OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage, callback) {
  6873. var requestMessageText=JSON.stringify(requestMessage.Body);
  6874. OfficeExtension.Utility.log("Request:");
  6875. OfficeExtension.Utility.log(requestMessageText);
  6876. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", null, requestMessageText);
  6877. OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) {
  6878. OfficeExtension.Utility.log("Response:");
  6879. OfficeExtension.Utility.log(JSON.stringify(result));
  6880. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  6881. if (result.status=="succeeded") {
  6882. var bodyText=OfficeExtension.RichApiMessageUtility.getResponseBody(result);
  6883. response.Body=JSON.parse(bodyText);
  6884. response.Headers=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result);
  6885. callback(response);
  6886. }
  6887. else {
  6888. response.ErrorCode=OfficeExtension.ErrorCodes.generalException;
  6889. if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability) {
  6890. response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied;
  6891. }
  6892. else if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached) {
  6893. response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached;
  6894. }
  6895. response.ErrorMessage=result.error.message;
  6896. callback(response);
  6897. }
  6898. });
  6899. };
  6900. OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability=7000;
  6901. OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached=5102;
  6902. return OfficeJsRequestExecutor;
  6903. })();
  6904. OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor;
  6905. })(OfficeExtension || (OfficeExtension={}));
  6906. var OfficeExtension;
  6907. (function (OfficeExtension) {
  6908. var OfficeXHRSettings=(function () {
  6909. function OfficeXHRSettings() {
  6910. }
  6911. return OfficeXHRSettings;
  6912. })();
  6913. OfficeExtension.OfficeXHRSettings=OfficeXHRSettings;
  6914. function resetXHRFactory(oldFactory) {
  6915. OfficeXHR.settings.oldxhr=oldFactory;
  6916. return officeXHRFactory;
  6917. }
  6918. OfficeExtension.resetXHRFactory=resetXHRFactory;
  6919. function officeXHRFactory() {
  6920. return new OfficeXHR;
  6921. }
  6922. OfficeExtension.officeXHRFactory=officeXHRFactory;
  6923. var OfficeXHR=(function () {
  6924. function OfficeXHR() {
  6925. }
  6926. OfficeXHR.prototype.open=function (method, url) {
  6927. this.m_method=method;
  6928. this.m_url=url;
  6929. if (this.m_url.toLowerCase().indexOf(OfficeExtension.Constants.localDocumentApiPrefix)==0) {
  6930. this.m_url=this.m_url.substr(OfficeExtension.Constants.localDocumentApiPrefix.length);
  6931. }
  6932. else {
  6933. this.m_innerXhr=OfficeXHR.settings.oldxhr();
  6934. var thisObj=this;
  6935. this.m_innerXhr.onreadystatechange=function () {
  6936. thisObj.innerXhrOnreadystatechage();
  6937. };
  6938. this.m_innerXhr.open(method, this.m_url);
  6939. }
  6940. };
  6941. OfficeXHR.prototype.abort=function () {
  6942. if (this.m_innerXhr) {
  6943. this.m_innerXhr.abort();
  6944. }
  6945. };
  6946. OfficeXHR.prototype.send=function (body) {
  6947. if (this.m_innerXhr) {
  6948. this.m_innerXhr.send(body);
  6949. }
  6950. else {
  6951. var thisObj=this;
  6952. var requestFlags=0 ;
  6953. if (!OfficeExtension.Utility.isReadonlyRestRequest(this.m_method)) {
  6954. requestFlags=1 ;
  6955. }
  6956. var execFunction=OfficeXHR.settings.executeRichApiRequestAsync;
  6957. if (!execFunction) {
  6958. execFunction=OSF.DDA.RichApi.executeRichApiRequestAsync;
  6959. }
  6960. execFunction(OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray('', requestFlags, this.m_method, this.m_url, this.m_requestHeaders, body), function (asyncResult) {
  6961. thisObj.officeContextRequestCallback(asyncResult);
  6962. });
  6963. }
  6964. };
  6965. OfficeXHR.prototype.setRequestHeader=function (header, value) {
  6966. if (this.m_innerXhr) {
  6967. this.m_innerXhr.setRequestHeader(header, value);
  6968. }
  6969. else {
  6970. if (!this.m_requestHeaders) {
  6971. this.m_requestHeaders={};
  6972. }
  6973. this.m_requestHeaders[header]=value;
  6974. }
  6975. };
  6976. OfficeXHR.prototype.getResponseHeader=function (header) {
  6977. if (this.m_responseHeaders) {
  6978. return this.m_responseHeaders[header.toUpperCase()];
  6979. }
  6980. return null;
  6981. };
  6982. OfficeXHR.prototype.getAllResponseHeaders=function () {
  6983. return this.m_allResponseHeaders;
  6984. };
  6985. OfficeXHR.prototype.overrideMimeType=function (mimeType) {
  6986. if (this.m_innerXhr) {
  6987. this.m_innerXhr.overrideMimeType(mimeType);
  6988. }
  6989. };
  6990. OfficeXHR.prototype.innerXhrOnreadystatechage=function () {
  6991. this.readyState=this.m_innerXhr.readyState;
  6992. if (this.readyState==OfficeXHR.DONE) {
  6993. this.status=this.m_innerXhr.status;
  6994. this.statusText=this.m_innerXhr.statusText;
  6995. this.responseText=this.m_innerXhr.responseText;
  6996. this.response=this.m_innerXhr.response;
  6997. this.responseType=this.m_innerXhr.responseType;
  6998. this.setAllResponseHeaders(this.m_innerXhr.getAllResponseHeaders());
  6999. }
  7000. if (this.onreadystatechange) {
  7001. this.onreadystatechange();
  7002. }
  7003. };
  7004. OfficeXHR.prototype.officeContextRequestCallback=function (result) {
  7005. this.readyState=OfficeXHR.DONE;
  7006. if (result.status=="succeeded") {
  7007. this.status=OfficeExtension.RichApiMessageUtility.getResponseStatusCode(result);
  7008. this.m_responseHeaders=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result);
  7009. console.debug("ResponseHeaders="+JSON.stringify(this.m_responseHeaders));
  7010. this.responseText=OfficeExtension.RichApiMessageUtility.getResponseBody(result);
  7011. console.debug("ResponseText="+this.responseText);
  7012. this.response=this.responseText;
  7013. }
  7014. else {
  7015. this.status=500;
  7016. this.statusText="Internal Error";
  7017. }
  7018. if (this.onreadystatechange) {
  7019. this.onreadystatechange();
  7020. }
  7021. };
  7022. OfficeXHR.prototype.setAllResponseHeaders=function (allResponseHeaders) {
  7023. this.m_allResponseHeaders=allResponseHeaders;
  7024. this.m_responseHeaders={};
  7025. if (this.m_allResponseHeaders !=null) {
  7026. var regex=new RegExp("\r?\n");
  7027. var entries=this.m_allResponseHeaders.split(regex);
  7028. for (var i=0; i < entries.length; i++) {
  7029. var entry=entries[i];
  7030. if (entry !=null) {
  7031. var index=entry.indexOf(':');
  7032. if (index > 0) {
  7033. var key=entry.substr(0, index);
  7034. var value=entry.substr(index+1);
  7035. key=OfficeExtension.Utility.trim(key);
  7036. value=OfficeExtension.Utility.trim(value);
  7037. this.m_responseHeaders[key.toUpperCase()]=value;
  7038. }
  7039. }
  7040. }
  7041. }
  7042. };
  7043. OfficeXHR.UNSENT=0;
  7044. OfficeXHR.OPENED=1;
  7045. OfficeXHR.DONE=4;
  7046. OfficeXHR.settings=new OfficeXHRSettings();
  7047. return OfficeXHR;
  7048. })();
  7049. OfficeExtension.OfficeXHR=OfficeXHR;
  7050. })(OfficeExtension || (OfficeExtension={}));
  7051. var OfficeExtension;
  7052. (function (OfficeExtension) {
  7053. function _EnsurePromise() {
  7054. if (!OfficeExtension["Promise"]) {
  7055. PromiseImpl.Init();
  7056. }
  7057. }
  7058. OfficeExtension._EnsurePromise=_EnsurePromise;
  7059. var PromiseImpl;
  7060. (function (PromiseImpl) {
  7061. function Init() {
  7062. (function () {
  7063. "use strict";
  7064. function lib$es6$promise$utils$$objectOrFunction(x) {
  7065. return typeof x==='function' || (typeof x==='object' && x !==null);
  7066. }
  7067. function lib$es6$promise$utils$$isFunction(x) {
  7068. return typeof x==='function';
  7069. }
  7070. function lib$es6$promise$utils$$isMaybeThenable(x) {
  7071. return typeof x==='object' && x !==null;
  7072. }
  7073. var lib$es6$promise$utils$$_isArray;
  7074. if (!Array.isArray) {
  7075. lib$es6$promise$utils$$_isArray=function (x) {
  7076. return Object.prototype.toString.call(x)==='[object Array]';
  7077. };
  7078. }
  7079. else {
  7080. lib$es6$promise$utils$$_isArray=Array.isArray;
  7081. }
  7082. var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;
  7083. var lib$es6$promise$asap$$len=0;
  7084. var lib$es6$promise$asap$$toString={}.toString;
  7085. var lib$es6$promise$asap$$vertxNext;
  7086. var lib$es6$promise$asap$$customSchedulerFn;
  7087. var lib$es6$promise$asap$$asap=function asap(callback, arg) {
  7088. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;
  7089. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;
  7090. lib$es6$promise$asap$$len+=2;
  7091. if (lib$es6$promise$asap$$len===2) {
  7092. if (lib$es6$promise$asap$$customSchedulerFn) {
  7093. lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
  7094. }
  7095. else {
  7096. lib$es6$promise$asap$$scheduleFlush();
  7097. }
  7098. }
  7099. };
  7100. function lib$es6$promise$asap$$setScheduler(scheduleFn) {
  7101. lib$es6$promise$asap$$customSchedulerFn=scheduleFn;
  7102. }
  7103. function lib$es6$promise$asap$$setAsap(asapFn) {
  7104. lib$es6$promise$asap$$asap=asapFn;
  7105. }
  7106. var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined;
  7107. var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {};
  7108. var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
  7109. var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]';
  7110. var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined';
  7111. function lib$es6$promise$asap$$useNextTick() {
  7112. var nextTick=process.nextTick;
  7113. var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
  7114. if (Array.isArray(version) && version[1]==='0' && version[2]==='10') {
  7115. nextTick=setImmediate;
  7116. }
  7117. return function () {
  7118. nextTick(lib$es6$promise$asap$$flush);
  7119. };
  7120. }
  7121. function lib$es6$promise$asap$$useVertxTimer() {
  7122. return function () {
  7123. lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
  7124. };
  7125. }
  7126. function lib$es6$promise$asap$$useMutationObserver() {
  7127. var iterations=0;
  7128. var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
  7129. var node=document.createTextNode('');
  7130. observer.observe(node, { characterData: true });
  7131. return function () {
  7132. node.data=(iterations=++iterations % 2);
  7133. };
  7134. }
  7135. function lib$es6$promise$asap$$useMessageChannel() {
  7136. var channel=new MessageChannel();
  7137. channel.port1.onmessage=lib$es6$promise$asap$$flush;
  7138. return function () {
  7139. channel.port2.postMessage(0);
  7140. };
  7141. }
  7142. function lib$es6$promise$asap$$useSetTimeout() {
  7143. return function () {
  7144. setTimeout(lib$es6$promise$asap$$flush, 1);
  7145. };
  7146. }
  7147. var lib$es6$promise$asap$$queue=new Array(1000);
  7148. function lib$es6$promise$asap$$flush() {
  7149. for (var i=0; i < lib$es6$promise$asap$$len; i+=2) {
  7150. var callback=lib$es6$promise$asap$$queue[i];
  7151. var arg=lib$es6$promise$asap$$queue[i+1];
  7152. callback(arg);
  7153. lib$es6$promise$asap$$queue[i]=undefined;
  7154. lib$es6$promise$asap$$queue[i+1]=undefined;
  7155. }
  7156. lib$es6$promise$asap$$len=0;
  7157. }
  7158. function lib$es6$promise$asap$$attemptVertex() {
  7159. try {
  7160. var r=require;
  7161. var vertx=r('vertx');
  7162. lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext;
  7163. return lib$es6$promise$asap$$useVertxTimer();
  7164. }
  7165. catch (e) {
  7166. return lib$es6$promise$asap$$useSetTimeout();
  7167. }
  7168. }
  7169. var lib$es6$promise$asap$$scheduleFlush;
  7170. if (lib$es6$promise$asap$$isNode) {
  7171. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick();
  7172. }
  7173. else if (lib$es6$promise$asap$$BrowserMutationObserver) {
  7174. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver();
  7175. }
  7176. else if (lib$es6$promise$asap$$isWorker) {
  7177. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel();
  7178. }
  7179. else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') {
  7180. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex();
  7181. }
  7182. else {
  7183. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout();
  7184. }
  7185. function lib$es6$promise$$internal$$noop() {
  7186. }
  7187. var lib$es6$promise$$internal$$PENDING=void 0;
  7188. var lib$es6$promise$$internal$$FULFILLED=1;
  7189. var lib$es6$promise$$internal$$REJECTED=2;
  7190. var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  7191. function lib$es6$promise$$internal$$selfFullfillment() {
  7192. return new TypeError("You cannot resolve a promise with itself");
  7193. }
  7194. function lib$es6$promise$$internal$$cannotReturnOwn() {
  7195. return new TypeError('A promises callback cannot return that same promise.');
  7196. }
  7197. function lib$es6$promise$$internal$$getThen(promise) {
  7198. try {
  7199. return promise.then;
  7200. }
  7201. catch (error) {
  7202. lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;
  7203. return lib$es6$promise$$internal$$GET_THEN_ERROR;
  7204. }
  7205. }
  7206. function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
  7207. try {
  7208. then.call(value, fulfillmentHandler, rejectionHandler);
  7209. }
  7210. catch (e) {
  7211. return e;
  7212. }
  7213. }
  7214. function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
  7215. lib$es6$promise$asap$$asap(function (promise) {
  7216. var sealed=false;
  7217. var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {
  7218. if (sealed) {
  7219. return;
  7220. }
  7221. sealed=true;
  7222. if (thenable !==value) {
  7223. lib$es6$promise$$internal$$resolve(promise, value);
  7224. }
  7225. else {
  7226. lib$es6$promise$$internal$$fulfill(promise, value);
  7227. }
  7228. }, function (reason) {
  7229. if (sealed) {
  7230. return;
  7231. }
  7232. sealed=true;
  7233. lib$es6$promise$$internal$$reject(promise, reason);
  7234. }, 'Settle: '+(promise._label || ' unknown promise'));
  7235. if (!sealed && error) {
  7236. sealed=true;
  7237. lib$es6$promise$$internal$$reject(promise, error);
  7238. }
  7239. }, promise);
  7240. }
  7241. function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
  7242. if (thenable._state===lib$es6$promise$$internal$$FULFILLED) {
  7243. lib$es6$promise$$internal$$fulfill(promise, thenable._result);
  7244. }
  7245. else if (thenable._state===lib$es6$promise$$internal$$REJECTED) {
  7246. lib$es6$promise$$internal$$reject(promise, thenable._result);
  7247. }
  7248. else {
  7249. lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {
  7250. lib$es6$promise$$internal$$resolve(promise, value);
  7251. }, function (reason) {
  7252. lib$es6$promise$$internal$$reject(promise, reason);
  7253. });
  7254. }
  7255. }
  7256. function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
  7257. if (maybeThenable.constructor===promise.constructor) {
  7258. lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
  7259. }
  7260. else {
  7261. var then=lib$es6$promise$$internal$$getThen(maybeThenable);
  7262. if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) {
  7263. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
  7264. }
  7265. else if (then===undefined) {
  7266. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  7267. }
  7268. else if (lib$es6$promise$utils$$isFunction(then)) {
  7269. lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
  7270. }
  7271. else {
  7272. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  7273. }
  7274. }
  7275. }
  7276. function lib$es6$promise$$internal$$resolve(promise, value) {
  7277. if (promise===value) {
  7278. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
  7279. }
  7280. else if (lib$es6$promise$utils$$objectOrFunction(value)) {
  7281. lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
  7282. }
  7283. else {
  7284. lib$es6$promise$$internal$$fulfill(promise, value);
  7285. }
  7286. }
  7287. function lib$es6$promise$$internal$$publishRejection(promise) {
  7288. if (promise._onerror) {
  7289. promise._onerror(promise._result);
  7290. }
  7291. lib$es6$promise$$internal$$publish(promise);
  7292. }
  7293. function lib$es6$promise$$internal$$fulfill(promise, value) {
  7294. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  7295. return;
  7296. }
  7297. promise._result=value;
  7298. promise._state=lib$es6$promise$$internal$$FULFILLED;
  7299. if (promise._subscribers.length !==0) {
  7300. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
  7301. }
  7302. }
  7303. function lib$es6$promise$$internal$$reject(promise, reason) {
  7304. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  7305. return;
  7306. }
  7307. promise._state=lib$es6$promise$$internal$$REJECTED;
  7308. promise._result=reason;
  7309. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
  7310. }
  7311. function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
  7312. var subscribers=parent._subscribers;
  7313. var length=subscribers.length;
  7314. parent._onerror=null;
  7315. subscribers[length]=child;
  7316. subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;
  7317. subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;
  7318. if (length===0 && parent._state) {
  7319. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
  7320. }
  7321. }
  7322. function lib$es6$promise$$internal$$publish(promise) {
  7323. var subscribers=promise._subscribers;
  7324. var settled=promise._state;
  7325. if (subscribers.length===0) {
  7326. return;
  7327. }
  7328. var child, callback, detail=promise._result;
  7329. for (var i=0; i < subscribers.length; i+=3) {
  7330. child=subscribers[i];
  7331. callback=subscribers[i+settled];
  7332. if (child) {
  7333. lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
  7334. }
  7335. else {
  7336. callback(detail);
  7337. }
  7338. }
  7339. promise._subscribers.length=0;
  7340. }
  7341. function lib$es6$promise$$internal$$ErrorObject() {
  7342. this.error=null;
  7343. }
  7344. var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  7345. function lib$es6$promise$$internal$$tryCatch(callback, detail) {
  7346. try {
  7347. return callback(detail);
  7348. }
  7349. catch (e) {
  7350. lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;
  7351. return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
  7352. }
  7353. }
  7354. function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
  7355. var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed;
  7356. if (hasCallback) {
  7357. value=lib$es6$promise$$internal$$tryCatch(callback, detail);
  7358. if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
  7359. failed=true;
  7360. error=value.error;
  7361. value=null;
  7362. }
  7363. else {
  7364. succeeded=true;
  7365. }
  7366. if (promise===value) {
  7367. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
  7368. return;
  7369. }
  7370. }
  7371. else {
  7372. value=detail;
  7373. succeeded=true;
  7374. }
  7375. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  7376. }
  7377. else if (hasCallback && succeeded) {
  7378. lib$es6$promise$$internal$$resolve(promise, value);
  7379. }
  7380. else if (failed) {
  7381. lib$es6$promise$$internal$$reject(promise, error);
  7382. }
  7383. else if (settled===lib$es6$promise$$internal$$FULFILLED) {
  7384. lib$es6$promise$$internal$$fulfill(promise, value);
  7385. }
  7386. else if (settled===lib$es6$promise$$internal$$REJECTED) {
  7387. lib$es6$promise$$internal$$reject(promise, value);
  7388. }
  7389. }
  7390. function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
  7391. try {
  7392. resolver(function resolvePromise(value) {
  7393. lib$es6$promise$$internal$$resolve(promise, value);
  7394. }, function rejectPromise(reason) {
  7395. lib$es6$promise$$internal$$reject(promise, reason);
  7396. });
  7397. }
  7398. catch (e) {
  7399. lib$es6$promise$$internal$$reject(promise, e);
  7400. }
  7401. }
  7402. function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
  7403. var enumerator=this;
  7404. enumerator._instanceConstructor=Constructor;
  7405. enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);
  7406. if (enumerator._validateInput(input)) {
  7407. enumerator._input=input;
  7408. enumerator.length=input.length;
  7409. enumerator._remaining=input.length;
  7410. enumerator._init();
  7411. if (enumerator.length===0) {
  7412. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  7413. }
  7414. else {
  7415. enumerator.length=enumerator.length || 0;
  7416. enumerator._enumerate();
  7417. if (enumerator._remaining===0) {
  7418. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  7419. }
  7420. }
  7421. }
  7422. else {
  7423. lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
  7424. }
  7425. }
  7426. lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) {
  7427. return lib$es6$promise$utils$$isArray(input);
  7428. };
  7429. lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () {
  7430. return new OfficeExtension.Error('Array Methods must be provided an Array');
  7431. };
  7432. lib$es6$promise$enumerator$$Enumerator.prototype._init=function () {
  7433. this._result=new Array(this.length);
  7434. };
  7435. var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;
  7436. lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () {
  7437. var enumerator=this;
  7438. var length=enumerator.length;
  7439. var promise=enumerator.promise;
  7440. var input=enumerator._input;
  7441. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  7442. enumerator._eachEntry(input[i], i);
  7443. }
  7444. };
  7445. lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) {
  7446. var enumerator=this;
  7447. var c=enumerator._instanceConstructor;
  7448. if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
  7449. if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) {
  7450. entry._onerror=null;
  7451. enumerator._settledAt(entry._state, i, entry._result);
  7452. }
  7453. else {
  7454. enumerator._willSettleAt(c.resolve(entry), i);
  7455. }
  7456. }
  7457. else {
  7458. enumerator._remaining--;
  7459. enumerator._result[i]=entry;
  7460. }
  7461. };
  7462. lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) {
  7463. var enumerator=this;
  7464. var promise=enumerator.promise;
  7465. if (promise._state===lib$es6$promise$$internal$$PENDING) {
  7466. enumerator._remaining--;
  7467. if (state===lib$es6$promise$$internal$$REJECTED) {
  7468. lib$es6$promise$$internal$$reject(promise, value);
  7469. }
  7470. else {
  7471. enumerator._result[i]=value;
  7472. }
  7473. }
  7474. if (enumerator._remaining===0) {
  7475. lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
  7476. }
  7477. };
  7478. lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) {
  7479. var enumerator=this;
  7480. lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {
  7481. enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
  7482. }, function (reason) {
  7483. enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
  7484. });
  7485. };
  7486. function lib$es6$promise$promise$all$$all(entries) {
  7487. return new lib$es6$promise$enumerator$$default(this, entries).promise;
  7488. }
  7489. var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;
  7490. function lib$es6$promise$promise$race$$race(entries) {
  7491. var Constructor=this;
  7492. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  7493. if (!lib$es6$promise$utils$$isArray(entries)) {
  7494. lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
  7495. return promise;
  7496. }
  7497. var length=entries.length;
  7498. function onFulfillment(value) {
  7499. lib$es6$promise$$internal$$resolve(promise, value);
  7500. }
  7501. function onRejection(reason) {
  7502. lib$es6$promise$$internal$$reject(promise, reason);
  7503. }
  7504. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  7505. lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
  7506. }
  7507. return promise;
  7508. }
  7509. var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;
  7510. function lib$es6$promise$promise$resolve$$resolve(object) {
  7511. var Constructor=this;
  7512. if (object && typeof object==='object' && object.constructor===Constructor) {
  7513. return object;
  7514. }
  7515. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  7516. lib$es6$promise$$internal$$resolve(promise, object);
  7517. return promise;
  7518. }
  7519. var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;
  7520. function lib$es6$promise$promise$reject$$reject(reason) {
  7521. var Constructor=this;
  7522. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  7523. lib$es6$promise$$internal$$reject(promise, reason);
  7524. return promise;
  7525. }
  7526. var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;
  7527. var lib$es6$promise$promise$$counter=0;
  7528. function lib$es6$promise$promise$$needsResolver() {
  7529. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  7530. }
  7531. function lib$es6$promise$promise$$needsNew() {
  7532. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  7533. }
  7534. var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;
  7535. function lib$es6$promise$promise$$Promise(resolver) {
  7536. this._id=lib$es6$promise$promise$$counter++;
  7537. this._state=undefined;
  7538. this._result=undefined;
  7539. this._subscribers=[];
  7540. if (lib$es6$promise$$internal$$noop !==resolver) {
  7541. if (!lib$es6$promise$utils$$isFunction(resolver)) {
  7542. lib$es6$promise$promise$$needsResolver();
  7543. }
  7544. if (!(this instanceof lib$es6$promise$promise$$Promise)) {
  7545. lib$es6$promise$promise$$needsNew();
  7546. }
  7547. lib$es6$promise$$internal$$initializePromise(this, resolver);
  7548. }
  7549. }
  7550. lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;
  7551. lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;
  7552. lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;
  7553. lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;
  7554. lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;
  7555. lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;
  7556. lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;
  7557. lib$es6$promise$promise$$Promise.prototype={
  7558. constructor: lib$es6$promise$promise$$Promise,
  7559. then: function (onFulfillment, onRejection) {
  7560. var parent=this;
  7561. var state=parent._state;
  7562. if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) {
  7563. return this;
  7564. }
  7565. var child=new this.constructor(lib$es6$promise$$internal$$noop);
  7566. var result=parent._result;
  7567. if (state) {
  7568. var callback=arguments[state - 1];
  7569. lib$es6$promise$asap$$asap(function () {
  7570. lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
  7571. });
  7572. }
  7573. else {
  7574. lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
  7575. }
  7576. return child;
  7577. },
  7578. 'catch': function (onRejection) {
  7579. return this.then(null, onRejection);
  7580. }
  7581. };
  7582. OfficeExtension["Promise"]=lib$es6$promise$promise$$default;
  7583. }).call(this);
  7584. }
  7585. PromiseImpl.Init=Init;
  7586. })(PromiseImpl || (PromiseImpl={}));
  7587. })(OfficeExtension || (OfficeExtension={}));
  7588. var OfficeExtension;
  7589. (function (OfficeExtension) {
  7590. (function (OperationType) {
  7591. OperationType[OperationType["Default"]=0]="Default";
  7592. OperationType[OperationType["Read"]=1]="Read";
  7593. })(OfficeExtension.OperationType || (OfficeExtension.OperationType={}));
  7594. var OperationType=OfficeExtension.OperationType;
  7595. })(OfficeExtension || (OfficeExtension={}));
  7596. var OfficeExtension;
  7597. (function (OfficeExtension) {
  7598. var TrackedObjects=(function () {
  7599. function TrackedObjects(context) {
  7600. this._autoCleanupList={};
  7601. this.m_context=context;
  7602. }
  7603. TrackedObjects.prototype.add=function (param) {
  7604. var _this=this;
  7605. if (Array.isArray(param)) {
  7606. param.forEach(function (item) { return _this._addCommon(item, true); });
  7607. }
  7608. else {
  7609. this._addCommon(param, true);
  7610. }
  7611. };
  7612. TrackedObjects.prototype._autoAdd=function (object) {
  7613. this._addCommon(object, false);
  7614. this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object;
  7615. };
  7616. TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) {
  7617. var referenceId=object[OfficeExtension.Constants.referenceId];
  7618. if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) {
  7619. object._KeepReference();
  7620. OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object);
  7621. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  7622. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  7623. }
  7624. }
  7625. };
  7626. TrackedObjects.prototype.remove=function (param) {
  7627. var _this=this;
  7628. if (Array.isArray(param)) {
  7629. param.forEach(function (item) { return _this._removeCommon(item); });
  7630. }
  7631. else {
  7632. this._removeCommon(param);
  7633. }
  7634. };
  7635. TrackedObjects.prototype._removeCommon=function (object) {
  7636. var referenceId=object[OfficeExtension.Constants.referenceId];
  7637. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  7638. var rootObject=this.m_context._rootObject;
  7639. if (rootObject._RemoveReference) {
  7640. rootObject._RemoveReference(referenceId);
  7641. }
  7642. }
  7643. };
  7644. TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () {
  7645. var list=this._autoCleanupList;
  7646. this._autoCleanupList={};
  7647. return list;
  7648. };
  7649. return TrackedObjects;
  7650. })();
  7651. OfficeExtension.TrackedObjects=TrackedObjects;
  7652. })(OfficeExtension || (OfficeExtension={}));
  7653. var OfficeExtension;
  7654. (function (OfficeExtension) {
  7655. var ResourceStrings=(function () {
  7656. function ResourceStrings() {
  7657. }
  7658. ResourceStrings.invalidObjectPath="InvalidObjectPath";
  7659. ResourceStrings.propertyNotLoaded="PropertyNotLoaded";
  7660. ResourceStrings.invalidRequestContext="InvalidRequestContext";
  7661. ResourceStrings.invalidArgument="InvalidArgument";
  7662. ResourceStrings.runMustReturnPromise="RunMustReturnPromise";
  7663. return ResourceStrings;
  7664. })();
  7665. OfficeExtension.ResourceStrings=ResourceStrings;
  7666. })(OfficeExtension || (OfficeExtension={}));
  7667. var OfficeExtension;
  7668. (function (OfficeExtension) {
  7669. var RichApiMessageUtility=(function () {
  7670. function RichApiMessageUtility() {
  7671. }
  7672. RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) {
  7673. var headerArray=[];
  7674. if (headers) {
  7675. for (var headerName in headers) {
  7676. headerArray.push(headerName);
  7677. headerArray.push(headers[headerName]);
  7678. }
  7679. }
  7680. var appPermission=0;
  7681. var solutionId="";
  7682. var instanceId="";
  7683. var marketplaceType="";
  7684. return [
  7685. customData,
  7686. method,
  7687. path,
  7688. headerArray,
  7689. body,
  7690. appPermission,
  7691. requestFlags,
  7692. solutionId,
  7693. instanceId,
  7694. marketplaceType
  7695. ];
  7696. };
  7697. RichApiMessageUtility.getResponseBody=function (result) {
  7698. return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data);
  7699. };
  7700. RichApiMessageUtility.getResponseHeaders=function (result) {
  7701. return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data);
  7702. };
  7703. RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) {
  7704. var ret=data[2 ];
  7705. if (typeof (ret)==="string") {
  7706. return ret;
  7707. }
  7708. var arr=ret;
  7709. return arr.join("");
  7710. };
  7711. RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) {
  7712. var arrayHeader=data[1 ];
  7713. if (!arrayHeader) {
  7714. return null;
  7715. }
  7716. var headers={};
  7717. for (var i=0; i < arrayHeader.length - 1; i+=2) {
  7718. headers[arrayHeader[i]]=arrayHeader[i+1];
  7719. }
  7720. return headers;
  7721. };
  7722. RichApiMessageUtility.getResponseStatusCode=function (result) {
  7723. return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data);
  7724. };
  7725. RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) {
  7726. return data[0 ];
  7727. };
  7728. return RichApiMessageUtility;
  7729. })();
  7730. OfficeExtension.RichApiMessageUtility=RichApiMessageUtility;
  7731. })(OfficeExtension || (OfficeExtension={}));
  7732. var OfficeExtension;
  7733. (function (OfficeExtension) {
  7734. var Utility=(function () {
  7735. function Utility() {
  7736. }
  7737. Utility.checkArgumentNull=function (value, name) {
  7738. };
  7739. Utility.isNullOrUndefined=function (value) {
  7740. if (value===null) {
  7741. return true;
  7742. }
  7743. if (typeof (value)==="undefined") {
  7744. return true;
  7745. }
  7746. return false;
  7747. };
  7748. Utility.isUndefined=function (value) {
  7749. if (typeof (value)==="undefined") {
  7750. return true;
  7751. }
  7752. return false;
  7753. };
  7754. Utility.isNullOrEmptyString=function (value) {
  7755. if (value===null) {
  7756. return true;
  7757. }
  7758. if (typeof (value)==="undefined") {
  7759. return true;
  7760. }
  7761. if (value.length==0) {
  7762. return true;
  7763. }
  7764. return false;
  7765. };
  7766. Utility.trim=function (str) {
  7767. return str.replace(new RegExp("^\\s+|\\s+$", "g"), "");
  7768. };
  7769. Utility.caseInsensitiveCompareString=function (str1, str2) {
  7770. if (Utility.isNullOrUndefined(str1)) {
  7771. return Utility.isNullOrUndefined(str2);
  7772. }
  7773. else {
  7774. if (Utility.isNullOrUndefined(str2)) {
  7775. return false;
  7776. }
  7777. else {
  7778. return str1.toUpperCase()==str2.toUpperCase();
  7779. }
  7780. }
  7781. };
  7782. Utility.isReadonlyRestRequest=function (method) {
  7783. return Utility.caseInsensitiveCompareString(method, "GET");
  7784. };
  7785. Utility.setMethodArguments=function (context, argumentInfo, args) {
  7786. if (Utility.isNullOrUndefined(args)) {
  7787. return null;
  7788. }
  7789. var referencedObjectPaths=new Array();
  7790. var referencedObjectPathIds=new Array();
  7791. var hasOne=false;
  7792. for (var i=0; i < args.length; i++) {
  7793. if (args[i] instanceof OfficeExtension.ClientObject) {
  7794. var clientObject=args[i];
  7795. Utility.validateContext(context, clientObject);
  7796. args[i]=clientObject._objectPath.objectPathInfo.Id;
  7797. referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id);
  7798. referencedObjectPaths.push(clientObject._objectPath);
  7799. hasOne=true;
  7800. }
  7801. else {
  7802. referencedObjectPathIds.push(0);
  7803. }
  7804. }
  7805. argumentInfo.Arguments=args;
  7806. if (hasOne) {
  7807. argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds;
  7808. return referencedObjectPaths;
  7809. }
  7810. return null;
  7811. };
  7812. Utility.fixObjectPathIfNecessary=function (clientObject, value) {
  7813. if (clientObject && clientObject._objectPath && value) {
  7814. clientObject._objectPath.updateUsingObjectData(value);
  7815. }
  7816. };
  7817. Utility.validateObjectPath=function (clientObject) {
  7818. var objectPath=clientObject._objectPath;
  7819. while (objectPath) {
  7820. if (!objectPath.isValid) {
  7821. var pathExpression=Utility.getObjectPathExpression(objectPath);
  7822. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  7823. }
  7824. objectPath=objectPath.parentObjectPath;
  7825. }
  7826. };
  7827. Utility.validateReferencedObjectPaths=function (objectPaths) {
  7828. if (objectPaths) {
  7829. for (var i=0; i < objectPaths.length; i++) {
  7830. var objectPath=objectPaths[i];
  7831. while (objectPath) {
  7832. if (!objectPath.isValid) {
  7833. var pathExpression=Utility.getObjectPathExpression(objectPath);
  7834. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  7835. }
  7836. objectPath=objectPath.parentObjectPath;
  7837. }
  7838. }
  7839. }
  7840. };
  7841. Utility.validateContext=function (context, obj) {
  7842. if (obj && obj.context !==context) {
  7843. Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext);
  7844. }
  7845. };
  7846. Utility.log=function (message) {
  7847. if (Utility._logEnabled && window.console && window.console.log) {
  7848. window.console.log(message);
  7849. }
  7850. };
  7851. Utility.load=function (clientObj, option) {
  7852. clientObj.context.load(clientObj, option);
  7853. };
  7854. Utility.throwError=function (resourceId, arg) {
  7855. throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), {});
  7856. };
  7857. Utility.createRuntimeError=function (code, message, location) {
  7858. return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location });
  7859. };
  7860. Utility._getResourceString=function (resourceId, arg) {
  7861. var ret=resourceId;
  7862. if (window.Strings && window.Strings.OfficeOM) {
  7863. var stringName="L_"+resourceId;
  7864. var stringValue=window.Strings.OfficeOM[stringName];
  7865. if (stringValue) {
  7866. ret=stringValue;
  7867. }
  7868. }
  7869. if (!Utility.isNullOrUndefined(arg)) {
  7870. ret=ret.replace("{0}", arg);
  7871. }
  7872. return ret;
  7873. };
  7874. Utility.throwIfNotLoaded=function (propertyName, fieldValue) {
  7875. if (Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) {
  7876. Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName);
  7877. }
  7878. };
  7879. Utility.getObjectPathExpression=function (objectPath) {
  7880. var ret="";
  7881. while (objectPath) {
  7882. switch (objectPath.objectPathInfo.ObjectPathType) {
  7883. case 1 :
  7884. ret=ret;
  7885. break;
  7886. case 2 :
  7887. ret="new()"+(ret.length > 0 ? "." : "")+ret;
  7888. break;
  7889. case 3 :
  7890. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret;
  7891. break;
  7892. case 4 :
  7893. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret;
  7894. break;
  7895. case 5 :
  7896. ret="getItem()"+(ret.length > 0 ? "." : "")+ret;
  7897. break;
  7898. case 6 :
  7899. ret="_reference()"+(ret.length > 0 ? "." : "")+ret;
  7900. break;
  7901. }
  7902. objectPath=objectPath.parentObjectPath;
  7903. }
  7904. return ret;
  7905. };
  7906. Utility._createPromiseFromResult=function (value) {
  7907. OfficeExtension._EnsurePromise();
  7908. return new OfficeExtension['Promise'](function (resolve, reject) {
  7909. resolve(value);
  7910. });
  7911. };
  7912. Utility._addActionResultHandler=function (clientObj, action, resultHandler) {
  7913. clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler);
  7914. };
  7915. Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) {
  7916. for (var i=0; i < propertyNames.length - 1; i+=2) {
  7917. if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) {
  7918. clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]);
  7919. }
  7920. }
  7921. };
  7922. Utility.normalizeName=function (name) {
  7923. return name.substr(0, 1).toLowerCase()+name.substr(1);
  7924. };
  7925. Utility._logEnabled=false;
  7926. Utility.s_underscoreCharCode="_".charCodeAt(0);
  7927. return Utility;
  7928. })();
  7929. OfficeExtension.Utility=Utility;
  7930. })(OfficeExtension || (OfficeExtension={}));
  7931. var __extends=this.__extends || function (d, b) {
  7932. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  7933. function __() { this.constructor=d; }
  7934. __.prototype=b.prototype;
  7935. d.prototype=new __();
  7936. };
  7937. var Excel;
  7938. (function (Excel) {
  7939. var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath;
  7940. var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath;
  7941. var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath;
  7942. var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath;
  7943. var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer;
  7944. var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt;
  7945. var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction;
  7946. var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction;
  7947. var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined;
  7948. var _isUndefined=OfficeExtension.Utility.isUndefined;
  7949. var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded;
  7950. var _load=OfficeExtension.Utility.load;
  7951. var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary;
  7952. var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler;
  7953. var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults;
  7954. var Application=(function (_super) {
  7955. __extends(Application, _super);
  7956. function Application() {
  7957. _super.apply(this, arguments);
  7958. }
  7959. Object.defineProperty(Application.prototype, "calculationMode", {
  7960. get: function () {
  7961. _throwIfNotLoaded("calculationMode", this.m_calculationMode);
  7962. return this.m_calculationMode;
  7963. },
  7964. enumerable: true,
  7965. configurable: true
  7966. });
  7967. Application.prototype.calculate=function (calculationType) {
  7968. _createMethodAction(this.context, this, "Calculate", 0 , [calculationType]);
  7969. };
  7970. Application.prototype._handleResult=function (value) {
  7971. if (_isNullOrUndefined(value))
  7972. return;
  7973. var obj=value;
  7974. _fixObjectPathIfNecessary(this, obj);
  7975. if (!_isUndefined(obj["CalculationMode"])) {
  7976. this.m_calculationMode=obj["CalculationMode"];
  7977. }
  7978. };
  7979. Application.prototype.load=function (option) {
  7980. _load(this, option);
  7981. return this;
  7982. };
  7983. return Application;
  7984. })(OfficeExtension.ClientObject);
  7985. Excel.Application=Application;
  7986. var Workbook=(function (_super) {
  7987. __extends(Workbook, _super);
  7988. function Workbook() {
  7989. _super.apply(this, arguments);
  7990. }
  7991. Object.defineProperty(Workbook.prototype, "application", {
  7992. get: function () {
  7993. if (!this.m_application) {
  7994. this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false));
  7995. }
  7996. return this.m_application;
  7997. },
  7998. enumerable: true,
  7999. configurable: true
  8000. });
  8001. Object.defineProperty(Workbook.prototype, "bindings", {
  8002. get: function () {
  8003. if (!this.m_bindings) {
  8004. this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false));
  8005. }
  8006. return this.m_bindings;
  8007. },
  8008. enumerable: true,
  8009. configurable: true
  8010. });
  8011. Object.defineProperty(Workbook.prototype, "names", {
  8012. get: function () {
  8013. if (!this.m_names) {
  8014. this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false));
  8015. }
  8016. return this.m_names;
  8017. },
  8018. enumerable: true,
  8019. configurable: true
  8020. });
  8021. Object.defineProperty(Workbook.prototype, "tables", {
  8022. get: function () {
  8023. if (!this.m_tables) {
  8024. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  8025. }
  8026. return this.m_tables;
  8027. },
  8028. enumerable: true,
  8029. configurable: true
  8030. });
  8031. Object.defineProperty(Workbook.prototype, "worksheets", {
  8032. get: function () {
  8033. if (!this.m_worksheets) {
  8034. this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false));
  8035. }
  8036. return this.m_worksheets;
  8037. },
  8038. enumerable: true,
  8039. configurable: true
  8040. });
  8041. Workbook.prototype.getSelectedRange=function () {
  8042. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", 1 , [], false, true));
  8043. };
  8044. Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) {
  8045. var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", 1 , [bstrReferenceId]);
  8046. var ret=new OfficeExtension.ClientResult();
  8047. _addActionResultHandler(this, action, ret);
  8048. return ret;
  8049. };
  8050. Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) {
  8051. var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", 1 , [bstrReferenceId]);
  8052. var ret=new OfficeExtension.ClientResult();
  8053. _addActionResultHandler(this, action, ret);
  8054. return ret;
  8055. };
  8056. Workbook.prototype._GetReferenceCount=function () {
  8057. var action=_createMethodAction(this.context, this, "_GetReferenceCount", 1 , []);
  8058. var ret=new OfficeExtension.ClientResult();
  8059. _addActionResultHandler(this, action, ret);
  8060. return ret;
  8061. };
  8062. Workbook.prototype._RemoveAllReferences=function () {
  8063. _createMethodAction(this.context, this, "_RemoveAllReferences", 1 , []);
  8064. };
  8065. Workbook.prototype._RemoveReference=function (bstrReferenceId) {
  8066. _createMethodAction(this.context, this, "_RemoveReference", 1 , [bstrReferenceId]);
  8067. };
  8068. Workbook.prototype._handleResult=function (value) {
  8069. if (_isNullOrUndefined(value))
  8070. return;
  8071. var obj=value;
  8072. _fixObjectPathIfNecessary(this, obj);
  8073. _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "names", "Names", "tables", "Tables", "worksheets", "Worksheets"]);
  8074. };
  8075. Workbook.prototype.load=function (option) {
  8076. _load(this, option);
  8077. return this;
  8078. };
  8079. return Workbook;
  8080. })(OfficeExtension.ClientObject);
  8081. Excel.Workbook=Workbook;
  8082. var Worksheet=(function (_super) {
  8083. __extends(Worksheet, _super);
  8084. function Worksheet() {
  8085. _super.apply(this, arguments);
  8086. }
  8087. Object.defineProperty(Worksheet.prototype, "charts", {
  8088. get: function () {
  8089. if (!this.m_charts) {
  8090. this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false));
  8091. }
  8092. return this.m_charts;
  8093. },
  8094. enumerable: true,
  8095. configurable: true
  8096. });
  8097. Object.defineProperty(Worksheet.prototype, "tables", {
  8098. get: function () {
  8099. if (!this.m_tables) {
  8100. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  8101. }
  8102. return this.m_tables;
  8103. },
  8104. enumerable: true,
  8105. configurable: true
  8106. });
  8107. Object.defineProperty(Worksheet.prototype, "id", {
  8108. get: function () {
  8109. _throwIfNotLoaded("id", this.m_id);
  8110. return this.m_id;
  8111. },
  8112. enumerable: true,
  8113. configurable: true
  8114. });
  8115. Object.defineProperty(Worksheet.prototype, "name", {
  8116. get: function () {
  8117. _throwIfNotLoaded("name", this.m_name);
  8118. return this.m_name;
  8119. },
  8120. set: function (value) {
  8121. this.m_name=value;
  8122. _createSetPropertyAction(this.context, this, "Name", value);
  8123. },
  8124. enumerable: true,
  8125. configurable: true
  8126. });
  8127. Object.defineProperty(Worksheet.prototype, "position", {
  8128. get: function () {
  8129. _throwIfNotLoaded("position", this.m_position);
  8130. return this.m_position;
  8131. },
  8132. set: function (value) {
  8133. this.m_position=value;
  8134. _createSetPropertyAction(this.context, this, "Position", value);
  8135. },
  8136. enumerable: true,
  8137. configurable: true
  8138. });
  8139. Object.defineProperty(Worksheet.prototype, "visibility", {
  8140. get: function () {
  8141. _throwIfNotLoaded("visibility", this.m_visibility);
  8142. return this.m_visibility;
  8143. },
  8144. enumerable: true,
  8145. configurable: true
  8146. });
  8147. Worksheet.prototype.activate=function () {
  8148. _createMethodAction(this.context, this, "Activate", 1 , []);
  8149. };
  8150. Worksheet.prototype.delete=function () {
  8151. _createMethodAction(this.context, this, "Delete", 0 , []);
  8152. };
  8153. Worksheet.prototype.getCell=function (row, column) {
  8154. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", 1 , [row, column], false, true));
  8155. };
  8156. Worksheet.prototype.getRange=function (address) {
  8157. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [address], false, true));
  8158. };
  8159. Worksheet.prototype.getUsedRange=function () {
  8160. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", 1 , [], false, true));
  8161. };
  8162. Worksheet.prototype._handleResult=function (value) {
  8163. if (_isNullOrUndefined(value))
  8164. return;
  8165. var obj=value;
  8166. _fixObjectPathIfNecessary(this, obj);
  8167. if (!_isUndefined(obj["Id"])) {
  8168. this.m_id=obj["Id"];
  8169. }
  8170. if (!_isUndefined(obj["Name"])) {
  8171. this.m_name=obj["Name"];
  8172. }
  8173. if (!_isUndefined(obj["Position"])) {
  8174. this.m_position=obj["Position"];
  8175. }
  8176. if (!_isUndefined(obj["Visibility"])) {
  8177. this.m_visibility=obj["Visibility"];
  8178. }
  8179. _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "tables", "Tables"]);
  8180. };
  8181. Worksheet.prototype.load=function (option) {
  8182. _load(this, option);
  8183. return this;
  8184. };
  8185. return Worksheet;
  8186. })(OfficeExtension.ClientObject);
  8187. Excel.Worksheet=Worksheet;
  8188. var WorksheetCollection=(function (_super) {
  8189. __extends(WorksheetCollection, _super);
  8190. function WorksheetCollection() {
  8191. _super.apply(this, arguments);
  8192. }
  8193. Object.defineProperty(WorksheetCollection.prototype, "items", {
  8194. get: function () {
  8195. _throwIfNotLoaded("items", this.m__items);
  8196. return this.m__items;
  8197. },
  8198. enumerable: true,
  8199. configurable: true
  8200. });
  8201. WorksheetCollection.prototype.add=function (name) {
  8202. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [name], false, true));
  8203. };
  8204. WorksheetCollection.prototype.getActiveWorksheet=function () {
  8205. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", 1 , [], false, false));
  8206. };
  8207. WorksheetCollection.prototype.getItem=function (key) {
  8208. return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key]));
  8209. };
  8210. WorksheetCollection.prototype._handleResult=function (value) {
  8211. if (_isNullOrUndefined(value))
  8212. return;
  8213. var obj=value;
  8214. _fixObjectPathIfNecessary(this, obj);
  8215. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  8216. this.m__items=[];
  8217. var _data=obj[OfficeExtension.Constants.items];
  8218. for (var i=0; i < _data.length; i++) {
  8219. var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  8220. _item._handleResult(_data[i]);
  8221. this.m__items.push(_item);
  8222. }
  8223. }
  8224. };
  8225. WorksheetCollection.prototype.load=function (option) {
  8226. _load(this, option);
  8227. return this;
  8228. };
  8229. return WorksheetCollection;
  8230. })(OfficeExtension.ClientObject);
  8231. Excel.WorksheetCollection=WorksheetCollection;
  8232. var Range=(function (_super) {
  8233. __extends(Range, _super);
  8234. function Range() {
  8235. _super.apply(this, arguments);
  8236. }
  8237. Object.defineProperty(Range.prototype, "format", {
  8238. get: function () {
  8239. if (!this.m_format) {
  8240. this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  8241. }
  8242. return this.m_format;
  8243. },
  8244. enumerable: true,
  8245. configurable: true
  8246. });
  8247. Object.defineProperty(Range.prototype, "worksheet", {
  8248. get: function () {
  8249. if (!this.m_worksheet) {
  8250. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  8251. }
  8252. return this.m_worksheet;
  8253. },
  8254. enumerable: true,
  8255. configurable: true
  8256. });
  8257. Object.defineProperty(Range.prototype, "address", {
  8258. get: function () {
  8259. _throwIfNotLoaded("address", this.m_address);
  8260. return this.m_address;
  8261. },
  8262. enumerable: true,
  8263. configurable: true
  8264. });
  8265. Object.defineProperty(Range.prototype, "addressLocal", {
  8266. get: function () {
  8267. _throwIfNotLoaded("addressLocal", this.m_addressLocal);
  8268. return this.m_addressLocal;
  8269. },
  8270. enumerable: true,
  8271. configurable: true
  8272. });
  8273. Object.defineProperty(Range.prototype, "cellCount", {
  8274. get: function () {
  8275. _throwIfNotLoaded("cellCount", this.m_cellCount);
  8276. return this.m_cellCount;
  8277. },
  8278. enumerable: true,
  8279. configurable: true
  8280. });
  8281. Object.defineProperty(Range.prototype, "columnCount", {
  8282. get: function () {
  8283. _throwIfNotLoaded("columnCount", this.m_columnCount);
  8284. return this.m_columnCount;
  8285. },
  8286. enumerable: true,
  8287. configurable: true
  8288. });
  8289. Object.defineProperty(Range.prototype, "columnIndex", {
  8290. get: function () {
  8291. _throwIfNotLoaded("columnIndex", this.m_columnIndex);
  8292. return this.m_columnIndex;
  8293. },
  8294. enumerable: true,
  8295. configurable: true
  8296. });
  8297. Object.defineProperty(Range.prototype, "formulas", {
  8298. get: function () {
  8299. _throwIfNotLoaded("formulas", this.m_formulas);
  8300. return this.m_formulas;
  8301. },
  8302. set: function (value) {
  8303. this.m_formulas=value;
  8304. _createSetPropertyAction(this.context, this, "Formulas", value);
  8305. },
  8306. enumerable: true,
  8307. configurable: true
  8308. });
  8309. Object.defineProperty(Range.prototype, "formulasLocal", {
  8310. get: function () {
  8311. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal);
  8312. return this.m_formulasLocal;
  8313. },
  8314. set: function (value) {
  8315. this.m_formulasLocal=value;
  8316. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  8317. },
  8318. enumerable: true,
  8319. configurable: true
  8320. });
  8321. Object.defineProperty(Range.prototype, "numberFormat", {
  8322. get: function () {
  8323. _throwIfNotLoaded("numberFormat", this.m_numberFormat);
  8324. return this.m_numberFormat;
  8325. },
  8326. set: function (value) {
  8327. this.m_numberFormat=value;
  8328. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  8329. },
  8330. enumerable: true,
  8331. configurable: true
  8332. });
  8333. Object.defineProperty(Range.prototype, "rowCount", {
  8334. get: function () {
  8335. _throwIfNotLoaded("rowCount", this.m_rowCount);
  8336. return this.m_rowCount;
  8337. },
  8338. enumerable: true,
  8339. configurable: true
  8340. });
  8341. Object.defineProperty(Range.prototype, "rowIndex", {
  8342. get: function () {
  8343. _throwIfNotLoaded("rowIndex", this.m_rowIndex);
  8344. return this.m_rowIndex;
  8345. },
  8346. enumerable: true,
  8347. configurable: true
  8348. });
  8349. Object.defineProperty(Range.prototype, "text", {
  8350. get: function () {
  8351. _throwIfNotLoaded("text", this.m_text);
  8352. return this.m_text;
  8353. },
  8354. enumerable: true,
  8355. configurable: true
  8356. });
  8357. Object.defineProperty(Range.prototype, "valueTypes", {
  8358. get: function () {
  8359. _throwIfNotLoaded("valueTypes", this.m_valueTypes);
  8360. return this.m_valueTypes;
  8361. },
  8362. enumerable: true,
  8363. configurable: true
  8364. });
  8365. Object.defineProperty(Range.prototype, "values", {
  8366. get: function () {
  8367. _throwIfNotLoaded("values", this.m_values);
  8368. return this.m_values;
  8369. },
  8370. set: function (value) {
  8371. this.m_values=value;
  8372. _createSetPropertyAction(this.context, this, "Values", value);
  8373. },
  8374. enumerable: true,
  8375. configurable: true
  8376. });
  8377. Object.defineProperty(Range.prototype, "_ReferenceId", {
  8378. get: function () {
  8379. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  8380. return this.m__ReferenceId;
  8381. },
  8382. enumerable: true,
  8383. configurable: true
  8384. });
  8385. Range.prototype.clear=function (applyTo) {
  8386. _createMethodAction(this.context, this, "Clear", 0 , [applyTo]);
  8387. };
  8388. Range.prototype.delete=function (shift) {
  8389. _createMethodAction(this.context, this, "Delete", 0 , [shift]);
  8390. };
  8391. Range.prototype.getBoundingRect=function (anotherRange) {
  8392. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", 1 , [anotherRange], false, true));
  8393. };
  8394. Range.prototype.getCell=function (row, column) {
  8395. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", 1 , [row, column], false, true));
  8396. };
  8397. Range.prototype.getColumn=function (column) {
  8398. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", 1 , [column], false, true));
  8399. };
  8400. Range.prototype.getEntireColumn=function () {
  8401. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", 1 , [], false, true));
  8402. };
  8403. Range.prototype.getEntireRow=function () {
  8404. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", 1 , [], false, true));
  8405. };
  8406. Range.prototype.getIntersection=function (anotherRange) {
  8407. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", 1 , [anotherRange], false, true));
  8408. };
  8409. Range.prototype.getLastCell=function () {
  8410. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", 1 , [], false, true));
  8411. };
  8412. Range.prototype.getLastColumn=function () {
  8413. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", 1 , [], false, true));
  8414. };
  8415. Range.prototype.getLastRow=function () {
  8416. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", 1 , [], false, true));
  8417. };
  8418. Range.prototype.getOffsetRange=function (rowOffset, columnOffset) {
  8419. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", 1 , [rowOffset, columnOffset], false, true));
  8420. };
  8421. Range.prototype.getRow=function (row) {
  8422. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", 1 , [row], false, true));
  8423. };
  8424. Range.prototype.getUsedRange=function () {
  8425. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", 1 , [], false, true));
  8426. };
  8427. Range.prototype.insert=function (shift) {
  8428. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", 0 , [shift], false, true));
  8429. };
  8430. Range.prototype.select=function () {
  8431. _createMethodAction(this.context, this, "Select", 1 , []);
  8432. };
  8433. Range.prototype._KeepReference=function () {
  8434. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  8435. };
  8436. Range.prototype._handleResult=function (value) {
  8437. if (_isNullOrUndefined(value))
  8438. return;
  8439. var obj=value;
  8440. _fixObjectPathIfNecessary(this, obj);
  8441. if (!_isUndefined(obj["Address"])) {
  8442. this.m_address=obj["Address"];
  8443. }
  8444. if (!_isUndefined(obj["AddressLocal"])) {
  8445. this.m_addressLocal=obj["AddressLocal"];
  8446. }
  8447. if (!_isUndefined(obj["CellCount"])) {
  8448. this.m_cellCount=obj["CellCount"];
  8449. }
  8450. if (!_isUndefined(obj["ColumnCount"])) {
  8451. this.m_columnCount=obj["ColumnCount"];
  8452. }
  8453. if (!_isUndefined(obj["ColumnIndex"])) {
  8454. this.m_columnIndex=obj["ColumnIndex"];
  8455. }
  8456. if (!_isUndefined(obj["Formulas"])) {
  8457. this.m_formulas=obj["Formulas"];
  8458. }
  8459. if (!_isUndefined(obj["FormulasLocal"])) {
  8460. this.m_formulasLocal=obj["FormulasLocal"];
  8461. }
  8462. if (!_isUndefined(obj["NumberFormat"])) {
  8463. this.m_numberFormat=obj["NumberFormat"];
  8464. }
  8465. if (!_isUndefined(obj["RowCount"])) {
  8466. this.m_rowCount=obj["RowCount"];
  8467. }
  8468. if (!_isUndefined(obj["RowIndex"])) {
  8469. this.m_rowIndex=obj["RowIndex"];
  8470. }
  8471. if (!_isUndefined(obj["Text"])) {
  8472. this.m_text=obj["Text"];
  8473. }
  8474. if (!_isUndefined(obj["ValueTypes"])) {
  8475. this.m_valueTypes=obj["ValueTypes"];
  8476. }
  8477. if (!_isUndefined(obj["Values"])) {
  8478. this.m_values=obj["Values"];
  8479. }
  8480. if (!_isUndefined(obj["_ReferenceId"])) {
  8481. this.m__ReferenceId=obj["_ReferenceId"];
  8482. }
  8483. _handleNavigationPropertyResults(this, obj, ["format", "Format", "worksheet", "Worksheet"]);
  8484. };
  8485. Range.prototype.load=function (option) {
  8486. _load(this, option);
  8487. return this;
  8488. };
  8489. Range.prototype._initReferenceId=function (value) {
  8490. this.m__ReferenceId=value;
  8491. };
  8492. return Range;
  8493. })(OfficeExtension.ClientObject);
  8494. Excel.Range=Range;
  8495. var NamedItemCollection=(function (_super) {
  8496. __extends(NamedItemCollection, _super);
  8497. function NamedItemCollection() {
  8498. _super.apply(this, arguments);
  8499. }
  8500. Object.defineProperty(NamedItemCollection.prototype, "items", {
  8501. get: function () {
  8502. _throwIfNotLoaded("items", this.m__items);
  8503. return this.m__items;
  8504. },
  8505. enumerable: true,
  8506. configurable: true
  8507. });
  8508. NamedItemCollection.prototype.getItem=function (name) {
  8509. return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name]));
  8510. };
  8511. NamedItemCollection.prototype._handleResult=function (value) {
  8512. if (_isNullOrUndefined(value))
  8513. return;
  8514. var obj=value;
  8515. _fixObjectPathIfNecessary(this, obj);
  8516. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  8517. this.m__items=[];
  8518. var _data=obj[OfficeExtension.Constants.items];
  8519. for (var i=0; i < _data.length; i++) {
  8520. var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  8521. _item._handleResult(_data[i]);
  8522. this.m__items.push(_item);
  8523. }
  8524. }
  8525. };
  8526. NamedItemCollection.prototype.load=function (option) {
  8527. _load(this, option);
  8528. return this;
  8529. };
  8530. return NamedItemCollection;
  8531. })(OfficeExtension.ClientObject);
  8532. Excel.NamedItemCollection=NamedItemCollection;
  8533. var NamedItem=(function (_super) {
  8534. __extends(NamedItem, _super);
  8535. function NamedItem() {
  8536. _super.apply(this, arguments);
  8537. }
  8538. Object.defineProperty(NamedItem.prototype, "name", {
  8539. get: function () {
  8540. _throwIfNotLoaded("name", this.m_name);
  8541. return this.m_name;
  8542. },
  8543. enumerable: true,
  8544. configurable: true
  8545. });
  8546. Object.defineProperty(NamedItem.prototype, "type", {
  8547. get: function () {
  8548. _throwIfNotLoaded("type", this.m_type);
  8549. return this.m_type;
  8550. },
  8551. enumerable: true,
  8552. configurable: true
  8553. });
  8554. Object.defineProperty(NamedItem.prototype, "value", {
  8555. get: function () {
  8556. _throwIfNotLoaded("value", this.m_value);
  8557. return this.m_value;
  8558. },
  8559. enumerable: true,
  8560. configurable: true
  8561. });
  8562. Object.defineProperty(NamedItem.prototype, "visible", {
  8563. get: function () {
  8564. _throwIfNotLoaded("visible", this.m_visible);
  8565. return this.m_visible;
  8566. },
  8567. set: function (value) {
  8568. this.m_visible=value;
  8569. _createSetPropertyAction(this.context, this, "Visible", value);
  8570. },
  8571. enumerable: true,
  8572. configurable: true
  8573. });
  8574. Object.defineProperty(NamedItem.prototype, "_Id", {
  8575. get: function () {
  8576. _throwIfNotLoaded("_Id", this.m__Id);
  8577. return this.m__Id;
  8578. },
  8579. enumerable: true,
  8580. configurable: true
  8581. });
  8582. NamedItem.prototype.getRange=function () {
  8583. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true));
  8584. };
  8585. NamedItem.prototype._handleResult=function (value) {
  8586. if (_isNullOrUndefined(value))
  8587. return;
  8588. var obj=value;
  8589. _fixObjectPathIfNecessary(this, obj);
  8590. if (!_isUndefined(obj["Name"])) {
  8591. this.m_name=obj["Name"];
  8592. }
  8593. if (!_isUndefined(obj["Type"])) {
  8594. this.m_type=obj["Type"];
  8595. }
  8596. if (!_isUndefined(obj["Value"])) {
  8597. this.m_value=obj["Value"];
  8598. }
  8599. if (!_isUndefined(obj["Visible"])) {
  8600. this.m_visible=obj["Visible"];
  8601. }
  8602. if (!_isUndefined(obj["_Id"])) {
  8603. this.m__Id=obj["_Id"];
  8604. }
  8605. };
  8606. NamedItem.prototype.load=function (option) {
  8607. _load(this, option);
  8608. return this;
  8609. };
  8610. return NamedItem;
  8611. })(OfficeExtension.ClientObject);
  8612. Excel.NamedItem=NamedItem;
  8613. var Binding=(function (_super) {
  8614. __extends(Binding, _super);
  8615. function Binding() {
  8616. _super.apply(this, arguments);
  8617. }
  8618. Object.defineProperty(Binding.prototype, "id", {
  8619. get: function () {
  8620. _throwIfNotLoaded("id", this.m_id);
  8621. return this.m_id;
  8622. },
  8623. enumerable: true,
  8624. configurable: true
  8625. });
  8626. Object.defineProperty(Binding.prototype, "type", {
  8627. get: function () {
  8628. _throwIfNotLoaded("type", this.m_type);
  8629. return this.m_type;
  8630. },
  8631. enumerable: true,
  8632. configurable: true
  8633. });
  8634. Binding.prototype.getRange=function () {
  8635. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, false));
  8636. };
  8637. Binding.prototype.getTable=function () {
  8638. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", 1 , [], false, false));
  8639. };
  8640. Binding.prototype.getText=function () {
  8641. var action=_createMethodAction(this.context, this, "GetText", 1 , []);
  8642. var ret=new OfficeExtension.ClientResult();
  8643. _addActionResultHandler(this, action, ret);
  8644. return ret;
  8645. };
  8646. Binding.prototype._handleResult=function (value) {
  8647. if (_isNullOrUndefined(value))
  8648. return;
  8649. var obj=value;
  8650. _fixObjectPathIfNecessary(this, obj);
  8651. if (!_isUndefined(obj["Id"])) {
  8652. this.m_id=obj["Id"];
  8653. }
  8654. if (!_isUndefined(obj["Type"])) {
  8655. this.m_type=obj["Type"];
  8656. }
  8657. };
  8658. Binding.prototype.load=function (option) {
  8659. _load(this, option);
  8660. return this;
  8661. };
  8662. return Binding;
  8663. })(OfficeExtension.ClientObject);
  8664. Excel.Binding=Binding;
  8665. var BindingCollection=(function (_super) {
  8666. __extends(BindingCollection, _super);
  8667. function BindingCollection() {
  8668. _super.apply(this, arguments);
  8669. }
  8670. Object.defineProperty(BindingCollection.prototype, "items", {
  8671. get: function () {
  8672. _throwIfNotLoaded("items", this.m__items);
  8673. return this.m__items;
  8674. },
  8675. enumerable: true,
  8676. configurable: true
  8677. });
  8678. Object.defineProperty(BindingCollection.prototype, "count", {
  8679. get: function () {
  8680. _throwIfNotLoaded("count", this.m_count);
  8681. return this.m_count;
  8682. },
  8683. enumerable: true,
  8684. configurable: true
  8685. });
  8686. BindingCollection.prototype.getItem=function (id) {
  8687. return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id]));
  8688. };
  8689. BindingCollection.prototype.getItemAt=function (index) {
  8690. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false));
  8691. };
  8692. BindingCollection.prototype._handleResult=function (value) {
  8693. if (_isNullOrUndefined(value))
  8694. return;
  8695. var obj=value;
  8696. _fixObjectPathIfNecessary(this, obj);
  8697. if (!_isUndefined(obj["Count"])) {
  8698. this.m_count=obj["Count"];
  8699. }
  8700. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  8701. this.m__items=[];
  8702. var _data=obj[OfficeExtension.Constants.items];
  8703. for (var i=0; i < _data.length; i++) {
  8704. var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  8705. _item._handleResult(_data[i]);
  8706. this.m__items.push(_item);
  8707. }
  8708. }
  8709. };
  8710. BindingCollection.prototype.load=function (option) {
  8711. _load(this, option);
  8712. return this;
  8713. };
  8714. return BindingCollection;
  8715. })(OfficeExtension.ClientObject);
  8716. Excel.BindingCollection=BindingCollection;
  8717. var TableCollection=(function (_super) {
  8718. __extends(TableCollection, _super);
  8719. function TableCollection() {
  8720. _super.apply(this, arguments);
  8721. }
  8722. Object.defineProperty(TableCollection.prototype, "items", {
  8723. get: function () {
  8724. _throwIfNotLoaded("items", this.m__items);
  8725. return this.m__items;
  8726. },
  8727. enumerable: true,
  8728. configurable: true
  8729. });
  8730. Object.defineProperty(TableCollection.prototype, "count", {
  8731. get: function () {
  8732. _throwIfNotLoaded("count", this.m_count);
  8733. return this.m_count;
  8734. },
  8735. enumerable: true,
  8736. configurable: true
  8737. });
  8738. TableCollection.prototype.add=function (address, hasHeaders) {
  8739. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [address, hasHeaders], false, true));
  8740. };
  8741. TableCollection.prototype.getItem=function (key) {
  8742. return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key]));
  8743. };
  8744. TableCollection.prototype.getItemAt=function (index) {
  8745. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false));
  8746. };
  8747. TableCollection.prototype._handleResult=function (value) {
  8748. if (_isNullOrUndefined(value))
  8749. return;
  8750. var obj=value;
  8751. _fixObjectPathIfNecessary(this, obj);
  8752. if (!_isUndefined(obj["Count"])) {
  8753. this.m_count=obj["Count"];
  8754. }
  8755. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  8756. this.m__items=[];
  8757. var _data=obj[OfficeExtension.Constants.items];
  8758. for (var i=0; i < _data.length; i++) {
  8759. var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  8760. _item._handleResult(_data[i]);
  8761. this.m__items.push(_item);
  8762. }
  8763. }
  8764. };
  8765. TableCollection.prototype.load=function (option) {
  8766. _load(this, option);
  8767. return this;
  8768. };
  8769. return TableCollection;
  8770. })(OfficeExtension.ClientObject);
  8771. Excel.TableCollection=TableCollection;
  8772. var Table=(function (_super) {
  8773. __extends(Table, _super);
  8774. function Table() {
  8775. _super.apply(this, arguments);
  8776. }
  8777. Object.defineProperty(Table.prototype, "columns", {
  8778. get: function () {
  8779. if (!this.m_columns) {
  8780. this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false));
  8781. }
  8782. return this.m_columns;
  8783. },
  8784. enumerable: true,
  8785. configurable: true
  8786. });
  8787. Object.defineProperty(Table.prototype, "rows", {
  8788. get: function () {
  8789. if (!this.m_rows) {
  8790. this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  8791. }
  8792. return this.m_rows;
  8793. },
  8794. enumerable: true,
  8795. configurable: true
  8796. });
  8797. Object.defineProperty(Table.prototype, "id", {
  8798. get: function () {
  8799. _throwIfNotLoaded("id", this.m_id);
  8800. return this.m_id;
  8801. },
  8802. enumerable: true,
  8803. configurable: true
  8804. });
  8805. Object.defineProperty(Table.prototype, "name", {
  8806. get: function () {
  8807. _throwIfNotLoaded("name", this.m_name);
  8808. return this.m_name;
  8809. },
  8810. set: function (value) {
  8811. this.m_name=value;
  8812. _createSetPropertyAction(this.context, this, "Name", value);
  8813. },
  8814. enumerable: true,
  8815. configurable: true
  8816. });
  8817. Object.defineProperty(Table.prototype, "showHeaders", {
  8818. get: function () {
  8819. _throwIfNotLoaded("showHeaders", this.m_showHeaders);
  8820. return this.m_showHeaders;
  8821. },
  8822. set: function (value) {
  8823. this.m_showHeaders=value;
  8824. _createSetPropertyAction(this.context, this, "ShowHeaders", value);
  8825. },
  8826. enumerable: true,
  8827. configurable: true
  8828. });
  8829. Object.defineProperty(Table.prototype, "showTotals", {
  8830. get: function () {
  8831. _throwIfNotLoaded("showTotals", this.m_showTotals);
  8832. return this.m_showTotals;
  8833. },
  8834. set: function (value) {
  8835. this.m_showTotals=value;
  8836. _createSetPropertyAction(this.context, this, "ShowTotals", value);
  8837. },
  8838. enumerable: true,
  8839. configurable: true
  8840. });
  8841. Object.defineProperty(Table.prototype, "style", {
  8842. get: function () {
  8843. _throwIfNotLoaded("style", this.m_style);
  8844. return this.m_style;
  8845. },
  8846. set: function (value) {
  8847. this.m_style=value;
  8848. _createSetPropertyAction(this.context, this, "Style", value);
  8849. },
  8850. enumerable: true,
  8851. configurable: true
  8852. });
  8853. Table.prototype.delete=function () {
  8854. _createMethodAction(this.context, this, "Delete", 0 , []);
  8855. };
  8856. Table.prototype.getDataBodyRange=function () {
  8857. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", 1 , [], false, true));
  8858. };
  8859. Table.prototype.getHeaderRowRange=function () {
  8860. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", 1 , [], false, true));
  8861. };
  8862. Table.prototype.getRange=function () {
  8863. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true));
  8864. };
  8865. Table.prototype.getTotalRowRange=function () {
  8866. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", 1 , [], false, true));
  8867. };
  8868. Table.prototype._handleResult=function (value) {
  8869. if (_isNullOrUndefined(value))
  8870. return;
  8871. var obj=value;
  8872. _fixObjectPathIfNecessary(this, obj);
  8873. if (!_isUndefined(obj["Id"])) {
  8874. this.m_id=obj["Id"];
  8875. }
  8876. if (!_isUndefined(obj["Name"])) {
  8877. this.m_name=obj["Name"];
  8878. }
  8879. if (!_isUndefined(obj["ShowHeaders"])) {
  8880. this.m_showHeaders=obj["ShowHeaders"];
  8881. }
  8882. if (!_isUndefined(obj["ShowTotals"])) {
  8883. this.m_showTotals=obj["ShowTotals"];
  8884. }
  8885. if (!_isUndefined(obj["Style"])) {
  8886. this.m_style=obj["Style"];
  8887. }
  8888. _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows"]);
  8889. };
  8890. Table.prototype.load=function (option) {
  8891. _load(this, option);
  8892. return this;
  8893. };
  8894. return Table;
  8895. })(OfficeExtension.ClientObject);
  8896. Excel.Table=Table;
  8897. var TableColumnCollection=(function (_super) {
  8898. __extends(TableColumnCollection, _super);
  8899. function TableColumnCollection() {
  8900. _super.apply(this, arguments);
  8901. }
  8902. Object.defineProperty(TableColumnCollection.prototype, "items", {
  8903. get: function () {
  8904. _throwIfNotLoaded("items", this.m__items);
  8905. return this.m__items;
  8906. },
  8907. enumerable: true,
  8908. configurable: true
  8909. });
  8910. Object.defineProperty(TableColumnCollection.prototype, "count", {
  8911. get: function () {
  8912. _throwIfNotLoaded("count", this.m_count);
  8913. return this.m_count;
  8914. },
  8915. enumerable: true,
  8916. configurable: true
  8917. });
  8918. TableColumnCollection.prototype.add=function (index, values) {
  8919. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [index, values], false, true));
  8920. };
  8921. TableColumnCollection.prototype.getItem=function (key) {
  8922. return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key]));
  8923. };
  8924. TableColumnCollection.prototype.getItemAt=function (index) {
  8925. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false));
  8926. };
  8927. TableColumnCollection.prototype._handleResult=function (value) {
  8928. if (_isNullOrUndefined(value))
  8929. return;
  8930. var obj=value;
  8931. _fixObjectPathIfNecessary(this, obj);
  8932. if (!_isUndefined(obj["Count"])) {
  8933. this.m_count=obj["Count"];
  8934. }
  8935. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  8936. this.m__items=[];
  8937. var _data=obj[OfficeExtension.Constants.items];
  8938. for (var i=0; i < _data.length; i++) {
  8939. var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  8940. _item._handleResult(_data[i]);
  8941. this.m__items.push(_item);
  8942. }
  8943. }
  8944. };
  8945. TableColumnCollection.prototype.load=function (option) {
  8946. _load(this, option);
  8947. return this;
  8948. };
  8949. return TableColumnCollection;
  8950. })(OfficeExtension.ClientObject);
  8951. Excel.TableColumnCollection=TableColumnCollection;
  8952. var TableColumn=(function (_super) {
  8953. __extends(TableColumn, _super);
  8954. function TableColumn() {
  8955. _super.apply(this, arguments);
  8956. }
  8957. Object.defineProperty(TableColumn.prototype, "id", {
  8958. get: function () {
  8959. _throwIfNotLoaded("id", this.m_id);
  8960. return this.m_id;
  8961. },
  8962. enumerable: true,
  8963. configurable: true
  8964. });
  8965. Object.defineProperty(TableColumn.prototype, "index", {
  8966. get: function () {
  8967. _throwIfNotLoaded("index", this.m_index);
  8968. return this.m_index;
  8969. },
  8970. enumerable: true,
  8971. configurable: true
  8972. });
  8973. Object.defineProperty(TableColumn.prototype, "name", {
  8974. get: function () {
  8975. _throwIfNotLoaded("name", this.m_name);
  8976. return this.m_name;
  8977. },
  8978. enumerable: true,
  8979. configurable: true
  8980. });
  8981. Object.defineProperty(TableColumn.prototype, "values", {
  8982. get: function () {
  8983. _throwIfNotLoaded("values", this.m_values);
  8984. return this.m_values;
  8985. },
  8986. set: function (value) {
  8987. this.m_values=value;
  8988. _createSetPropertyAction(this.context, this, "Values", value);
  8989. },
  8990. enumerable: true,
  8991. configurable: true
  8992. });
  8993. TableColumn.prototype.delete=function () {
  8994. _createMethodAction(this.context, this, "Delete", 0 , []);
  8995. };
  8996. TableColumn.prototype.getDataBodyRange=function () {
  8997. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", 1 , [], false, true));
  8998. };
  8999. TableColumn.prototype.getHeaderRowRange=function () {
  9000. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", 1 , [], false, true));
  9001. };
  9002. TableColumn.prototype.getRange=function () {
  9003. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true));
  9004. };
  9005. TableColumn.prototype.getTotalRowRange=function () {
  9006. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", 1 , [], false, true));
  9007. };
  9008. TableColumn.prototype._handleResult=function (value) {
  9009. if (_isNullOrUndefined(value))
  9010. return;
  9011. var obj=value;
  9012. _fixObjectPathIfNecessary(this, obj);
  9013. if (!_isUndefined(obj["Id"])) {
  9014. this.m_id=obj["Id"];
  9015. }
  9016. if (!_isUndefined(obj["Index"])) {
  9017. this.m_index=obj["Index"];
  9018. }
  9019. if (!_isUndefined(obj["Name"])) {
  9020. this.m_name=obj["Name"];
  9021. }
  9022. if (!_isUndefined(obj["Values"])) {
  9023. this.m_values=obj["Values"];
  9024. }
  9025. };
  9026. TableColumn.prototype.load=function (option) {
  9027. _load(this, option);
  9028. return this;
  9029. };
  9030. return TableColumn;
  9031. })(OfficeExtension.ClientObject);
  9032. Excel.TableColumn=TableColumn;
  9033. var TableRowCollection=(function (_super) {
  9034. __extends(TableRowCollection, _super);
  9035. function TableRowCollection() {
  9036. _super.apply(this, arguments);
  9037. }
  9038. Object.defineProperty(TableRowCollection.prototype, "items", {
  9039. get: function () {
  9040. _throwIfNotLoaded("items", this.m__items);
  9041. return this.m__items;
  9042. },
  9043. enumerable: true,
  9044. configurable: true
  9045. });
  9046. Object.defineProperty(TableRowCollection.prototype, "count", {
  9047. get: function () {
  9048. _throwIfNotLoaded("count", this.m_count);
  9049. return this.m_count;
  9050. },
  9051. enumerable: true,
  9052. configurable: true
  9053. });
  9054. TableRowCollection.prototype.add=function (index, values) {
  9055. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [index, values], false, true));
  9056. };
  9057. TableRowCollection.prototype.getItemAt=function (index) {
  9058. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false));
  9059. };
  9060. TableRowCollection.prototype._handleResult=function (value) {
  9061. if (_isNullOrUndefined(value))
  9062. return;
  9063. var obj=value;
  9064. _fixObjectPathIfNecessary(this, obj);
  9065. if (!_isUndefined(obj["Count"])) {
  9066. this.m_count=obj["Count"];
  9067. }
  9068. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  9069. this.m__items=[];
  9070. var _data=obj[OfficeExtension.Constants.items];
  9071. for (var i=0; i < _data.length; i++) {
  9072. var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i));
  9073. _item._handleResult(_data[i]);
  9074. this.m__items.push(_item);
  9075. }
  9076. }
  9077. };
  9078. TableRowCollection.prototype.load=function (option) {
  9079. _load(this, option);
  9080. return this;
  9081. };
  9082. return TableRowCollection;
  9083. })(OfficeExtension.ClientObject);
  9084. Excel.TableRowCollection=TableRowCollection;
  9085. var TableRow=(function (_super) {
  9086. __extends(TableRow, _super);
  9087. function TableRow() {
  9088. _super.apply(this, arguments);
  9089. }
  9090. Object.defineProperty(TableRow.prototype, "index", {
  9091. get: function () {
  9092. _throwIfNotLoaded("index", this.m_index);
  9093. return this.m_index;
  9094. },
  9095. enumerable: true,
  9096. configurable: true
  9097. });
  9098. Object.defineProperty(TableRow.prototype, "values", {
  9099. get: function () {
  9100. _throwIfNotLoaded("values", this.m_values);
  9101. return this.m_values;
  9102. },
  9103. set: function (value) {
  9104. this.m_values=value;
  9105. _createSetPropertyAction(this.context, this, "Values", value);
  9106. },
  9107. enumerable: true,
  9108. configurable: true
  9109. });
  9110. TableRow.prototype.delete=function () {
  9111. _createMethodAction(this.context, this, "Delete", 0 , []);
  9112. };
  9113. TableRow.prototype.getRange=function () {
  9114. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", 1 , [], false, true));
  9115. };
  9116. TableRow.prototype._handleResult=function (value) {
  9117. if (_isNullOrUndefined(value))
  9118. return;
  9119. var obj=value;
  9120. _fixObjectPathIfNecessary(this, obj);
  9121. if (!_isUndefined(obj["Index"])) {
  9122. this.m_index=obj["Index"];
  9123. }
  9124. if (!_isUndefined(obj["Values"])) {
  9125. this.m_values=obj["Values"];
  9126. }
  9127. };
  9128. TableRow.prototype.load=function (option) {
  9129. _load(this, option);
  9130. return this;
  9131. };
  9132. return TableRow;
  9133. })(OfficeExtension.ClientObject);
  9134. Excel.TableRow=TableRow;
  9135. var RangeFormat=(function (_super) {
  9136. __extends(RangeFormat, _super);
  9137. function RangeFormat() {
  9138. _super.apply(this, arguments);
  9139. }
  9140. Object.defineProperty(RangeFormat.prototype, "borders", {
  9141. get: function () {
  9142. if (!this.m_borders) {
  9143. this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false));
  9144. }
  9145. return this.m_borders;
  9146. },
  9147. enumerable: true,
  9148. configurable: true
  9149. });
  9150. Object.defineProperty(RangeFormat.prototype, "fill", {
  9151. get: function () {
  9152. if (!this.m_fill) {
  9153. this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  9154. }
  9155. return this.m_fill;
  9156. },
  9157. enumerable: true,
  9158. configurable: true
  9159. });
  9160. Object.defineProperty(RangeFormat.prototype, "font", {
  9161. get: function () {
  9162. if (!this.m_font) {
  9163. this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  9164. }
  9165. return this.m_font;
  9166. },
  9167. enumerable: true,
  9168. configurable: true
  9169. });
  9170. Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", {
  9171. get: function () {
  9172. _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment);
  9173. return this.m_horizontalAlignment;
  9174. },
  9175. set: function (value) {
  9176. this.m_horizontalAlignment=value;
  9177. _createSetPropertyAction(this.context, this, "HorizontalAlignment", value);
  9178. },
  9179. enumerable: true,
  9180. configurable: true
  9181. });
  9182. Object.defineProperty(RangeFormat.prototype, "verticalAlignment", {
  9183. get: function () {
  9184. _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment);
  9185. return this.m_verticalAlignment;
  9186. },
  9187. set: function (value) {
  9188. this.m_verticalAlignment=value;
  9189. _createSetPropertyAction(this.context, this, "VerticalAlignment", value);
  9190. },
  9191. enumerable: true,
  9192. configurable: true
  9193. });
  9194. Object.defineProperty(RangeFormat.prototype, "wrapText", {
  9195. get: function () {
  9196. _throwIfNotLoaded("wrapText", this.m_wrapText);
  9197. return this.m_wrapText;
  9198. },
  9199. set: function (value) {
  9200. this.m_wrapText=value;
  9201. _createSetPropertyAction(this.context, this, "WrapText", value);
  9202. },
  9203. enumerable: true,
  9204. configurable: true
  9205. });
  9206. RangeFormat.prototype._handleResult=function (value) {
  9207. if (_isNullOrUndefined(value))
  9208. return;
  9209. var obj=value;
  9210. _fixObjectPathIfNecessary(this, obj);
  9211. if (!_isUndefined(obj["HorizontalAlignment"])) {
  9212. this.m_horizontalAlignment=obj["HorizontalAlignment"];
  9213. }
  9214. if (!_isUndefined(obj["VerticalAlignment"])) {
  9215. this.m_verticalAlignment=obj["VerticalAlignment"];
  9216. }
  9217. if (!_isUndefined(obj["WrapText"])) {
  9218. this.m_wrapText=obj["WrapText"];
  9219. }
  9220. _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font"]);
  9221. };
  9222. RangeFormat.prototype.load=function (option) {
  9223. _load(this, option);
  9224. return this;
  9225. };
  9226. return RangeFormat;
  9227. })(OfficeExtension.ClientObject);
  9228. Excel.RangeFormat=RangeFormat;
  9229. var RangeFill=(function (_super) {
  9230. __extends(RangeFill, _super);
  9231. function RangeFill() {
  9232. _super.apply(this, arguments);
  9233. }
  9234. Object.defineProperty(RangeFill.prototype, "color", {
  9235. get: function () {
  9236. _throwIfNotLoaded("color", this.m_color);
  9237. return this.m_color;
  9238. },
  9239. set: function (value) {
  9240. this.m_color=value;
  9241. _createSetPropertyAction(this.context, this, "Color", value);
  9242. },
  9243. enumerable: true,
  9244. configurable: true
  9245. });
  9246. RangeFill.prototype.clear=function () {
  9247. _createMethodAction(this.context, this, "Clear", 0 , []);
  9248. };
  9249. RangeFill.prototype._handleResult=function (value) {
  9250. if (_isNullOrUndefined(value))
  9251. return;
  9252. var obj=value;
  9253. _fixObjectPathIfNecessary(this, obj);
  9254. if (!_isUndefined(obj["Color"])) {
  9255. this.m_color=obj["Color"];
  9256. }
  9257. };
  9258. RangeFill.prototype.load=function (option) {
  9259. _load(this, option);
  9260. return this;
  9261. };
  9262. return RangeFill;
  9263. })(OfficeExtension.ClientObject);
  9264. Excel.RangeFill=RangeFill;
  9265. var RangeBorder=(function (_super) {
  9266. __extends(RangeBorder, _super);
  9267. function RangeBorder() {
  9268. _super.apply(this, arguments);
  9269. }
  9270. Object.defineProperty(RangeBorder.prototype, "color", {
  9271. get: function () {
  9272. _throwIfNotLoaded("color", this.m_color);
  9273. return this.m_color;
  9274. },
  9275. set: function (value) {
  9276. this.m_color=value;
  9277. _createSetPropertyAction(this.context, this, "Color", value);
  9278. },
  9279. enumerable: true,
  9280. configurable: true
  9281. });
  9282. Object.defineProperty(RangeBorder.prototype, "sideIndex", {
  9283. get: function () {
  9284. _throwIfNotLoaded("sideIndex", this.m_sideIndex);
  9285. return this.m_sideIndex;
  9286. },
  9287. enumerable: true,
  9288. configurable: true
  9289. });
  9290. Object.defineProperty(RangeBorder.prototype, "style", {
  9291. get: function () {
  9292. _throwIfNotLoaded("style", this.m_style);
  9293. return this.m_style;
  9294. },
  9295. set: function (value) {
  9296. this.m_style=value;
  9297. _createSetPropertyAction(this.context, this, "Style", value);
  9298. },
  9299. enumerable: true,
  9300. configurable: true
  9301. });
  9302. Object.defineProperty(RangeBorder.prototype, "weight", {
  9303. get: function () {
  9304. _throwIfNotLoaded("weight", this.m_weight);
  9305. return this.m_weight;
  9306. },
  9307. set: function (value) {
  9308. this.m_weight=value;
  9309. _createSetPropertyAction(this.context, this, "Weight", value);
  9310. },
  9311. enumerable: true,
  9312. configurable: true
  9313. });
  9314. RangeBorder.prototype._handleResult=function (value) {
  9315. if (_isNullOrUndefined(value))
  9316. return;
  9317. var obj=value;
  9318. _fixObjectPathIfNecessary(this, obj);
  9319. if (!_isUndefined(obj["Color"])) {
  9320. this.m_color=obj["Color"];
  9321. }
  9322. if (!_isUndefined(obj["SideIndex"])) {
  9323. this.m_sideIndex=obj["SideIndex"];
  9324. }
  9325. if (!_isUndefined(obj["Style"])) {
  9326. this.m_style=obj["Style"];
  9327. }
  9328. if (!_isUndefined(obj["Weight"])) {
  9329. this.m_weight=obj["Weight"];
  9330. }
  9331. };
  9332. RangeBorder.prototype.load=function (option) {
  9333. _load(this, option);
  9334. return this;
  9335. };
  9336. return RangeBorder;
  9337. })(OfficeExtension.ClientObject);
  9338. Excel.RangeBorder=RangeBorder;
  9339. var RangeBorderCollection=(function (_super) {
  9340. __extends(RangeBorderCollection, _super);
  9341. function RangeBorderCollection() {
  9342. _super.apply(this, arguments);
  9343. }
  9344. Object.defineProperty(RangeBorderCollection.prototype, "items", {
  9345. get: function () {
  9346. _throwIfNotLoaded("items", this.m__items);
  9347. return this.m__items;
  9348. },
  9349. enumerable: true,
  9350. configurable: true
  9351. });
  9352. Object.defineProperty(RangeBorderCollection.prototype, "count", {
  9353. get: function () {
  9354. _throwIfNotLoaded("count", this.m_count);
  9355. return this.m_count;
  9356. },
  9357. enumerable: true,
  9358. configurable: true
  9359. });
  9360. RangeBorderCollection.prototype.getItem=function (index) {
  9361. return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index]));
  9362. };
  9363. RangeBorderCollection.prototype.getItemAt=function (index) {
  9364. return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false));
  9365. };
  9366. RangeBorderCollection.prototype._handleResult=function (value) {
  9367. if (_isNullOrUndefined(value))
  9368. return;
  9369. var obj=value;
  9370. _fixObjectPathIfNecessary(this, obj);
  9371. if (!_isUndefined(obj["Count"])) {
  9372. this.m_count=obj["Count"];
  9373. }
  9374. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  9375. this.m__items=[];
  9376. var _data=obj[OfficeExtension.Constants.items];
  9377. for (var i=0; i < _data.length; i++) {
  9378. var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i));
  9379. _item._handleResult(_data[i]);
  9380. this.m__items.push(_item);
  9381. }
  9382. }
  9383. };
  9384. RangeBorderCollection.prototype.load=function (option) {
  9385. _load(this, option);
  9386. return this;
  9387. };
  9388. return RangeBorderCollection;
  9389. })(OfficeExtension.ClientObject);
  9390. Excel.RangeBorderCollection=RangeBorderCollection;
  9391. var RangeFont=(function (_super) {
  9392. __extends(RangeFont, _super);
  9393. function RangeFont() {
  9394. _super.apply(this, arguments);
  9395. }
  9396. Object.defineProperty(RangeFont.prototype, "bold", {
  9397. get: function () {
  9398. _throwIfNotLoaded("bold", this.m_bold);
  9399. return this.m_bold;
  9400. },
  9401. set: function (value) {
  9402. this.m_bold=value;
  9403. _createSetPropertyAction(this.context, this, "Bold", value);
  9404. },
  9405. enumerable: true,
  9406. configurable: true
  9407. });
  9408. Object.defineProperty(RangeFont.prototype, "color", {
  9409. get: function () {
  9410. _throwIfNotLoaded("color", this.m_color);
  9411. return this.m_color;
  9412. },
  9413. set: function (value) {
  9414. this.m_color=value;
  9415. _createSetPropertyAction(this.context, this, "Color", value);
  9416. },
  9417. enumerable: true,
  9418. configurable: true
  9419. });
  9420. Object.defineProperty(RangeFont.prototype, "italic", {
  9421. get: function () {
  9422. _throwIfNotLoaded("italic", this.m_italic);
  9423. return this.m_italic;
  9424. },
  9425. set: function (value) {
  9426. this.m_italic=value;
  9427. _createSetPropertyAction(this.context, this, "Italic", value);
  9428. },
  9429. enumerable: true,
  9430. configurable: true
  9431. });
  9432. Object.defineProperty(RangeFont.prototype, "name", {
  9433. get: function () {
  9434. _throwIfNotLoaded("name", this.m_name);
  9435. return this.m_name;
  9436. },
  9437. set: function (value) {
  9438. this.m_name=value;
  9439. _createSetPropertyAction(this.context, this, "Name", value);
  9440. },
  9441. enumerable: true,
  9442. configurable: true
  9443. });
  9444. Object.defineProperty(RangeFont.prototype, "size", {
  9445. get: function () {
  9446. _throwIfNotLoaded("size", this.m_size);
  9447. return this.m_size;
  9448. },
  9449. set: function (value) {
  9450. this.m_size=value;
  9451. _createSetPropertyAction(this.context, this, "Size", value);
  9452. },
  9453. enumerable: true,
  9454. configurable: true
  9455. });
  9456. Object.defineProperty(RangeFont.prototype, "underline", {
  9457. get: function () {
  9458. _throwIfNotLoaded("underline", this.m_underline);
  9459. return this.m_underline;
  9460. },
  9461. set: function (value) {
  9462. this.m_underline=value;
  9463. _createSetPropertyAction(this.context, this, "Underline", value);
  9464. },
  9465. enumerable: true,
  9466. configurable: true
  9467. });
  9468. RangeFont.prototype._handleResult=function (value) {
  9469. if (_isNullOrUndefined(value))
  9470. return;
  9471. var obj=value;
  9472. _fixObjectPathIfNecessary(this, obj);
  9473. if (!_isUndefined(obj["Bold"])) {
  9474. this.m_bold=obj["Bold"];
  9475. }
  9476. if (!_isUndefined(obj["Color"])) {
  9477. this.m_color=obj["Color"];
  9478. }
  9479. if (!_isUndefined(obj["Italic"])) {
  9480. this.m_italic=obj["Italic"];
  9481. }
  9482. if (!_isUndefined(obj["Name"])) {
  9483. this.m_name=obj["Name"];
  9484. }
  9485. if (!_isUndefined(obj["Size"])) {
  9486. this.m_size=obj["Size"];
  9487. }
  9488. if (!_isUndefined(obj["Underline"])) {
  9489. this.m_underline=obj["Underline"];
  9490. }
  9491. };
  9492. RangeFont.prototype.load=function (option) {
  9493. _load(this, option);
  9494. return this;
  9495. };
  9496. return RangeFont;
  9497. })(OfficeExtension.ClientObject);
  9498. Excel.RangeFont=RangeFont;
  9499. var ChartCollection=(function (_super) {
  9500. __extends(ChartCollection, _super);
  9501. function ChartCollection() {
  9502. _super.apply(this, arguments);
  9503. }
  9504. Object.defineProperty(ChartCollection.prototype, "items", {
  9505. get: function () {
  9506. _throwIfNotLoaded("items", this.m__items);
  9507. return this.m__items;
  9508. },
  9509. enumerable: true,
  9510. configurable: true
  9511. });
  9512. Object.defineProperty(ChartCollection.prototype, "count", {
  9513. get: function () {
  9514. _throwIfNotLoaded("count", this.m_count);
  9515. return this.m_count;
  9516. },
  9517. enumerable: true,
  9518. configurable: true
  9519. });
  9520. ChartCollection.prototype.add=function (type, sourceData, seriesBy) {
  9521. if (!(sourceData instanceof Range)) {
  9522. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add");
  9523. }
  9524. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", 0 , [type, sourceData, seriesBy], false, true));
  9525. };
  9526. ChartCollection.prototype.getItem=function (name) {
  9527. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", 1 , [name], false, false));
  9528. };
  9529. ChartCollection.prototype.getItemAt=function (index) {
  9530. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false));
  9531. };
  9532. ChartCollection.prototype._GetItem=function (id) {
  9533. return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [id]));
  9534. };
  9535. ChartCollection.prototype._handleResult=function (value) {
  9536. if (_isNullOrUndefined(value))
  9537. return;
  9538. var obj=value;
  9539. _fixObjectPathIfNecessary(this, obj);
  9540. if (!_isUndefined(obj["Count"])) {
  9541. this.m_count=obj["Count"];
  9542. }
  9543. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  9544. this.m__items=[];
  9545. var _data=obj[OfficeExtension.Constants.items];
  9546. for (var i=0; i < _data.length; i++) {
  9547. var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  9548. _item._handleResult(_data[i]);
  9549. this.m__items.push(_item);
  9550. }
  9551. }
  9552. };
  9553. ChartCollection.prototype.load=function (option) {
  9554. _load(this, option);
  9555. return this;
  9556. };
  9557. return ChartCollection;
  9558. })(OfficeExtension.ClientObject);
  9559. Excel.ChartCollection=ChartCollection;
  9560. var Chart=(function (_super) {
  9561. __extends(Chart, _super);
  9562. function Chart() {
  9563. _super.apply(this, arguments);
  9564. }
  9565. Object.defineProperty(Chart.prototype, "axes", {
  9566. get: function () {
  9567. if (!this.m_axes) {
  9568. this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false));
  9569. }
  9570. return this.m_axes;
  9571. },
  9572. enumerable: true,
  9573. configurable: true
  9574. });
  9575. Object.defineProperty(Chart.prototype, "dataLabels", {
  9576. get: function () {
  9577. if (!this.m_dataLabels) {
  9578. this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false));
  9579. }
  9580. return this.m_dataLabels;
  9581. },
  9582. enumerable: true,
  9583. configurable: true
  9584. });
  9585. Object.defineProperty(Chart.prototype, "format", {
  9586. get: function () {
  9587. if (!this.m_format) {
  9588. this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  9589. }
  9590. return this.m_format;
  9591. },
  9592. enumerable: true,
  9593. configurable: true
  9594. });
  9595. Object.defineProperty(Chart.prototype, "legend", {
  9596. get: function () {
  9597. if (!this.m_legend) {
  9598. this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false));
  9599. }
  9600. return this.m_legend;
  9601. },
  9602. enumerable: true,
  9603. configurable: true
  9604. });
  9605. Object.defineProperty(Chart.prototype, "series", {
  9606. get: function () {
  9607. if (!this.m_series) {
  9608. this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false));
  9609. }
  9610. return this.m_series;
  9611. },
  9612. enumerable: true,
  9613. configurable: true
  9614. });
  9615. Object.defineProperty(Chart.prototype, "title", {
  9616. get: function () {
  9617. if (!this.m_title) {
  9618. this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  9619. }
  9620. return this.m_title;
  9621. },
  9622. enumerable: true,
  9623. configurable: true
  9624. });
  9625. Object.defineProperty(Chart.prototype, "height", {
  9626. get: function () {
  9627. _throwIfNotLoaded("height", this.m_height);
  9628. return this.m_height;
  9629. },
  9630. set: function (value) {
  9631. this.m_height=value;
  9632. _createSetPropertyAction(this.context, this, "Height", value);
  9633. },
  9634. enumerable: true,
  9635. configurable: true
  9636. });
  9637. Object.defineProperty(Chart.prototype, "left", {
  9638. get: function () {
  9639. _throwIfNotLoaded("left", this.m_left);
  9640. return this.m_left;
  9641. },
  9642. set: function (value) {
  9643. this.m_left=value;
  9644. _createSetPropertyAction(this.context, this, "Left", value);
  9645. },
  9646. enumerable: true,
  9647. configurable: true
  9648. });
  9649. Object.defineProperty(Chart.prototype, "name", {
  9650. get: function () {
  9651. _throwIfNotLoaded("name", this.m_name);
  9652. return this.m_name;
  9653. },
  9654. set: function (value) {
  9655. this.m_name=value;
  9656. _createSetPropertyAction(this.context, this, "Name", value);
  9657. },
  9658. enumerable: true,
  9659. configurable: true
  9660. });
  9661. Object.defineProperty(Chart.prototype, "top", {
  9662. get: function () {
  9663. _throwIfNotLoaded("top", this.m_top);
  9664. return this.m_top;
  9665. },
  9666. set: function (value) {
  9667. this.m_top=value;
  9668. _createSetPropertyAction(this.context, this, "Top", value);
  9669. },
  9670. enumerable: true,
  9671. configurable: true
  9672. });
  9673. Object.defineProperty(Chart.prototype, "width", {
  9674. get: function () {
  9675. _throwIfNotLoaded("width", this.m_width);
  9676. return this.m_width;
  9677. },
  9678. set: function (value) {
  9679. this.m_width=value;
  9680. _createSetPropertyAction(this.context, this, "Width", value);
  9681. },
  9682. enumerable: true,
  9683. configurable: true
  9684. });
  9685. Object.defineProperty(Chart.prototype, "_Id", {
  9686. get: function () {
  9687. _throwIfNotLoaded("_Id", this.m__Id);
  9688. return this.m__Id;
  9689. },
  9690. enumerable: true,
  9691. configurable: true
  9692. });
  9693. Chart.prototype.delete=function () {
  9694. _createMethodAction(this.context, this, "Delete", 0 , []);
  9695. };
  9696. Chart.prototype.setData=function (sourceData, seriesBy) {
  9697. if (!(sourceData instanceof Range)) {
  9698. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData");
  9699. }
  9700. _createMethodAction(this.context, this, "SetData", 0 , [sourceData, seriesBy]);
  9701. };
  9702. Chart.prototype.setPosition=function (startCell, endCell) {
  9703. _createMethodAction(this.context, this, "SetPosition", 0 , [startCell, endCell]);
  9704. };
  9705. Chart.prototype._handleResult=function (value) {
  9706. if (_isNullOrUndefined(value))
  9707. return;
  9708. var obj=value;
  9709. _fixObjectPathIfNecessary(this, obj);
  9710. if (!_isUndefined(obj["Height"])) {
  9711. this.m_height=obj["Height"];
  9712. }
  9713. if (!_isUndefined(obj["Left"])) {
  9714. this.m_left=obj["Left"];
  9715. }
  9716. if (!_isUndefined(obj["Name"])) {
  9717. this.m_name=obj["Name"];
  9718. }
  9719. if (!_isUndefined(obj["Top"])) {
  9720. this.m_top=obj["Top"];
  9721. }
  9722. if (!_isUndefined(obj["Width"])) {
  9723. this.m_width=obj["Width"];
  9724. }
  9725. if (!_isUndefined(obj["_Id"])) {
  9726. this.m__Id=obj["_Id"];
  9727. }
  9728. _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title"]);
  9729. };
  9730. Chart.prototype.load=function (option) {
  9731. _load(this, option);
  9732. return this;
  9733. };
  9734. return Chart;
  9735. })(OfficeExtension.ClientObject);
  9736. Excel.Chart=Chart;
  9737. var ChartAreaFormat=(function (_super) {
  9738. __extends(ChartAreaFormat, _super);
  9739. function ChartAreaFormat() {
  9740. _super.apply(this, arguments);
  9741. }
  9742. Object.defineProperty(ChartAreaFormat.prototype, "fill", {
  9743. get: function () {
  9744. if (!this.m_fill) {
  9745. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  9746. }
  9747. return this.m_fill;
  9748. },
  9749. enumerable: true,
  9750. configurable: true
  9751. });
  9752. Object.defineProperty(ChartAreaFormat.prototype, "font", {
  9753. get: function () {
  9754. if (!this.m_font) {
  9755. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  9756. }
  9757. return this.m_font;
  9758. },
  9759. enumerable: true,
  9760. configurable: true
  9761. });
  9762. ChartAreaFormat.prototype._handleResult=function (value) {
  9763. if (_isNullOrUndefined(value))
  9764. return;
  9765. var obj=value;
  9766. _fixObjectPathIfNecessary(this, obj);
  9767. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  9768. };
  9769. ChartAreaFormat.prototype.load=function (option) {
  9770. _load(this, option);
  9771. return this;
  9772. };
  9773. return ChartAreaFormat;
  9774. })(OfficeExtension.ClientObject);
  9775. Excel.ChartAreaFormat=ChartAreaFormat;
  9776. var ChartSeriesCollection=(function (_super) {
  9777. __extends(ChartSeriesCollection, _super);
  9778. function ChartSeriesCollection() {
  9779. _super.apply(this, arguments);
  9780. }
  9781. Object.defineProperty(ChartSeriesCollection.prototype, "items", {
  9782. get: function () {
  9783. _throwIfNotLoaded("items", this.m__items);
  9784. return this.m__items;
  9785. },
  9786. enumerable: true,
  9787. configurable: true
  9788. });
  9789. Object.defineProperty(ChartSeriesCollection.prototype, "count", {
  9790. get: function () {
  9791. _throwIfNotLoaded("count", this.m_count);
  9792. return this.m_count;
  9793. },
  9794. enumerable: true,
  9795. configurable: true
  9796. });
  9797. ChartSeriesCollection.prototype.getItemAt=function (index) {
  9798. return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false));
  9799. };
  9800. ChartSeriesCollection.prototype._handleResult=function (value) {
  9801. if (_isNullOrUndefined(value))
  9802. return;
  9803. var obj=value;
  9804. _fixObjectPathIfNecessary(this, obj);
  9805. if (!_isUndefined(obj["Count"])) {
  9806. this.m_count=obj["Count"];
  9807. }
  9808. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  9809. this.m__items=[];
  9810. var _data=obj[OfficeExtension.Constants.items];
  9811. for (var i=0; i < _data.length; i++) {
  9812. var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i));
  9813. _item._handleResult(_data[i]);
  9814. this.m__items.push(_item);
  9815. }
  9816. }
  9817. };
  9818. ChartSeriesCollection.prototype.load=function (option) {
  9819. _load(this, option);
  9820. return this;
  9821. };
  9822. return ChartSeriesCollection;
  9823. })(OfficeExtension.ClientObject);
  9824. Excel.ChartSeriesCollection=ChartSeriesCollection;
  9825. var ChartSeries=(function (_super) {
  9826. __extends(ChartSeries, _super);
  9827. function ChartSeries() {
  9828. _super.apply(this, arguments);
  9829. }
  9830. Object.defineProperty(ChartSeries.prototype, "format", {
  9831. get: function () {
  9832. if (!this.m_format) {
  9833. this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  9834. }
  9835. return this.m_format;
  9836. },
  9837. enumerable: true,
  9838. configurable: true
  9839. });
  9840. Object.defineProperty(ChartSeries.prototype, "points", {
  9841. get: function () {
  9842. if (!this.m_points) {
  9843. this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false));
  9844. }
  9845. return this.m_points;
  9846. },
  9847. enumerable: true,
  9848. configurable: true
  9849. });
  9850. Object.defineProperty(ChartSeries.prototype, "name", {
  9851. get: function () {
  9852. _throwIfNotLoaded("name", this.m_name);
  9853. return this.m_name;
  9854. },
  9855. set: function (value) {
  9856. this.m_name=value;
  9857. _createSetPropertyAction(this.context, this, "Name", value);
  9858. },
  9859. enumerable: true,
  9860. configurable: true
  9861. });
  9862. ChartSeries.prototype._handleResult=function (value) {
  9863. if (_isNullOrUndefined(value))
  9864. return;
  9865. var obj=value;
  9866. _fixObjectPathIfNecessary(this, obj);
  9867. if (!_isUndefined(obj["Name"])) {
  9868. this.m_name=obj["Name"];
  9869. }
  9870. _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]);
  9871. };
  9872. ChartSeries.prototype.load=function (option) {
  9873. _load(this, option);
  9874. return this;
  9875. };
  9876. return ChartSeries;
  9877. })(OfficeExtension.ClientObject);
  9878. Excel.ChartSeries=ChartSeries;
  9879. var ChartSeriesFormat=(function (_super) {
  9880. __extends(ChartSeriesFormat, _super);
  9881. function ChartSeriesFormat() {
  9882. _super.apply(this, arguments);
  9883. }
  9884. Object.defineProperty(ChartSeriesFormat.prototype, "fill", {
  9885. get: function () {
  9886. if (!this.m_fill) {
  9887. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  9888. }
  9889. return this.m_fill;
  9890. },
  9891. enumerable: true,
  9892. configurable: true
  9893. });
  9894. Object.defineProperty(ChartSeriesFormat.prototype, "line", {
  9895. get: function () {
  9896. if (!this.m_line) {
  9897. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  9898. }
  9899. return this.m_line;
  9900. },
  9901. enumerable: true,
  9902. configurable: true
  9903. });
  9904. ChartSeriesFormat.prototype._handleResult=function (value) {
  9905. if (_isNullOrUndefined(value))
  9906. return;
  9907. var obj=value;
  9908. _fixObjectPathIfNecessary(this, obj);
  9909. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]);
  9910. };
  9911. ChartSeriesFormat.prototype.load=function (option) {
  9912. _load(this, option);
  9913. return this;
  9914. };
  9915. return ChartSeriesFormat;
  9916. })(OfficeExtension.ClientObject);
  9917. Excel.ChartSeriesFormat=ChartSeriesFormat;
  9918. var ChartPointsCollection=(function (_super) {
  9919. __extends(ChartPointsCollection, _super);
  9920. function ChartPointsCollection() {
  9921. _super.apply(this, arguments);
  9922. }
  9923. Object.defineProperty(ChartPointsCollection.prototype, "items", {
  9924. get: function () {
  9925. _throwIfNotLoaded("items", this.m__items);
  9926. return this.m__items;
  9927. },
  9928. enumerable: true,
  9929. configurable: true
  9930. });
  9931. Object.defineProperty(ChartPointsCollection.prototype, "count", {
  9932. get: function () {
  9933. _throwIfNotLoaded("count", this.m_count);
  9934. return this.m_count;
  9935. },
  9936. enumerable: true,
  9937. configurable: true
  9938. });
  9939. ChartPointsCollection.prototype.getItemAt=function (index) {
  9940. return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", 1 , [index], false, false));
  9941. };
  9942. ChartPointsCollection.prototype._handleResult=function (value) {
  9943. if (_isNullOrUndefined(value))
  9944. return;
  9945. var obj=value;
  9946. _fixObjectPathIfNecessary(this, obj);
  9947. if (!_isUndefined(obj["Count"])) {
  9948. this.m_count=obj["Count"];
  9949. }
  9950. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  9951. this.m__items=[];
  9952. var _data=obj[OfficeExtension.Constants.items];
  9953. for (var i=0; i < _data.length; i++) {
  9954. var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingGetItemAt(this.context, this, _data[i], i));
  9955. _item._handleResult(_data[i]);
  9956. this.m__items.push(_item);
  9957. }
  9958. }
  9959. };
  9960. ChartPointsCollection.prototype.load=function (option) {
  9961. _load(this, option);
  9962. return this;
  9963. };
  9964. return ChartPointsCollection;
  9965. })(OfficeExtension.ClientObject);
  9966. Excel.ChartPointsCollection=ChartPointsCollection;
  9967. var ChartPoint=(function (_super) {
  9968. __extends(ChartPoint, _super);
  9969. function ChartPoint() {
  9970. _super.apply(this, arguments);
  9971. }
  9972. Object.defineProperty(ChartPoint.prototype, "format", {
  9973. get: function () {
  9974. if (!this.m_format) {
  9975. this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  9976. }
  9977. return this.m_format;
  9978. },
  9979. enumerable: true,
  9980. configurable: true
  9981. });
  9982. Object.defineProperty(ChartPoint.prototype, "value", {
  9983. get: function () {
  9984. _throwIfNotLoaded("value", this.m_value);
  9985. return this.m_value;
  9986. },
  9987. enumerable: true,
  9988. configurable: true
  9989. });
  9990. ChartPoint.prototype._handleResult=function (value) {
  9991. if (_isNullOrUndefined(value))
  9992. return;
  9993. var obj=value;
  9994. _fixObjectPathIfNecessary(this, obj);
  9995. if (!_isUndefined(obj["Value"])) {
  9996. this.m_value=obj["Value"];
  9997. }
  9998. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  9999. };
  10000. ChartPoint.prototype.load=function (option) {
  10001. _load(this, option);
  10002. return this;
  10003. };
  10004. return ChartPoint;
  10005. })(OfficeExtension.ClientObject);
  10006. Excel.ChartPoint=ChartPoint;
  10007. var ChartPointFormat=(function (_super) {
  10008. __extends(ChartPointFormat, _super);
  10009. function ChartPointFormat() {
  10010. _super.apply(this, arguments);
  10011. }
  10012. Object.defineProperty(ChartPointFormat.prototype, "fill", {
  10013. get: function () {
  10014. if (!this.m_fill) {
  10015. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  10016. }
  10017. return this.m_fill;
  10018. },
  10019. enumerable: true,
  10020. configurable: true
  10021. });
  10022. ChartPointFormat.prototype._handleResult=function (value) {
  10023. if (_isNullOrUndefined(value))
  10024. return;
  10025. var obj=value;
  10026. _fixObjectPathIfNecessary(this, obj);
  10027. _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]);
  10028. };
  10029. ChartPointFormat.prototype.load=function (option) {
  10030. _load(this, option);
  10031. return this;
  10032. };
  10033. return ChartPointFormat;
  10034. })(OfficeExtension.ClientObject);
  10035. Excel.ChartPointFormat=ChartPointFormat;
  10036. var ChartAxes=(function (_super) {
  10037. __extends(ChartAxes, _super);
  10038. function ChartAxes() {
  10039. _super.apply(this, arguments);
  10040. }
  10041. Object.defineProperty(ChartAxes.prototype, "categoryAxis", {
  10042. get: function () {
  10043. if (!this.m_categoryAxis) {
  10044. this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false));
  10045. }
  10046. return this.m_categoryAxis;
  10047. },
  10048. enumerable: true,
  10049. configurable: true
  10050. });
  10051. Object.defineProperty(ChartAxes.prototype, "seriesAxis", {
  10052. get: function () {
  10053. if (!this.m_seriesAxis) {
  10054. this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false));
  10055. }
  10056. return this.m_seriesAxis;
  10057. },
  10058. enumerable: true,
  10059. configurable: true
  10060. });
  10061. Object.defineProperty(ChartAxes.prototype, "valueAxis", {
  10062. get: function () {
  10063. if (!this.m_valueAxis) {
  10064. this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false));
  10065. }
  10066. return this.m_valueAxis;
  10067. },
  10068. enumerable: true,
  10069. configurable: true
  10070. });
  10071. ChartAxes.prototype._handleResult=function (value) {
  10072. if (_isNullOrUndefined(value))
  10073. return;
  10074. var obj=value;
  10075. _fixObjectPathIfNecessary(this, obj);
  10076. _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]);
  10077. };
  10078. ChartAxes.prototype.load=function (option) {
  10079. _load(this, option);
  10080. return this;
  10081. };
  10082. return ChartAxes;
  10083. })(OfficeExtension.ClientObject);
  10084. Excel.ChartAxes=ChartAxes;
  10085. var ChartAxis=(function (_super) {
  10086. __extends(ChartAxis, _super);
  10087. function ChartAxis() {
  10088. _super.apply(this, arguments);
  10089. }
  10090. Object.defineProperty(ChartAxis.prototype, "format", {
  10091. get: function () {
  10092. if (!this.m_format) {
  10093. this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  10094. }
  10095. return this.m_format;
  10096. },
  10097. enumerable: true,
  10098. configurable: true
  10099. });
  10100. Object.defineProperty(ChartAxis.prototype, "majorGridlines", {
  10101. get: function () {
  10102. if (!this.m_majorGridlines) {
  10103. this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false));
  10104. }
  10105. return this.m_majorGridlines;
  10106. },
  10107. enumerable: true,
  10108. configurable: true
  10109. });
  10110. Object.defineProperty(ChartAxis.prototype, "minorGridlines", {
  10111. get: function () {
  10112. if (!this.m_minorGridlines) {
  10113. this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false));
  10114. }
  10115. return this.m_minorGridlines;
  10116. },
  10117. enumerable: true,
  10118. configurable: true
  10119. });
  10120. Object.defineProperty(ChartAxis.prototype, "title", {
  10121. get: function () {
  10122. if (!this.m_title) {
  10123. this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  10124. }
  10125. return this.m_title;
  10126. },
  10127. enumerable: true,
  10128. configurable: true
  10129. });
  10130. Object.defineProperty(ChartAxis.prototype, "majorUnit", {
  10131. get: function () {
  10132. _throwIfNotLoaded("majorUnit", this.m_majorUnit);
  10133. return this.m_majorUnit;
  10134. },
  10135. set: function (value) {
  10136. this.m_majorUnit=value;
  10137. _createSetPropertyAction(this.context, this, "MajorUnit", value);
  10138. },
  10139. enumerable: true,
  10140. configurable: true
  10141. });
  10142. Object.defineProperty(ChartAxis.prototype, "maximum", {
  10143. get: function () {
  10144. _throwIfNotLoaded("maximum", this.m_maximum);
  10145. return this.m_maximum;
  10146. },
  10147. set: function (value) {
  10148. this.m_maximum=value;
  10149. _createSetPropertyAction(this.context, this, "Maximum", value);
  10150. },
  10151. enumerable: true,
  10152. configurable: true
  10153. });
  10154. Object.defineProperty(ChartAxis.prototype, "minimum", {
  10155. get: function () {
  10156. _throwIfNotLoaded("minimum", this.m_minimum);
  10157. return this.m_minimum;
  10158. },
  10159. set: function (value) {
  10160. this.m_minimum=value;
  10161. _createSetPropertyAction(this.context, this, "Minimum", value);
  10162. },
  10163. enumerable: true,
  10164. configurable: true
  10165. });
  10166. Object.defineProperty(ChartAxis.prototype, "minorUnit", {
  10167. get: function () {
  10168. _throwIfNotLoaded("minorUnit", this.m_minorUnit);
  10169. return this.m_minorUnit;
  10170. },
  10171. set: function (value) {
  10172. this.m_minorUnit=value;
  10173. _createSetPropertyAction(this.context, this, "MinorUnit", value);
  10174. },
  10175. enumerable: true,
  10176. configurable: true
  10177. });
  10178. ChartAxis.prototype._handleResult=function (value) {
  10179. if (_isNullOrUndefined(value))
  10180. return;
  10181. var obj=value;
  10182. _fixObjectPathIfNecessary(this, obj);
  10183. if (!_isUndefined(obj["MajorUnit"])) {
  10184. this.m_majorUnit=obj["MajorUnit"];
  10185. }
  10186. if (!_isUndefined(obj["Maximum"])) {
  10187. this.m_maximum=obj["Maximum"];
  10188. }
  10189. if (!_isUndefined(obj["Minimum"])) {
  10190. this.m_minimum=obj["Minimum"];
  10191. }
  10192. if (!_isUndefined(obj["MinorUnit"])) {
  10193. this.m_minorUnit=obj["MinorUnit"];
  10194. }
  10195. _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]);
  10196. };
  10197. ChartAxis.prototype.load=function (option) {
  10198. _load(this, option);
  10199. return this;
  10200. };
  10201. return ChartAxis;
  10202. })(OfficeExtension.ClientObject);
  10203. Excel.ChartAxis=ChartAxis;
  10204. var ChartAxisFormat=(function (_super) {
  10205. __extends(ChartAxisFormat, _super);
  10206. function ChartAxisFormat() {
  10207. _super.apply(this, arguments);
  10208. }
  10209. Object.defineProperty(ChartAxisFormat.prototype, "font", {
  10210. get: function () {
  10211. if (!this.m_font) {
  10212. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  10213. }
  10214. return this.m_font;
  10215. },
  10216. enumerable: true,
  10217. configurable: true
  10218. });
  10219. Object.defineProperty(ChartAxisFormat.prototype, "line", {
  10220. get: function () {
  10221. if (!this.m_line) {
  10222. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  10223. }
  10224. return this.m_line;
  10225. },
  10226. enumerable: true,
  10227. configurable: true
  10228. });
  10229. ChartAxisFormat.prototype._handleResult=function (value) {
  10230. if (_isNullOrUndefined(value))
  10231. return;
  10232. var obj=value;
  10233. _fixObjectPathIfNecessary(this, obj);
  10234. _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]);
  10235. };
  10236. ChartAxisFormat.prototype.load=function (option) {
  10237. _load(this, option);
  10238. return this;
  10239. };
  10240. return ChartAxisFormat;
  10241. })(OfficeExtension.ClientObject);
  10242. Excel.ChartAxisFormat=ChartAxisFormat;
  10243. var ChartAxisTitle=(function (_super) {
  10244. __extends(ChartAxisTitle, _super);
  10245. function ChartAxisTitle() {
  10246. _super.apply(this, arguments);
  10247. }
  10248. Object.defineProperty(ChartAxisTitle.prototype, "format", {
  10249. get: function () {
  10250. if (!this.m_format) {
  10251. this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  10252. }
  10253. return this.m_format;
  10254. },
  10255. enumerable: true,
  10256. configurable: true
  10257. });
  10258. Object.defineProperty(ChartAxisTitle.prototype, "text", {
  10259. get: function () {
  10260. _throwIfNotLoaded("text", this.m_text);
  10261. return this.m_text;
  10262. },
  10263. set: function (value) {
  10264. this.m_text=value;
  10265. _createSetPropertyAction(this.context, this, "Text", value);
  10266. },
  10267. enumerable: true,
  10268. configurable: true
  10269. });
  10270. Object.defineProperty(ChartAxisTitle.prototype, "visible", {
  10271. get: function () {
  10272. _throwIfNotLoaded("visible", this.m_visible);
  10273. return this.m_visible;
  10274. },
  10275. set: function (value) {
  10276. this.m_visible=value;
  10277. _createSetPropertyAction(this.context, this, "Visible", value);
  10278. },
  10279. enumerable: true,
  10280. configurable: true
  10281. });
  10282. ChartAxisTitle.prototype._handleResult=function (value) {
  10283. if (_isNullOrUndefined(value))
  10284. return;
  10285. var obj=value;
  10286. _fixObjectPathIfNecessary(this, obj);
  10287. if (!_isUndefined(obj["Text"])) {
  10288. this.m_text=obj["Text"];
  10289. }
  10290. if (!_isUndefined(obj["Visible"])) {
  10291. this.m_visible=obj["Visible"];
  10292. }
  10293. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  10294. };
  10295. ChartAxisTitle.prototype.load=function (option) {
  10296. _load(this, option);
  10297. return this;
  10298. };
  10299. return ChartAxisTitle;
  10300. })(OfficeExtension.ClientObject);
  10301. Excel.ChartAxisTitle=ChartAxisTitle;
  10302. var ChartAxisTitleFormat=(function (_super) {
  10303. __extends(ChartAxisTitleFormat, _super);
  10304. function ChartAxisTitleFormat() {
  10305. _super.apply(this, arguments);
  10306. }
  10307. Object.defineProperty(ChartAxisTitleFormat.prototype, "font", {
  10308. get: function () {
  10309. if (!this.m_font) {
  10310. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  10311. }
  10312. return this.m_font;
  10313. },
  10314. enumerable: true,
  10315. configurable: true
  10316. });
  10317. ChartAxisTitleFormat.prototype._handleResult=function (value) {
  10318. if (_isNullOrUndefined(value))
  10319. return;
  10320. var obj=value;
  10321. _fixObjectPathIfNecessary(this, obj);
  10322. _handleNavigationPropertyResults(this, obj, ["font", "Font"]);
  10323. };
  10324. ChartAxisTitleFormat.prototype.load=function (option) {
  10325. _load(this, option);
  10326. return this;
  10327. };
  10328. return ChartAxisTitleFormat;
  10329. })(OfficeExtension.ClientObject);
  10330. Excel.ChartAxisTitleFormat=ChartAxisTitleFormat;
  10331. var ChartDataLabels=(function (_super) {
  10332. __extends(ChartDataLabels, _super);
  10333. function ChartDataLabels() {
  10334. _super.apply(this, arguments);
  10335. }
  10336. Object.defineProperty(ChartDataLabels.prototype, "format", {
  10337. get: function () {
  10338. if (!this.m_format) {
  10339. this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  10340. }
  10341. return this.m_format;
  10342. },
  10343. enumerable: true,
  10344. configurable: true
  10345. });
  10346. Object.defineProperty(ChartDataLabels.prototype, "position", {
  10347. get: function () {
  10348. _throwIfNotLoaded("position", this.m_position);
  10349. return this.m_position;
  10350. },
  10351. set: function (value) {
  10352. this.m_position=value;
  10353. _createSetPropertyAction(this.context, this, "Position", value);
  10354. },
  10355. enumerable: true,
  10356. configurable: true
  10357. });
  10358. Object.defineProperty(ChartDataLabels.prototype, "separator", {
  10359. get: function () {
  10360. _throwIfNotLoaded("separator", this.m_separator);
  10361. return this.m_separator;
  10362. },
  10363. set: function (value) {
  10364. this.m_separator=value;
  10365. _createSetPropertyAction(this.context, this, "Separator", value);
  10366. },
  10367. enumerable: true,
  10368. configurable: true
  10369. });
  10370. Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", {
  10371. get: function () {
  10372. _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize);
  10373. return this.m_showBubbleSize;
  10374. },
  10375. set: function (value) {
  10376. this.m_showBubbleSize=value;
  10377. _createSetPropertyAction(this.context, this, "ShowBubbleSize", value);
  10378. },
  10379. enumerable: true,
  10380. configurable: true
  10381. });
  10382. Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", {
  10383. get: function () {
  10384. _throwIfNotLoaded("showCategoryName", this.m_showCategoryName);
  10385. return this.m_showCategoryName;
  10386. },
  10387. set: function (value) {
  10388. this.m_showCategoryName=value;
  10389. _createSetPropertyAction(this.context, this, "ShowCategoryName", value);
  10390. },
  10391. enumerable: true,
  10392. configurable: true
  10393. });
  10394. Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", {
  10395. get: function () {
  10396. _throwIfNotLoaded("showLegendKey", this.m_showLegendKey);
  10397. return this.m_showLegendKey;
  10398. },
  10399. set: function (value) {
  10400. this.m_showLegendKey=value;
  10401. _createSetPropertyAction(this.context, this, "ShowLegendKey", value);
  10402. },
  10403. enumerable: true,
  10404. configurable: true
  10405. });
  10406. Object.defineProperty(ChartDataLabels.prototype, "showPercentage", {
  10407. get: function () {
  10408. _throwIfNotLoaded("showPercentage", this.m_showPercentage);
  10409. return this.m_showPercentage;
  10410. },
  10411. set: function (value) {
  10412. this.m_showPercentage=value;
  10413. _createSetPropertyAction(this.context, this, "ShowPercentage", value);
  10414. },
  10415. enumerable: true,
  10416. configurable: true
  10417. });
  10418. Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", {
  10419. get: function () {
  10420. _throwIfNotLoaded("showSeriesName", this.m_showSeriesName);
  10421. return this.m_showSeriesName;
  10422. },
  10423. set: function (value) {
  10424. this.m_showSeriesName=value;
  10425. _createSetPropertyAction(this.context, this, "ShowSeriesName", value);
  10426. },
  10427. enumerable: true,
  10428. configurable: true
  10429. });
  10430. Object.defineProperty(ChartDataLabels.prototype, "showValue", {
  10431. get: function () {
  10432. _throwIfNotLoaded("showValue", this.m_showValue);
  10433. return this.m_showValue;
  10434. },
  10435. set: function (value) {
  10436. this.m_showValue=value;
  10437. _createSetPropertyAction(this.context, this, "ShowValue", value);
  10438. },
  10439. enumerable: true,
  10440. configurable: true
  10441. });
  10442. ChartDataLabels.prototype._handleResult=function (value) {
  10443. if (_isNullOrUndefined(value))
  10444. return;
  10445. var obj=value;
  10446. _fixObjectPathIfNecessary(this, obj);
  10447. if (!_isUndefined(obj["Position"])) {
  10448. this.m_position=obj["Position"];
  10449. }
  10450. if (!_isUndefined(obj["Separator"])) {
  10451. this.m_separator=obj["Separator"];
  10452. }
  10453. if (!_isUndefined(obj["ShowBubbleSize"])) {
  10454. this.m_showBubbleSize=obj["ShowBubbleSize"];
  10455. }
  10456. if (!_isUndefined(obj["ShowCategoryName"])) {
  10457. this.m_showCategoryName=obj["ShowCategoryName"];
  10458. }
  10459. if (!_isUndefined(obj["ShowLegendKey"])) {
  10460. this.m_showLegendKey=obj["ShowLegendKey"];
  10461. }
  10462. if (!_isUndefined(obj["ShowPercentage"])) {
  10463. this.m_showPercentage=obj["ShowPercentage"];
  10464. }
  10465. if (!_isUndefined(obj["ShowSeriesName"])) {
  10466. this.m_showSeriesName=obj["ShowSeriesName"];
  10467. }
  10468. if (!_isUndefined(obj["ShowValue"])) {
  10469. this.m_showValue=obj["ShowValue"];
  10470. }
  10471. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  10472. };
  10473. ChartDataLabels.prototype.load=function (option) {
  10474. _load(this, option);
  10475. return this;
  10476. };
  10477. return ChartDataLabels;
  10478. })(OfficeExtension.ClientObject);
  10479. Excel.ChartDataLabels=ChartDataLabels;
  10480. var ChartDataLabelFormat=(function (_super) {
  10481. __extends(ChartDataLabelFormat, _super);
  10482. function ChartDataLabelFormat() {
  10483. _super.apply(this, arguments);
  10484. }
  10485. Object.defineProperty(ChartDataLabelFormat.prototype, "fill", {
  10486. get: function () {
  10487. if (!this.m_fill) {
  10488. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  10489. }
  10490. return this.m_fill;
  10491. },
  10492. enumerable: true,
  10493. configurable: true
  10494. });
  10495. Object.defineProperty(ChartDataLabelFormat.prototype, "font", {
  10496. get: function () {
  10497. if (!this.m_font) {
  10498. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  10499. }
  10500. return this.m_font;
  10501. },
  10502. enumerable: true,
  10503. configurable: true
  10504. });
  10505. ChartDataLabelFormat.prototype._handleResult=function (value) {
  10506. if (_isNullOrUndefined(value))
  10507. return;
  10508. var obj=value;
  10509. _fixObjectPathIfNecessary(this, obj);
  10510. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  10511. };
  10512. ChartDataLabelFormat.prototype.load=function (option) {
  10513. _load(this, option);
  10514. return this;
  10515. };
  10516. return ChartDataLabelFormat;
  10517. })(OfficeExtension.ClientObject);
  10518. Excel.ChartDataLabelFormat=ChartDataLabelFormat;
  10519. var ChartGridlines=(function (_super) {
  10520. __extends(ChartGridlines, _super);
  10521. function ChartGridlines() {
  10522. _super.apply(this, arguments);
  10523. }
  10524. Object.defineProperty(ChartGridlines.prototype, "format", {
  10525. get: function () {
  10526. if (!this.m_format) {
  10527. this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  10528. }
  10529. return this.m_format;
  10530. },
  10531. enumerable: true,
  10532. configurable: true
  10533. });
  10534. Object.defineProperty(ChartGridlines.prototype, "visible", {
  10535. get: function () {
  10536. _throwIfNotLoaded("visible", this.m_visible);
  10537. return this.m_visible;
  10538. },
  10539. set: function (value) {
  10540. this.m_visible=value;
  10541. _createSetPropertyAction(this.context, this, "Visible", value);
  10542. },
  10543. enumerable: true,
  10544. configurable: true
  10545. });
  10546. ChartGridlines.prototype._handleResult=function (value) {
  10547. if (_isNullOrUndefined(value))
  10548. return;
  10549. var obj=value;
  10550. _fixObjectPathIfNecessary(this, obj);
  10551. if (!_isUndefined(obj["Visible"])) {
  10552. this.m_visible=obj["Visible"];
  10553. }
  10554. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  10555. };
  10556. ChartGridlines.prototype.load=function (option) {
  10557. _load(this, option);
  10558. return this;
  10559. };
  10560. return ChartGridlines;
  10561. })(OfficeExtension.ClientObject);
  10562. Excel.ChartGridlines=ChartGridlines;
  10563. var ChartGridlinesFormat=(function (_super) {
  10564. __extends(ChartGridlinesFormat, _super);
  10565. function ChartGridlinesFormat() {
  10566. _super.apply(this, arguments);
  10567. }
  10568. Object.defineProperty(ChartGridlinesFormat.prototype, "line", {
  10569. get: function () {
  10570. if (!this.m_line) {
  10571. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  10572. }
  10573. return this.m_line;
  10574. },
  10575. enumerable: true,
  10576. configurable: true
  10577. });
  10578. ChartGridlinesFormat.prototype._handleResult=function (value) {
  10579. if (_isNullOrUndefined(value))
  10580. return;
  10581. var obj=value;
  10582. _fixObjectPathIfNecessary(this, obj);
  10583. _handleNavigationPropertyResults(this, obj, ["line", "Line"]);
  10584. };
  10585. ChartGridlinesFormat.prototype.load=function (option) {
  10586. _load(this, option);
  10587. return this;
  10588. };
  10589. return ChartGridlinesFormat;
  10590. })(OfficeExtension.ClientObject);
  10591. Excel.ChartGridlinesFormat=ChartGridlinesFormat;
  10592. var ChartLegend=(function (_super) {
  10593. __extends(ChartLegend, _super);
  10594. function ChartLegend() {
  10595. _super.apply(this, arguments);
  10596. }
  10597. Object.defineProperty(ChartLegend.prototype, "format", {
  10598. get: function () {
  10599. if (!this.m_format) {
  10600. this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  10601. }
  10602. return this.m_format;
  10603. },
  10604. enumerable: true,
  10605. configurable: true
  10606. });
  10607. Object.defineProperty(ChartLegend.prototype, "overlay", {
  10608. get: function () {
  10609. _throwIfNotLoaded("overlay", this.m_overlay);
  10610. return this.m_overlay;
  10611. },
  10612. set: function (value) {
  10613. this.m_overlay=value;
  10614. _createSetPropertyAction(this.context, this, "Overlay", value);
  10615. },
  10616. enumerable: true,
  10617. configurable: true
  10618. });
  10619. Object.defineProperty(ChartLegend.prototype, "position", {
  10620. get: function () {
  10621. _throwIfNotLoaded("position", this.m_position);
  10622. return this.m_position;
  10623. },
  10624. set: function (value) {
  10625. this.m_position=value;
  10626. _createSetPropertyAction(this.context, this, "Position", value);
  10627. },
  10628. enumerable: true,
  10629. configurable: true
  10630. });
  10631. Object.defineProperty(ChartLegend.prototype, "visible", {
  10632. get: function () {
  10633. _throwIfNotLoaded("visible", this.m_visible);
  10634. return this.m_visible;
  10635. },
  10636. set: function (value) {
  10637. this.m_visible=value;
  10638. _createSetPropertyAction(this.context, this, "Visible", value);
  10639. },
  10640. enumerable: true,
  10641. configurable: true
  10642. });
  10643. ChartLegend.prototype._handleResult=function (value) {
  10644. if (_isNullOrUndefined(value))
  10645. return;
  10646. var obj=value;
  10647. _fixObjectPathIfNecessary(this, obj);
  10648. if (!_isUndefined(obj["Overlay"])) {
  10649. this.m_overlay=obj["Overlay"];
  10650. }
  10651. if (!_isUndefined(obj["Position"])) {
  10652. this.m_position=obj["Position"];
  10653. }
  10654. if (!_isUndefined(obj["Visible"])) {
  10655. this.m_visible=obj["Visible"];
  10656. }
  10657. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  10658. };
  10659. ChartLegend.prototype.load=function (option) {
  10660. _load(this, option);
  10661. return this;
  10662. };
  10663. return ChartLegend;
  10664. })(OfficeExtension.ClientObject);
  10665. Excel.ChartLegend=ChartLegend;
  10666. var ChartLegendFormat=(function (_super) {
  10667. __extends(ChartLegendFormat, _super);
  10668. function ChartLegendFormat() {
  10669. _super.apply(this, arguments);
  10670. }
  10671. Object.defineProperty(ChartLegendFormat.prototype, "fill", {
  10672. get: function () {
  10673. if (!this.m_fill) {
  10674. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  10675. }
  10676. return this.m_fill;
  10677. },
  10678. enumerable: true,
  10679. configurable: true
  10680. });
  10681. Object.defineProperty(ChartLegendFormat.prototype, "font", {
  10682. get: function () {
  10683. if (!this.m_font) {
  10684. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  10685. }
  10686. return this.m_font;
  10687. },
  10688. enumerable: true,
  10689. configurable: true
  10690. });
  10691. ChartLegendFormat.prototype._handleResult=function (value) {
  10692. if (_isNullOrUndefined(value))
  10693. return;
  10694. var obj=value;
  10695. _fixObjectPathIfNecessary(this, obj);
  10696. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  10697. };
  10698. ChartLegendFormat.prototype.load=function (option) {
  10699. _load(this, option);
  10700. return this;
  10701. };
  10702. return ChartLegendFormat;
  10703. })(OfficeExtension.ClientObject);
  10704. Excel.ChartLegendFormat=ChartLegendFormat;
  10705. var ChartTitle=(function (_super) {
  10706. __extends(ChartTitle, _super);
  10707. function ChartTitle() {
  10708. _super.apply(this, arguments);
  10709. }
  10710. Object.defineProperty(ChartTitle.prototype, "format", {
  10711. get: function () {
  10712. if (!this.m_format) {
  10713. this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  10714. }
  10715. return this.m_format;
  10716. },
  10717. enumerable: true,
  10718. configurable: true
  10719. });
  10720. Object.defineProperty(ChartTitle.prototype, "overlay", {
  10721. get: function () {
  10722. _throwIfNotLoaded("overlay", this.m_overlay);
  10723. return this.m_overlay;
  10724. },
  10725. set: function (value) {
  10726. this.m_overlay=value;
  10727. _createSetPropertyAction(this.context, this, "Overlay", value);
  10728. },
  10729. enumerable: true,
  10730. configurable: true
  10731. });
  10732. Object.defineProperty(ChartTitle.prototype, "text", {
  10733. get: function () {
  10734. _throwIfNotLoaded("text", this.m_text);
  10735. return this.m_text;
  10736. },
  10737. set: function (value) {
  10738. this.m_text=value;
  10739. _createSetPropertyAction(this.context, this, "Text", value);
  10740. },
  10741. enumerable: true,
  10742. configurable: true
  10743. });
  10744. Object.defineProperty(ChartTitle.prototype, "visible", {
  10745. get: function () {
  10746. _throwIfNotLoaded("visible", this.m_visible);
  10747. return this.m_visible;
  10748. },
  10749. set: function (value) {
  10750. this.m_visible=value;
  10751. _createSetPropertyAction(this.context, this, "Visible", value);
  10752. },
  10753. enumerable: true,
  10754. configurable: true
  10755. });
  10756. ChartTitle.prototype._handleResult=function (value) {
  10757. if (_isNullOrUndefined(value))
  10758. return;
  10759. var obj=value;
  10760. _fixObjectPathIfNecessary(this, obj);
  10761. if (!_isUndefined(obj["Overlay"])) {
  10762. this.m_overlay=obj["Overlay"];
  10763. }
  10764. if (!_isUndefined(obj["Text"])) {
  10765. this.m_text=obj["Text"];
  10766. }
  10767. if (!_isUndefined(obj["Visible"])) {
  10768. this.m_visible=obj["Visible"];
  10769. }
  10770. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  10771. };
  10772. ChartTitle.prototype.load=function (option) {
  10773. _load(this, option);
  10774. return this;
  10775. };
  10776. return ChartTitle;
  10777. })(OfficeExtension.ClientObject);
  10778. Excel.ChartTitle=ChartTitle;
  10779. var ChartTitleFormat=(function (_super) {
  10780. __extends(ChartTitleFormat, _super);
  10781. function ChartTitleFormat() {
  10782. _super.apply(this, arguments);
  10783. }
  10784. Object.defineProperty(ChartTitleFormat.prototype, "fill", {
  10785. get: function () {
  10786. if (!this.m_fill) {
  10787. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  10788. }
  10789. return this.m_fill;
  10790. },
  10791. enumerable: true,
  10792. configurable: true
  10793. });
  10794. Object.defineProperty(ChartTitleFormat.prototype, "font", {
  10795. get: function () {
  10796. if (!this.m_font) {
  10797. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  10798. }
  10799. return this.m_font;
  10800. },
  10801. enumerable: true,
  10802. configurable: true
  10803. });
  10804. ChartTitleFormat.prototype._handleResult=function (value) {
  10805. if (_isNullOrUndefined(value))
  10806. return;
  10807. var obj=value;
  10808. _fixObjectPathIfNecessary(this, obj);
  10809. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  10810. };
  10811. ChartTitleFormat.prototype.load=function (option) {
  10812. _load(this, option);
  10813. return this;
  10814. };
  10815. return ChartTitleFormat;
  10816. })(OfficeExtension.ClientObject);
  10817. Excel.ChartTitleFormat=ChartTitleFormat;
  10818. var ChartFill=(function (_super) {
  10819. __extends(ChartFill, _super);
  10820. function ChartFill() {
  10821. _super.apply(this, arguments);
  10822. }
  10823. ChartFill.prototype.clear=function () {
  10824. _createMethodAction(this.context, this, "Clear", 0 , []);
  10825. };
  10826. ChartFill.prototype.setSolidColor=function (color) {
  10827. _createMethodAction(this.context, this, "SetSolidColor", 0 , [color]);
  10828. };
  10829. ChartFill.prototype._handleResult=function (value) {
  10830. if (_isNullOrUndefined(value))
  10831. return;
  10832. var obj=value;
  10833. _fixObjectPathIfNecessary(this, obj);
  10834. };
  10835. ChartFill.prototype.load=function (option) {
  10836. _load(this, option);
  10837. return this;
  10838. };
  10839. return ChartFill;
  10840. })(OfficeExtension.ClientObject);
  10841. Excel.ChartFill=ChartFill;
  10842. var ChartLineFormat=(function (_super) {
  10843. __extends(ChartLineFormat, _super);
  10844. function ChartLineFormat() {
  10845. _super.apply(this, arguments);
  10846. }
  10847. Object.defineProperty(ChartLineFormat.prototype, "color", {
  10848. get: function () {
  10849. _throwIfNotLoaded("color", this.m_color);
  10850. return this.m_color;
  10851. },
  10852. set: function (value) {
  10853. this.m_color=value;
  10854. _createSetPropertyAction(this.context, this, "Color", value);
  10855. },
  10856. enumerable: true,
  10857. configurable: true
  10858. });
  10859. ChartLineFormat.prototype.clear=function () {
  10860. _createMethodAction(this.context, this, "Clear", 0 , []);
  10861. };
  10862. ChartLineFormat.prototype._handleResult=function (value) {
  10863. if (_isNullOrUndefined(value))
  10864. return;
  10865. var obj=value;
  10866. _fixObjectPathIfNecessary(this, obj);
  10867. if (!_isUndefined(obj["Color"])) {
  10868. this.m_color=obj["Color"];
  10869. }
  10870. };
  10871. ChartLineFormat.prototype.load=function (option) {
  10872. _load(this, option);
  10873. return this;
  10874. };
  10875. return ChartLineFormat;
  10876. })(OfficeExtension.ClientObject);
  10877. Excel.ChartLineFormat=ChartLineFormat;
  10878. var ChartFont=(function (_super) {
  10879. __extends(ChartFont, _super);
  10880. function ChartFont() {
  10881. _super.apply(this, arguments);
  10882. }
  10883. Object.defineProperty(ChartFont.prototype, "bold", {
  10884. get: function () {
  10885. _throwIfNotLoaded("bold", this.m_bold);
  10886. return this.m_bold;
  10887. },
  10888. set: function (value) {
  10889. this.m_bold=value;
  10890. _createSetPropertyAction(this.context, this, "Bold", value);
  10891. },
  10892. enumerable: true,
  10893. configurable: true
  10894. });
  10895. Object.defineProperty(ChartFont.prototype, "color", {
  10896. get: function () {
  10897. _throwIfNotLoaded("color", this.m_color);
  10898. return this.m_color;
  10899. },
  10900. set: function (value) {
  10901. this.m_color=value;
  10902. _createSetPropertyAction(this.context, this, "Color", value);
  10903. },
  10904. enumerable: true,
  10905. configurable: true
  10906. });
  10907. Object.defineProperty(ChartFont.prototype, "italic", {
  10908. get: function () {
  10909. _throwIfNotLoaded("italic", this.m_italic);
  10910. return this.m_italic;
  10911. },
  10912. set: function (value) {
  10913. this.m_italic=value;
  10914. _createSetPropertyAction(this.context, this, "Italic", value);
  10915. },
  10916. enumerable: true,
  10917. configurable: true
  10918. });
  10919. Object.defineProperty(ChartFont.prototype, "name", {
  10920. get: function () {
  10921. _throwIfNotLoaded("name", this.m_name);
  10922. return this.m_name;
  10923. },
  10924. set: function (value) {
  10925. this.m_name=value;
  10926. _createSetPropertyAction(this.context, this, "Name", value);
  10927. },
  10928. enumerable: true,
  10929. configurable: true
  10930. });
  10931. Object.defineProperty(ChartFont.prototype, "size", {
  10932. get: function () {
  10933. _throwIfNotLoaded("size", this.m_size);
  10934. return this.m_size;
  10935. },
  10936. set: function (value) {
  10937. this.m_size=value;
  10938. _createSetPropertyAction(this.context, this, "Size", value);
  10939. },
  10940. enumerable: true,
  10941. configurable: true
  10942. });
  10943. Object.defineProperty(ChartFont.prototype, "underline", {
  10944. get: function () {
  10945. _throwIfNotLoaded("underline", this.m_underline);
  10946. return this.m_underline;
  10947. },
  10948. set: function (value) {
  10949. this.m_underline=value;
  10950. _createSetPropertyAction(this.context, this, "Underline", value);
  10951. },
  10952. enumerable: true,
  10953. configurable: true
  10954. });
  10955. ChartFont.prototype._handleResult=function (value) {
  10956. if (_isNullOrUndefined(value))
  10957. return;
  10958. var obj=value;
  10959. _fixObjectPathIfNecessary(this, obj);
  10960. if (!_isUndefined(obj["Bold"])) {
  10961. this.m_bold=obj["Bold"];
  10962. }
  10963. if (!_isUndefined(obj["Color"])) {
  10964. this.m_color=obj["Color"];
  10965. }
  10966. if (!_isUndefined(obj["Italic"])) {
  10967. this.m_italic=obj["Italic"];
  10968. }
  10969. if (!_isUndefined(obj["Name"])) {
  10970. this.m_name=obj["Name"];
  10971. }
  10972. if (!_isUndefined(obj["Size"])) {
  10973. this.m_size=obj["Size"];
  10974. }
  10975. if (!_isUndefined(obj["Underline"])) {
  10976. this.m_underline=obj["Underline"];
  10977. }
  10978. };
  10979. ChartFont.prototype.load=function (option) {
  10980. _load(this, option);
  10981. return this;
  10982. };
  10983. return ChartFont;
  10984. })(OfficeExtension.ClientObject);
  10985. Excel.ChartFont=ChartFont;
  10986. var BindingType;
  10987. (function (BindingType) {
  10988. BindingType.range="Range";
  10989. BindingType.table="Table";
  10990. BindingType.text="Text";
  10991. })(BindingType=Excel.BindingType || (Excel.BindingType={}));
  10992. var BorderIndex;
  10993. (function (BorderIndex) {
  10994. BorderIndex.edgeTop="EdgeTop";
  10995. BorderIndex.edgeBottom="EdgeBottom";
  10996. BorderIndex.edgeLeft="EdgeLeft";
  10997. BorderIndex.edgeRight="EdgeRight";
  10998. BorderIndex.insideVertical="InsideVertical";
  10999. BorderIndex.insideHorizontal="InsideHorizontal";
  11000. BorderIndex.diagonalDown="DiagonalDown";
  11001. BorderIndex.diagonalUp="DiagonalUp";
  11002. })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={}));
  11003. var BorderLineStyle;
  11004. (function (BorderLineStyle) {
  11005. BorderLineStyle.none="None";
  11006. BorderLineStyle.continuous="Continuous";
  11007. BorderLineStyle.dash="Dash";
  11008. BorderLineStyle.dashDot="DashDot";
  11009. BorderLineStyle.dashDotDot="DashDotDot";
  11010. BorderLineStyle.dot="Dot";
  11011. BorderLineStyle.double="Double";
  11012. BorderLineStyle.slantDashDot="SlantDashDot";
  11013. })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={}));
  11014. var BorderWeight;
  11015. (function (BorderWeight) {
  11016. BorderWeight.hairline="Hairline";
  11017. BorderWeight.thin="Thin";
  11018. BorderWeight.medium="Medium";
  11019. BorderWeight.thick="Thick";
  11020. })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={}));
  11021. var CalculationMode;
  11022. (function (CalculationMode) {
  11023. CalculationMode.automatic="Automatic";
  11024. CalculationMode.automaticExceptTables="AutomaticExceptTables";
  11025. CalculationMode.manual="Manual";
  11026. })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={}));
  11027. var CalculationType;
  11028. (function (CalculationType) {
  11029. CalculationType.recalculate="Recalculate";
  11030. CalculationType.full="Full";
  11031. CalculationType.fullRebuild="FullRebuild";
  11032. })(CalculationType=Excel.CalculationType || (Excel.CalculationType={}));
  11033. var ClearApplyTo;
  11034. (function (ClearApplyTo) {
  11035. ClearApplyTo.all="All";
  11036. ClearApplyTo.formats="Formats";
  11037. ClearApplyTo.contents="Contents";
  11038. })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={}));
  11039. var ChartDataLabelPosition;
  11040. (function (ChartDataLabelPosition) {
  11041. ChartDataLabelPosition.invalid="Invalid";
  11042. ChartDataLabelPosition.none="None";
  11043. ChartDataLabelPosition.center="Center";
  11044. ChartDataLabelPosition.insideEnd="InsideEnd";
  11045. ChartDataLabelPosition.insideBase="InsideBase";
  11046. ChartDataLabelPosition.outsideEnd="OutsideEnd";
  11047. ChartDataLabelPosition.left="Left";
  11048. ChartDataLabelPosition.right="Right";
  11049. ChartDataLabelPosition.top="Top";
  11050. ChartDataLabelPosition.bottom="Bottom";
  11051. ChartDataLabelPosition.bestFit="BestFit";
  11052. ChartDataLabelPosition.callout="Callout";
  11053. })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={}));
  11054. var ChartLegendPosition;
  11055. (function (ChartLegendPosition) {
  11056. ChartLegendPosition.invalid="Invalid";
  11057. ChartLegendPosition.top="Top";
  11058. ChartLegendPosition.bottom="Bottom";
  11059. ChartLegendPosition.left="Left";
  11060. ChartLegendPosition.right="Right";
  11061. ChartLegendPosition.corner="Corner";
  11062. ChartLegendPosition.custom="Custom";
  11063. })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={}));
  11064. var ChartSeriesBy;
  11065. (function (ChartSeriesBy) {
  11066. ChartSeriesBy.auto="Auto";
  11067. ChartSeriesBy.columns="Columns";
  11068. ChartSeriesBy.rows="Rows";
  11069. })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={}));
  11070. var ChartType;
  11071. (function (ChartType) {
  11072. ChartType.invalid="Invalid";
  11073. ChartType.columnClustered="ColumnClustered";
  11074. ChartType.columnStacked="ColumnStacked";
  11075. ChartType.columnStacked100="ColumnStacked100";
  11076. ChartType._3DColumnClustered="3DColumnClustered";
  11077. ChartType._3DColumnStacked="3DColumnStacked";
  11078. ChartType._3DColumnStacked100="3DColumnStacked100";
  11079. ChartType.barClustered="BarClustered";
  11080. ChartType.barStacked="BarStacked";
  11081. ChartType.barStacked100="BarStacked100";
  11082. ChartType._3DBarClustered="3DBarClustered";
  11083. ChartType._3DBarStacked="3DBarStacked";
  11084. ChartType._3DBarStacked100="3DBarStacked100";
  11085. ChartType.lineStacked="LineStacked";
  11086. ChartType.lineStacked100="LineStacked100";
  11087. ChartType.lineMarkers="LineMarkers";
  11088. ChartType.lineMarkersStacked="LineMarkersStacked";
  11089. ChartType.lineMarkersStacked100="LineMarkersStacked100";
  11090. ChartType.pieOfPie="PieOfPie";
  11091. ChartType.pieExploded="PieExploded";
  11092. ChartType._3DPieExploded="3DPieExploded";
  11093. ChartType.barOfPie="BarOfPie";
  11094. ChartType.xyscatterSmooth="XYScatterSmooth";
  11095. ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers";
  11096. ChartType.xyscatterLines="XYScatterLines";
  11097. ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers";
  11098. ChartType.areaStacked="AreaStacked";
  11099. ChartType.areaStacked100="AreaStacked100";
  11100. ChartType._3DAreaStacked="3DAreaStacked";
  11101. ChartType._3DAreaStacked100="3DAreaStacked100";
  11102. ChartType.doughnutExploded="DoughnutExploded";
  11103. ChartType.radarMarkers="RadarMarkers";
  11104. ChartType.radarFilled="RadarFilled";
  11105. ChartType.surface="Surface";
  11106. ChartType.surfaceWireframe="SurfaceWireframe";
  11107. ChartType.surfaceTopView="SurfaceTopView";
  11108. ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe";
  11109. ChartType.bubble="Bubble";
  11110. ChartType.bubble3DEffect="Bubble3DEffect";
  11111. ChartType.stockHLC="StockHLC";
  11112. ChartType.stockOHLC="StockOHLC";
  11113. ChartType.stockVHLC="StockVHLC";
  11114. ChartType.stockVOHLC="StockVOHLC";
  11115. ChartType.cylinderColClustered="CylinderColClustered";
  11116. ChartType.cylinderColStacked="CylinderColStacked";
  11117. ChartType.cylinderColStacked100="CylinderColStacked100";
  11118. ChartType.cylinderBarClustered="CylinderBarClustered";
  11119. ChartType.cylinderBarStacked="CylinderBarStacked";
  11120. ChartType.cylinderBarStacked100="CylinderBarStacked100";
  11121. ChartType.cylinderCol="CylinderCol";
  11122. ChartType.coneColClustered="ConeColClustered";
  11123. ChartType.coneColStacked="ConeColStacked";
  11124. ChartType.coneColStacked100="ConeColStacked100";
  11125. ChartType.coneBarClustered="ConeBarClustered";
  11126. ChartType.coneBarStacked="ConeBarStacked";
  11127. ChartType.coneBarStacked100="ConeBarStacked100";
  11128. ChartType.coneCol="ConeCol";
  11129. ChartType.pyramidColClustered="PyramidColClustered";
  11130. ChartType.pyramidColStacked="PyramidColStacked";
  11131. ChartType.pyramidColStacked100="PyramidColStacked100";
  11132. ChartType.pyramidBarClustered="PyramidBarClustered";
  11133. ChartType.pyramidBarStacked="PyramidBarStacked";
  11134. ChartType.pyramidBarStacked100="PyramidBarStacked100";
  11135. ChartType.pyramidCol="PyramidCol";
  11136. ChartType._3DColumn="3DColumn";
  11137. ChartType.line="Line";
  11138. ChartType._3DLine="3DLine";
  11139. ChartType._3DPie="3DPie";
  11140. ChartType.pie="Pie";
  11141. ChartType.xyscatter="XYScatter";
  11142. ChartType._3DArea="3DArea";
  11143. ChartType.area="Area";
  11144. ChartType.doughnut="Doughnut";
  11145. ChartType.radar="Radar";
  11146. })(ChartType=Excel.ChartType || (Excel.ChartType={}));
  11147. var ChartUnderlineStyle;
  11148. (function (ChartUnderlineStyle) {
  11149. ChartUnderlineStyle.none="None";
  11150. ChartUnderlineStyle.single="Single";
  11151. })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={}));
  11152. var DeleteShiftDirection;
  11153. (function (DeleteShiftDirection) {
  11154. DeleteShiftDirection.up="Up";
  11155. DeleteShiftDirection.left="Left";
  11156. })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={}));
  11157. var HorizontalAlignment;
  11158. (function (HorizontalAlignment) {
  11159. HorizontalAlignment.general="General";
  11160. HorizontalAlignment.left="Left";
  11161. HorizontalAlignment.center="Center";
  11162. HorizontalAlignment.right="Right";
  11163. HorizontalAlignment.fill="Fill";
  11164. HorizontalAlignment.justify="Justify";
  11165. HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection";
  11166. HorizontalAlignment.distributed="Distributed";
  11167. })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={}));
  11168. var InsertShiftDirection;
  11169. (function (InsertShiftDirection) {
  11170. InsertShiftDirection.down="Down";
  11171. InsertShiftDirection.right="Right";
  11172. })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={}));
  11173. var NamedItemType;
  11174. (function (NamedItemType) {
  11175. NamedItemType.string="String";
  11176. NamedItemType.integer="Integer";
  11177. NamedItemType.double="Double";
  11178. NamedItemType.boolean="Boolean";
  11179. NamedItemType.range="Range";
  11180. })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={}));
  11181. var RangeUnderlineStyle;
  11182. (function (RangeUnderlineStyle) {
  11183. RangeUnderlineStyle.none="None";
  11184. RangeUnderlineStyle.single="Single";
  11185. RangeUnderlineStyle.double="Double";
  11186. RangeUnderlineStyle.singleAccountant="SingleAccountant";
  11187. RangeUnderlineStyle.doubleAccountant="DoubleAccountant";
  11188. })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={}));
  11189. var SheetVisibility;
  11190. (function (SheetVisibility) {
  11191. SheetVisibility.visible="Visible";
  11192. SheetVisibility.hidden="Hidden";
  11193. SheetVisibility.veryHidden="VeryHidden";
  11194. })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={}));
  11195. var RangeValueType;
  11196. (function (RangeValueType) {
  11197. RangeValueType.unknown="Unknown";
  11198. RangeValueType.empty="Empty";
  11199. RangeValueType.string="String";
  11200. RangeValueType.integer="Integer";
  11201. RangeValueType.double="Double";
  11202. RangeValueType.boolean="Boolean";
  11203. RangeValueType.error="Error";
  11204. })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={}));
  11205. var VerticalAlignment;
  11206. (function (VerticalAlignment) {
  11207. VerticalAlignment.top="Top";
  11208. VerticalAlignment.center="Center";
  11209. VerticalAlignment.bottom="Bottom";
  11210. VerticalAlignment.justify="Justify";
  11211. VerticalAlignment.distributed="Distributed";
  11212. })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={}));
  11213. var ErrorCodes;
  11214. (function (ErrorCodes) {
  11215. ErrorCodes.accessDenied="AccessDenied";
  11216. ErrorCodes.generalException="GeneralException";
  11217. ErrorCodes.insertDeleteConflict="InsertDeleteConflict";
  11218. ErrorCodes.invalidArgument="InvalidArgument";
  11219. ErrorCodes.invalidBinding="InvalidBinding";
  11220. ErrorCodes.invalidOperation="InvalidOperation";
  11221. ErrorCodes.invalidReference="InvalidReference";
  11222. ErrorCodes.invalidSelection="InvalidSelection";
  11223. ErrorCodes.itemAlreadyExists="ItemAlreadyExists";
  11224. ErrorCodes.itemNotFound="ItemNotFound";
  11225. ErrorCodes.notImplemented="NotImplemented";
  11226. ErrorCodes.unsupportedOperation="UnsupportedOperation";
  11227. })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={}));
  11228. })(Excel || (Excel={}));
  11229. var Excel;
  11230. (function (Excel) {
  11231. var RequestContext=(function (_super) {
  11232. __extends(RequestContext, _super);
  11233. function RequestContext(url) {
  11234. _super.call(this, url);
  11235. this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this));
  11236. this._rootObject=this.m_workbook;
  11237. }
  11238. Object.defineProperty(RequestContext.prototype, "workbook", {
  11239. get: function () {
  11240. return this.m_workbook;
  11241. },
  11242. enumerable: true,
  11243. configurable: true
  11244. });
  11245. return RequestContext;
  11246. })(OfficeExtension.ClientRequestContext);
  11247. Excel.RequestContext=RequestContext;
  11248. function run(batch) {
  11249. return OfficeExtension.ClientRequestContext._run(function () { return new Excel.RequestContext(); }, batch);
  11250. }
  11251. Excel.run=run;
  11252. })(Excel || (Excel={}));