1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242 |
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2016, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/api/ActionInterface',[], function () {
- 'use strict';
- /**
- * This class provides a means to declare a custom action controller for a button/menu item
- * It plays the role of an interface, consumer can implement it.
- *
- * @interface
- */
- var ActionInterface = function ActionInterface() {
- /**
- * Called when the custom button/menu item is Clicked/Tapped
- *
- * @public
- * @param {Context}
- */
- this.execute = function
- /* context */
- () {};
- /**
- * Optional:-
- * Implement this method if the widget being added is a menu item.
- * Determines based on the return value if the menu item should be visible or hidden.
- *
- * @public
- * @param {Context}
- * @return {Boolean} True - will show the menu item, False - will hide the menu item.
- */
- this.isVisible = function
- /* context */
- () {};
- };
- return ActionInterface;
- });
- //# sourceMappingURL=ActionInterface.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2013, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/core/Class',['underscore'], function (_) {
- 'use strict';
- /**
- * The Class implements the root of class hierarchy implementing the mechanism for
- * creating new derived classes and calling inherited methods.
- */
- // @class
- // @abstract
- var Class = function Class() {};
- function createConstructor() {
- return function () {
- if (typeof this.init === 'function') {
- this.init.apply(this, arguments);
- }
- };
- }
- // Create new widget class derived from the Class
- // @static
- // @param mixins [optional] An array of the mixin classes.
- // @param def The definition of the derived class, methods, member variables. The
- // special method 'init' is called at construction of the class instance.
- //
- Class.extend = function (mixins, def) {
- if (arguments.length === 1) {
- def = mixins;
- mixins = null;
- }
- var baseProto = this.prototype,
- parentProto = baseProto,
- proto = Object.create(parentProto);
- // create the constructor
- var ctor = createConstructor();
- // add the mixins
- if (mixins) {
- for (var i = 0, len = mixins.length; i < len; ++i) {
- proto = _.extend(proto, mixins[i].prototype);
- }
- parentProto = proto;
- proto = Object.create(proto);
- if (typeof def.init !== 'function') {
- // generate default init method for multi-class inheritance
- def.init = function () {
- ctor.inherited('init', this, arguments);
- };
- }
- }
- _.extend(proto, def);
- ctor.prototype = proto;
- // static method to allow for further extension
- ctor.extend = this.extend;
- // calling the inherited methods
- ctor.inherited = function (name, that, args) {
- if (name === 'init') {
- // the 'init' method has a special case of calling inherited implementation
- // it should call all the 'init' methods from the base class and mixins
- if (typeof baseProto[name] === 'function') {
- baseProto[name].apply(that, args);
- }
- _.each(mixins, function (m) {
- if (typeof m.prototype[name] === 'function') {
- m.prototype[name].apply(that, args);
- }
- });
- } else if (typeof parentProto[name] === 'function') {
- return parentProto[name].apply(that, args);
- }
- };
- return ctor;
- };
- return Class;
- });
- //# sourceMappingURL=Class.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2013, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *
- * @module /dashboard/data/Events
- * @see Events
- */
- define('baglass/core-client/js/core-client/ui/core/Events',['./Class'], function (Class) {
- 'use strict';
- /**
- * Events implements the Backbone-style eventing model objects
- *
- * @class Events
- */
- var Events = Class.extend({
- init: function init() {
- this._events = {};
- },
- /**
- * The 'on' method registers the handler and return DOJO-style event registration object with 'remove' method, which unregisters the handler.
- *
- * This implementation supports composite event names, such as 'eventBaseName:eventSecondaryName', for example: 'change:name'. Triggering 'change:name' event would invoke handlers registered to
- * listen 'change' event as well as the handlers registered to listen the 'change:name' event. The special event name 'all' can be used to listen to all event types.
- */
- on: function on(eventName, handler, context) {
- if (typeof handler !== 'function') {
- console.log('ERROR in Events.on: Invalid event handler');
- }
- if (!this._events[eventName]) {
- this._events[eventName] = [];
- }
- this._events[eventName].push({
- handler: handler,
- context: context
- });
- var that = this;
- return {
- remove: function remove() {
- that.off(eventName, handler, context);
- }
- };
- },
- /**
- * Removes the specified handler from the listening to the events on this object. If eventName is not specified then unregister handler and context for all event types. If handler is not specified
- * then unregister all event handlers for the specified context and event name. If context is not specified then unregister all event handlers for the specified handler and event name.
- *
- * Examples: obj.off('change:name', handler, context); // unregister handler in context from listening 'change:name' event obj.off(null, null, context); // unregister all event handlers for the
- * specified context obj.off(); // unregister all event handlers
- */
- off: function off(eventName, handler, context) {
- var getEvents = function getEvents(evName, self) {
- var events = self._events;
- if (!evName) {
- return events;
- }
- var parts = evName.split(':');
- events = {};
- events[parts[0]] = self._events[parts[0]];
- if (parts.length > 1 && parts[1] !== '*') {
- events[evName] = self._events[evName];
- } else if (parts.length > 1 && parts[1] === '*') {
- for (var name in self._events) {
- if (name.indexOf(parts[0] + ':') === 0) {
- events[name] = self._events[name];
- }
- }
- }
- return events;
- };
- var events = getEvents(eventName, this);
- for (var name in events) {
- var i = 0,
- handlers = events[name];
- if (!handlers) {
- continue;
- }
- while (i < handlers.length) {
- if ((handlers[i].handler === handler || !handler) && (handlers[i].context === context || !context)) {
- handlers.splice(i, 1);
- } else {
- i++;
- }
- }
- }
- },
- /**
- * Triggers an event
- */
- trigger: function trigger(eventName, event) {
- var parts = eventName.split(':');
- var handlers = [].concat(this._events['all'] || []).concat(this._events[parts[0]] || []);
- if (parts.length > 1) {
- handlers = handlers.concat(this._events[eventName] || []);
- }
- for (var i = 0; i < handlers.length; i++) {
- if (typeof handlers[i].handler === 'function') {
- handlers[i].handler.call(handlers[i].context, event, eventName);
- }
- }
- }
- });
- // alias
- Events.prototype.emit = Events.prototype.trigger;
- //
- return Events;
- });
- //# sourceMappingURL=Events.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2012, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *
- * borrowed from cclcore.
- * Common bidi javascript library - BidiUtils.
- * Singleton containing useable bidi methods.
- */
- /**
- * This module contains a subset of BidiUtils from cclcore with some
- * modifications to meet gemini's requirements for BiDi text. Elements passed
- * in to the methods of this module is expected to contain only a single text
- * node such as <div contenteditable> or <input> elements
- */
- define('baglass/core-client/js/core-client/utils/BidiUtil',[], function () {
- 'use strict';
- var AUTO = 'auto',
- arabicLocales = {
- 'General Info': {
- 'Generated from': 'CLDR Version: 30.0.3',
- 'Generated by': 'BDL CLDR Reader Tool',
- 'Date': '16-03-17 12:40:12'
- },
- 'Arabic Default Numbering Systems': {
- 'ar': 'arab',
- 'ar_AE': 'arab',
- 'ar_BH': 'arab',
- 'ar_DJ': 'arab',
- 'ar_DZ': 'latn',
- 'ar_EG': 'arab',
- 'ar_EH': 'latn',
- 'ar_ER': 'arab',
- 'ar_IL': 'arab',
- 'ar_IQ': 'arab',
- 'ar_JO': 'arab',
- 'ar_KM': 'arab',
- 'ar_KW': 'arab',
- 'ar_LB': 'arab',
- 'ar_LY': 'latn',
- 'ar_MA': 'latn',
- 'ar_MR': 'arab',
- 'ar_OM': 'arab',
- 'ar_PS': 'arab',
- 'ar_QA': 'arab',
- 'ar_SA': 'arab',
- 'ar_SD': 'arab',
- 'ar_SO': 'arab',
- 'ar_SS': 'arab',
- 'ar_SY': 'arab',
- 'ar_TD': 'arab',
- 'ar_TN': 'latn',
- 'ar_YE': 'arab'
- }
- },
- cldrData = arabicLocales['Arabic Default Numbering Systems'];
- var BidiUtil = function BidiUtil() {
- this._isIE = this._detectIE(navigator.userAgent);
- this.userPreferredTextDir = this._getUserPreferredTextDir() || AUTO;
- this.LRE = '\u202A';
- this.RLE = '\u202B';
- this.PDF = '\u202C';
- this.LRM = '\u200E';
- };
- BidiUtil.prototype._detectIE = function (useragent) {
- return (/\b(MSIE|Trident|Edge)\b/.test(useragent)
- );
- };
- // Private Methods
- // Should not need to call these methods outside this module. Although real
- // encapsulation is possible, defining as part of BidiUtil's prototype allows
- // unit testing and faster scope chain access from public methods
- /**
- * Gets the user's preferred text direction from <html> attribute passed in
- * from server-side and stores it as member of this singleton as userPreferredTextDir
- * @return {string} User's preferred text direction (i.e. ltr, rtl, auto)
- */
- BidiUtil.prototype._getUserPreferredTextDir = function () {
- if (!this.userPreferredTextDir) {
- this.userPreferredTextDir = document.documentElement.getAttribute('data-pref-text-dir');
- }
- return this.userPreferredTextDir;
- };
- /**
- * Normalizes the process of retrieving the value from <input> or <div contenteditable>
- * HTML elements
- * @param {Element|HTMLInputElement} element - DOM element receiving text input
- * @return {string} String value of the DOM element
- */
- BidiUtil.prototype._getNodeValue = function (element) {
- return element.value || element.tagName === 'INPUT' ? element.value : element.textContent;
- };
- /**
- * Normalizes the process of setting the value to <input> or <div contenteditable>
- * HTML elements
- * @param {Element|HTMLInputElement} element - DOM element receiving text input
- * @param {string} value - String value to be set to element
- */
- BidiUtil.prototype._setNodeValue = function (element, value) {
- if (element.value || element.tagName === 'INPUT') {
- element.value = value;
- } else {
- // setting the textContent removes any text of its child nodes
- element.textContent = value;
- }
- };
- /**
- * Checks if the character passed in is an Arabic character.
- * @param {string} charCode - Character code
- * @return {boolean} True, if character is an Arabic character
- */
- BidiUtil.prototype._isArabicChar = function (charCode) {
- if (charCode >= 0x0600 && charCode <= 0x0669 || charCode >= 0x06fa && charCode <= 0x07ff || charCode >= 0xfb50 && charCode <= 0xfdff || charCode >= 0xfe70 && charCode <= 0xfefc) {
- return true;
- }
- return false;
- };
- /**
- * Checks if the character passed in is a Hebrew character.
- * @param {string} charCode - Character code
- * @return {boolean} True, if character is a Hebrew character
- */
- BidiUtil.prototype._isHebrewChar = function (charCode) {
- if (charCode >= 0x05d0 && charCode <= 0x05ff) {
- return true;
- }
- return false;
- };
- /**
- * Checks if the character passed in is a BiDi character.
- * @param {number} charCode - Chracter code
- * @return {boolean} True, if the character is a BiDi (Arabic or Hebrew) character
- */
- BidiUtil.prototype._isBidiChar = function (charCode) {
- return this._isArabicChar(charCode) || this._isHebrewChar(charCode);
- };
- /**
- * Checks if the character passed in is a Latin character (Only treats
- * capital and lower case alphabets as latin characters)
- * @param {number} charCode - Character code
- * @return {boolean} True, if the character is a Latin character
- */
- BidiUtil.prototype._isLatinChar = function (charCode) {
- if (charCode > 64 && charCode < 91 || charCode > 96 && charCode < 123) {
- return true;
- }
- return false;
- };
- /**
- * Event handler for 'input' event (events causing the value of the target
- * element to change)
- * Resolves the base text direction and sets the dir attribute
- * @param {Event} event - DOM Event object
- */
- BidiUtil.prototype._handleInputEvent = function (event) {
- // NOTE: 'this' has been binded to be BidiUtil in _addBidiEventListeners function
- this._resolveDirAttr(event.target);
- };
- /**
- * Adds event listeners for events changing the value of the element being passed in
- * @param {Element|HTMLInputElement} element - DOM element receiving text input
- */
- BidiUtil.prototype._addBidiEventListeners = function (element) {
- if (!element._hasBidiEventListeners) {
- element._hasBidiEventListeners = true;
- var eventTypes = ['keyup', 'cut', 'paste'];
- for (var i = 0; i < eventTypes.length; ++i) {
- element.addEventListener(eventTypes[i], this._handleInputEvent.bind(this), false);
- }
- }
- };
- /**
- * Sets dir attribute of the DOM element passed in as parameter according to
- * the direction of the first strong character in the text content of the element
- * @param {Element|HTMLInputElement} element - DOM element receiving text input
- */
- BidiUtil.prototype._resolveDirAttr = function (element) {
- if (this._isIE && (this.userPreferredTextDir === AUTO || !this.userPreferredTextDir)) {
- // IE doesn't support dir="auto" HTML attribute
- var text = this._getNodeValue(element);
- element.dir = this.resolveBaseTextDir(text);
- } else {
- // Chrome, Safari, and Firefox supports dir="auto" HTML attribute
- // IE will only receive "ltr" or "rtl" in this block
- element.dir = this.userPreferredTextDir || AUTO;
- }
- };
- /**
- * This function determines the positions where we should insert the LRM marker for correct display
- * of Structured Text Value
- * @param str
- * @param isLocation
- * @returns array
- */
- BidiUtil.prototype._parseSTT = function (str, isLocation) {
- var delimiter = isLocation ? '>' : ':/@=[]\'<>';
- var segmentsPointers = [];
- var sp_len = 0,
- i;
- for (i = 0; i < str.length; i++) {
- if (delimiter.indexOf(str.charAt(i)) >= 0) {
- segmentsPointers[sp_len] = i;
- sp_len++;
- }
- }
- return segmentsPointers;
- };
- // Public Methods
- /**
- * Simply resolves the dir attribute of the HTML element and adds BiDi specific
- * event handlers if necessary
- * @param {Element|HTMLInputElement} element - DOM element receiving text input
- */
- BidiUtil.prototype.initElementForBidi = function (element) {
- if (element) {
- this._resolveDirAttr(element); // resolve dir attribute of the element
- if (this._isIE) {
- this._addBidiEventListeners(element);
- }
- }
- };
- /**
- * Enforces text direction by adding UCC (Unicode Control Characters)
- * @param {String} text - The text for which we should enforce text direction.
- * @returns string
- */
- BidiUtil.prototype.enforceTextDirection = function (text) {
- if (text) {
- var finalDir = this.resolveBaseTextDir(text);
- var finalValue = text;
- if (finalDir === 'ltr') {
- finalValue = this.LRE + finalValue + this.PDF;
- } else if (finalDir === 'rtl') {
- finalValue = this.RLE + finalValue + this.PDF;
- }
- return finalValue;
- }
- return text;
- };
- /**
- * Traverses the string passed in as parameter from the beginning and
- * determines the direction of the text based on the first strong character
- * @param {string} text - A bi-directional text
- * @param {bool} isTextArea - Does the text belong to a textarea
- * @return {string} Direction of the text
- */
- BidiUtil.prototype.resolveBaseTextDir = function (text, isTextArea) {
- var textDir = this.userPreferredTextDir;
- if (!textDir) {
- textDir = AUTO;
- }
- if (textDir === AUTO && (!isTextArea || this._isIE)) {
- for (var i = 0; text && i < text.length; i++) {
- var character = text.charCodeAt(i);
- if (this._isBidiChar(character)) {
- textDir = 'rtl';
- break;
- } else if (this._isLatinChar(character)) {
- textDir = 'ltr';
- break;
- }
- }
- if (this._isIE && textDir === AUTO) {
- textDir = '';
- }
- }
- return textDir;
- };
- /**
- * Enforces text direction for Structured Text value by adding UCC (Unicode Control Characters)
- * We should add an LRM before each segment and also we should enforce text direction of each segment
- * @param {String} text - The text for which we should enforce text direction.
- * @returns string
- */
- BidiUtil.prototype.enforceTextDirectionForSTT = function (text) {
- if (text) {
- text = this.removeMarkers(text);
- var isLocation = (text.match(/ > /g) || []).length > 0;
- var segmentsPointers = this._parseSTT(text, isLocation);
- var result = '';
- var n;
- var marker = this.LRM;
- var offset = isLocation ? 1 : 0;
- if (segmentsPointers.length === 0) {
- result = this.enforceTextDirection(text);
- } else {
- result = this.enforceTextDirection(text.substring(0, segmentsPointers[0] - offset));
- }
- for (var i = 0; i < segmentsPointers.length; i++) {
- n = segmentsPointers[i];
- if (n) {
- var endIndex = i < segmentsPointers.length - 1 ? segmentsPointers[i + 1] - offset : text.length;
- var segment = text.substring(n + 1 + offset, endIndex);
- result = result + marker + text.substring(n - offset, n + offset + 1) + this.enforceTextDirection(segment);
- }
- }
- return result;
- }
- return text;
- };
- /**
- * Enforces text direction for Structured Text value by adding UCC (Unicode Control Characters)
- * We should add an LRM before each segment and also we should enforce text direction of each segment
- * @param {String} text - The text for which we should enforce text direction.
- * @returns string
- */
- BidiUtil.prototype.enforceTextDirectionForLocation = function (text) {
- return this.enforceTextDirectionForSTT(text);
- };
- /**
- * Removes all the markers from the text
- * @param {String} text - The text
- * @returns string
- */
- BidiUtil.prototype.removeMarkers = function (text) {
- return text.replace(/[\u202A\u202B\u202C\u200E]/g, '');
- };
- BidiUtil.prototype._isArabicLocale = function (locale) {
- return locale.match(/^ar[-_].*$/i);
- };
- BidiUtil.prototype._useLatinNums = function (locale) {
- if (!this._isArabicLocale(locale)) {
- return true;
- }
- return cldrData[locale] && cldrData[locale] === 'latn';
- };
- /**
- * Enforces numeric shaping for the given string
- * @param {Object} text to be wrapped. Can be number or string object.
- * @param {bool} isContextual. Should enforce contextual numeric shaping.
- * @returns {string}
- */
- BidiUtil.prototype.enforceNumericShaping = function (text, isContextual) {
- if (this.bidiSupport && this.userPreferredContentLocale.startsWith('ar') && (typeof text === 'number' || typeof text === 'string')) {
- var segmentDir = this.userPreferredTextDir;
- if (this.userPreferredTextDir === AUTO) {
- segmentDir = this.resolveBaseTextDir(text);
- }
- var locale = typeof navigator === 'undefined' ? '' : navigator.language || navigator.userLanguage || '';
- locale = locale.replace('-', '_');
- var finalText = text;
- if (typeof text === 'number') {
- finalText = text.toString();
- }
- var pattern = /([0-9])|([\u0660-\u0669])|([\u0590-\u05FF\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FF\u0750-\u077F\u08A0-\u08E3\u200F\u202B\u202E\u2067\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFC\uFDFE-\uFDFF\uFE70-\uFEFE]+)|([^0-9\u0590-\u05FF\u0660-\u0669\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FF\u0750-\u077F\u08A0-\u08E3\u200F\u202B\u202E\u2067\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFC\uFDFE-\uFDFF\uFE70-\uFEFE\u0600-\u0607\u0609-\u060A\u060C\u060E-\u061A\u064B-\u066C\u0670\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u08E4-\u08FF\uFD3E-\uFD3F\uFDD0-\uFDEF\uFDFD\uFEFF\u0000-\u0040\u005B-\u0060\u007B-\u007F\u0080-\u00A9\u00AB-\u00B4\u00B6-\u00B9\u00BB-\u00BF\u00D7\u00F7\u02B9-\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u02FF\u2070\u2074-\u207E\u2080-\u208E\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A-\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189\uA720-\uA721\uA788\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE]+)/g; // eslint-disable-line no-control-regex
- var self = this;
- return finalText.replace(pattern, function (curChs, latNum, araNum, rtlChs, ltrChs) {
- if (araNum) {
- if (isContextual && segmentDir === 'ltr' || !isContextual && self._useLatinNums(locale)) {
- return araNum.charCodeAt(0) - 1632;
- } else {
- return araNum;
- }
- } else if (latNum) {
- if (isContextual && segmentDir === 'rtl' || !isContextual && !self._useLatinNums(locale)) {
- return String.fromCharCode(parseInt(latNum) + 1632);
- } else {
- return latNum;
- }
- } else if (rtlChs) {
- segmentDir = 'rtl';
- } else if (ltrChs) {
- segmentDir = 'ltr';
- }
- return curChs;
- });
- }
- return text;
- };
- /**
- * Sets the text dir user preference
- * @param {String} textDir - The text direction user preference.
- * @param {String} bidiSupport - Is Bidi support enabled ?
- */
- BidiUtil.prototype.setUserPreferredTextDir = function (textDir, bidiSupport) {
- this.userPreferredTextDir = '';
- this.bidiSupport = false;
- if (bidiSupport === 'true') {
- this.userPreferredTextDir = textDir.toLowerCase();
- this.bidiSupport = true;
- }
- };
- /**
- * Sets the content locale user preference
- * @param {String} contentLocale - The content locale user preference.
- */
- BidiUtil.prototype.setUserPreferredContentLocale = function (contentLocale) {
- this.userPreferredContentLocale = contentLocale;
- };
- return new BidiUtil();
- });
- //# sourceMappingURL=BidiUtil.js.map
- //# sourceMappingURL=BidiUtil.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2014, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule
- * Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/dom-utils',[], function () {
- 'use strict';
- return {
- getAncestorOfClass: function getAncestorOfClass(node, className) {
- var doc = document;
- while (node && node !== doc) {
- if (node.className.split(' ').indexOf(className) >= 0) {
- return node;
- }
- node = node.parentNode;
- }
- return null;
- },
- isTouchEvent: function isTouchEvent(ev) {
- return ev.type.indexOf('touch') === 0;
- },
- isPointerTouch: function isPointerTouch(ev) {
- return ev.gesture && ev.gesture.pointerType === 'touch';
- },
- isMultiTouchEvent: function isMultiTouchEvent(ev) {
- var oev = ev.originalEvent || ev;
- if (oev && oev.touches && oev.touches.length > 1) {
- return true;
- }
- return false;
- },
- isGesture: function isGesture(ev) {
- if (ev.gesture && ev.gesture.touches && ev.gesture.touches.length > 0) {
- return true;
- }
- return false;
- },
- getEventPos: function getEventPos(ev) {
- var pageValuesValid = function pageValuesValid(event) {
- return event && (event.pageX || event.pageX === 0) && (event.pageY || event.pageY === 0);
- };
- var pos;
- if (this.isGesture(ev)) {
- var touches = ev.gesture.touches[0];
- if (pageValuesValid(touches)) {
- pos = {
- pageX: touches.pageX,
- pageY: touches.pageY
- };
- }
- }
- if (!pos && this.isTouchEvent(ev)) {
- var oev = ev.originalEvent || ev;
- if (oev && oev.touches.length > 0 && pageValuesValid(oev.touches[0])) {
- pos = { pageX: oev.touches[0].pageX, pageY: oev.touches[0].pageY };
- }
- }
- if (!pos && pageValuesValid(ev)) {
- pos = { pageX: ev.pageX, pageY: ev.pageY };
- }
- if (!pos && pageValuesValid(ev.originalEvent)) {
- pos = { pageX: ev.originalEvent.pageX, pageY: ev.originalEvent.pageY };
- }
- if (!pos) {
- // could not find any valid numbers so return zero. Returning undefined values breaks some other code.
- pos = { pageX: 0, pageY: 0 };
- }
- return pos;
- },
- getEventTarget: function getEventTarget(ev) {
- if (this.isTouchEvent(ev)) {
- var oev = ev.originalEvent || ev;
- if (oev && oev.touches.length > 0) {
- return oev.touches[0].target;
- }
- }
- return ev.target;
- },
- withinElementBoundaries: function withinElementBoundaries(event, node) {
- var pos = this.getEventPos(event);
- var boundingRect = node.getBoundingClientRect();
- var inXRange = pos.pageX >= boundingRect.left && pos.pageX <= boundingRect.right;
- var inYRange = pos.pageY >= boundingRect.top && pos.pageY <= boundingRect.bottom;
- return inXRange && inYRange;
- }
- };
- });
- //# sourceMappingURL=dom-utils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2014, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *
- * Drag-and-Drop Manager
- */
- define('baglass/core-client/js/core-client/utils/dnd/DnDManager',['jquery', 'underscore', '../../ui/core/Class', '../dom-utils'], function ($, _, Class, utils) {
- 'use strict';
- var DnDManager = null;
- DnDManager = Class.extend({
- dropTargets: null,
- currentDropTarget: null,
- init: function init() {
- this.dropTargets = [];
- this.currentDropTarget = {};
- // Add the dialog blocker as a default drop zone to swallow and ignore any drop that happens on the backdrop
- this.addDropTarget($('body')[0], '.dialogBlocker', {
- accepts: function accepts() {
- return true;
- }
- });
- },
- // Utility method that subscribes to the specified jQuery event
- // and returns removable object, that can be inserted into the 'owned' collections
- // of subscriptions
- //
- on: function on($el, types, selector, data, fn) {
- $el.on(types, selector, data, fn);
- return {
- remove: function remove() {
- $el.off(types, selector, fn);
- }
- };
- },
- /**
- * Register a drop Zone with the drag and drop manage
- *
- *
- * @param el - The drop zone element.
- * @param selector - Selector to identify the drop zone sub regions. If not specified, there will only be one region which is the drop zone element.
- * @param callbacks
- * callbacks.accepts(dragObject) - Called to check if the dropzone accepts the payload.
- * callbacks.onDragStart() - Called when a drag starts
- * callbacks.onDragEnd() - Called when a drag ends
- * callbacks.onDragEnter(dragObject, dropNode) - Called when we enter a drop zone
- * callbacks.onDragMove(dragObject, dropNode) - Called when we move inside a drop zone
- * callbacks.onDragLeave(dragObject, dropNode) - Called when we leave a drop zone
- * callbacks.onDrop(dragObject, dropNode) - Called when a drop occurs.
- * @returns {___anonymous1282_1365}
- */
- addDropTarget: function addDropTarget(el, selector, callbacks) {
- if (typeof selector !== 'string') {
- callbacks = selector;
- selector = null;
- }
- this.removeDropTarget(el);
- this.dropTargets.push({
- el: el,
- selector: selector,
- callbacks: callbacks
- });
- return {
- remove: function () {
- this.removeDropTarget(el);
- }.bind(this)
- };
- },
- /**
- * Remove a registered drop target
- * @param el
- */
- removeDropTarget: function removeDropTarget(el) {
- var target = _.find(this.dropTargets, function (t) {
- return t.el === el;
- });
- if (target) {
- this.dropTargets.splice(_.indexOf(this.dropTargets, target), 1);
- }
- },
- _isScrollDropSupported: function _isScrollDropSupported() {
- return this.currentDropTarget.target && this.currentDropTarget.target.callbacks.isScrollDropSupported ? true : false;
- },
- /**
- *
- * Check if the intention is scrolling and return the proper scrolling enabled drop zone.
- * If we are dragging outside of the view port, the intention is to auto scroll. In this case we do the following:
- * - if we have a drop zone, find the closest scrollable drop zone in the ancestors.
- * - if there is no drop zone, select the last scrollable drop zone that was used.
- *
- * If we are dragging within the view and we have no drop zone, find the closest scrolling drop zone using the last drop target that was used.
- * @param target
- * @param isScrollDropSupported
- * @param pos - current mouse position
- *
- * @returns the target or empty object.
- */
- _validateDropTarget: function _validateDropTarget(target, isScrollDropSupported, pos) {
- var foundTarget = target;
- if (isScrollDropSupported) {
- if (pos.x + 1 >= $(window).innerWidth() || pos.y + 1 >= $(window).height() || pos.x <= 1 || pos.y <= 1) {
- // dragging outside of the viewport.. most likely the intent is to auto scroll a drop zone
- if (foundTarget) {
- foundTarget = this._getClosestTargetWithScrollSupport(foundTarget.node);
- } else {
- foundTarget = this.lastActiveScrollableTarget;
- }
- }
- if (!foundTarget && this.currentDropTarget) {
- foundTarget = this._getClosestTargetWithScrollSupport(this.currentDropTarget.node);
- }
- }
- return foundTarget || {};
- },
- /**
- * Scan the list containing the ancestors + self and return the first drop zone that suppports scrolling.
- *
- * @param dropTargetNode - the node of the drop target where to start the search
- *
- */
- _getClosestTargetWithScrollSupport: function _getClosestTargetWithScrollSupport(dropTargetNode) {
- var parentsAndSelf = $(dropTargetNode).parents();
- parentsAndSelf.splice(0, 0, dropTargetNode);
- var target = null;
- for (var i = 0; i < parentsAndSelf.length; i++) {
- target = this._getDropTargetWithScrollSupport(parentsAndSelf[i]);
- if (target) {
- this.lastActiveScrollableTarget = target;
- break;
- }
- }
- return target;
- },
- /**
- * Find the drop zone that support scrolling where the node match the given node parameter
- *
- * @param targetNode - node to match with the drop zone node.
- *
- */
- _getDropTargetWithScrollSupport: function _getDropTargetWithScrollSupport(targetNode) {
- var foundTarget = null;
- var dropTarget = _.find(this.dropTargets, function (target) {
- var $elements = $(target.el);
- if (target.selector) {
- $elements = $elements.find(target.selector);
- }
- return _.find($elements, function (node) {
- return node === targetNode && target.callbacks.isScrollDropSupported && (!target.callbacks.accepts || target.callbacks.accepts(this.dragObject));
- }.bind(this));
- }.bind(this));
- if (dropTarget) {
- foundTarget = {
- target: dropTarget,
- node: targetNode
- };
- }
- return foundTarget;
- },
- /**
- * Helper method that gets the current drop target from a position
- * @param pos
- * @param options -- options passed by the called when the startDrag method is called
- * @returns {Object} - drop target
- */
- getDropTargetFromPos: function getDropTargetFromPos(pos, options) {
- var isScrollDropSupported = options && !options.disableScrollableDropZoneSupport;
- var foundTarget = null;
- var foundTargetArea = 0;
- var foundTargetPriority = 0;
- var nonActiveDropZones = [];
- _.each(this.dropTargets, function (target) {
- var $elements = $(target.el);
- if (target.selector) {
- $elements = $elements.find(target.selector);
- }
- _.each($elements, function (node) {
- var info = this.getTargetMatchInformation(pos, node, target, foundTarget, foundTargetArea, foundTargetPriority);
- if (info.isMatch) {
- if (!target.callbacks.accepts || target.callbacks.accepts(this.dragObject)) {
- foundTarget = {
- target: target,
- node: node
- };
- foundTargetArea = info.area;
- foundTargetPriority = info.priority;
- } else if (target.callbacks.receiveEventsWhenNotAccepting) {
- nonActiveDropZones.push({
- target: target,
- node: node
- });
- }
- }
- }.bind(this));
- }.bind(this));
- foundTarget = this._validateDropTarget(foundTarget, isScrollDropSupported, pos);
- if (foundTarget) {
- foundTarget.nonActiveDropZones = nonActiveDropZones;
- }
- return foundTarget || {};
- },
- /**
- * Return true if val is between lowerBound and (lowerBound + rangeSize).
- */
- _isInRange: function _isInRange(val, lowerBound, rangeSize) {
- return val >= lowerBound && val < lowerBound + rangeSize;
- },
- /**
- * return the priority set for target or 0.
- */
- _getPriority: function _getPriority(target) {
- var priority = target.callbacks.priority;
- if (typeof priority === 'function') {
- priority = priority();
- }
- return priority || 0;
- },
- /**
- * Helper function used by getDropTargetFromPos to decide if a drop target is found or not using the current mouse position
- */
- getTargetMatchInformation: function getTargetMatchInformation(pos, node, target, foundTarget, foundTargetArea, foundTargetPriority) {
- var matchInformation = {};
- var $el = $(node);
- var bounds = node.getBoundingClientRect();
- var isVisible = $el.is(':visible');
- if (isVisible) {
- var xInRange = this._isInRange(pos.x, bounds.left, bounds.width);
- var yInRange = this._isInRange(pos.y, bounds.top, bounds.height);
- if (xInRange && yInRange) {
- matchInformation = {
- area: bounds.width * bounds.height,
- priority: this._getPriority(target)
- };
- matchInformation.isMatch = !foundTarget || matchInformation.priority > foundTargetPriority || foundTargetArea > matchInformation.area && matchInformation.priority >= foundTargetPriority;
- }
- }
- return matchInformation;
- },
- /**
- * Helper method that gets the current drop target from a node
- * @param pos
- * @returns {Object} - drop target
- */
- getDropTargetFromNode: function getDropTargetFromNode(node) {
- var target = null;
- for (var i = 0; i < this.dropTargets.length; i++) {
- if (node === this.dropTargets[i].el) {
- target = this.dropTargets[i];
- break;
- }
- }
- return target;
- },
- dragObject: null,
- /**
- * Called to start dragging
- * @param options
- * options.event ev - the event used to start the drag. e.g. mousedown, touchstart
- * options.type - The type of the data being dropped.
- * options.data - The data being dropped.
- * options.avatar - the avatar node associated with the drag and drop operation
- * options.avatarXOffset - the number of pixel added to the avatar left position
- * options.avatarYOffset - the number of pixel added to the avatar top position
- * options.restrictToXAxis - restrict moving on the x axis
- * options.restrictToYAxis - restrict moving on the y axis
- *
- * options.callerCallbacks
- * callerCallback.onDragStart(event, {dragObject}) - Called when the drag is started.
- * callerCallback.onMove(event, {dragObject, dropNode}) - Called on every move event.
- * callerCallback.onDragDone(event, {dragObject, dropNode, isDropped}) - Called when the drag is complete, whether we droppped or not.
- *
- * options.moveXThreshold - the number of pixel to move on the X axis before we allow the drag to start. A good example to use this is
- * when want to enable a drag horizontally and still allow vertical scrolling/panning. In this case, we would set the moveXThreshold to something like 30.
- * This will allow vertical scroll as long as we don't drag horizontally more that 30 pixels.
- *
- * options.moveYThreshold - the number of pixel to move on the Y axis before we allow the drag to start.
- *
- * @param moveThreshold - distance in pixel that will activate the move and the avatar
- */
- startDrag: function startDrag(options) {
- if (this.dragObject) {
- // cannot start another drag operation until the previous one is finished
- return;
- }
- $('body').addClass('preventSelection');
- this.isDragStartCalled = false;
- this.targetMap = {};
- var isTouch = utils.isTouchEvent(options.event);
- this.dragObject = {
- type: options.type,
- data: options.data,
- avatar: options.avatar,
- isTouch: isTouch || options.event.gesture !== undefined
- };
- var eventPos = utils.getEventPos(options.event);
- this.dragObject.startPosition = {
- x: eventPos.pageX,
- y: eventPos.pageY
- };
- this.setAvatar(options.avatar, options);
- this.callerCallbacks = options.callerCallbacks ? options.callerCallbacks : {};
- var $target = $(window);
- if (isTouch) {
- $target = $(utils.getEventTarget(options.event));
- }
- this.attachedMoveHandler = this.on($target, 'mousemove touchmove', this.moveHandler.bind(this, options));
- this.attachedUpHandler = this.on($target, 'mouseup touchend touchcancel', this.upHandler.bind(this));
- if (options.event.type === 'mousedown') {
- this.attachedScrollHandler = this.on($(options.event.target), 'scroll', this.scrollHandler.bind(this));
- }
- if (options.currentDropZoneNode) {
- var target = this.getDropTargetFromNode(options.currentDropZoneNode);
- if (target) {
- this.currentDropTarget = {
- target: target,
- node: options.currentDropZoneNode
- };
- }
- }
- },
- scrollHandler: function scrollHandler() /* event */{
- // we are scrolling, do not track movement
- // cancel drag
- // IE does not fire mouseUp on scrollbar so drag move continues after releasing the mouse when it should not
- this.resetDragging();
- },
- _setAvatarPosition: function _setAvatarPosition(options) {
- if (this.avatar && this.dragObject.position) {
- if (!this.avatar.parentNode) {
- $('body').append(this.avatar);
- }
- var xOffset = options && options.avatarXOffset ? options.avatarXOffset : 1;
- var yOffset = options && options.avatarYOffset ? options.avatarYOffset : 1;
- $(this.avatar).css({
- left: this.dragObject.position.x + xOffset + 'px',
- top: this.dragObject.position.y + yOffset + 'px'
- });
- }
- },
- setAvatar: function setAvatar(avatar, options) {
- this.avatar = avatar;
- this._setAvatarPosition(options);
- },
- /**
- * Move event main handler
- * @param options - drag options
- * @param ev
- */
- moveHandler: function moveHandler(options, ev) {
- //Always prevent the default behavior on drag move to prevent chrome auto scrolling
- ev.preventDefault();
- var eventPos = utils.getEventPos(ev);
- var dx = eventPos.pageX;
- var dy = eventPos.pageY;
- this.dragObject.position = {
- x: dx,
- y: dy
- };
- if (options.restrictToXAxis) {
- this.dragObject.position.y = this.dragObject.startPosition.y;
- }
- if (options.restrictToYAxis) {
- this.dragObject.position.x = this.dragObject.startPosition.x;
- }
- if (!this.isDragStartCalled && this._isThresholdNotMet(options)) {
- return;
- }
- this._setAvatarPosition(options);
- var dropTarget = this.getDropTargetFromPos(this.dragObject.position, options);
- this._callStartDrag(ev);
- this._callMove(dropTarget, ev);
- this._processCallbacks(dropTarget);
- // Don't stop the propagation. This will interfere with hammer gestures like tap and hold.
- // If there is an active tap/hold handlers, hammer needs to know when there is a move.
- },
- _processCallbacks: function _processCallbacks(dropTarget) {
- var currentNonActiveDropZones = this.currentDropTarget.nonActiveDropZones;
- // Process the callback for the active drop zone that accepted the drop
- if (dropTarget.target !== this.currentDropTarget.target || dropTarget.node !== this.currentDropTarget.node) {
- this._dropTargetCallback(this.currentDropTarget, 'onDragLeave');
- this.currentDropTarget = dropTarget;
- this._dropTargetCallback(this.currentDropTarget, 'onDragEnter');
- } else {
- this._dropTargetCallback(this.currentDropTarget, 'onDragMove');
- }
- // Process callback for drop zone that didn't accept but chose to receive the event anyway
- this._processCallbacksForNonActiveDropzones(dropTarget.nonActiveDropZones, currentNonActiveDropZones);
- },
- _processCallbacksForNonActiveDropzones: function _processCallbacksForNonActiveDropzones(newDropZones, oldDropZones) {
- _.each(newDropZones, function (dropZone) {
- if (this._isDropZoneInArray(dropZone, oldDropZones)) {
- this._dropTargetCallback(dropZone, 'onDragMove');
- } else {
- this._dropTargetCallback(dropZone, 'onDragEnter');
- }
- }.bind(this));
- if (oldDropZones) {
- _.each(oldDropZones, function (dropZone) {
- if (!this._isDropZoneInArray(dropZone, newDropZones)) {
- this._dropTargetCallback(dropZone, 'onDragLeave');
- }
- }.bind(this));
- }
- this.currentDropTarget.nonActiveDropZones = newDropZones;
- },
- _dropTargetCallback: function _dropTargetCallback(dropTarget, callbackName) {
- if (dropTarget.target && dropTarget.target.callbacks[callbackName]) {
- dropTarget.target.callbacks[callbackName](this.dragObject, dropTarget.node);
- return true;
- }
- return false;
- },
- _isDropZoneInArray: function _isDropZoneInArray(dropZone, dropZoneArray) {
- var found = false;
- if (dropZoneArray) {
- for (var i = 0; i < dropZoneArray.length; i++) {
- if (dropZone.target === dropZoneArray[i].target) {
- found = true;
- break;
- }
- }
- }
- return found;
- },
- _isThresholdNotMet: function _isThresholdNotMet(options) {
- var hasThreshold = options.moveXThreshold || options.moveYThreshold;
- var isXThresholdNotMet = !options.moveXThreshold || options.moveXThreshold > Math.abs(this.dragObject.position.x - this.dragObject.startPosition.x);
- var isYThresholdNotMet = !options.moveYThreshold || options.moveYThreshold > Math.abs(this.dragObject.position.y - this.dragObject.startPosition.y);
- return hasThreshold && isXThresholdNotMet && isYThresholdNotMet;
- },
- _callMove: function _callMove(dropTarget, ev) {
- if (this.callerCallbacks.onMove) {
- this.callerCallbacks.onMove(ev, {
- dragObject: this.dragObject,
- dropTargetNode: dropTarget.node
- });
- }
- },
- _callStartDrag: function _callStartDrag(ev) {
- if (this.callerCallbacks.onDragStart && !this.isDragStartCalled) {
- this.callerCallbacks.onDragStart(ev, { dragObject: this.dragObject });
- _.each(this.dropTargets, function (target) {
- if (target.callbacks.onDragStart) {
- target.callbacks.onDragStart(this.dragObject);
- }
- }.bind(this));
- }
- $('body').addClass('dragging');
- this.isDragStartCalled = true;
- },
- /**
- * mouseup/touchend main handler
- *
- * @param ev
- */
- upHandler: function upHandler(ev) {
- if (this.isDragStartCalled) {
- var isDropped = false;
- $('body').removeClass('dragging');
- var dropTarget = this.currentDropTarget;
- if (this._dropTargetCallback(dropTarget, 'onDrop')) {
- isDropped = true;
- }
- if (this.callerCallbacks.onDragDone) {
- this.callerCallbacks.onDragDone(ev, {
- dragObject: this.dragObject,
- dropTargetNode: isDropped ? dropTarget.node : null,
- isDropped: isDropped
- });
- }
- if (dropTarget.nonActiveDropZones) {
- _.each(dropTarget.nonActiveDropZones, function (dropZone) {
- this._dropTargetCallback(dropZone, 'onDrop');
- }.bind(this));
- }
- _.each(this.dropTargets, function (target) {
- if (target.callbacks.onDragEnd) {
- target.callbacks.onDragEnd(this.dragObject);
- }
- }.bind(this));
- }
- this.resetDragging();
- // Don't stop the propagation. This will interfere with hammer gestures like tap and hold.
- // If there is an active tap/hold handlers, hammer needs to know when the touch ends.
- },
- resetDragging: function resetDragging() {
- // Release the capture that we set in the mouse down.
- // This is used to allow IE to keep firing the mouse event when the mouse leaves the window or iframe
- if (document.releaseCapture) {
- document.releaseCapture();
- }
- if (this.attachedMoveHandler) {
- this.attachedMoveHandler.remove();
- }
- if (this.attachedUpHandler) {
- this.attachedUpHandler.remove();
- }
- if (this.attachedScrollHandler) {
- this.attachedScrollHandler.remove();
- }
- $('body').removeClass('preventSelection');
- this.currentDropTarget = {};
- this.dragObject = null;
- this.isDragStartCalled = false;
- this.targetMap = null;
- this.lastActiveScrollableTarget = null;
- $(this.avatar).remove();
- }
- });
- return new DnDManager();
- });
- //# sourceMappingURL=DnDManager.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2014, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule
- * Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/EventHelper',['jquery', './BidiUtil', './dnd/DnDManager', 'underscore', 'hammerjs', 'jquery.hammer'], function ($, BidiUtil, DnDManager, _, hammer) {
- // Setup jquery to create a hammer instance when we use hammer events.
- var hammerGestures = [];
- for (var name in hammer.gestures) {
- if (hammer.gestures.hasOwnProperty(name)) {
- hammerGestures.push(hammer.gestures[name].name);
- }
- }
- var hammerDefaultOptions = {
- 'prevent_mouseevents': true,
- 'stop_browser_behavior': false
- };
- $.each(hammerGestures, function (index, name) {
- $.event.special[name] = {
- setup: function setup() {
- var $el = $(this);
- var inst = $el.data('hammer');
- if (!inst) {
- // create hammer instance with default values
- $el.hammer(hammerDefaultOptions);
- }
- }
- };
- });
- /**
- * A jQuery function that can be used to attach the onClick event handler. This function will also attach the touch events required for touch devices to avoid the delay caused by simulated mouse
- * events
- */
- $.fn.onClick = function (handler) {
- this.on('click', function (e) {
- handler(e);
- }).on('tap', function (e) {
- handler(e);
- // prevent the simulated clicks on touch devices
- e.gesture.preventDefault();
- });
- return this;
- };
- // Get the box style to be applied to the inline editor
- var getInlineEditBoxStyles = function getInlineEditBoxStyles($text, options) {
- var cssProps = ['padding-top', 'padding-right', 'padding-bottom', 'padding-left', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-top-color', 'border-top-style', 'border-top-width', 'border-right-color', 'border-right-style', 'border-right-width', 'border-left-color', 'border-left-style', 'border-left-width', 'position', 'top', 'right', 'left', 'bottom', 'height', 'width', 'min-height', 'min-width', 'max-height', 'max-width'];
- var cssValues = $text.css(cssProps);
- // We don't want to set a zero height and width
- if (cssValues.height === '0px') {
- delete cssValues.height;
- }
- if (cssValues.width === '0px') {
- delete cssValues.width;
- }
- // Set the maximum width to strech with the parent
- if (options && options.maxSizeNode) {
- var $node = $(options.maxSizeNode);
- var width = options.maxSizeNode.style.width;
- if (width) {
- cssValues['max-width'] = '100%';
- delete cssValues.width;
- } else {
- cssValues['max-width'] = $node.width() + 'px';
- }
- }
- return cssValues;
- };
- // Get the css styles to be applied to the inline editor input element
- var getInlineEditStyles = function getInlineEditStyles($text) {
- var textCss = {
- width: '0px',
- 'min-width': $text.css('fontSize')
- };
- // Get the text alignment and apply it to the text input
- var textAlignment = $text.css('text-align');
- if (textAlignment === 'center') {
- textCss['margin'] = '0px auto';
- } else if (textAlignment === 'right') {
- textCss['margin'] = '0px 0px 0px auto';
- }
- return textCss;
- };
- // Get the text css style to be applied to the inline editor
- var getInlineEditTextStyles = function getInlineEditTextStyles($text) {
- return $text.css(['fontSize', 'fontFamily', 'fontWeight', 'letterSpacing', 'color']);
- };
- var _addInlineEditHandlers = function _addInlineEditHandlers($text, fCallback, options) {
- var $inlineEdit = $text._$inlineEdit;
- $text._updateWidth = function () {
- if ($inlineEdit) {
- var value = $inlineEdit.val() || '';
- if (value !== $inlineEdit._hidden.text()) {
- $inlineEdit._hidden.text(value);
- $inlineEdit.width($inlineEdit._hidden.width() + 2);
- }
- }
- };
- $text._inlineEditChangedFn = function () {
- var sText = $inlineEdit.val().trim();
- if (sText.length === 0 && options.noEmptyText) {
- sText = $text._previousInlineText;
- }
- $inlineEdit.removeClass('inlineText').off('keypress').off('keydown').off('blur');
- var invokeCallback = false;
- if ($text._previousInlineText !== sText) {
- invokeCallback = true;
- }
- $text._previousInlineText = null;
- $inlineEdit._hidden.remove();
- $inlineEdit._hidden = null;
- $inlineEdit.off();
- $inlineEdit.hide();
- $inlineEdit.parent().remove();
- $inlineEdit = null;
- $text._$inlineEdit = null;
- $text.text(sText);
- $text.removeClass('inEditMode');
- $text.show().focus();
- if (invokeCallback) {
- fCallback(sText);
- }
- var onEditEnd = options && options.onEditEnd;
- if (onEditEnd) {
- onEditEnd();
- }
- }.bind($text);
- var sText = $text.text();
- $text._previousInlineText = sText; // keep a back up of the current string
- if (!$inlineEdit) {
- $text.addClass('inEditMode');
- // Create a container node that will inherit the text container properties
- // like margin, padding, border and position
- var $inlineEditContainer = $('<div>', {
- 'class': 'inlineEditContainer'
- });
- $inlineEditContainer.css(getInlineEditBoxStyles($text, options));
- $text.after($inlineEditContainer);
- $inlineEdit = $('<input>', {
- 'class': 'inlineText'
- });
- $inlineEdit.css('max-width', '100%');
- $inlineEdit.css(getInlineEditStyles($text));
- var cssValues = getInlineEditTextStyles($text);
- $inlineEdit.css(cssValues);
- $inlineEditContainer.append($inlineEdit);
- $text._$inlineEdit = $inlineEdit;
- $inlineEdit.val(sText);
- $inlineEdit._hidden = $('<div style="white-space:pre; top:-999px; left:-999px; position:absolute;"></div>');
- $inlineEdit._hidden.css(cssValues);
- $text.hide();
- $text.after($inlineEdit._hidden);
- $inlineEdit.on('keyup keydown input propertychange change', function () {
- $text._updateWidth();
- });
- if (options && options.style) {
- $inlineEdit.css(options.style);
- }
- $text._updateWidth();
- $inlineEdit.on('blur', $text._inlineEditChangedFn).on('keypress', function (e) {
- if (e.keyCode === 13) {
- $text._inlineEditChangedFn();
- }
- }).on('keyup', function (e) {
- //stop propagation for delete key
- if (e.keyCode === 46 || e.keyCode === 8) {
- e.stopPropagation();
- }
- }).on('keydown', function (e) {
- // stop the arrow keys from bubbling when in edit mode. Fix for when editing the name of a tab.
- if (e.keyCode === 37 || e.keyCode === 39) {
- e.stopPropagation();
- }
- }).on('mousedown mouseup dblclick', function (e) {
- // cancel the mouse down, up and double click to allow the user to interact with the text
- e.stopPropagation();
- });
- BidiUtil.initElementForBidi($inlineEdit[0]);
- $inlineEdit.show();
- } else {
- $inlineEdit.val(sText);
- }
- $inlineEdit.focus();
- $inlineEdit[0].setSelectionRange(0, 9999); //needed for selecting on ios
- return false;
- };
- /**
- * Turns an div element into an inline edit control
- */
- $.fn.inlineEditor = function (action, options) {
- if (action === 'remove') {
- if (this._$inlineEdit) {
- this._inlineEditChangedFn();
- }
- this.off('dblclick', this._inlineEditFn);
- this.off('hold', this._inlineEditFn);
- delete this._inlineEditFn;
- delete this._previousInlineText;
- delete this._inlineEditChangedFn;
- delete this._updateWidth;
- } else if (action === 'blur') {
- if (this._$inlineEdit) {
- this._inlineEditChangedFn();
- }
- } else if (action === 'isEditing') {
- return this._$inlineEdit ? true : false;
- } else if (action === 'edit') {
- if (this._inlineEditFn) {
- this._inlineEditFn();
- }
- } else {
- var onEditStart = options && options.onEditStart;
- this._inlineEditFn = function (e) {
- DnDManager.resetDragging();
- if (onEditStart) {
- onEditStart();
- }
- _addInlineEditHandlers(this, action, options);
- if (e) {
- e.stopPropagation();
- }
- }.bind(this);
- this.hammer({
- stop_browser_behavior: false,
- prevent_mouseevents: true
- });
- this.on('dblclick', this._inlineEditFn);
- this.on('hold', this._inlineEditFn);
- this.on('keypress', function (e) {
- var keyCode = e.keyCode || e.charCode;
- if (keyCode === 13 || keyCode === 32) {
- this._inlineEditFn(e);
- }
- }.bind(this));
- }
- };
- });
- //# sourceMappingURL=EventHelper.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/core/View',['jquery', 'underscore', 'doT', './Events', '../../utils/EventHelper'], function ($, _, dot, Events) {
- 'use strict';
- var View = null;
- var eventsRegex = /^(\S+)\s*(.*)$/;
- // View related attributes that are supported
- var viewAttributes = ['el', 'id', 'className', 'tagName', 'events'];
- /**
- * A Backbone style base View Class. UI Views should extend this class.
- *
- */
- View = Events.extend({
- templateString: null,
- id: null,
- init: function init(attributes) {
- View.inherited('init', this, arguments);
- this.viewId = _.uniqueId('view');
- this.dotTemplate = dot.template(this.templateString || '');
- _.extend(this, _.pick(attributes || {}, viewAttributes));
- this._initDomElement();
- this._attachEvents();
- },
- /**
- * The tag name given to the view's DOM element. By default it's a DIV.
- */
- tagName: 'div',
- /**
- * Initialize the DOM element for this view
- */
- _initDomElement: function _initDomElement() {
- if (!this.el) {
- var attrs = {};
- if (this.id) {
- attrs.id = _.result(this, 'id');
- }
- if (this.className) {
- attrs['class'] = _.result(this, 'className');
- }
- this.setElement(document.createElement(this.tagName));
- this.$el.attr(attrs);
- } else {
- this.setElement(_.result(this, 'el'));
- }
- },
- /**
- * Convenience function to use jQuery to find a DOM element within this view. This is
- * faster then doing a global lockup.
- */
- $: function $(selector) {
- return this.$el.find(selector);
- },
- /**
- * Hide the view
- */
- hide: function hide() {
- this.$el.hide();
- },
- /**
- * Show the view if hidden
- */
- show: function show() {
- this.$el.show();
- },
- /**
- * Make sure the target is the intended dom node, using CSS class to validate.
- * If not the right node, check out the parents.
- */
- getTarget: function getTarget(target, sClass) {
- var $t = $(target);
- if (!$t.hasClass(sClass)) {
- var parents = $t.parents('.' + sClass);
- if (parents.length > 0) {
- target = parents[0];
- }
- }
- return target;
- },
- /**
- * Render is the main function of the View. Views should implement (override) the render
- * method to populate this.el with the appropriate HTML. Render should always return this
- * to allow chaining of calls.
- */
- render: function render() {
- return this;
- },
- /**
- * Remove this view:
- * -Remove the element from the DOM
- * -Remove the event listeners
- */
- remove: function remove() {
- if (this.$el) {
- this.$el.remove();
- }
- if (this.off) {
- this.off();
- }
- return this;
- },
- /**
- * Set the view element to a new DOM element
- */
- setElement: function setElement(el) {
- this._detachEvents();
- this.$el = el instanceof $ ? el : $(el);
- this.el = this.$el[0];
- this._attachEvents();
- return this;
- },
- /**
- * Attaches the events in this.events to this.el for this view
- */
- _attachEvents: function _attachEvents() {
- var events = this.events;
- this._detachEvents();
- for (var key in events) {
- var callback = events[key];
- if (!_.isFunction(callback)) {
- callback = this[events[key]];
- }
- if (!callback) {
- continue;
- }
- var match = key.match(eventsRegex);
- var eventName = match[1];
- var selector = match[2];
- // add the event to the element, with a namespace 'privateViewEvents'
- this.$el.on(eventName + '.privateViewEvents' + this.viewId, selector, callback.bind(this));
- }
- return this;
- },
- /**
- * Detaches all the events from the element
- */
- _detachEvents: function _detachEvents() {
- if (this.$el) {
- this.$el.off('.privateViewEvents' + this.viewId);
- }
- return this;
- }
- });
- return View;
- });
- //# sourceMappingURL=View.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI
- *
- * Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/View',['./core/View'], function (BaseView) {
- /**
- * A Backbone style base View Class. Glass UI Views should extend this class.
- */
- var View = BaseView.extend({
- /**
- * @param {options} set of initial properties
- */
- init: function init(options) {
- if (options && options.glassContext && options.glassContext.getCoreSvc) {
- this.logger = options.glassContext.getCoreSvc('.Logger');
- }
- View.inherited('init', this, arguments);
- },
- /**
- * Hide the view
- */
- hide: function hide() {
- this.$el.addClass('hidden');
- this.$el.attr('aria-hidden', 'true');
- },
- /**
- * Show the view if hidden
- */
- show: function show() {
- this.$el.removeClass('hidden');
- this.$el.removeAttr('aria-hidden');
- }
- });
- return View;
- });
- //# sourceMappingURL=View.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/ClassFactory',['require'], function (require) {
- /**
- *This class provides utility to create an instance from a module id
- */
- var ClassFactory = function ClassFactory() {};
- /**
- * @constant
- * @default
- */
- ClassFactory.prototype.FAIL_CREATE_INSTANCE = 'Failed to create the instance';
- /**
- * @constant
- * @default
- */
- ClassFactory.prototype.FAIL_LOAD_MODULE = 'Failed to load the module';
- /**
- * Instantiate an object based on the passed module id
- * @param {moduleId} module id
- * @param potential additional parameters
- * @return promise
- */
- ClassFactory.prototype.instantiate = function (moduleId) {
- var args = arguments;
- return this.loadModule(moduleId).then(function (Module) {
- try {
- var factoryFunction = Module.bind.apply(Module, args);
- var object = new factoryFunction();
- object.moduleID = args[0];
- return object;
- } catch (error) {
- throw { msg: this.FAIL_CREATE_INSTANCE, causedBy: error };
- }
- }.bind(this));
- };
- ClassFactory.prototype.loadModule = function (moduleId) {
- return new Promise(function (resolve, reject) {
- if (typeof moduleId === 'function') {
- resolve(moduleId);
- } else {
- return require([moduleId], function (Module) {
- if (Module) {
- resolve(Module);
- } else {
- reject({ msg: this.FAIL_LOAD_MODULE, causedBy: 'Module is not set', moduleId: moduleId });
- }
- }.bind(this), function (error) {
- reject({ msg: this.FAIL_LOAD_MODULE, causedBy: error, moduleId: moduleId });
- }.bind(this));
- }
- }.bind(this));
- };
- return new ClassFactory();
- });
- //# sourceMappingURL=ClassFactory.js.map
- ;
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2016, 2020
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/utils/Utils',['jquery', 'underscore', '../core-client/js/core-client/utils/ClassFactory', 'jquery-bbq'], function ($, _, ClassFactory) {
- $.browser = {};
- var Utils = {
- _ClassFactory: ClassFactory,
- /**
- * Builds and returns a URL for you given a returnURL and additional URL parameters.
- * @param {String} url - The URL you want to redirect to.
- * @param {String} [returnURL=undefined] - The m_return parameter that you want to be added to the returned url.
- * @param {Object} [params=undefined] - Key/Value pairs of additional parameters that you might want to add to the url.
- */
- buildRedirectURL: function buildRedirectURL(url, returnURL, params) {
- var redirectURL = url;
- var combinedParams = {};
- if (returnURL !== undefined && returnURL !== null) {
- combinedParams.m_redirect = returnURL;
- }
- if (params) {
- _.extend(combinedParams, params);
- }
- if (redirectURL) {
- $.each(combinedParams, function (key, value) {
- redirectURL = redirectURL + (redirectURL.indexOf('?') > -1 ? '&' : '?') + encodeURIComponent(key) + '=' + encodeURIComponent(value);
- });
- }
- return redirectURL;
- },
- /**
- * Returns the value of the requested cookie
- * @param {String} The key of the cookie
- * @return {String|undefined} the value of the cookie
- */
- getCookieValue: function getCookieValue(key) {
- var retVal;
- var aCookies = document.cookie.split(';');
- for (var i = 0; i < aCookies.length; i++) {
- var aSet = aCookies[i].split('=');
- var sKey = decodeURIComponent(aSet[0].trim());
- if (sKey === key && aSet.length > 1) {
- retVal = decodeURIComponent(aSet[1]);
- break;
- }
- }
- return retVal;
- },
- /**
- * Returns true if the passed in has been protected for errors
- * @private
- * @param {Object} anObj - a function you want to test if it has been protected.
- */
- _needsProtection: function _needsProtection(aFunction) {
- return $.isFunction(aFunction) && (_.isUndefined(aFunction.needsProtection) || aFunction.needsProtection === false);
- },
- /**
- * update the passed in function to mark it as protected
- * @private
- * @param {Object} anObj - a function you want to test if it has been protected.
- */
- _markAsProtected: function _markAsProtected(aFunction) {
- aFunction.needsProtection = false;
- },
- /**
- * Returns true if the passed in object is a promise object (implemented the promise interface)
- * @private
- * @param {Object} anObj - an instance of an object that you want to check if it is a promise.
- */
- _isPromise: function _isPromise(anObj) {
- return !_.isUndefined(anObj) && anObj.then && $.isFunction(anObj.then);
- },
- /**
- * Returns a JQuery deferred object that is resolved only when all the promises in the arrayOfPromises are
- * either resolved or rejected
- * @public
- * @param {Promise[]} arrayOfPromises - an array of all the promises that you want to wait for
- */
- waitForAllOrSomePromises: function waitForAllOrSomePromises(arrayOfPromises) {
- var deferred = $.Deferred();
- if (_.isUndefined(arrayOfPromises) || arrayOfPromises === null || arrayOfPromises.length === 0) {
- deferred.resolve();
- return deferred;
- }
- var unresolvedCount = arrayOfPromises.length;
- var rejectedCount = 0;
- var responses = [];
- for (var index = 0; index < arrayOfPromises.length; index += 1) {
- var currentPromise = arrayOfPromises[index];
- if (!Utils._isPromise(currentPromise)) {
- //if this is not a promise then skip it
- console.warn('waitForAllOrSomePromises found an invalid promise: ' + currentPromise);
- continue;
- }
- (function (aPromise) {
- aPromise.then(function (resp) {
- if (_.isUndefined(resp)) {
- resp = {};
- }
- aPromise.responseModule = resp;
- unresolvedCount -= 1;
- resp.isSuccess = true;
- responses.push(resp);
- if (unresolvedCount <= 0) {
- deferred.resolve.apply(deferred, responses);
- }
- }, function (resp) {
- if (_.isUndefined(resp)) {
- resp = {};
- }
- unresolvedCount -= 1;
- rejectedCount += 1;
- resp.isSuccess = false;
- responses.push(resp);
- console.info(resp);
- if (unresolvedCount <= 0) {
- if (rejectedCount === arrayOfPromises.length) {
- //in this case every promise was rejected so we do need to reject this bad boy
- deferred.reject.apply(deferred, responses);
- } else {
- deferred.resolve.apply(deferred, responses);
- }
- }
- });
- })(currentPromise);
- }
- return deferred;
- },
- /**
- * Utility function to wrap functions introspectively with try catch'es respecting promises in error conditions if there are any
- * be aware that in the case of catching a javascript script error, the return value is assumed to be a promise
- * @public
- * @param {Object} obj - an instance of an object that you want to protect errors with.
- * @param {String[]} applyList - list of functions that are to wrapped. If the method name is not a valid function for the supplied object then it skeps it
- * @param {function} errCallback -optional error callback to call if an error occurrs when the function is executed. The default is to log the error and reject any promises
- */
- errorProtect: function errorProtect(obj, applyList, errCallback) {
- if (_.isUndefined(applyList)) {
- return;
- }
- for (var ind = 0; ind < applyList.length; ind += 1) {
- var methodName = applyList[ind]; //need a closure here as we want the value of methodName not the variable
- (function (methodName) {
- var currentMethod = obj[methodName];
- if (Utils._needsProtection(currentMethod)) {
- obj[methodName] = function () {
- var answer = null;
- try {
- answer = currentMethod.apply(obj, arguments);
- return answer;
- } catch (ex) {
- console.error(ex);
- if (!_.isUndefined(errCallback)) {
- errCallback(ex);
- }
- if (_.isUndefined(answer) || answer === null) {
- //in this case we got nothing back for the response
- //this very possibly could mean that a js error occurred and the return of the promise could not happen
- //so create a dummy promise that you can return and reject
- var dummyDef = $.Deferred();
- dummyDef.reject(ex);
- return dummyDef.promise();
- }
- if (Utils._isPromise(answer)) {
- //in this case the response was a promise so lets reject it with impunity
- answer.reject(ex);
- }
- }
- };
- Utils._markAsProtected(obj[methodName]);
- }
- }).bind(obj)(methodName);
- }
- },
- /**
- * Determines whether the user requested a factory mode by passing an extra "factoryMode" parameter in URL query string.
- * If "factoryMode" parameter is equal to "true" then a global "isFactoryMode" variable (defined in index.jsp of bi-service project) is set to true,
- * otherwise is set to false.
- *
- * For more information, please see index.jsp of bi-service.
- *
- * @public
- * @return {Boolean} Returns true if factory mode was requested, otherwise false
- */
- isFactoryMode: function (_isFactoryMode) {
- function isFactoryMode() {
- return _isFactoryMode.apply(this, arguments);
- }
- isFactoryMode.toString = function () {
- return _isFactoryMode.toString();
- };
- return isFactoryMode;
- }(function () {
- return typeof isFactoryMode !== 'undefined' && isFactoryMode === true;
- }),
- /**
- * Determines whether glass is displayed in preview mode.
- *
- * @public
- * @return {Boolean} Returns true if glass is in ui-preview mode, otherwise false
- */
- isUiPreview: function (_isUiPreview) {
- function isUiPreview() {
- return _isUiPreview.apply(this, arguments);
- }
- isUiPreview.toString = function () {
- return _isUiPreview.toString();
- };
- return isUiPreview;
- }(function () {
- return typeof isUiPreview !== 'undefined' && isUiPreview === true;
- }),
- /**
- * Gets the shared resource action controller for the type.
- * @public
- * @param {object} [glassContext] The glassContext
- * @param {String} [type] The type of the object.
- * @return {Object} Promise. Resolved with the action controller or undefined if the collection item is not found.
- * Rejects if there are any errors.
- */
- getSharedResourceActionController: function getSharedResourceActionController(glassContext, type, context) {
- var _this = this;
- return glassContext.findCollection(Utils.SHARE_CONTAINER).then(function (collectionItems) {
- if (!collectionItems) {
- return;
- }
- var promises = []; // Sort the contributions based on the weight.
- collectionItems.sort(function (a, b) {
- return (b.weight || 0) - (a.weight || 0);
- }); // Instantiate the controllers.
- collectionItems.forEach(function (item) {
- if (item.types && item.types.indexOf(type) !== -1) {
- var promise = _this._ClassFactory.instantiate(item.actionController).catch(function (error) {
- glassContext.getCoreSvc('.Logger').error(Utils.COLLECTION_MODULE_NOT_FOUND + type);
- throw error;
- });
- promises.push(promise);
- }
- });
- return Promise.all(promises).then(function (items) {
- var options = {
- glassContext: glassContext,
- context: context
- };
- return _.find(items, function (item) {
- return item && (!item.isEnabled || typeof item.isEnabled === 'function' && item.isEnabled(options));
- });
- });
- });
- },
- /**
- * Add a coachmark dynamically to the UI.
- * @param options - The options parameter takes the following values to add the coachmark:
- * id: the identifier for the element to attach the coachmark to,
- * $el: the element to attach the coachmark to,
- * title: the title string for the coachmark,
- * content: the content string for the coachmark,
- * glassContext: the relevant glass context
- */
- addCoachmark: function addCoachmark(options) {
- return Promise.try(function () {
- if (options.glassContext.getCoreSvc('.UserProfile').preferences.showHints === 'showAll') {
- var coachmarkOptions = {
- title: options.title,
- contents: options.contents,
- glassContext: options.glassContext,
- placement: options.placement
- };
- if (options.$el.find('.coachMark').length === 0) {
- var persistence = options.glassContext.getCoreSvc('.CoachMarkService').getPersistence();
- return persistence.isRead(options.id).then(function (isRead) {
- options.$el.attr('id', options.id);
- var CoachMark = options.glassContext.getCoreSvc('.CoachMarkService').getRenderer();
- var coachmark = new CoachMark(coachmarkOptions);
- coachmark.render(options.$el, !isRead);
- if (options.showPopover && !isRead) {
- coachmark.$popover.trigger('primaryaction');
- }
- });
- }
- }
- });
- },
- /**
- * Gets the application content from browser's queryString and fragment.
- * @public
- * @param {String} queryString] The browser url queryString
- * @param {String} [fragment] The browser url fragment
- * @return {Object} Content. Returns an object representing the key values pairs found in the supplied queryString and fragment.
- */
- getAppContent: function getAppContent(queryString, fragment, glassContext) {
- try {
- var coerce = Utils._checkCoerceFeatureFlag(glassContext);
- return Utils._getAppContent(queryString, fragment, coerce);
- } catch (err) {
- if (glassContext) {
- glassContext.getCoreSvc('.Logger').error(err);
- } else {
- console.error(err);
- }
- return {};
- }
- },
- _checkCoerceFeatureFlag: function _checkCoerceFeatureFlag(glassContext) {
- var featureChecker = glassContext && glassContext.getCoreSvc('.FeatureChecker');
- var coerce = featureChecker && featureChecker.checkValue('ba-glass', 'stringOnlyQS', 'disabled');
- return coerce;
- },
- _getAppContent: function _getAppContent(queryString, fragment, coerce) {
- var qsObj = queryString && this.deparam(queryString, coerce) || {};
- var fragObj = fragment && $.deparam(fragment, coerce) || {};
- var content = $.extend(true, fragObj, qsObj);
- if (coerce) {
- var nonCoercedContent;
- for (var key in content) {
- if (key.indexOf('p_') === 0) {
- nonCoercedContent = nonCoercedContent || Utils._getAppContent(queryString, fragment, false);
- content[key] = nonCoercedContent[key];
- }
- }
- }
- return content;
- },
- deparam: function deparam(queryString, coerce) {
- var pair, value, name;
- var qsObj = {};
- var coerce_types = {
- 'true': true,
- 'false': false,
- 'null': null
- };
- queryString = queryString.replace(/\+/g, ' ');
- var params = queryString ? queryString.split('&') : [];
- _.map(params, function (param) {
- pair = param.split('=');
- name = decodeURIComponent(pair[0]);
- value = pair.length > 2 ? pair.slice(1).join('=') : pair[1];
- value = decodeURIComponent(value);
- if (coerce) {
- value = value && !isNaN(value) ? +value : value === 'undefined' ? undefined : coerce_types[value] !== undefined ? coerce_types[value] : value;
- }
- if (qsObj[name] !== undefined) {
- qsObj[name] = Array.isArray(qsObj[name]) ? qsObj[name].concat(value) : [].concat(qsObj[name], value);
- } else {
- qsObj[name] = value;
- }
- });
- return qsObj;
- },
- /**
- * Parses the #queryString_data element text populated by the entry-page.
- * @returns {Object} - Map of parameter:value
- */
- getQueryDataParameterMap: function getQueryDataParameterMap(glassContext) {
- var queryString = _.unescape($('#queryString_data').text());
- return Utils.getAppContent(queryString, $.param.fragment(), glassContext);
- },
- getFilteredLoginParameters: function getFilteredLoginParameters(glassContext, queryString, loginPromptParameters) {
- var parameters = glassContext.getAllowedUrlLoginParameters();
- var allowedParameters = ['CAMNamespace'];
- var filteredMap = {};
- var filteredParameters = [];
- if (_.isString(parameters)) {
- _.each(parameters.split(','), function (value) {
- allowedParameters.push(value.trim());
- });
- }
- if (queryString) {
- _.each(queryString, function (value, key) {
- if (_.isString(value) && allowedParameters.indexOf(key) !== -1 && filteredMap[key] == undefined) {
- filteredMap[key] = value;
- }
- });
- }
- if (loginPromptParameters) {
- _.each(loginPromptParameters, function (value, key) {
- if (_.isString(loginPromptParameters[key].value) && filteredMap[loginPromptParameters[key].name] == undefined) {
- filteredMap[loginPromptParameters[key].name] = loginPromptParameters[key].value;
- }
- });
- }
- _.each(filteredMap, function (value, key) {
- filteredParameters.push({
- name: key,
- value: value
- });
- });
- return filteredParameters;
- },
- /**
- * Will iterate through object using propertyMap to safely find nested property value
- *
- * @public
- * @param {Array} propertyMap map of tested property
- * @param {Object} object object to search for nested property
- * @return Returns object property or null if property not found
- */
- getObjectProperty: function getObjectProperty(propertyMap, object) {
- if (propertyMap) {
- var reducerCallbackFunc = function reducerCallbackFunc(reducedObject, currentProperty) {
- return reducedObject && reducedObject[currentProperty] ? reducedObject[currentProperty] : null;
- };
- return propertyMap.reduce(reducerCallbackFunc, object);
- } else {
- return null;
- }
- },
- /**
- * Passed as the replacer argment for JSON.stringify, this will remove cyclical references from the object and allow it to be serializable
- *
- * @public
- * @return Returns the value of a key if it is not a duplicate
- */
- getCircularReplacer: function getCircularReplacer() {
- var seen = new WeakSet();
- return function (key, value) {
- if (_typeof(value) === 'object' && value !== null) {
- if (seen.has(value)) {
- return;
- }
- seen.add(value);
- }
- return value;
- };
- },
- /**
- * Simple XOR encryption of a string
- *
- * @public
- * @param {String} simple string to be encrypted
- * @param {Number} encryption key
- * @return a simple XOR encryption
- */
- encryptString: function encryptString(strToEncrypt, encryptionKey) {
- encryptionKey = Number(String(Number(encryptionKey))) === encryptionKey ? Number(encryptionKey) : 13;
- var encryptedString = strToEncrypt.split('').map(function (c) {
- return c.charCodeAt(0);
- }).map(function (i) {
- return i ^ encryptionKey;
- });
- return String.fromCharCode.apply(undefined, encryptedString);
- }
- };
- Utils.SSO_PARAMS = {
- 'm': 'portal/main.xts',
- 'h_CAM_action': 'logon'
- };
- Utils.SHARE_CONTAINER = 'com.ibm.bi.glass.common.sharedResources';
- Utils.COLLECTION_MODULE_NOT_FOUND = 'Unable to load collection item for shareable type: ';
- return Utils;
- });
- //# sourceMappingURL=Utils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * "Restricted Materials of IBM"
- *
- * 5746-SM2
- *
- * (C) Copyright IBM Corp. 2015, 2016
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/ContentView',['../core-client/js/core-client/ui/View', 'jquery', '../utils/Utils'], function (BaseView, $, Utils) {
- /**
- * @public
- */
- var ContentView = BaseView.extend(
- /**
- * @lends ContentView.prototype
- */
- {
- /**
- * @classdesc A base class for different Perspective Content Views in the application. A Content view should implement all of the functions required by View.
- * @constructs
- * @public
- *
- * @param {options} set of initial properties
- */
- init: function init(options) {
- $.extend(this, options);
- ContentView.inherited('init', this, [options]);
- this.$el.addClass('pageView');
- Utils.errorProtect(this, ['render', 'getTitle', 'getContent']);
- },
- /**
- * Return a boolean to the caller indicating whether this view is dirty (ie edited)
- * Glass uses this value to display a * in the switcher and confirm closing
- * Content views should override this and provide an appropriate boolean when called
- * @returns {Boolean} is dirty flag.
- */
- isDirty: function isDirty() {
- return false;
- },
- /**
- * Render is the main function of the Content View. Content Views should implement (override) the render
- * method to populate this.el with the appropriate HTML. Render should always return this as a promise
- * to allow chaining of calls.
- *
- * Errors occurring within the contentView should be handled by rejecting the promise with an error object as follows:
- * {
- * "status": "notFound" or "noCapability" or "noPermission"
- * "message": Localized error message. Note: Optional if an applicable status is supplied since glass will supply one accordingly
- *
- * }
- * @returns (Promise)
- */
- render: function render() {
- return Promise.resolve(this);
- },
- /**
- * Content views should override this and provide a meaningful title
- * which will be used to display in the browser's title area
- * @returns {String} The title of this content view.
- */
- getTitle: function getTitle() {
- if (this.module) {
- var moduleTokens = this.module.split('/');
- return moduleTokens[moduleTokens.length - 1];
- } else {
- return this.glassContext.currentAppView.perspective;
- }
- },
- /**
- * Content views can override this and provide a snapshot of it's state
- * @returns {Object} A cloneable object containing state for this contentView.
- */
- getContent: function getContent() {
- return {};
- },
- /**
- * Set the focus to an element within the view.
- * Sub classes should override this method as required
- * @Default sets focus to first tabbable element in this view if one exists
- * @public
- */
- setFocus: function setFocus() {
- var $tabs = this.$el.find(':tabbable:first');
- if ($tabs.length > 0) {
- $tabs.focus();
- }
- }
- });
- return ContentView;
- });
- //# sourceMappingURL=ContentView.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2016, 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/api/Context',[], function () {
- 'use strict'; //NOSONAR: Meant to be strict
- /**
- * This class represents the Context passed by Cognos Analytics to third party providers.
- *
- */
- var NO_LOGGER_DEFINED = 'There is no logged part of this context. Logs generated in the console log.';
- /**
- * Constructor that is used make a shallow copy of the GlassContext to only include the
- * logger and a public means to open a perspective.
- * @private
- */
- var Context = function Context(options) {
- if (options.getCoreSvc) {
- this.logger = options.getCoreSvc('.Logger');
- } else {
- console.info(NO_LOGGER_DEFINED);
- }
- try {
- this._openPerspective = options.appController.openAppView.bind(options.appController);
- } catch (err) {
- if (this.logger) {
- this.logger.error(err);
- } else {
- console.error(err);
- }
- }
- };
- /**
- *Opens a factory or custom perspective with given options.
- *@public
- *@param {String} [name] - Name of the perspective to open.
- *@param {Object} [options] - Options with which to open the perspective.
- *@returns {Object} The supplied or new object injected with the glassContext.
- */
- Context.prototype.openPerspective = function (name, options) {
- return new Promise(function (resolve, reject) {
- this._openPerspective(name, options).then(resolve, reject);
- }.bind(this));
- };
- return Context;
- });
- //# sourceMappingURL=Context.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2016, 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/api/ExtensionViewAdaptor',['../app/ContentView', 'jquery', 'underscore', '../core-client/js/core-client/utils/ClassFactory', './Context'], function (BaseContentView, $, _, classFactory, Context) {
- /**
- * 2.0 ExtensionView adaptor
- *
- */
- var ContentView = BaseContentView.extend({
- init: function init(options) {
- this.content = options;
- this.glassContext = options.glassContext;
- this.displayInfo = {};
- this.shallowContext = new Context(this.glassContext);
- ContentView.inherited('init', this, arguments);
- },
- createView: function createView() {
- var _this = this;
- return new Promise(function (resolve, reject) {
- classFactory.instantiate(_this.type, {}).done(function (view) {
- Object.assign(view, _this.content);
- delete _this.content;
- _this.view = view;
- _this.bindToView(view);
- resolve(view);
- }).fail(function (error) {
- return reject({
- msg: 'Internal error: unable to create content View ' + _this.type,
- causedBy: error
- });
- });
- });
- },
- bindToView: function bindToView(view) {
- view.login = this.login.bind(this);
- view.signin = this.signin.bind(this);
- },
- callViewOpen: function callViewOpen(view) {
- var _this2 = this;
- if (this.view && _.isFunction(this.view.open)) {
- return view.open(this.shallowContext, this.options).then(function (eRoot) {
- _this2.$el.empty().append($(eRoot));
- _this2.displayInfo = _this2._proxyMethod('getDisplayInfo') || {};
- _this2.show();
- return _this2;
- });
- } else {
- return Promise.reject({
- msg: 'Internal error: content view open method not implemented for ' + this.type
- });
- }
- },
- doRender: function doRender() {
- var _this3 = this;
- return this.createView().then(function (view) {
- return _this3.callViewOpen(view);
- });
- },
- render: function render() {
- return this.doRender();
- },
- /**
- * performs a login; returns a jquery promise for backward
- *
- * @public
- * @deprecated since R6
- * @param {Object[]} loginPrompts - object containing the login prompts
- * @param {string} loginPrompts[].name - name of the login prompt
- * @param {string} loginPrompts[].value - value of the login prompt
- * @return {Promise} promise resolved when the login is successful, rejected when it fails,
- *
- */
- login: function login(loginPrompts) {
- var dfd = $.Deferred();
- this.signin(loginPrompts).then(function () {
- dfd.resolve();
- }).catch(function (error) {
- dfd.reject(dfd, error.jqXHR);
- });
- return dfd.promise();
- },
- /**
- * @typedef {Object} LoginError
- * @property {string} message - error message
- */
- /**
- * stub for signin - required to overriden by inherited class
- *
- * @public
- * @param {Object[]} loginPrompts - object containing the login prompts
- * @param {string} loginPrompts[].name - name of the login prompt
- * @param {string} loginPrompts[].value - value of the login prompt
- * @return {Promise<undefined|LoginError>} - promise resolved with no object when the login is successful, rejected with an error when it fails,
- *
- */
- signin: function
- /* loginPrompts */
- signin() {},
- show: function show() {
- this._proxyMethod('onShow');
- },
- deactivate: function deactivate() {
- this._proxyMethod('onHide');
- },
- getTitle: function getTitle() {
- return this.displayInfo.title || '';
- },
- getIcon: function getIcon() {
- return this.displayInfo.icon || '';
- },
- getContent: function getContent() {
- return this._proxyMethod('getContent') || {};
- },
- remove: function remove() {
- this._proxyMethod('close');
- },
- _proxyMethod: function _proxyMethod(method, args) {
- if (this.view && _.isFunction(this.view[method])) {
- return this.view[method](args);
- } else {
- this.glassContext.getCoreSvc('.Logger').warn('method not implemented', method);
- }
- }
- });
- return ContentView;
- });
- //# sourceMappingURL=ExtensionViewAdaptor.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2016, 2018
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('baglass/api/IFrameOpener',['../core-client/js/core-client/ui/core/Class', 'jquery', 'underscore'], function (BaseClass, $, _) {
- 'use strict'; //NOSONAR: Meant to be strict
- var IFrameOpener = BaseClass.extend({
- /**
- * @classdesc class to open an IFrame
- * @constructs IFrameOpener
- * @public
- * @param {options}
- * options.id - unique id
- * options.content.url - url to be loaded in IFrame
- * options.content.title - label to be used in perspective switcher
- */
- init: function init(options) {
- IFrameOpener.inherited('init', this, arguments);
- $.extend(this, options);
- },
- onSelectItem: function onSelectItem(context) {
- this.onPress(context);
- },
- /**
- * Keyboard press handler to open IFrame.
- *
- * @public
- * @param {object} context-glass context
- */
- onPress: function onPress(context) {
- return new Promise(function (resolve, reject) {
- try {
- context.glassContext.openAppView('generic_iframe', this._buildPayload(context)).then(resolve, reject);
- } catch (error) {
- context.glassContext.getCoreSvc('.Logger').error(error);
- reject(error);
- }
- }.bind(this));
- },
- _buildPayload: function _buildPayload(context) {
- var options = this._getOptions(context);
- return {
- content: {
- id: options.id,
- url: options.url,
- title: options.title
- }
- };
- },
- _getOptions: function _getOptions(context) {
- var options = {};
- if (this._isValidContext(context)) {
- var _itemSpec = context.target.plugin.itemSpec;
- if (this._isItMenuItem(context) === true) {
- var selectedItemIndex = context.target.specItemIndex;
- var item = _itemSpec.items[selectedItemIndex];
- options = _.pick(item.options, 'url', 'title');
- options.id = this._getID(item);
- } else if (this._isItButton(context) === true) {
- options = _.pick(_itemSpec.options, 'url', 'title');
- options.id = this._getID(_itemSpec);
- }
- if (_.isUndefined(options.url)) {
- $.extend(options, this.getOptionsFromid(context, options.id));
- }
- return options;
- }
- },
- _isValidContext: function _isValidContext(context) {
- return context && context.target && context.target.plugin && context.target.plugin.itemSpec;
- },
- _getID: function _getID(itemSpec) {
- return itemSpec.id ? btoa(itemSpec.id + itemSpec.options.url) : btoa(itemSpec.options.url);
- },
- getOptionsFromid: function getOptionsFromid(context, id) {
- try {
- var plugin = context.glassContext.findElement(id);
- return plugin.options;
- } catch (e) {
- return {};
- }
- },
- _isItMenuItem: function _isItMenuItem(context) {
- return context.target.specItemIndex !== undefined && context.target.plugin.itemSpec.items.length > 0 && context.target.plugin.itemSpec.items[context.target.specItemIndex].options !== undefined;
- },
- _isItButton: function _isItButton(context) {
- return context.target.plugin.itemSpec.options !== undefined;
- }
- });
- return IFrameOpener;
- });
- //# sourceMappingURL=IFrameOpener.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2019
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/api/View',[], function () {
- 'use strict'; //NOSONAR: Meant to be strict
- /**
- * This class provides a means to declare a content View for a perspective
- * It plays the role of an interface, consumer can implement it.
- *
- * @interface
- */
- var ContentView = function ContentView() {
- /**
- * Called when this view is created
- *
- * @public
- * @param {context} context.logger - logger utility
- * @param {options} custom options for this particular instance
- * @returns {Promise} promise resolved to the root DOM element for this view.
- */
- this.open = function () {};
- /**
- * Called when this view is destroyed
- *
- * @public
- */
- this.close = function () {};
- /**
- * Called whenever this view is shown
- *
- * @public
- */
- this.onShow = function () {};
- /**
- * Called whenever this view is hidden
- *
- * @public
- */
- this.onHide = function () {};
- /**
- * Called whenever display Info is required for this view
- *
- * @public
- * @returns {Object} displayInfo - The displayInfo for this view.
- * @returns {string} displayInfo.title - The title.
- * @returns {string} displayInfo.icon - The icon.
- */
- this.getDisplayInfo = function () {};
- };
- return ContentView;
- });
- //# sourceMappingURL=View.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/api/all',['./ActionInterface', './ExtensionViewAdaptor', './IFrameOpener', './View'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/nls/BAGlassResources',{
- "root": true,
- "cs": true,
- "da": true,
- "de": true,
- "es": true,
- "fi": true,
- "fr": true,
- "hr": true,
- "hu": true,
- "it": true,
- "ja": true,
- "kk": true,
- "ko": true,
- "no": true,
- "nb": true,
- "nl": true,
- "pl": true,
- "pt": true,
- "pt-br": true,
- "ro": true,
- "ru": true,
- "sl": true,
- "sv": true,
- "th": true,
- "tr": true,
- "zh": true,
- "zh-cn": true,
- "zh-tw": true
- });
- //# sourceMappingURL=BAGlassResources.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2018, 2019
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/nls/root/BAGlassResources',{
- "signInButtonText": "Sign in",
- "userPlaceholder": "Username",
- "passPlaceholder": "Password",
- "nsPlaceholder": "Namespace",
- "anonymousLoginFail": "Failed to open session as Anonymous",
- "retrieveInstallInfoErrorTitle": "Installation Information Error",
- "retrieveInstallInfoErrorMsg": "A failure occurred while retrieving the installation environment. Some features may not be available. The root cause is the following: %{reason}",
- "selectNamespace": "Select Namespace",
- "connectAnonymously": "Connect anonymously",
- "CAInitTitle": "CA Initialization Information",
- "CALoginAuthError": "CA Login Authentication Error",
- "unableSetSSOURL": "unable to set up SSO URL",
- "unableGetInstallInfo": "Unable to get CA install information",
- "loginInfoTitle": "CA Login Information",
- "loginInProgress": "Logging in",
- "loginSuccess": "Login Successful",
- "unableLogin": "Cannot login",
- "invalidLogin": "The provided credentials are invalid. Please type your credentials for authentication.",
- "unableGetAccountInfo": "Cannot get user's account information!",
- "accountInfoTitle": "Account Information Error",
- "credentialSubmitError": "Error submitting login credentials",
- "invalidLoginResponse": "Invalid login response",
- "CAMPromptInfoMissing": "Error retrieving CAM PromptInfo Response",
- "CAMMessagesMissing": "Error retrieving CAM Messages Response",
- "changePassword": "Change Password",
- "newPasswordsDoNotMatch": "The new passwords you entered do not match. Please retype the new password in both text boxes.",
- "loginLegalText": "Licensed Materials - Property of IBM Corp. © Copyright IBM Corporation and other(s) 2005, %{fullYear}. IBM, the IBM logo, ibm.com and Cognos are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide.",
- "legalText": "Licensed Materials - Property of IBM Corp. © Copyright IBM Corporation and other(s) 2005, %{fullYear}. IBM, the IBM logo, ibm.com and Cognos are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. A current list of IBM trademarks is available on the Web at www.ibm.com/legal/copytrade.shtml. This Program is licensed under the terms of the license agreement accompanying the Program. This license agreement may be either located in a Program directory folder or library identified as \"License\" or \"Non_IBM_License\", if applicable, or provided as a printed license agreement. Please read the agreement carefully before using the Program. By using the Program you agree to these terms.",
- "CAMNamespaceDisplayName": "Sign in with your %{promptValue} ID",
- "customLoginPerspectiveNotFound": "The custom sign-in view could not be found",
- "defaultToIBMLoginPage": "The custom sign-in view is not available. The default sign-in view is displayed instead.",
- "errorRetrievePerspectiveURL": "Error retrieving perspective: %{url}",
- "CAMUserNameForDisplay": "User ID: %{promptValue}",
- "genericPrompt": "%{promptName} %{promptValue}",
- "errLoadingView": "Unable to load requested view.",
- "errLoadingViewShowHome": "Unable to load requested view. Displaying home view instead.",
- "productName": "IBM Cognos Analytics %{version}",
- "version": "Version",
- "myPreferences": "My preferences",
- "skin": "Style",
- "showHiddenObjects": "Show hidden entries",
- "format": "Report format",
- "accessibilityFeatures": "Turn on accessibility features",
- "displayMode": "Default view",
- "productLocale": "Product language",
- "contentLocale": "Content language",
- "biDirectionalFeaturesEnabled": "Bidirectional language support",
- "baseTextDirection": "Base direction for text",
- "portal": "Portal",
- "regionalOptions": "Options for your region",
- "timeZoneID": "Time zone",
- "email": "Email",
- "homePage": "Home page",
- "defaultHome": "Default",
- "resetHome": "Reset to default",
- "homeSet": "Your home was set successfully",
- "homeSetError": "An error occurred setting the default home page, try closing and reopening this view.",
- "resetHomeSuccess": "You have successfully reset your home to default.",
- "shareSetError": "This action cannot be performed before closing and reopening this view.",
- "general": "General",
- "personal": "Personal",
- "nameSpace": "Namespace",
- "userName": "User name",
- "password": "Password",
- "confirmPassword": "Confirm password",
- "passwordChange": "Change your password",
- "changePasswordTitle": "Change my password",
- "showPassword": "Show password",
- "oldPassword": "Old password",
- "newPassword": "New password",
- "confirmNewPassword": "Confirm new password",
- "passwordMatch": "Password match",
- "passwordNotMatch": "Oops, password does not match",
- "wrongPassword": "Unable to authenticate",
- "updatePWUnknownError": "Unable to update password",
- "passWordChangeSuccess": "You have successfully changed your password",
- "advanced": "Advanced",
- "credentials": "Credentials",
- "credentialCreate": "Create",
- "credentialCreateSuccess": "You have successfully created your credentials",
- "credentialChange": "Renew",
- "credentialRenewed": "Your credentials were renewed with your current user ID and password.",
- "myCredentials": "My credentials",
- "myCapabilities": "My capabilities",
- "viewDetails": "View details",
- "manage": "Manage",
- "dataSourceCredentials": "Data server credentials",
- "groupsAndRoles": "Groups and roles",
- "welcome": "Welcome",
- "welcomeMsg": "Welcome to %{brandName}",
- "samples": "Sample content to explore",
- "sampleName1": "Call Activity and Win Plans",
- "sampleName2": "Product Line Dashboard",
- "welcomeGetStarted": "Get started with a tour of the new interface and see what is new and exciting",
- "submit": "Submit",
- "companionApps": "Companion applications",
- "analysisStudio": "Analysis Studio",
- "dashboardConsole": "Workspace",
- "drillThrough": "Drill-Through definitions",
- "eventStudio": "Event Studio",
- "queryStudio": "Query Studio",
- "metricsManager": "Metrics Manager",
- "powerplayStudio": "PowerPlay Studio",
- "controller": "Controller",
- "contributor": "Contributor",
- "metricStudio": "Studio",
- "metricsFileImportTask": "New Import from Files",
- "metricsMaintenanceTask": "New Maintenance",
- "metricsExportTask": "New Export",
- "metricsPackage": "New Package",
- "ok": "OK",
- "html": "HTML",
- "pdf": "PDF",
- "spreadsheetML": "Excel",
- "xlsxData": "Excel Data",
- "csv": "CSV",
- "cancel": "Cancel",
- "rtl": "Right-to-left",
- "ltr": "Left-to-right",
- "contextual": "Contextual",
- "showAll": "Show all",
- "showUnread": "Show unread",
- "hideAll": "Hide all",
- "showHints": "Show hints",
- "defaultCompleteMessage": "Operation completed.",
- "defaultProgressMessage": "Operation in progress...",
- "defaultFailMessage": "Operation failed.",
- "defaultIndefiniteMessage": "Operation in progress...",
- "defaultPauseMessage": "Operation paused.",
- "progressHideBtn": "Hide",
- "coachMarkLabel": "Learn more about - %{title}",
- "coachMarkTurnOffHints": "Turn off hints",
- "coachMarkClose": "Close",
- "secondaryWelcomeMsg": "Get started by opening a report, dashboard, or story!",
- "invalidHomePageTitle": "The home page cannot be retrieved. Click OK to reset the home page to the Welcome page.",
- "unsavedViewsMsg": "You have work that has not been saved:",
- "unsavedViewMsg1": "Close the view?",
- "unsavedViewMsg2": "You have unsaved changes that will be lost if you don’t save them first.",
- "unsavedViewMsg3": "Close without saving",
- "errorLabel": "Error",
- "unknownError": "An unknown error occurred trying to view the requested resource.",
- "notFound": "The requested resource cannot be retrieved. It might have been deleted or renamed.",
- "noCapability": "You do not have the capability to view the requested resource.",
- "noPermission": "You do not have sufficient privileges to view the requested resource.",
- "knowledgeCenterErrorTitle": "The link to Knowledge Center didn't work",
- "knowledgeCenterErrorMessage": "Try again. If the problem persists, contact your administrator.",
- "communityErrorTitle": "The link to the community didn't work",
- "communityErrorMessage": "Try again. If the problem persists, contact your administrator.",
- "close": "Close",
- "info": "Info",
- "warning": "Warning",
- "error": "Error",
- "success": "Success",
- "defaultSlideoutLabel": "Slideout",
- "legacyAppsSlideoutLabel": "Available Legacy Applications",
- "myPreferencesSlideoutLabel": "My Preferences",
- "pinSlideout": "Pin Slideout",
- "unpinSlideout": "Unpin Slideout",
- "paginationControl": "Open Collapsed Slideout(s)",
- "openPerspectiveFailed": "Failed to open %{name}",
- "untitled": "Untitled",
- "invalidPerspectiveErrorTitle": "Invalid perspective name",
- "invalidPerspectiveErrorMessage": "Perspective name cannot contain '/' or '.'",
- "perspective404ErrorTitle": "Perspective not available",
- "perspective404ErrorMessage": "The perspective name at the end of the URL is not available. Please try again, using a valid perspective name.",
- "perspective404HomeErrorMessage": "The home perspective name at the end of the URL is not available. Please check if a valid extension exists and try again.",
- "log_level_Error": "Error",
- "log_level_Warn": "Warning",
- "log_level_Info": "Information",
- "log_level_Debug": "Debug",
- "logging_level": "Logging level:",
- "logging_active": "Logging is on:",
- "logging_config_description": "Logging is used for troubleshooting. Consult your administrator for guidance on settings.",
- "logging_congfig_title": "Logging",
- "manageLogging": "Logging",
- "loggingConfigurationSlideoutA11yLabel": "Logging Configuration",
- "validationControl": "Show validation information",
- "previewDialogTitle": "Preview",
- "error404NotFound": "The asset that you want to open is not available. You might not have the required permissions to access it, or it might be deleted or disabled.",
- "website": "Website",
- "unavailable": "Unavailable",
- "offlineErrorTitle": "Trying to reconnect",
- "offlineErrorMessage": "There seems to be a network problem. Please wait while we try to reconnect or check your network connection and try again",
- "refreshButton": "Refresh",
- "shareDialogTitle": "Share",
- "shareDialogCodeLabel": "Share URL",
- "shareDialogText": "Copy this link to share this content with other users.",
- "embedDialogTitle": "Embed",
- "embedDialogCodeLabel": "Embed code",
- "embedDialogText": "Copy this code to embed.",
- "embedURLWidthLabel": "Width:",
- "embedURLHeightLabel": "Height:",
- "embedURLWidth": "Width",
- "embedURLHeight": "Height",
- "copyText": "Copy",
- "bypassBlockButtonTitle": "Skip to content",
- "cannotOpenLocation": "Invalid URL detected",
- "invalidUrl": "A request to navigate the browser to a new location has been denied. Reload Application?"
- });
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/Lexicon',['../ui/core/Class', 'jquery', 'polyglot'], function (Class, $, Polyglot) {
- var Lexicon = Class.extend({
- /**
- *constructor
- *@param {options} with data and verbose = {true|false}
- */
- init: function init(options) {
- $.extend(true, this, options);
- this._polyglot = new Polyglot({ phrases: this.data });
- },
- /**
- * Translates a key in the current locale
- * @param key message key
- * @param interpolation key-value pairs for interpolation
- */
- translate: function translate(key, interpolation) {
- var translated = this._polyglot.t(key, interpolation);
- if (this.verbose) {
- if (translated === key) {
- translated = Lexicon.NOT_TRANSLATED + '(' + key + ')';
- }
- }
- return translated;
- }
- });
- Lexicon.NOT_TRANSLATED = '__NOT_TRANSLATED__';
- return Lexicon;
- });
- //# sourceMappingURL=Lexicon.js.map
- ;
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2015, 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- (function (root, factory) {
- if (typeof define === 'function' && define.amd) {
- define('baglass/nls/StringResources',['i18n!./BAGlassResources', '../core-client/js/core-client/utils/Lexicon'], factory);
- } else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object') {
- module.exports = factory(require('i18n!./BAGlassResources'), require('../core-client/js/core-client/utils/Lexicon'));
- } else {
- root.Requester = factory(root.BAGlassResources, root.Lexicon);
- }
- })(void 0, function (BAGlassResources, Lexicon) {
- var lexicon = new Lexicon({
- data: BAGlassResources,
- allowMissing: true,
- verbose: false
- });
- return {
- /**
- * Get the string resource for the given key and interpolation options
- *
- * @param key The key of the string to return
- * @param interpolationOptions Optional interpolation options (see poly.t documentation for details)
- * @returns The string to display
- */
- get: function get(key, interpolationOptions) {
- var translated = lexicon.translate(key, interpolationOptions);
- if (translated !== key) {
- return translated;
- }
- return "".concat(Lexicon.NOT_TRANSLATED, "(").concat(key, ")");
- }
- };
- });
- //# sourceMappingURL=StringResources.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /**
- * This class provides the base error class. It must have a message, the caused
- * by and error code are optional.
- */
- define('baglass/core-client/js/core-client/errors/BaseError',['../ui/core/Class', 'underscore'], function (Class, _) {
- var BaseError = Class.extend(
- /**
- * @lends BaseError.prototype
- */
- {
- /**
- * @classdesc Class defining a base error; it extends the JavaScript Error
- * @constructs
- * @public
- * @param {String} message - message of the error
- * @param {Error|String|Object} [causedBy] - cause of the error; can be an error, a string or a object with a message property; if the object does not contain
- * a message property it is considered as additionalInfo
- * @param {Object} [additionalInfo] - JSON objects with additional info; title or code for example
- * @example
- * Error with message only:
- * new BaseError('some error');
- *
- * Error with message and cause as a string:
- * new BaseError('some error', 'some cause');
- *
- * Error with message and additional info
- * new BaseError('some error', {title: 'Network Error'});
- *
- */
- init: function init(message, causedBy, additionalInfo) {
- var error = Error.apply(this, arguments);
- this.name = 'BaseError';
- this.message = message || 'Error';
- if (this._isValidCause(causedBy)) {
- this.causedBy = causedBy;
- this._setAdditionalInfo(additionalInfo);
- } else {
- this._setAdditionalInfo(causedBy);
- }
- if (error.stack) {
- this.stack = error.stack;
- }
- },
- /**
- * Serializes the error as a string
- * @public
- */
- toString: function toString() {
- var str = this.name + ': ' + this.message;
- _.each(_.keys(this).sort(), function (key) {
- if (key !== 'name' && key !== 'causedBy' && key !== 'message' && key !== 'stack') {
- str += '\n' + key + ': ' + this[key];
- }
- }.bind(this));
- if (this.causedBy) {
- str += '\nCaused by: ' + this.causedBy;
- }
- return str;
- },
- _isValidCause: function _isValidCause(causedBy) {
- return causedBy instanceof Error || _.isString(causedBy) || _.isObject(causedBy) && causedBy.message;
- },
- _setAdditionalInfo: function _setAdditionalInfo(additionalInfo) {
- if (_.isObject(additionalInfo)) {
- _.extend(this, additionalInfo);
- }
- }
- });
- return BaseError;
- });
- //# sourceMappingURL=BaseError.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2015, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/api/Url',['jquery', 'underscore', '../utils/Utils', 'jquery-bbq'], function ($, _, GlassUtils) {
- var urlApi = function urlApi() {};
- $.extend(urlApi.prototype, {
- URL_EMBED_API: [{
- key: 'closeWindowOnLastView',
- values: [true],
- getValue: function getValue(key, value, isEmbed) {
- return isEmbed === true ? true : value;
- },
- preserveInUrl: true
- }, {
- key: 'ui_appbar',
- values: [false],
- getValue: function getValue(key, value, isEmbed) {
- return isEmbed === true ? false : value;
- },
- preserveInUrl: true
- }, {
- key: 'ui_navbar',
- values: [false],
- getValue: function getValue(key, value, isEmbed) {
- return isEmbed === true ? false : value;
- },
- preserveInUrl: true
- }, {
- key: 'shareMode',
- values: ['embedded'],
- getValue: function getValue(key, value, isEmbed) {
- return isEmbed === true ? 'embedded' : undefined;
- }
- }, {
- key: 'productLocale',
- preserveInUrl: true
- }],
- URL_API: [{
- key: 'perspective'
- }, {
- key: 'pathRef'
- }, {
- key: 'factoryMode',
- values: [true],
- getValue: function getValue(key, value
- /*, isEmbed */
- ) {
- if (value === undefined) {
- return GlassUtils.isFactoryMode();
- } else {
- return value;
- }
- }
- }, {
- //Currently used for cacheID
- key: 'id'
- }, {
- key: 'nextgen3p'
- }, {
- key: 'prefetchsvc'
- }, {
- key: 'appcue'
- }],
- ENDPOINT_PATHS: {
- objRef: 'v1/objects',
- pathRef: 'v1/path',
- searchPathRef: 'v1/search_path'
- },
- _getUrlPath: function _getUrlPath() {
- return location.origin + location.pathname.split(/[?#]/)[0];
- },
- /**
- * encodes the characters that are not encoded by bbq according to rfc-3986
- * also encodes extra characters
- * @private
- * @param {String} queryParam - query string
- * @return {String} completed encoded query string
- */
- _completeURIEncoding: function _completeURIEncoding(queryParams) {
- var fullyEncoded = queryParams.replace(/[!'()*~]/g, function (char) {
- var encoded = '';
- switch (char) {
- case '!':
- encoded = '%21';
- break;
- case '\'':
- encoded = '%27';
- break;
- case '(':
- encoded = '%28';
- break;
- case ')':
- encoded = '%29';
- break;
- case '*':
- encoded = '%2A';
- break;
- case '~':
- encoded = '%7E';
- break;
- default:
- encoded = char;
- break;
- }
- return encoded;
- });
- return fullyEncoded;
- },
- /**
- * build a url for a given resource context
- * @public
- * @param {Object} context - The resource context.
- * @param {Object} context.urlMap - A map of key/value pairs to be converted into a queryString.
- * @param {String} context.urlMap.perspective - Value representing the perspective for this resource. (Required)
- * @param {String} context.urlMap.pathRef - Unique immutable key used to find the resource (Required when resource is persisted)
- * @param {Boolean} context.isEmbed - Indicates whether this a Share or Embed Context. Defaults to false (ie Share).
- * @param {Object} glassContext - context for the glass application
- * @returns a url String representing the applicable resource
- * @throws Will throw an error if context.urlMap is missing any required attributes (eg context.urlMap.perspective).
- */
- getUrl: function getUrl(context, glassContext) {
- if (_.isUndefined(glassContext)) {
- console.warn('The Glass Context is not being passed to the getUrl method. In the current usage of getUrl, the Glass Context should be passed as an argument --> getUrl(context, glassContext)');
- }
- var urlParms = this.getMap(context);
- var urlEncoderService = glassContext && glassContext.getCoreSvc('.URLEncoder');
- if (urlEncoderService) {
- for (var item in urlParms) {
- urlParms[item] = urlEncoderService.encodeQSValue(urlParms[item]);
- }
- }
- var urlPath = this._getUrlPath();
- var url = $.param.querystring(urlPath, urlParms); // eslint-disable-next-line
- var queryParams = url.replace(/^([^\?]+)(\?.+)$/, '$2');
- if (queryParams.indexOf('?') === 0) {
- url = urlPath + this._completeURIEncoding(queryParams);
- }
- return url;
- },
- /**
- * return only the public map for a given urlMap
- * @public
- * @param {Object} context - The resource context.
- * @param {Object} context.urlMap - A map of key/value pairs to be inspected
- * @param {String} context.urlMap.perspective - Value representing the perspective for this resource. (Required)
- * @param {Boolean} context.isEmbed - Indicates whether this a Share or Embed context. Defaults to false (ie Share).
- * @returns a clone of the supplied urlMap filtered by public keys
- * @throws Will throw an error if context.urlMap is missing any required attributes (eg context.urlMap.perspective).
- */
- getPublicMap: function getPublicMap(context) {
- //NOSONAR: necessary complexity
- context = context || {};
- var publicMap = {};
- var urlParms = context.urlMap || {}; //Validate URL API Parms
- $.each(this.URL_API, function (i, ruleObj) {
- //NOSONAR: necessary complexity
- var value = urlParms[ruleObj.key];
- if (_.isFunction(value)) {
- throw new Error('Value cannot be a function: ' + ruleObj.key);
- }
- if (ruleObj.required && !value) {
- throw new Error('Missing required attribute: ' + ruleObj.key);
- }
- var _value = _.isFunction(ruleObj.getValue) ? ruleObj.getValue(ruleObj.key, value, context.isEmbed) : undefined;
- value = !_.isUndefined(_value) ? _value : value;
- if (!_.isUndefined(value) && (ruleObj.preserveInUrl || !ruleObj.values || ruleObj.values.indexOf(value) >= 0)) {
- publicMap[ruleObj.key] = value;
- }
- }.bind(this));
- return publicMap;
- },
- /**
- * return the map for a given urlMap omitting unsupported public key values
- * @public
- * @param {Object} context - The resource context.
- * @param {Object} context.urlMap - A map of key/value pairs to be inspected
- * @param {String} context.urlMap.perspective - Value representing the perspective for this resource. (Required)
- * @param {Boolean} context.isEmbed - Indicates whether this a Share or Embed context. Defaults to false (ie Share).
- * @returns a clone of the supplied urlMap omitting unsupported keys
- * @throws Will throw an error if context.urlMap is missing any required attributes (eg context.urlMap.perspective).
- */
- getMap: function getMap(context) {
- context = context || {};
- var publicParms = this.getPublicMap(context);
- var publicKeys = _.pluck(urlApi.prototype.URL_API, 'key');
- var privateParms = _.omit(context.urlMap, publicKeys);
- $.each(privateParms, function (key, value) {
- if (_.isFunction(value)) {
- throw new Error('Value cannot be a function: ' + key);
- }
- });
- return $.extend(publicParms, privateParms);
- },
- isAppBarVisible: function isAppBarVisible(urlMap) {
- return !urlMap || urlMap.ui_appbar !== false;
- },
- /**
- * get objInfo for pathRef
- * @public
- * @param {Object} glassContext - The glassContext.
- * @param {String} pathRef - the path reference, unencoded
- * @param {Array} fields - array of fields to be picked and returned
- * @param {String} searchPath - the object search path reference, unencoded
- * @returns the promise with the objInfo applicable to the given pathRef
- */
- getPathRefInfo: function getPathRefInfo(glassContext, pathRef, fields, searchPath) {
- return this._getObjInfo(glassContext, this.ENDPOINT_PATHS['pathRef'] + '?path=' + encodeURIComponent(pathRef) + '&', fields, searchPath);
- },
- /**
- * get objInfo for objRef
- * @public
- * @param {Object} glassContext - The glassContext.
- * @param {String} objRef - the id reference, unencoded
- * @param {Array} fields - array of fields to be picked and returned
- * @returns the promise with the objInfo applicable to the given pathRef
- */
- getObjRefInfo: function getObjRefInfo(glassContext, objRef, fields) {
- return this._getObjInfo(glassContext, this.ENDPOINT_PATHS['objRef'] + '/' + encodeURIComponent(objRef) + '?', fields);
- },
- _getObjInfo: function _getObjInfo(glassContext, url, fields, searchPath) {
- var _this = this;
- if (!fields) {
- fields = ['type'];
- }
- var requestURL = url + 'fields=' + fields.concat(['id', 'path']).join(',');
- return this._getAjaxSvc(glassContext).ajax({
- url: requestURL,
- type: 'GET',
- dataType: 'json'
- }).then(function (response) {
- return _this._getFormattedObjInfo(response, fields);
- }).catch(function (error) {
- if (searchPath) {
- return _this._getObjInfoBySearchPath(glassContext, searchPath, fields);
- }
- throw error;
- });
- },
- _getObjInfoBySearchPath: function _getObjInfoBySearchPath(glassContext, searchPath, fields) {
- var _this2 = this;
- var searchUrl = this.ENDPOINT_PATHS['searchPathRef'] + '?searchPath=' + encodeURIComponent(searchPath) + '&fields=' + fields.concat(['id', 'path']).join(',');
- return this._getAjaxSvc(glassContext).ajax({
- url: searchUrl,
- type: 'GET',
- dataType: 'json'
- }).then(function (response) {
- return _this2._getFormattedObjInfo(response, fields);
- }).catch(function (error) {
- throw error;
- });
- },
- _getFormattedObjInfo: function _getFormattedObjInfo(objData, fields) {
- var obj = GlassUtils.getObjectProperty(['data', 'data', 0], objData);
- var pathRef = null;
- var url = GlassUtils.getObjectProperty(['_meta', 'links', 'path', 'url'], obj);
- if (url) {
- var index = url.indexOf('=');
- pathRef = decodeURIComponent(url.substring(index + 1));
- }
- var objId = obj.id ? obj.id : null;
- var objInfo = {
- pathRef: pathRef,
- objRef: objId
- };
- _.extend(objInfo, _.pick(obj, fields));
- return objInfo;
- },
- _getAjaxSvc: function _getAjaxSvc(glassContext) {
- if (glassContext && glassContext.getCoreSvc) {
- return glassContext.getCoreSvc('.Ajax');
- } else {
- console.warn('API Change: ba-glass-client/api/Url now expects "glassContext" instead of "services.ajax" in public API calls. Please update your code!'); // Terrible hack...
- return window.__glassAppController.glassContext.getCoreSvc('.Ajax');
- }
- },
- _isValueAcceptableAPIValue: function _isValueAcceptableAPIValue(API, value) {
- var isBooleanAsString = value === 'true' || value === 'false';
- if (isBooleanAsString) {
- value = JSON.parse(value);
- }
- return API.values.includes(value);
- },
- /**
- * get objInfo for pathRef or objRef
- * @public
- * @param {Object} glassContext - The glass context
- * @param {Object} content - the content containing either a pathRef or an objRef
- * @param {Array} fields - array of fields to be picked and returned
- * @returns the promise with the objInfo applicable to the given pathRef
- */
- getObjInfoFromContent: function getObjInfoFromContent(glassContext, content, fields) {
- return Promise.try(function () {
- if (content && content.pathRef) {
- return this.getPathRefInfo(glassContext, content.pathRef, fields);
- } else if (content && content.objRef) {
- return this.getObjRefInfo(glassContext, content.objRef, fields);
- } else {
- throw new Error('Missing pathRef and objRef');
- }
- }.bind(this));
- },
- getContextFromUrlMap: function getContextFromUrlMap(urlMap) {
- if (urlMap) {
- return {
- perspective: urlMap.perspective,
- content: urlMap
- };
- }
- },
- /**
- * get objInfo for pathRef
- * @public
- * @param {Object} module - The module
- * @param {Object} glassContext - The glass context
- * @param {Object} context - The resource context.
- * @returns Promise resolved by urlMap
- */
- getUrlMap: function getUrlMap(module, glassContext, context) {
- return Promise.resolve().then(function () {
- if (module && _.isFunction(module.execute)) {
- var appView = context && context.glassContext && context.glassContext.currentAppView;
- if (appView && appView.context && appView.context.isDefaultAction) {
- context.isDefaultAction = appView.context.isDefaultAction;
- }
- return Promise.resolve(module.execute(context)).then(function (urlMap) {
- if (context && context.urlMap && context.urlMap.pathRef) {
- return urlMap;
- } else {
- return this.getPathRef(glassContext, urlMap.objRef).then(function (pathRef) {
- if (context && context.mode !== 'defaultAction') {
- delete urlMap.objRef;
- }
- urlMap.pathRef = pathRef;
- return urlMap;
- }.bind(this));
- }
- }.bind(this));
- }
- }.bind(this));
- },
- /**
- * convert an objRef into a pathRef
- * @public
- * @param {Object} glassContext - The glassContext
- * @param {String} objRef - the object reference
- * @param {String} searchPath - the object search path, default undefined
- * @returns the pathRef applicable to the given objRef
- */
- getPathRef: function getPathRef(glassContext, objRef, searchPath) {
- if (objRef) {
- return this.getPathRefInfo(glassContext, objRef, null, searchPath).then(function (obj) {
- return obj.pathRef;
- });
- } else {
- return Promise.resolve();
- }
- },
- updateContextWithCurrentUIFilters: function updateContextWithCurrentUIFilters(currentUIFilters, newContext) {
- var _this3 = this;
- if (currentUIFilters) {
- this.URL_EMBED_API.forEach(function (API) {
- if (API.preserveInUrl && API.preserveInUrl === true) {
- if (currentUIFilters.hasOwnProperty(API.key) && _this3._isValueAcceptableAPIValue(API, currentUIFilters[API.key])) {
- newContext.content[API.key] = currentUIFilters[API.key];
- }
- }
- });
- }
- return newContext;
- }
- });
- urlApi.prototype.URL_UI_API = urlApi.prototype.URL_EMBED_API;
- urlApi.prototype.URL_API = _.union(urlApi.prototype.URL_API, urlApi.prototype.URL_UI_API);
- urlApi.MODES = {
- DYNAMIC: 'dynamic',
- CURRENT: 'current',
- DEFAULT_ACTION: 'defaultAction'
- };
- return urlApi;
- });
- //# sourceMappingURL=Url.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2015, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/KeyCodes',[], function () {
- return {
- NUM0: 48,
- NUM1: 49,
- NUM2: 50,
- NUM3: 51,
- NUM4: 52,
- NUM5: 53,
- NUM6: 54,
- NUM7: 55,
- NUM8: 56,
- NUM9: 57,
- // Letters: Upper and Lower Case share the same code, i.e. the code for "a" is 65, too.
- A: 65,
- B: 66,
- C: 67,
- D: 68,
- E: 69,
- F: 70,
- G: 71,
- H: 72,
- I: 73,
- J: 74,
- K: 75,
- L: 76,
- M: 77,
- N: 78,
- O: 79,
- P: 80,
- Q: 81,
- R: 82,
- S: 83,
- T: 84,
- U: 85,
- V: 86,
- W: 87,
- X: 88,
- Y: 89,
- Z: 90,
- NUMPAD0: 96,
- NUMPAD1: 97,
- NUMPAD2: 98,
- NUMPAD3: 99,
- NUMPAD4: 100,
- NUMPAD5: 101,
- NUMPAD6: 102,
- NUMPAD7: 103,
- NUMPAD8: 104,
- NUMPAD9: 105,
- F1: 112,
- F2: 113,
- F3: 114,
- F4: 115,
- F5: 116,
- F6: 117,
- F7: 118,
- F8: 119,
- F9: 120,
- F10: 121,
- F11: 122,
- F12: 123,
- // Note: some keys have the same shape but different number, like DIVIDE and FORWARDSLASH.
- // Make sure you're using the right key.
- BACKSPACE: 8,
- TAB: 9,
- ENTER: 13,
- SHIFT: 16,
- CTRL: 17,
- ALT: 18,
- PAUSEBREAK: 19,
- CAPSLOCK: 20,
- ESCAPE: 27,
- SPACE: 32,
- PAGEUP: 33,
- PAGEDOWN: 34,
- END: 35,
- HOME: 36,
- LEFT_ARROW: 37,
- UP_ARROW: 38,
- RIGHT_ARROW: 39,
- DOWN_ARROW: 40,
- INSERT: 45,
- DELETE: 46,
- SECOND: 50, // the same with NUM2. Keep it for history reason.
- LEFT_WINDOW_KEY: 91, // Left Command on Mac
- RIGHT_WINDOW_KEY: 92, // Right Command on Mac
- SELECT_KEY: 93,
- MULTIPLY: 106,
- ADD: 107,
- SUBTRACT: 109,
- DECIMAL_POINT: 110,
- DIVIDE: 111,
- NUM_LOCK: 144,
- SCROLL_LOCK: 145,
- SEMI_COLON: 186,
- EQUAL: 187,
- COMMA: 188,
- DASH: 189,
- PERIOD: 190,
- FORWARDSLASH: 191,
- GRAVE_ACCENT: 192,
- OPEN_BRACKET: 219,
- BACKSLASH: 220,
- CLOSE_BRACKET: 221,
- SINGLE_QUOTE: 222
- };
- });
- //# sourceMappingURL=KeyCodes.js.map
- ;
- define('text!baglass/core-client/js/core-client/ui/template/LoadingWaitAnimation1.html',[],function () { return '<div class="wait_loading_animation" role="presentation">\n\t<div id="wait_loader_div1" role="presentation"></div>\n\t<div id="wait_loader_div2" role="presentation"></div>\n\t<div id="wait_loader_div3" role="presentation"></div>\n\t<div id="wait_loader_div4" role="presentation"></div>\n\t<div id="wait_loader_div5" role="presentation"></div>\n\t<div id="wait_loader_div6" role="presentation"></div>\n\t<div id="wait_loader_div7" role="presentation"></div>\n\t<div id="wait_loader_div8" role="presentation"></div>\n</div>\n';});
- define('text!baglass/core-client/js/core-client/ui/template/LoadingWaitAnimation2.html',[],function () { return '<div class="wait_loading_bar" role="presentation">\n</div>';});
- define('text!baglass/core-client/js/core-client/ui/template/MediumSpinner.html',[],function () { return '<div class="mediumSpinner" role="presentation">\n</div>\n';});
- define('text!baglass/core-client/js/core-client/utils/templates/webfont.html',[],function () { return '<span role="img" class="webfont {{!it.icon}}" {{? it.tooltip}}title="{{!it.tooltip}}"{{?}} {{? it.label}}aria-label="{{!it.label}}"{{?}} {{? it.color}}style="color:{{!it.color}}"{{?}}></span>';});
- define('text!baglass/core-client/js/core-client/utils/templates/image.html',[],function () { return '<img src="{{!it.icon}}" {{? it.tooltip}}title="{{!it.tooltip}}"{{?}} {{? it.label}}alt="{{!it.label}}"{{?}}></img>';});
- define('text!baglass/core-client/js/core-client/utils/templates/svg.html',[],function () { return '<svg class="svgIcon" role="img" {{? it.label}}aria-label="{{!it.label}}"{{?}} focusable=false>\n\t{{? it.tooltip}}\n\t\t<title>\n\t\t\t{{!it.tooltip}}\n\t\t</title>\n\t{{?}}\n\t<use style="pointer-events: none; {{? it.fill}}fill:{{!it.fill}} {{?}}" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#{{!it.icon}}">\n\t</use>\n</svg>\n';});
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2015, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/BrowserUtils',[], function () {
- return {
- isBrowser: {
- ie: function ie() {
- return this.isIE();
- },
- ieEdge: function ieEdge() {
- return this.isIEEdge();
- },
- ie11: function ie11() {
- return this.isIE11();
- },
- ff: function ff() {
- return this.isFirefox();
- },
- chrome: function chrome() {
- return this.isChrome();
- },
- safari: function safari() {
- return this.isSafari();
- },
- iPad: function iPad() {
- return this.isIPad();
- }
- },
- isIE: function isIE() {
- return (/\b(MSIE|Trident|Edge)\b/.test(this._getUserAgent())
- );
- },
- isIE11: function isIE11() {
- return (/Trident\/7\./.test(this._getUserAgent())
- );
- },
- isIEEdge: function isIEEdge() {
- return (/Edge/.test(this._getUserAgent())
- );
- },
- isFirefox: function isFirefox() {
- return (/.*Firefox.*/i.test(this._getUserAgent())
- );
- },
- isChrome: function isChrome() {
- return (/chrome/i.test(this._getUserAgent()) && !this.isIE()
- );
- },
- isSafari: function isSafari() {
- return (/^((?!chrome|android|crios|fxios).)*safari/i.test(this._getUserAgent()) && !this.isChrome() && !this.isIE() && !this.isIPad()
- );
- },
- isIPad: function isIPad() {
- return (/iPad/i.test(this._getUserAgent())
- );
- },
- _getUserAgent: function _getUserAgent() {
- return navigator.userAgent;
- }
- };
- });
- //# sourceMappingURL=BrowserUtils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2015, 2021
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/LegacyUtils',['jquery', 'underscore', './BrowserUtils'], function ($, _, BrowserUtils) {
- return {
- /**
- * Launch a legacy Cognos application in a separate tab
- */
- legacyLaunch: function legacyLaunch(glassContext, tool, object) {
- this._openLegacyWindow(this._getLaunchParms(glassContext, tool, object));
- },
- /**
- * Get the URL to launch a legacy Cognos application
- */
- getLegacyLaunchUrl: function getLegacyLaunchUrl(glassContext, tool, object, action) {
- return this._getUrl(this._getLaunchParms(glassContext, tool, object, action));
- },
- _getLaunchParms: function _getLaunchParms(glassContext, tool, object, action) {
- var app = this.legacyApps[tool] || tool;
- if (!_.isUndefined(app) && !_.isUndefined(app.launchParams)) {
- return app.launchParams;
- } else {
- return {
- 'b_action': 'xts.run',
- 'm': 'portal/launch.xts',
- 'ui.gateway': glassContext.gateway + '/v1/disp',
- 'ui.tool': tool,
- 'ui.object': object,
- 'ui.action': action || 'new',
- 'launch.launchinWindow': 'true',
- 'backURL': 'disp?b_action=xts.run&m=portal/close.xts'
- };
- }
- },
- /*
- * Based on the user's capabilities and browser vendor,
- * determines whether the supplied tool can be used.
- * @See LegacyUtils.legacyApps for supported tool types.
- * @returns A boolean indicating whether the supplied tool can be used.
- */
- canUseLegacyTool: function canUseLegacyTool(glassContext, tool) {
- var toolInfo = this.legacyApps[tool] || tool;
- if (!_.isUndefined(toolInfo)) {
- var hasCapability = glassContext.hasCapability(toolInfo.capability);
- if (hasCapability) {
- var browsers = toolInfo.browsers;
- if (!_.isUndefined(browsers)) {
- for (var i = 0; i < browsers.length; i++) {
- var isBrowserFunc = BrowserUtils.isBrowser[browsers[i]];
- if (isBrowserFunc.call(BrowserUtils)) {
- return true;
- }
- }
- } else {
- return true;
- }
- }
- }
- return false;
- },
- legacyApps: {
- DashboardConsole: {
- icon: 'common-workspace',
- capability: 'canUseDashboardViewer',
- browsers: ['ie', 'ff', 'chrome', 'safari']
- },
- QueryStudio: {
- icon: 'common-query',
- capability: 'canUseQueryStudio',
- browsers: ['ie', 'ff']
- },
- AnalysisStudio: {
- icon: 'common-analysis_studio',
- capability: 'canUseAnalysisStudio',
- browsers: ['ie', 'ff']
- },
- DrillThrough: {
- icon: 'common-drill_through_definition',
- capability: 'canUseDrillThroughAssistant',
- launchParams: {
- 'b_action': 'xts.run',
- 'm': 'portal/cc_drillthrough.xts'
- }
- },
- EventStudio: {
- icon: 'common-agent',
- capability: 'canUseEventStudio',
- browsers: ['ie', 'ff', 'chrome']
- },
- Subscriptions: {
- capability: 'DO_NOT_SHOW_IN_COMPANION_APPS',
- launchParams: {
- 'b_action': 'xts.run',
- 'm': 'portal/subscriptions/subscriptions.xts'
- }
- },
- MetricsManager: {
- icon: 'common-metrics',
- capability: 'canUseMetricStudio',
- apps: {
- MetricStudio: {
- icon: 'common-metrics',
- capability: 'canUseMetricStudio',
- handler: function handler(evt) {
- this._launchLegacyWindow(evt);
- },
- browsers: ['ie', 'ff']
- },
- metricsFileImportTask: {
- icon: 'common-metricsImport',
- capability: 'canUseMetricsManagerAdministration'
- },
- metricsMaintenanceTask: {
- icon: 'common-metricsMaintenance',
- capability: 'canUseMetricsManagerAdministration'
- },
- metricsExportTask: {
- icon: 'common-metricsExport',
- capability: 'canUseMetricsManagerAdministration'
- },
- metricsPackage: {
- icon: 'common-metricsNewPackage',
- capability: 'canUseMetricsManagerAdministration',
- handler: function handler() {
- var queryParams = {
- 'b_action': 'mms.run',
- 'pid': 'new_mpwizard_start'
- };
- this._openLegacyWindow(queryParams);
- }
- }
- },
- handler: function handler(evt) {
- var queryParams = {
- 'b_action': 'xts.run',
- 'm': 'portal/newMetricsTasks/processNewTasks.xts',
- 'so.select': 'newmetricstaskspackage',
- 'so.return.m': 'portal/new_general.xts',
- 'm_new_class': evt.type
- };
- this._openLegacyWindow(queryParams);
- }
- },
- PowerplayStudio: {
- icon: 'common-powerPlayCube',
- capability: 'canUsePowerPlay',
- browsers: ['ie', 'ff', 'chrome', 'safari']
- },
- Controller: {
- icon: 'common-controller',
- capability: 'canUseControllerStudio',
- browsers: ['ie']
- },
- Contributor: {
- icon: 'common-planning',
- capability: 'canUsePlanningContributor'
- }
- },
- _openLegacyWindow: function _openLegacyWindow(queryParms) {
- this._openWindow(this._getUrl(queryParms));
- },
- _openWindow: function _openWindow(url) {
- window.open(url);
- },
- _launchLegacyWindow: function _launchLegacyWindow(evt) {
- this.legacyLaunch(evt.glassContext, evt.type);
- },
- _getUrl: function _getUrl(queryParms) {
- return 'v1/disp?' + $.param(queryParms, true);
- }
- };
- });
- //# sourceMappingURL=LegacyUtils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI
- *
- * Copyright IBM Corp. 2015
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/nls/CommonsResources',{
- "root": true,
- "cs": true,
- "da": true,
- "de": true,
- "es": true,
- "fi": true,
- "fr": true,
- "hr": true,
- "hu": true,
- "it": true,
- "ja": true,
- "kk": true,
- "ko": true,
- "no": true,
- "nb": true,
- "nl": true,
- "pl": true,
- "pt": true,
- "pt-br": true,
- "ro": true,
- "ru": true,
- "sl": true,
- "sv": true,
- "th": true,
- "tr": true,
- "zh": true,
- "zh-cn": true,
- "zh-tw": true
- });
- //# sourceMappingURL=CommonsResources.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/nls/root/CommonsResources',{
- "save": "Save",
- "saveAs": "Save as",
- "saveAsLabel": "Save as:",
- "teamFolders": "Team Folders",
- "open": "Open",
- "openDialogTitle": "Open file",
- "openDialogFooter": "Open and cancel button",
- "saveDialogTitle": "Save as",
- "saveDialogFooter": "Save and cancel button",
- "shareDialogTitle": "Share",
- "shareDialogCodeLabel": "Share URL",
- "shareDialogText": "Copy this link to share this content with other users.",
- "embedDialogTitle": "Embed",
- "embedDialogCodeLabel": "Embed code",
- "embedDialogText": "Copy this code to embed.",
- "embedURLWidthLabel": "Width:",
- "embedURLHeightLabel": "Height:",
- "embedURLWidth": "Width",
- "embedURLHeight": "Height",
- "filesToOpen": "Files to open:",
- "remove": "Remove",
- "loading": "Loading",
- "ok": "OK",
- "cancel": "Cancel",
- "close": "Close",
- "datasetLoading": "Your data set %{name} is loading...",
- "datasetFinishedLoading": "Your data set %{name} loaded successfully.",
- "datasetLoadingFailed": "Your data set %{name} did not load.",
- "datasetLoadingCancelled": "The loading of your data set %{name} was cancelled.",
- "datasetRefreshing": "Your data set %{name} is refreshing...",
- "datasetFinishedRefreshing": "Your data set %{name} refreshed successfully.",
- "datasetRefreshFailed": "Your data set %{name} did not refresh.",
- "datasetRefreshCancelled": "The refreshing of your data set %{name} was cancelled.",
- "userID": "User ID",
- "password": "Password",
- "signOnMessage": "Please provide your credentials to use this data",
- "rememberCre": "Remember my credentials",
- "signOnDialogFooter": "Submit and cancel button",
- "signOnTitle": "Credentials required: %{dataSource}",
- "errMessage": "The credentials are missing or invalid.\n Please type your credentials for authentication.",
- "submit": "Submit",
- "datepicker_input_describedby": "Type a date in the format YYYY dash MM dash DD.",
- "schedule_datepicker_label": "Date",
- "schedule_datepicker_description": "Date Picker",
- "time_picker_label": "Time",
- "bs_timepicker_container": "Time picker widget",
- "bs_timepicker_input_description": "Time picker",
- "bs_timepicker_input_describedby": "Type a time in the format HH colon MM AM or PM.",
- "bs_timepicker_hour_text": "Hour",
- "bs_timepicker_minute_text": "Minute",
- "bs_timepicker_meridian_text": "Meridian",
- "bs_timepicker_increment_hour": "Increment hour",
- "bs_timepicker_decrement_hour": "Decrement hour",
- "bs_timepicker_increment_minute": "Increment minute",
- "bs_timepicker_decrememt_minute": "Decrement minute",
- "bs_timepicker_toggle_meridian": "Toggle meridian",
- "unknown": "Unknown",
- "EllapsedTimeDays": "%{days}d %{hours}h %{minutes}m %{seconds}s",
- "EllapsedTimeHours": "%{hours}h %{minutes}m %{seconds}s",
- "EllapsedTimeMinutes": "%{minutes}m %{seconds}s",
- "EllapsedTimeSeconds": "%{seconds}s",
- "confirmRefreshUpload": "Confirm replacement of existing data",
- "msgConfirmRefreshUpload": "The file '%{fileName}' already exists. Do you want to replace its data with the data contained in the selected file?",
- "promptDialogTitle": "Prompt",
- "promptControlTitle": "Specify the prompt values for %{paramLabel}",
- "copyText": "Copy",
- "copySuccess": "Copied to Clipboard successfully",
- "copyFail": "Copy to Clipboard failed",
- "clear": "Clear",
- "invert": "Invert",
- "numSelected": "%{number} of %{total} selected",
- "search_box_default_text": "Find",
- "title": "Title",
- "back": "Back",
- "edit": "Edit",
- "invalidInput": "Invalid input",
- "owner": "Owner",
- "createdWithColon": "Created:",
- "modifiedWithColon": "Modified:",
- "typeWithColon": "Type:",
- "dataRefWithColon": "Data refreshed:",
- "defaultSlideoutLabel": "Slideout",
- "invalidNumber": "The value entered is not a number. Type a number.",
- "exceedMaxLength": "The text is too long. Shorten to %{maxLength} characters.",
- "invalidEmailMessage": "Email address is not valid.",
- "numberOutOfRange": "The value entered must be a number between %{min} and %{max}",
- "numberTooSmall": "The value entered must be a number greater than %{min}",
- "numberTooBig": "The value entered must be a number less than %{max}",
- "defaultCompleteMessage": "Operation completed.",
- "defaultProgressMessage": "Operation in progress...",
- "defaultFailMessage": "Operation failed.",
- "defaultIndefiniteMessage": "Operation in progress...",
- "defaultPauseMessage": "Operation paused.",
- "progressHideBtn": "Hide",
- "paginationControl": "Open Collapsed Slideout(s)",
- "confirmCancelMessage": "Do you want to discard your changes?",
- "confirmCancel": "Confirm cancel",
- "pinSlideout": "pin",
- "unpinSlideout": "Unpin",
- "details": "Details",
- "edit_palette": "Edit",
- "duplicate_palette": "Duplicate",
- "reverse_palette": "Reverse",
- "delete_palette": "Delete ",
- "palette_copy": "%{paletteName} copy",
- "showMoreColors": "More",
- "showLessColors": "Less",
- "addCustomColor": "Select custom color",
- "createPalette": "Create a custom palette",
- "moreActionsForPalette": "More actions for %{paletteName}",
- "showMoreColorPalette": "More"
- });
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI
- *
- * Copyright IBM Corp. 2015, 2016
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/nls/StringResources',['i18n!./CommonsResources', '../utils/Lexicon'], function (CommonsResources, Lexicon) {
- var lexicon = new Lexicon({
- data: CommonsResources,
- allowMissing: true,
- verbose: false
- });
- return {
- /**
- * Get the string resource for the given key and interpolation options
- *
- * @param key The key of the string to return
- * @param interpolationOptions Optional interpolation options (see poly.t documentation for details)
- * @returns The string to display
- */
- get: function get(key, interpolationOptions) {
- var translated = lexicon.translate(key, interpolationOptions);
- if (translated !== key) {
- return translated;
- }
- return Lexicon.NOT_TRANSLATED + '(' + key + ')';
- }
- };
- });
- //# sourceMappingURL=StringResources.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI UI_Commons
- * (C) Copyright IBM Corp. 2015, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/Utils',['jquery', 'underscore', 'doT', 'text!../ui/template/LoadingWaitAnimation1.html', 'text!../ui/template/LoadingWaitAnimation2.html', 'text!../ui/template/MediumSpinner.html', 'text!./templates/webfont.html', 'text!./templates/image.html', 'text!./templates/svg.html', './LegacyUtils', '../nls/StringResources', './BrowserUtils'], function ($, _, doT, animation1, animation2, MediumSpinner, webfontTemplate, imageTemplate, svgTemplate, LegacyUtils, StringResources, BrowserUtils) {
- /**
- * The patterns we will use to match the icon field beign passed in.
- */
- var matchPatterns = {
- WFG: 'wfg',
- WFT: 'wft',
- WFBI: 'wfbi'
- };
- var imageIcons = {
- PNG: '.png',
- JPEG: '.jpeg',
- JPG: '.jpg',
- GIF: '.gif',
- SVG: '.svg'
- };
- return {
- ALERT_ID: 'com-ibm-ca-alert',
- /** Sets the attribute only if value is defined.
- */
- setAttr: function setAttr($plugin, sAttr, sValue) {
- if (sValue) {
- $plugin.attr(sAttr, sValue);
- }
- },
- /** Adds the sClassname if it's defined to the element.
- *
- */
- addClass: function addClass($plugin, className) {
- if (className) {
- $plugin.addClass(className);
- }
- },
- _embed: function _embed(svg) {
- $('use', svg).each(function (i, use) {
- var href = use.getAttribute('xlink:href') || use.getAttribute('href');
- var useElement = $(href)[0];
- if (useElement) {
- var title = $('title', use)[0];
- var viewBox = !svg.getAttribute('viewBox') && useElement.getAttribute('viewBox');
- var newSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
- $.each(use.attributes, function (index, attr) {
- newSvg.setAttribute(attr.name, attr.value);
- });
- // conditionally set the viewBox on the SVG
- if (viewBox) {
- newSvg.setAttribute('viewBox', viewBox);
- }
- var clone = useElement.cloneNode(true);
- while (clone.firstChild) {
- if (clone.firstChild.tagName === 'title') {
- clone.removeChild(clone.firstChild);
- } else {
- newSvg.appendChild(clone.firstChild);
- }
- }
- var useParent = use.parentNode;
- useParent.appendChild(newSvg);
- if (title) {
- useParent.appendChild(title);
- }
- useParent.removeChild(use);
- }
- });
- },
- /** Embed the SVG use icon in the SVG itself.
- * @param parent of the SVG, can be a jQuery object or not.
- */
- embedSVGIcon: function embedSVGIcon(parent) {
- if (!BrowserUtils.isIE()) {
- return parent;
- }
- var $svg = $('svg', parent);
- if (!$svg.length) {
- $svg = $(parent).filter('svg');
- }
- if ($svg.length) {
- $svg.each(function (i, svg) {
- this._embed(svg);
- }.bind(this));
- }
- return parent;
- },
- /** Prepends an image to the specified jQuery $widget
- * @public
- * @param $widget either a jQuery in which to prepend the image/icon
- * @param icon the icon to insert. Can be a web font, an image URL or an svg sprite reference
- * @param iconTooltip the tooltip to use for this icon, if specified
- * @param ariaLabel The value to use for aria-label or alt attributes. If not specified, defaults to iconTooltip
- * @param right boolean. default is false. Set to true if the icon should be appended after the inner html.
- * @param iconColor color of the icon to be used
- */
- setIcon: function setIcon($widget, icon, iconTooltip, ariaLabel, right, iconColor) {
- if (icon) {
- if (!_.isBoolean(right)) {
- right = false;
- }
- var label = ariaLabel ? ariaLabel : iconTooltip;
- var template;
- var svg = false;
- if (this._isWebFont(icon)) {
- template = doT.template(webfontTemplate);
- } else if (this._isImageIcon(icon)) {
- template = doT.template(imageTemplate);
- } else {
- svg = true;
- template = doT.template(svgTemplate);
- }
- var html = template({
- icon: icon,
- tooltip: iconTooltip,
- label: label,
- color: iconColor,
- fill: iconColor
- });
- var $html = $(html);
- if (svg) {
- this.embedSVGIcon($html);
- }
- if (right) {
- $widget.append($html);
- } else {
- $widget.prepend($html);
- }
- }
- },
- /**
- * Show a loading animation to handle long operation; If the large format is shown,
- * an Aria alert element is inserted in the DOM for screen readers
- * @param {Number} type of loading icon; 1 is small; anything else or undefined is large
- * @returns A html object of the loading animation.
- */
- getLoadingAnimation: function getLoadingAnimation(number) {
- var $loadingIcon;
- var html;
- var options = {
- loadingBarLabel: StringResources.get('loading')
- };
- if (number === 1) {
- html = doT.template(animation1);
- } else {
- html = doT.template(animation2);
- this.activateAriaAlert(options.loadingBarLabel);
- }
- $loadingIcon = $(html(options));
- $loadingIcon.attr('aria-label', StringResources.get('loading'));
- return $loadingIcon[0];
- },
- /**
- * Show a loading Spinner animation to handle long operation.
- * @return a html object of the Spinner animation.
- */
- getSpinner: function getSpinner() {
- var options = {
- loadingBarLabel: StringResources.get('loading')
- };
- var html = doT.template(MediumSpinner);
- var $loadingIcon = $(html(options));
- $loadingIcon.attr('aria-label', StringResources.get('loading'));
- return $loadingIcon[0];
- },
- /**
- * Inserts or removes & adds an alert element at the DOM body level to be read by screen reader.
- * @param {String} Message to be read by screen reader
- */
- activateAriaAlert: function activateAriaAlert(sMessage) {
- if (!sMessage || !sMessage.length) {
- return;
- }
- var $divElem = $('#' + this.ALERT_ID);
- if ($divElem.length) {
- $divElem.remove();
- }
- $divElem = $('<div>', {
- 'id': this.ALERT_ID,
- 'style': 'position:absolute; top:-9000px;',
- 'role': 'alert',
- 'aria-live': 'assertive'
- });
- $divElem.text(sMessage);
- $('body').append($divElem);
- setTimeout(function () {
- $divElem.remove();
- }.bind(this), 100);
- },
- /**
- * Closes the currently open dialog. Assumes the dialog has a cancel button.
- * @public
- */
- closeDialog: function closeDialog() {
- $('.dialogBlocker').find('#cancel').trigger('primaryaction');
- },
- _isWebFont: function _isWebFont(icon) {
- if (icon) {
- for (var i in matchPatterns) {
- var pattern = matchPatterns[i];
- var regEx = new RegExp('^' + pattern, 'g');
- if (icon.search(regEx) !== -1) {
- return true;
- }
- }
- }
- return false;
- },
- _isImageIcon: function _isImageIcon(icon) {
- if (icon) {
- for (var i in imageIcons) {
- var pattern = imageIcons[i];
- var regEx = new RegExp(pattern, 'g');
- if (icon.search(regEx) !== -1) {
- return true;
- }
- }
- }
- return false;
- },
- /**
- * Launch a legacy Cognos application in a separate tab
- * @Deprected. See LegacyUtils.legacyLaunch
- */
- legacyLaunch: function legacyLaunch(glassContext, tool, object, folder) {
- return LegacyUtils.legacyLaunch(glassContext, tool, object, folder);
- },
- /**
- * @public
- * @property {String} EVENT_DIALOG - event property name.
- */
- EVENT_DIALOG: 'eventDialog',
- /**
- * @public
- * Sets the event property.
- *
- * @param {Object} event - The JQuery event object.
- * @param {String} propertyName - The property name to associate with the event.
- * @param {Object} propertyValue - The value of the property.
- *
- */
- setEventProperty: function setEventProperty(event, propertyName, propertyValue) {
- var srcEvent = this._getSourceEvent(event);
- srcEvent[propertyName] = propertyValue;
- },
- /**
- * @public
- * Gets the event property.
- *
- * @param {Object} event - The JQuery event object.
- * @param {String} propertyName - The property name to associate with the event.
- * @return {boolean} true if it is, false otherwise
- */
- getEventProperty: function getEventProperty(event, propertyName) {
- var srcEvent = this._getSourceEvent(event);
- return srcEvent[propertyName] && srcEvent[propertyName] === true;
- },
- _getSourceEvent: function _getSourceEvent(event) {
- var srcEvent;
- if (event.gesture) {
- srcEvent = event.gesture.srcEvent;
- } else if (event.originalEvent) {
- srcEvent = event.originalEvent;
- } else {
- srcEvent = event;
- }
- return srcEvent;
- },
- isIpad: function isIpad() {
- if (navigator.userAgent.match(/iPad/i) !== null) {
- $('body').addClass('mobile');
- return true;
- }
- return false;
- },
- /**
- * @public
- * Determines if the functional control key is pressed. For windows, this will
- * simply return true or false if <code>crtl</code> is pressed. For the Mac environment
- * this will return true or false if the <code>command</code> key is pressed. This is
- * because the <code>crtl</code> key maps to the <code>command</code> on a Mac. The
- * <code>control</code> key on a Mac does not provide the functionality that it does
- * in other environments (this is by Apple convention). The <code>control</code> key
- * in the Mac environment normally acts as though it were a "right-click", rather than
- * a secondary function key.
- *
- * @param {object} evt - a browser event object
- * @return {boolean} true if command key for Mac is pressed, or control key on other platforms. False otherwise
- */
- isControlKey: function isControlKey(evt) {
- var agentRegEx = /Macintosh/;
- if (agentRegEx.test(this._getBrowserUserAgent())) {
- return evt.metaKey;
- }
- return evt.ctrlKey;
- },
- _getBrowserUserAgent: function _getBrowserUserAgent() {
- return navigator.userAgent;
- },
- /**
- * @description Detect if a given window is in an iframe.
- * @param {Object} currentWindow (optional) - A window. If not provided, the current window will be used.
- * @returns {Boolean} true if window is in an iframe; false otherwise.
- */
- isInIframe: function isInIframe(currentWindow) {
- try {
- currentWindow = currentWindow || window;
- return currentWindow.self !== currentWindow.top;
- } catch (e) {
- // Cross-domain iframe will throw security acception when
- // attempting to access window.top.
- return true;
- }
- },
- /**
- Returns a formated duration string
- **/
- formatDuration: function formatDuration(milliseconds) {
- if (!milliseconds || isNaN(milliseconds)) {
- return StringResources.get('unknown');
- }
- var seconds = Math.floor(milliseconds / 1000);
- var minutes = Math.floor(seconds / 60);
- var hours = Math.floor(minutes / 60);
- var days = Math.floor(hours / 24);
- seconds = seconds % 60;
- minutes = minutes % 60;
- hours = hours % 24;
- if (days > 0) {
- return StringResources.get('EllapsedTimeDays', {
- 'days': days,
- 'hours': hours,
- 'minutes': minutes,
- 'seconds': seconds
- });
- } else if (hours > 0) {
- return StringResources.get('EllapsedTimeHours', {
- 'hours': hours,
- 'minutes': minutes,
- 'seconds': seconds
- });
- } else if (minutes > 0) {
- return StringResources.get('EllapsedTimeMinutes', {
- 'minutes': minutes,
- 'seconds': seconds
- });
- } else {
- return StringResources.get('EllapsedTimeSeconds', {
- 'seconds': seconds
- });
- }
- },
- /** Converts a rgb string to an hex representation of the color
- * @param rgb rgb string
- */
- rgbToHex: function rgbToHex(rgb) {
- rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
- return rgb && rgb.length === 4 ? '#' + ('0' + parseInt(rgb[1], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[2], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[3], 10).toString(16)).slice(-2) : '';
- },
- createTemporaryContainer: function createTemporaryContainer() {
- var container = $(document.body).find('.reactTemporaryContainer');
- if (container.length === 0) {
- container = $('<div class="reactTemporaryContainer">');
- $(document.body).append(container);
- }
- return container.get(0);
- },
- removeTemporaryContainer: function removeTemporaryContainer() {
- $(document.body).find('.reactTemporaryContainer').remove();
- },
- reactRender: function reactRender(element, container) {
- return new Promise(function (resolve, reject) {
- require(['react-dom'], function (ReactDOM) {
- try {
- ReactDOM.render(element, container, resolve);
- } catch (error) {
- reject(error);
- }
- }, reject);
- });
- },
- is24HrFormat: function is24HrFormat() {
- throw new Error('This function has been removed; Use core-client/utils/DateTimeUtils.is24HrFormat');
- },
- /**
- * @return the current Browser window object
- */
- getCurrentWindow: function getCurrentWindow() {
- return window;
- },
- createPerformanceMark: function createPerformanceMark() {
- throw new Error('This function has been removed; Use core-client/utils/PerfUtils.createPerformanceMark');
- },
- clearPerformanceMark: function clearPerformanceMark() {
- throw new Error('This function has been removed; Use core-client/utils/PerfUtils.clearPerformanceMark');
- },
- /**
- * @public
- * Traverse a JavaScript object and call matchCallback on each defined elements.
- * @returns found object
- *
- * @param {object} obj JavaScript object to be traversed
- * @param {function} matchCallback function which should return true when the element is matched
- * @example
- * utils.traverse([{id: 4}, {id: 5}], function(obj) {
- return obj.id === 4;
- });
- */
- traverse: function traverse(obj, matchCallback) {
- var queue = [obj];
- while (queue.length) {
- var current = queue.shift();
- if (current && matchCallback(current)) {
- return current;
- }
- if (_.isObject(current) || _.isArray(current)) {
- queue = queue.concat(_.values(current));
- }
- }
- }
- };
- });
- //# sourceMappingURL=Utils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI
- *
- * Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/ToastMessage',['./core/Class', 'underscore', 'jquery', 'toastr', '../utils/Utils', '../nls/StringResources', 'jquery-ui'], function (Class, _, $, toastr, utils, stringResources) {
- var ToastMessage = Class.extend(
- /**
- * @lends ToastMessage.prototype
- */
- {
- TIMEOUT: 3000,
- MAX_TOAST: 5,
- currentOptions: {},
- /**
- * @classdesc Class that allows you to create a toast message under the nav-bar. There is 4 type of toast :
- * 1.'success' to specify a positive message that a certain action was successfuly completed. (Default toast)
- * 2.'error' to specify an error after a certain action
- * 3.'warning' to warn the user.
- * 4.'info' to inform the user.
- * @constructs
- * @public
- * @param {Object} [options] Options to override the behaviour of the toast.
- * @param {String} [options.showMethod] : How the toast will show up (show, fadeIn, slideDown)
- * @param {String} [options.hideMethod] : How the toast will hide (hide, fadeOut,slideUp)
- * @param {String} [options.type] : Type of the toast (success, error, info, warning)
- * @param {String} [options.btnLabel] : Give a label to the close button
- * @param {Function} [options.callback] : Override the default callback for close button
- * @param {Function} [options.onHidden] : Override the default callback when the toast is hidden
- * @param {Function} [options.onShown] : Override the default callback when the toast is shown
- * @param {Boolean} [options.preventDuplicates] : When true, it prevents a same toast from appearing twice
- * @param {Number} [options.timeOut] : Optional value for custom timeout for the toast dismissal
- * @returns An object with the options of the toast.
- *
- * @example : var toast = new ToastMessage({'type':'warning', 'btnLabel':'OK', 'callback':function(){console.log('worked');}});
- */
- defaultOptions: {
- 'closeButton': true,
- 'newestOnTop': false,
- 'tapToDismiss': false,
- 'positionClass': 'toast-top-center',
- 'showDuration': '500',
- 'hideDuration': '500',
- 'showEasing': 'swing',
- 'hideEasing': 'linear',
- 'showMethod': 'slideDown',
- 'hideMethod': 'slideUp',
- 'type': 'success',
- iconClasses: {
- error: 'toast-error',
- info: 'toast-info',
- success: 'toast-success',
- warning: 'toast-warning'
- },
- 'secondaryLabel': stringResources.get('details')
- },
- init: function init(options) {
- this.toastrOptions = {};
- $.extend(true, this.toastrOptions, this.defaultOptions, options);
- this.toastrOptions.timeOut = this.toastrOptions.timeOut || 0;
- this.toastrOptions.extendedTimeOut = 0;
- ToastMessage.inherited('init', this, arguments);
- },
- render: function render(message) {
- var timestamp = $.now();
- var msgId = 'toast-message' + timestamp;
- var iconId = 'toast-icon' + timestamp;
- if (_.isUndefined(toastr.options.type)) {
- toastr.options.type = 'success';
- }
- var iconLabel = stringResources.get(toastr.options.type);
- if (toastr.options.btnLabel) {
- var $btn = $('<div></div>', {
- 'aria-label': toastr.options.btnLabel,
- 'title': toastr.options.btnLabel,
- 'class': 'toast-close-label',
- 'type': 'button',
- 'role': 'button',
- 'tabIndex': '0'
- });
- $btn.text(toastr.options.btnLabel);
- toastr.options.closeHtml = $btn[0];
- } else {
- var lblClose = stringResources.get('close');
- var $temp = $('<div></div>', {
- 'role': 'button',
- 'aria-label': lblClose,
- 'title': lblClose,
- 'class': 'toast-close-div',
- 'tabIndex': '0'
- });
- utils.setIcon($temp, 'common-close_icon', lblClose);
- toastr.options.closeHtml = $temp[0];
- }
- toastr.options.type = toastr.options.type.toLowerCase();
- var toastIcon = 'common-success';
- message = _.escape(message);
- if (this._isMessageLarge(message)) {
- _.each(toastr.options.iconClasses, function (value, key) {
- toastr.options.iconClasses[key] = value.concat(' large');
- });
- }
- var $el;
- switch (toastr.options.type) {
- case 'info':
- toastr.options.timeOut = toastr.options.timeOut === 0 ? this.TIMEOUT : toastr.options.timeOut;
- $el = toastr.info(message);
- toastIcon = 'common-info-moreinfo';
- break;
- case 'warning':
- toastr.options.timeOut = toastr.options.timeOut || 0;
- $el = toastr.warning(message);
- toastIcon = 'common-warning';
- break;
- case 'error':
- toastr.options.timeOut = toastr.options.timeOut || 0;
- $el = toastr.error(message);
- toastIcon = 'common-error';
- break;
- default:
- toastr.options.timeOut = toastr.options.timeOut === 0 ? this.TIMEOUT : toastr.options.timeOut;
- $el = toastr.success(message);
- }
- if ($el) {
- /*
- * Remove applicable container aria attributes added by Toastr
- * micro library which caused all visible toasts to be read again.
- */
- $el.parent().removeAttr('role aria-live');
- utils.activateAriaAlert(message);
- $el.attr('aria-labelledby', iconId + ' ' + msgId);
- $el.find('.toast-message').attr('id', msgId);
- var $iconToast = $('<div></div>', {
- 'class': 'toast-icon',
- 'id': iconId,
- 'aria-label': iconLabel
- });
- $el.append($iconToast);
- utils.setIcon($iconToast, toastIcon, iconLabel);
- if (_.isFunction(toastr.options.callback)) {
- $el.find('.toast-close-button').on('primaryaction', toastr.options.callback);
- }
- $($el).unbind('mouseenter mouseleave');
- var $closeBtn = $el.find('.toast-close-button');
- this._addSecondaryButton($closeBtn);
- $closeBtn.on('primaryaction', function (e) {
- $closeBtn.off('primaryaction');
- $closeBtn.trigger('click');
- this.setNextTabFocus($el);
- if (e) {
- e.stopPropagation();
- }
- }.bind(this));
- $el.on('click', function (e) {
- if (e) {
- e.stopPropagation();
- }
- }.bind(this));
- this._limitToast();
- }
- return $el;
- },
- /**
- * @classdesc Show the toast you created on the screen
- * @constructs
- * @public
- * @param {String} [message] Message of the toast
- * @returns a jquery object of the toast message
- * @example toast.show('A message');
- */
- show: function show(message) {
- toastr.options = this.toastrOptions;
- return this.render(message);
- },
- /** @protected */
- setNextTabFocus: function setNextTabFocus($el) {
- var $focusEl = $el.next('.toast').find('.toast-close-button').first();
- if ($focusEl.length === 0) {
- $focusEl = $el.prev('.toast').find('.toast-close-button').first();
- }
- if ($focusEl.length === 0) {
- //No toasts remain. Since Toasts are the last tab order, set focus to first tab in the document
- $(':tabbable:first').focus();
- } else {
- $focusEl.focus();
- }
- },
- _limitToast: function _limitToast() {
- var toastShown = $(document).find('#toast-container').children();
- if (toastShown.length > this.MAX_TOAST) {
- var removableToast = toastShown.length - this.MAX_TOAST;
- for (var i = 0; i < removableToast; i++) {
- if (!$(toastShown[i]).hasClass('toast-progress')) {
- toastr.clear($(toastShown[i]));
- }
- }
- }
- },
- _addSecondaryButton: function _addSecondaryButton($closeBtn) {
- var _this = this;
- if (this.toastrOptions.secondaryCallback) {
- var secondaryButton = $('<button class="secondaryButton">' + this.toastrOptions.secondaryLabel + '</button>');
- secondaryButton.click(function () {
- _this.toastrOptions.secondaryCallback();
- $closeBtn.trigger('primaryaction');
- });
- $closeBtn.after(secondaryButton);
- }
- },
- _isMessageLarge: function _isMessageLarge(message) {
- var result = false;
- var $tempDiv = $('<span class = "test-message">' + message + '</span>');
- $tempDiv.css('width', 200);
- $tempDiv.css('height', 'auto');
- $tempDiv.css('font-size', 15);
- $tempDiv.css('font-family', 'HelvNeue Roman for IBM');
- $tempDiv.css('word-wrap', 'break-word');
- var $container = $('<div></div>');
- $container.css('width', 200);
- $container.css('position', 'absolute');
- $container.css('left', -500);
- $container.append($tempDiv);
- $('body').append($container);
- result = $tempDiv.height() > 30;
- $container.remove();
- return result;
- }
- });
- ToastMessage.remove = function () {
- $('#toast-container').children(':not(.toast-progress)').remove();
- };
- return ToastMessage;
- });
- //# sourceMappingURL=ToastMessage.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/utils/CloseViewUtils',['jquery', 'baglass/nls/StringResources'], function ($, StringResources) {
- var CloseViewUtils = /*#__PURE__*/function () {
- function CloseViewUtils() {
- _classCallCheck(this, CloseViewUtils);
- }
- _createClass(CloseViewUtils, null, [{
- key: "waitForCloseConfirmation",
- value: function waitForCloseConfirmation(glassContext, options) {
- return new Promise(function (resolve, reject) {
- options = options || {};
- var message = options.unsaveMessage || StringResources.get('unsavedViewMsg2');
- var title = options.title || StringResources.get('unsavedViewMsg1');
- var buttons = [{
- defaultId: 'ok',
- text: StringResources.get('unsavedViewMsg3')
- }, 'cancel'];
- glassContext.showMessage(message, title, 'info', buttons, undefined, function (event) {
- if (event.btn === 'ok') {
- resolve();
- }
- reject();
- }).then(function () {
- $('.dialogButton.secondary').focus();
- });
- });
- }
- }]);
- return CloseViewUtils;
- }();
- return CloseViewUtils;
- });
- //# sourceMappingURL=CloseViewUtils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * "Restricted Materials of IBM"
- *
- * 5746-SM2
- *
- * (C) Copyright IBM Corp. 2016
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/AccessibleView',['jquery', 'underscore', './View'], function ($, _, View) {
- var AccessibleView = View.extend({
- /**
- * @classdesc Base class supporting keyboard accessibility by allowing the view to set focus within it's content and keep track of the launch point of the view.
- * @constructs
- * @public
- * @param {Object} options - set of initial properties
- * @param {DOMElement} [options.launchPoint] - the DOM UI element from which the view was launched. If not provided by the invoker, the last active element is used.
- * @param {Boolean} [options.enableTabLooping]- Set to true to allow tab looping within the view.
- */
- init: function init(options) {
- AccessibleView.inherited('init', this, arguments);
- _.extend(this, options);
- if (this.launchPoint === undefined || this.launchPoint === null) {
- this._launchPoint = document.activeElement;
- } else {
- this._launchPoint = this.launchPoint;
- delete this.launchPoint;
- }
- this.$entryHeader = $('<div tabindex="0" class="entryHeaderAV"></div>');
- this.$exitHeader = $('<div tabindex="0" class="exitHeaderAV"></div>');
- this.$el.append(this.$entryHeader);
- this.$el.append(this.$exitHeader);
- this.$entryHeader.on('focus', this._enterView.bind(this));
- this.$exitHeader.on('focus', this._setFocusToLaunchPoint.bind(this));
- },
- /**
- * Returns the launch point or the DOM element which invoked the current view. Implementing classes may override this method if there are special cases leading to
- * different launch points.
- * @public
- * @returns {String|DOM element|JQuery Object} the launch point which can be a String representing a JQuery selector, DOM element or Jquery Object
- */
- getLaunchPoint: function getLaunchPoint() {
- return this._launchPoint;
- },
- setInnerContent: function setInnerContent($content) {
- if ($content instanceof $) {
- $content.insertAfter(this.$exitHeader);
- }
- },
- _enterView: function _enterView() {
- var tabbableEls = this.$el.find(':tabbable');
- tabbableEls.eq(2).focus();
- },
- /**
- * Sets the launch point
- * @public
- * @param {String|DOM element|JQuery Object} - the launch point which can be a String representing a JQuery selector, DOM element or Jquery Object
- */
- setLaunchPoint: function setLaunchPoint(launchPoint) {
- this._launchPoint = launchPoint;
- },
- /**
- * Enables keyboard tab looping on a container.
- * @public
- * @param {JQuery Object} - the jquery UI object you want to enable the looping on.
- */
- enableLooping: function enableLooping($container) {
- if ($container instanceof $ && this.enableTabLooping === true && $container.next().hasClass('tabLoopFooter') === false) {
- this.$loopFooter = $('<div class="tabLoopFooter" tabindex="0" style="height:0px;width:0px"></div>');
- this.$loopFooter.insertAfter($container);
- this.$loopFooter.on('focus', this._tabToFirstElementInView.bind($container));
- this.$loopHeader = $('<div class="tabLoopHeader" tabindex="0" style="height:0px;width:0px"></div>');
- this.$loopHeader.insertBefore($container);
- this.$loopHeader.on('focus', this._tabToLastElementInView.bind($container));
- }
- },
- /**
- * @private
- * Action handler to shift the focus to the launch point when the root DOM node of the view gets the focus.
- */
- _setFocusToLaunchPoint: function _setFocusToLaunchPoint() {
- if (this.getLaunchPoint() !== undefined && this.getLaunchPoint() !== null) {
- $(this.getLaunchPoint()).focus();
- }
- },
- _tabToFirstElementInView: function _tabToFirstElementInView() {
- var firstTabbableElement = this.find(':tabbable').first();
- if (firstTabbableElement !== undefined && firstTabbableElement !== null) {
- firstTabbableElement.focus();
- }
- },
- _tabToLastElementInView: function _tabToLastElementInView() {
- var lastTabbableElement = this.find(':tabbable').last();
- if (lastTabbableElement !== undefined && lastTabbableElement !== null) {
- lastTabbableElement.focus();
- }
- },
- /**
- * @public
- * Removes the root container for the View from the natural tab order. Does not work for the content of the view.
- * The contributors are responsible for ensuring that the content they put in the view is also taken our of the natural tab order.
- */
- removeContainerOnlyFromTabOrder: function removeContainerOnlyFromTabOrder() {
- this.$entryHeader.removeAttr('tabIndex');
- this.$exitHeader.removeAttr('tabIndex');
- if (this.$loopFooter) {
- this.$loopFooter.removeAttr('tabIndex');
- }
- if (this.$loopHeader) {
- this.$loopHeader.removeAttr('tabIndex');
- }
- },
- /**
- * @public
- * Adds the root container for the View to the natural tab order. Does not work for the content of the view.
- * The contributors are responsible for ensuring that the content they put in the view is also put back in the natural tab order.
- */
- enterContainerOnlyInTabOrder: function enterContainerOnlyInTabOrder() {
- this.$entryHeader.attr('tabindex', '0');
- this.$exitHeader.attr('tabindex', '0');
- if (this.$loopFooter) {
- this.$loopFooter.attr('tabIndex', '0');
- }
- if (this.$loopHeader) {
- this.$loopHeader.attr('tabIndex', '0');
- }
- },
- remove: function remove() {
- AccessibleView.inherited('remove', this, arguments);
- }
- });
- return AccessibleView;
- });
- //# sourceMappingURL=AccessibleView.js.map
- ;
- define('baglass/core-client/js/core-client/utils/PerfUtils',['underscore'], function (_) {
- return {
- /**
- * @public
- * Create a performance entry in the browser's performance entry buffer.
- *
- * @param {string} options.component - component name, for example, glass
- * @param {String} options.name - entry name, for example, openPerspective
- * @param {String} options.state - state, for example, start or stop
- */
- createPerformanceMark: function createPerformanceMark(options) {
- if (!_.isUndefined(options)) {
- var performance = this._getPerformance();
- if (!_.isUndefined(performance) && _.isFunction(performance.mark)) {
- performance.mark(options.component + '-' + options.name + '-' + options.state);
- }
- }
- },
- /**
- * @public
- * Clear a performance entry in the browser's performance entry buffer.
- *
- * @param {string} options.component
- * @param {String} options.name
- * @param {String} options.state
- */
- clearPerformanceMark: function clearPerformanceMark(options) {
- if (!_.isUndefined(options)) {
- var performance = this._getPerformance();
- if (!_.isUndefined(performance) && _.isFunction(performance.clearMarks)) {
- performance.clearMarks(options.component + '-' + options.name + '-' + options.state);
- }
- }
- },
- _getPerformance: function _getPerformance() {
- return performance;
- }
- };
- });
- //# sourceMappingURL=PerfUtils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * Copyright IBM Corp. 2015, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/Slideout',['./AccessibleView', 'jquery', 'underscore', '../utils/ClassFactory', '../utils/Utils', '../utils/PerfUtils', '../nls/StringResources', 'jquery-ui', 'touch-punch'], function (View, $, _, ClassFactory, Utils, PerfUtils, StringResources) {
- /**
- * This Class is the Glass Slider
- */
- var Slideout = null;
- /**
- * Sets the id of the slideout
- */
- function __setId() {
- if (!_.isString(this.id)) {
- this.id = this.content && _.isString(this.content.module) ? this.content.module : _.uniqueId('undefinedModule');
- }
- }
- function __isTargetInSlideout(slideout, target) {
- var targetInSlideout = false;
- while (slideout !== null) {
- targetInSlideout = targetInSlideout || $.contains(slideout.$el.get(0), target);
- slideout = slideout.child;
- }
- return targetInSlideout;
- }
- function __isUniqueOption(hidingOptions, optionToCheck) {
- return hidingOptions.every(function (hidingOption) {
- return ['force', 'hideOnly', 'depth', 'isEscape'].some(function (prop) {
- return hidingOption[prop] !== optionToCheck[prop];
- });
- });
- }
- /**
- * We cancel the hide if any of the following conditions applies:
- * jshint maxcomplexity:14
- */
- function __shouldSlideoutHide(slideout, event, lastMouseDownEvent) {
- // - The event target is a child of the slideout
- if (__isTargetInSlideout(slideout, event.target)) {
- return false;
- }
- // - The event target is not a part of the body. This is to avoid closing the slideout when updating the content in the maximized content apps view
- if (!$.contains(document.body, event.target)) {
- return false;
- }
- // - preventDefault has been called.
- if (event.isDefaultPrevented()) {
- return false;
- }
- // - The container is hidden
- if (slideout.$el.closest('.tabhidden').length !== 0) {
- return false;
- }
- // - The event is a dialog event
- if (Utils.getEventProperty(event, Utils.EVENT_DIALOG)) {
- return false;
- }
- // - The mouse down event was in the slideout. This avoids closing the slideout if we click inside the slideout and drag the mouse outside the slideout.
- // For example, by selecting the resizable handle, and then release the mouse outside of the slideout.
- if (lastMouseDownEvent !== null && __isTargetInSlideout(slideout, lastMouseDownEvent.target)) {
- return false;
- }
- return true;
- }
- /**
- * creates the hideHandler only for the parent
- */
- function __createHideHandler() {
- var lastMouseDownEvent = null;
- if (this.parent === null) {
- this.hideHandler = function (event) {
- if (event.type === 'mousedown' || event.type === 'touchstart') {
- lastMouseDownEvent = event;
- } else {
- if (__shouldSlideoutHide(this, event, lastMouseDownEvent)) {
- this.hide({
- hideOnly: this.hideOnly
- });
- }
- lastMouseDownEvent = null;
- }
- }.bind(this);
- }
- }
- /**
- * Complete the hide operation
- * Wire off the hide handler if necessary and trigger the hide event
- */
- function __completeHide() {
- if (this.hideHandler !== null && !this.hasOpenChild()) {
- $(document).off(this.closeEventPattern, this.hideHandler);
- }
- this.$el.children('.ui-resizable-handle').hide();
- this.trigger('hide');
- }
- function __addChild(child, options) {
- var _this = this;
- if (!this.addChildLocked) {
- this.addChildLocked = true;
- this.removeChild().then(function () {
- _this.child = child;
- if (options.overlay) {
- _this.$el.css('z-index', '2999');
- $(_this.$el.parents()[0]).append(_this.child.$el);
- } else {
- _this.$el.children('.pane-child').append(_this.child.$el);
- }
- _this.child.render();
- _this.child.setContent(options.content);
- return _this.child.show();
- }).then(function () {
- _this.addChildLocked = false;
- });
- }
- }
- /**
- * @public
- */
- Slideout = View.extend(
- /**
- * @lends Slideout.prototype
- */
- {
- _ClassFactory: ClassFactory,
- /**
- * delay after which the animation is considered complete
- */
- ANIMATION_TIMEOUT: 500,
- /**
- * Default limit for the number of slideout being shown before the collapse bar appears
- */
- DISPLAY_LIMIT: 3,
- /**
- * This value has to be exactly the same as the value in slideout.css line 177 - the width of the pagination pane
- */
- PAGINATION_WIDTH: 36,
- open: false,
- events: {
- 'primaryaction .pane-pagination-control': 'pageBack',
- 'primaryaction .pin-icon': '_togglePin'
- },
- closeEventPattern: 'mousedown.slideout touchstart.slideout clicktap.slideout',
- /**
- * This type is used to provide info on how the slideout is shown
- * @typedef DisplayInfo
- * @type Object
- * @property {Slideout} firstToCollapse - first slideout to collapse if required
- * @property {Number} width - width of the displayed slideouts
- * @property {Slideout[]} visible - Array of displayed slideouts
- * @property {Number} firstDisplayedAfterCollapsed - expected to be null when there is no slideout to collapse
- * @property {Slideout[]} collapsed - Arrays of slideouts to collapse
- */
- /**
- * @classdesc class allowing to open/show/hide/close a slider
- * @constructs
- * @public
- * @param {Object} options - set of initial properties
- * @param {String} options.position - The position of the slideout; Supported values: left and right
- * @param {GlassContext} options.glassContext - The glassContext of the application
- * @param {Number} options.width - The width for the slideout
- * @param {Number} [options.displayLimit] - Number of slideouts being shown without being collapsed where there is enough space
- * @param {function} [options.onHide] - callback invoked when the slideout.hide is invoked
- * @param {Object} [options.pinning] - pinning properties
- * @param {boolean} [options.pinning.isPinned=false] - slideout is pinned when true
- * @param {boolean} [options.pinning.float=true] - no-float class is applied when false
- * @param {boolean} [options.pinning.display=false or true if isPinned is true] - default pin is shown when true
- * @param {Number} [options.collapseRootIndex=0] - index of the slideout which is to be the root of the collapse
- * @param {Boolean} [options.hideOnly=undefined] - indicates if the slideout is to be hidden only. Only applicable for the parent/whole slideout
- * @param {Boolean} [options.hideOnParentClick=true] - indicates if the slideout is to be hidden only when closing it using the clicktap event. Only applicable for the parent/whole slideout
- * @param {String} [options.label=Slideout] - specifies the label that will be used for the slideout by assistive technologies.
- * @param {Boolean} [options.enableTabLooping=undefined] - if true, enable tab looping within the slideout.
- * @param {Boolean} [options.resizable=false] - if true or object, the slideout will have a resizable handle.
- * @param {function} [options.onResize] - callback invoked during slideout resize
- * @param {function} [options.onResizeStart] - callback invoked at the beginning of slideout resize
- * @param {function} [options.onResizeStop] - callback invoked at the end of slideout resize
- * @param {Boolean} [options.resizable.min=300] - The minimum width the slideout should be allowed to resize to.
- * @param {Boolean} [options.resizable.max=1000] - The maximum width the slideout should be allowed to resize to.
- * @example
- * To create a left slideout:
- * new Slideout({
- * glassContext: this.glassContext,
- * position: 'left'
- * });
- *
- * To create a left pinned slideout without the shown pin:
- * new Slideout({
- * glassContext: this.glassContext,
- * position: 'left',
- * pinning: {
- * isPinned: true,
- * display: false
- * }
- * });
- *
- * */
- init: function init(options) {
- this.child = null;
- this.open = false;
- this.parent = null;
- Slideout.inherited('init', this, arguments);
- $.extend(this, options);
- this.hideHandler = null;
- this._showing = null;
- this.hideOnParentClick = this.hideOnParentClick !== false;
- this._root = this.parent === null ? this : this.parent._root;
- this._index = this.parent === null ? 0 : this.parent._index + 1;
- this.__initPinningSettings();
- this.__initDisplaySettings();
- __setId.call(this);
- __createHideHandler.call(this, options);
- this._childToAdd = [];
- this._paginationLaunchPoint = null;
- if (this.label === undefined || this.label === null) {
- this.label = _.uniqueId(StringResources.get('defaultSlideoutLabel'));
- }
- },
- /**
- * initializes the pinning info
- * When the slideout is marked as pinned, the pin is shown by default
- */
- __initPinningSettings: function __initPinningSettings() {
- if (_.isUndefined(this.pinning)) {
- this.pinning = {
- isPinned: false,
- float: true,
- display: false
- };
- }
- if (!_.isBoolean(this.pinning.isPinned)) {
- this.pinning.isPinned = false;
- }
- if (!_.isBoolean(this.pinning.float)) {
- this.pinning.float = true;
- }
- if (!_.isBoolean(this.pinning.display)) {
- if (this.pinning.isPinned === true) {
- this.pinning.display = true;
- } else {
- this.pinning.display = false;
- }
- }
- },
- /**
- * initializes the display settings
- */
- __initDisplaySettings: function __initDisplaySettings() {
- this._displayIndex = this.parent !== null && this.overlay === true ? this.parent._displayIndex : this._index;
- if (this.parent === null) {
- this._root.displayLimit = _.isNumber(this.displayLimit) && this.displayLimit > 0 ? this.displayLimit : Slideout.prototype.DISPLAY_LIMIT;
- this._root.collapseRootIndex = _.isNumber(this.collapseRootIndex) && this.collapseRootIndex >= 0 ? this.collapseRootIndex : 0;
- }
- this._displayInfo = {
- firstDisplayedAfterCollapsed: null
- };
- },
- /**
- * Gets the slidedout id
- * @public
- *
- */
- getRootId: function getRootId() {
- return this.getRootParent().id;
- },
- /**
- * Determines if the slideout is the last one
- * @public
- * @return {Boolean} true if it is, false otherwise
- */
- isLast: function isLast() {
- return this.child === null;
- },
- /**
- * renders content to page
- * @param content. Content to be displayed to the page
- *
- * */
- setContent: function setContent(content) {
- if (this.contentView) {
- this.contentView.remove();
- this.contentView = null;
- }
- this.content = content;
- if (this.isRendered && _.isObject(this.content) && this.content.module) {
- return this._createContent();
- }
- return Promise.resolve();
- },
- /**
- * sets pinned value
- * @param pinned. Boolean value
- *
- * */
- setPinned: function setPinned(pinned) {
- if (pinned === undefined) {
- this.pinning.isPinned = false;
- } else {
- this.pinning.isPinned = pinned;
- }
- this._updatePinCss();
- this.trigger('change:pinState', {
- pinned: this.isPinned()
- });
- },
- /**
- * @return {Number} displayLimit - the number of slideouts being shown before the collapse bar is shown
- */
- getDisplayLimit: function getDisplayLimit() {
- return this._root.displayLimit;
- },
- _handleEscape: function _handleEscape() {
- var paneContainer = this.$el.children('.pane-child');
- var pane = paneContainer.children();
- if (pane.length >= 1) {
- this.removeChild();
- } else {
- this.hide({
- hideOnly: this.hideOnly,
- force: true,
- isEscape: true
- });
- }
- },
- /**
- * render slideout to the page
- *
- * */
- render: function render() {
- PerfUtils.createPerformanceMark({
- 'component': 'glass',
- 'name': 'renderSlideout',
- 'state': 'start'
- });
- this.isRendered = true;
- this.$el.attr('role', 'group');
- this.$el.attr('aria-label', this.label);
- if (!this.parent) {
- this.$el.addClass('root');
- this._windowResizeHandler = this._collapseChildren.bind(this);
- $(window).on('resize', this._windowResizeHandler);
- this.$el.on('escapeaction', $.proxy(this._handleEscape, this));
- }
- this.fireResizeStart = true;
- this.$el.on('resize', this._handleResize.bind(this));
- this.$el.addClass('flyoutPane pane-' + this.position);
- var $content = $('<div class="pane-pagination-control" role="button"></div><div class="pane-content"></div><div class="pane-child"></div>');
- this.setInnerContent($content);
- var $paginationControl = this.$el.find('.pane-pagination-control');
- Utils.setIcon($paginationControl, 'common-chevron_left');
- var paginationAriaLabel = StringResources.get('paginationControl');
- $paginationControl.attr('aria-label', paginationAriaLabel);
- if (this.width) {
- this.setWidth(this.width);
- }
- if (this.resizable) {
- this._setResizable($content);
- }
- if (this.isPinDisplayed()) {
- this.$el.find('.pane-content').append('<div class="pin-icon-container"><div class="pin-icon" tabindex="0"><svg class="svgIcon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-pin"></use></svg></div></div>');
- var $pin = this.$el.find('.pin-icon');
- var ariaLabel;
- if (!this.isPinned()) {
- $pin.addClass('transform-pin');
- ariaLabel = StringResources.get('pinSlideout');
- } else {
- this.$el.find('.pane-content').addClass('pane-pinned');
- ariaLabel = StringResources.get('unpinSlideout');
- }
- $pin.attr('aria-label', ariaLabel);
- }
- if (_.isObject(this.content) && this.content.module) {
- return this._createContent();
- } else {
- return Promise.resolve();
- }
- },
- _onResizeStop: function _onResizeStop(event) {
- return function () {
- this.onResizeStop && this.onResizeStop(event);
- this.fireResizeStart = true;
- }.bind(this);
- },
- _handleResize: function _handleResize(event) {
- if (event.target === event.currentTarget) {
- if (this.fireResizeStart) {
- this.onResizeStart && this.onResizeStart(event);
- this.fireResizeStart = false;
- }
- this.onResize && this.onResize(event);
- clearTimeout(this.resizeTimeout);
- this.resizeTimeout = setTimeout(this._onResizeStop(event), 200);
- }
- },
- /**
- * Adds and shows a child slideout
- * It waits for 600ms till the slideout is open before adding it; otherwise showing the child may occur before the parent is actually
- * shown. In this case the child is not displayed
- * @public
- * @param {object} [options] - same options as the constructor except for position, glassContext which are retrieved from the current slideout and extra properties
- * @param {Boolean} [options.overlay=false] - the child is shown on the top of the parent if true
- * @param {Number} [options.width] - Width of the child slideout - if slideout is an overlay and is smaller, will be overriden with the width of the parent
- * @param {launchPoint} [options.launchPoint]- Optional, The UI dom element that launched the slideout. The last active element if not specified.
- * @param {String} [options.label]- The aria-label for the slideout. If no label is provided a default label is used.
- * @return {Slideout} Child slideout; It may be returned before the slideout is actually shown
- */
- addChild: function addChild(options) {
- var childOptions = _.isObject(options) ? options : {};
- childOptions.overlay = childOptions.overlay === true;
- if (childOptions.overlay && (_.isUndefined(childOptions.width) || childOptions.width < this.width)) {
- childOptions.width = this.width;
- }
- var child = this._createSlideout({
- glassContext: this.glassContext,
- position: this.position,
- overlay: childOptions.overlay,
- hideOnParentClick: childOptions.hideOnParentClick,
- width: childOptions.width,
- onHide: childOptions.onHide,
- pinning: childOptions.pinning,
- launchPoint: childOptions.launchPoint,
- label: childOptions.label,
- parent: this,
- enableTabLooping: childOptions.enableTabLooping,
- resizable: childOptions.resizable
- });
- if (this.open) {
- __addChild.call(this, child, childOptions);
- } else {
- this._childToAdd.push(function (child, childOptions) {
- __addChild.call(this, child, childOptions);
- }.bind(this, child, childOptions));
- }
- return child;
- },
- removeChild: function removeChild(options) {
- if (this.child !== null) {
- return this.child.hide(options);
- } else {
- return Promise.resolve();
- }
- },
- /**
- * @return true if the slideout is pinned, false otherwise
- */
- isPinned: function isPinned() {
- return this.pinning.isPinned;
- },
- isFloat: function isFloat() {
- return this.pinning.float;
- },
- isPinDisplayed: function isPinDisplayed() {
- return this.pinning.display;
- },
- _initializePinning: function _initializePinning() {
- this.pinning = {
- isPinned: false,
- float: true,
- display: false
- };
- },
- /**
- * Shows the rendered slideout.
- * Attaches hide callback on the clicktap event
- * Triggers 'done:show' event when the animation completes
- * For Pinned slideouts that have the pinning.float set to false, the no-float class is added.
- * See this._hide where it is removed
- * @public
- *
- * **/
- show: function show() {
- var shown;
- if (this.open || this.isBeingShown()) {
- shown = this._showing;
- } else {
- shown = this._showing = Promise.delay(30).then(function () {
- this.trigger('show');
- return this._show();
- }.bind(this)).then(this._setFocusOnLast.bind(this));
- }
- return shown;
- },
- _setFocusOnLast: function _setFocusOnLast() {
- if (this.isLast()) {
- try {
- if (this.contentView) {
- this._setFocusInContentView();
- }
- } catch (err) {
- return err;
- }
- }
- },
- /**
- * internal show method
- */
- _show: function _show() {
- this.$el.children('.ui-resizable-handle').show();
- this.$el.children('.pane-content').removeClass('tabhidden');
- this.$el.addClass('active');
- this.$el.removeClass('inactive');
- this.enterContainerOnlyInTabOrder();
- this.open = true;
- if (this.child !== null) {
- this.child.show();
- }
- var childToAdd = _.last(this._childToAdd);
- this._childToAdd = [];
- if (_.isFunction(childToAdd)) {
- childToAdd();
- }
- if (this.$el.hasClass('root')) {
- this._button = $('.toolpane button.currentlySelected');
- this._button.addClass('slideoutOpen');
- }
- if (this.hideHandler !== null) {
- $(document).on(this.closeEventPattern, null, {
- allowPropagationDefaultAction: true
- }, this.hideHandler);
- }
- this._addShadowToFinalSlideoutChild();
- if (this.parent !== null && this.hideOnParentClick === true) {
- this.parent.$el.children('.pane-content').on('clicktap.removeChild', function () {
- this.removeChild();
- }.bind(this.parent));
- }
- // Wait for the animation to complete as interrupting an animation causes artifacts on FireFox
- return this.whenAnimationDone('show').then(this._showHelper.bind(this));
- },
- _showHelper: function _showHelper() {
- if (this.child === null) {
- this._collapseChildren();
- }
- if (this.isPinned() && !this.isFloat() && !this.$el.hasClass('no-float')) {
- this._updatePinCss();
- }
- this.trigger('done:show');
- },
- /**
- * @return {Boolean} true if it is open
- */
- isOpen: function isOpen() {
- return this.open;
- },
- /**
- * Checks if the slideout is currently being shown
- * @return {Boolean} true it is showing
- */
- isBeingShown: function isBeingShown() {
- return this._showing !== null && this._showing.isPending();
- },
- /**
- * Checks if the current slideout has any open child
- * @return {boolean} true if there is at least one open child
- */
- hasOpenChild: function hasOpenChild() {
- var child = this.child;
- var hasOpenChild = false;
- while (child !== null && !hasOpenChild) {
- hasOpenChild = child.open;
- child = child.child;
- }
- return hasOpenChild;
- },
- /**
- * hides content on the page. changes div from class 'active' to 'inactive'
- * also removes the slideout element from the DOM after the animation is finished
- * <p>
- * When a parent pinned is found, continue the hiding process to delete the children.
- * Important limitation: a unpinned parent hides all the children, whatever their pin state.
- *
- * </p>
- * @public
- *
- * @param {Object} [options] set of hide options
- * @param {boolean} [options.force=false] - hides pinned slideout
- * @param {boolean} [options.hideOnly=false] - if true, keeps the slideout element in the DOM
- * @param {Number} [options.depth=-1] - index of the last slideout to hide: this is only applicable when options.hideOnly is true; -1 or lower means all slideouts are hidden; 0 means only the current one is removed
- * @param {boolean} [options.isEscape=false] - specified if the hide operation is to be executed in a escape context or not ; it is set to true in the escape handler of the root slideout
- * @return {Promise} resolve when the slideout is hidden; rejected if it is not
- * @example
- * To hide a pinned slideout: slideout.hide({force: true});
- * If hide() is called more than once before resolving, we store an array of promises to ensure they are all handled in seqeunce.
- * Only one hide call per unique options signature will be executed (a unique options signature is defined as having at least one different option as defined above relative to all other options objects)
- * **/
- hide: function hide(options) {
- var doHiding = function (options) {
- var _this2 = this;
- var force = _.isObject(options) && options.force === true;
- var hideOnly = _.isObject(options) && options.hideOnly === true;
- var depth = _.isObject(options) && _.isNumber(options.depth) && hideOnly ? options.depth : -1;
- var fullHideOptions = $.extend({}, {
- force: force,
- hideOnly: hideOnly,
- depth: depth
- });
- var isEscape = _.isObject(options) && options.isEscape === true;
- return this._canHide({
- isEscape: isEscape,
- depth: depth
- }).then(this._doHide.bind(this, fullHideOptions)).then(function () {
- if (this._button && this === this.getRootParent()) {
- this._button.removeClass('slideoutOpen');
- this._button.removeClass('currentlySelected');
- this._button = null;
- }
- }.bind(this)).finally(function () {
- _this2._hidingPromises.shift();
- _this2._hidingOptions.shift();
- });
- }.bind(this);
- if (!this._hidingPromises || this._hidingPromises.length === 0) {
- this._hidingPromises = [];
- this._hidingOptions = [];
- this._hidingPromises.push(doHiding(options));
- this._hidingOptions.push(options || {});
- } else if (__isUniqueOption(this._hidingOptions, options || {})) {
- this._hidingOptions.push(options || {});
- this._hidingPromises.push(_.last(this._hidingPromises).finally(function () {
- return doHiding(options);
- }));
- }
- return _.last(this._hidingPromises);
- },
- /**
- * Checks if the slideout can be hidden
- * Recursive method: it is stopped in one of the following cases:
- * - the first canHide method does not return true or a rejected promise
- * - the last slideout to hide is reached
- * - the last child is reached
- * @param {Object} - options
- * @param {Boolean} - options.isEscape - true if it is an escaped hiding; false otherwise
- * @param {Number} - options.depth - index of the last slideout to hide
- * @return {promise} resolved when it can be hidden or it is already hidden; rejected otherwise;
- */
- _canHide: function _canHide(options) {
- return new Promise(function (resolve, reject) {
- var needToInvokeCanHide = this.isOpen() && this.contentView && _.isFunction(this.contentView.canHide);
- var canHideChild = function canHideChild(options) {
- var isLastToHide = options.depth === 0;
- options.depth--;
- if (isLastToHide || this.isLast()) {
- resolve();
- } else {
- return this.child._canHide(options).then(resolve, reject);
- }
- };
- if (!needToInvokeCanHide) {
- canHideChild.call(this, options);
- } else {
- var result = true;
- try {
- result = this.contentView.canHide(options);
- } catch (error) {
- console.error('Error while executing canHide method', error);
- }
- Promise.resolve(result).then(function (slideCanHide) {
- if (slideCanHide === true || _.isUndefined(slideCanHide)) {
- canHideChild.call(this, options).then(resolve, reject);
- } else {
- reject();
- }
- }.bind(this)).catch(function () {
- reject();
- });
- }
- }.bind(this));
- },
- /**
- * does the hiding
- */
- _doHide: function _doHide(options) {
- return new Promise(function (resolve) {
- if (!this.open) {
- var removeMySelfOnly = options.depth === 0;
- if (removeMySelfOnly) {
- __completeHide.call(this);
- resolve();
- } else {
- options.depth = options.depth - 1;
- this._hideChild(options).then(function () {
- __completeHide.call(this);
- if (!options.hideOnly && (options.force || !this.isPinned())) {
- this.remove();
- }
- resolve();
- }.bind(this));
- }
- } else {
- var transferFocus = $.contains(this.$el[0], document.activeElement);
- var hidingSlideouts = [];
- var slideoutToRemove = this._hideOnly(hidingSlideouts, options);
- if (_.isEmpty(hidingSlideouts)) {
- resolve();
- } else {
- Promise.all(hidingSlideouts).then(function () {
- __completeHide.call(this);
- if (!options.hideOnly) {
- slideoutToRemove.remove();
- }
- if (transferFocus) {
- this._setFocusToLaunchPoint();
- }
- resolve();
- }.bind(this));
- }
- }
- }.bind(this));
- },
- /**
- * Hides the child when it is defined
- * @param {object} options passed in the hide method with the set values for the depth, force and hideOnly properties
- * @return {Promise} promise resolved when the child is hidden
- */
- _hideChild: function _hideChild(options) {
- if (this.child === null) {
- return Promise.resolve('no child to hide');
- } else {
- var hidingSlideouts = [];
- this._hideOnly(hidingSlideouts, options);
- return Promise.all(hidingSlideouts);
- }
- },
- /**
- * Hides the slideouts only visually
- * @Param {Array} hidingSlideouts - Array of promises which is populated by this method
- * @param {object} options passed in the hide method with the set values for the depth, force and hideOnly properties
- * @return {Slideout} slideout to remove if necessary
- */
- _hideOnly: function _hideOnly(hidingSlideouts, options) {
- var slideout = this;
- var slideoutToRemove;
- var index = 0;
- var ignorePinning = options.force;
- while (_.isObject(slideout) && (index <= options.depth || options.depth < 0)) {
- if (ignorePinning || !slideout.isPinned()) {
- if (_.isUndefined(slideoutToRemove)) {
- slideoutToRemove = slideout;
- ignorePinning = true;
- }
- hidingSlideouts.push(slideout._hide(options));
- }
- slideout = slideout.child;
- index++;
- }
- if (!_.isEmpty(hidingSlideouts)) {
- this._collapseChildren();
- }
- return slideoutToRemove;
- },
- /**
- * Performs the hide of the current slideout only
- * For pinned slideouts, the no-float class is removed avoid to have them shown when opening another one.
- * @return promise - resolved when the animation is finished
- */
- _hide: function _hide() {
- var whenAnimationEnd = new Promise(function (resolve) {
- if (!this.open) {
- resolve('Slideout already hidden');
- } else {
- this.open = false;
- if (this.$el.closest('html').length === 0) {
- console.log('The slideout DOM element is already removed');
- resolve('Slideout already removed');
- } else {
- if (this.parent) {
- this.parent.$el.children('.pane-content').off('clicktap.removeChild');
- }
- this.whenAnimationDone('_hide').then(function () {
- if (this.onHide) {
- this.onHide();
- }
- resolve();
- }.bind(this));
- }
- }
- }.bind(this));
- whenAnimationEnd.then(function () {
- if (this.open === false) {
- this.$el.children('.pane-content').addClass('tabhidden');
- this.removeContainerOnlyFromTabOrder();
- }
- this._addShadowToFinalSlideoutChild();
- }.bind(this));
- if (this.isPinned()) {
- this.$el.removeClass('no-float');
- }
- this.$el.removeClass('collapsed');
- this.$el.removeClass('collapseRoot');
- // Add the class notransition to let the browser complete it's animation before hiding the slideout
- this.$el.addClass('notransition');
- // Trigger a reflow, flushing the CSS changes
- // eslint-disable-next-line
- this.$el[0].offsetHeight;
- this.$el.removeClass('active');
- this.$el.addClass('inactive');
- this.$el.removeClass('notransition');
- return whenAnimationEnd;
- },
- /**
- * removes Slideout AND its children from the DOM.
- * if this is used directly on a slideout instance (eg. Slideout.remove())
- * it WILL NOT pick up the animation and the slideout will disapear immediately
- */
- remove: function remove() {
- if (this.child) {
- this.child.remove();
- }
- if (this.parent !== null) {
- if (this.parent.child === this) {
- this.parent.child = null;
- }
- }
- if (this._windowResizeHandler) {
- $(window).off('resize', this._windowResizeHandler);
- this.$el.off('resize', this._handleResize);
- }
- if (this.hideHandler) {
- $(document).off(this.closeEventPattern, this.hideHandler);
- this.hideHandler = null;
- }
- if (this.contentView) {
- this.contentView.remove();
- }
- this.$el.off('escapeaction');
- if (this.open) {
- this.trigger('hide');
- }
- this.trigger('remove');
- Slideout.inherited('remove', this, arguments);
- },
- setWidth: function setWidth(slide_width) {
- if ($.isPlainObject(slide_width)) {
- this.$el.css(slide_width);
- } else {
- this.$el.css('width', slide_width);
- }
- },
- /**
- * Appends content view to DOM
- *
- * **/
- _createContent: function _createContent() {
- var options = this.content || {};
- options.slideout = this;
- options = this.glassContext.addToOptions(options);
- return this._ClassFactory.instantiate(this.content.module, options).then(function (contentView) {
- this.contentView = contentView;
- this.$el.children('.pane-content').append(this.contentView.$el);
- var setFocusInContentView = function setFocusInContentView() {
- PerfUtils.createPerformanceMark({
- 'component': 'glass',
- 'name': 'renderSlideout',
- 'state': 'end'
- });
- if (this.isOpen() && !this.isBeingShown()) {
- this._setFocusInContentView();
- }
- };
- var result = this.contentView.render();
- return Promise.resolve(result).then(function () {
- setFocusInContentView.call(this);
- this.enableLooping(this.contentView.$el);
- }.bind(this)).catch(function (error) {
- this.logger.error('Error While rendering the content view for the slideout', error);
- return Promise.reject(error);
- }.bind(this));
- }.bind(this));
- },
- /**
- * Sets the focus in the content view
- */
- _setFocusInContentView: function _setFocusInContentView() {
- if (_.isFunction(this.contentView.setFocus)) {
- this.contentView.setFocus();
- }
- },
- /**
- * Get the root part slideout
- *
- * @return - root slideout object
- */
- getRootParent: function getRootParent() {
- return this._root;
- },
- getLaunchPoint: function getLaunchPoint() {
- if (this._paginationLaunchPoint !== null) {
- return this._paginationLaunchPoint;
- }
- return Slideout.inherited('getLaunchPoint', this);
- },
- /**
- * Get the width of the slideout
- *
- * @return - width of the slideout
- */
- getWidth: function getWidth() {
- return this.$el.outerWidth();
- },
- /**
- * Get the list children slideout including the current slider
- *
- * @return array of slideouts
- */
- getChildrenWithSelf: function getChildrenWithSelf() {
- var sliders = [this];
- var slider = this;
- while (slider.child) {
- sliders.push(slider.child);
- slider = slider.child;
- }
- return sliders;
- },
- /**
- * Collapse panels if necessary
- */
- _collapseChildren: function _collapseChildren() {
- var displayInfo = this._findFirstToCollapse();
- this.getRootParent()._displayInfo = displayInfo;
- if (displayInfo.firstToCollapse !== null) {
- var firstToCollapse = displayInfo.firstToCollapse;
- displayInfo = this._findSlideoutsToCollapse(displayInfo);
- _.each(displayInfo.visible, function (slideout) {
- slideout.$el.children('.pane-content').removeClass('tabhidden');
- slideout.enterContainerOnlyInTabOrder();
- });
- if (_.isEmpty(displayInfo.collapsed)) {
- firstToCollapse.$el.children('.pane-pagination-control:not(.collapsed .pane-pagination-control)').removeClass('visible');
- firstToCollapse.$el.children('.pane-pagination-control:not(.collapsed .pane-pagination-control)').removeAttr('tabindex');
- _.each(displayInfo.visible, function (slideout) {
- slideout._paginationLaunchPoint = null;
- });
- } else {
- firstToCollapse.$el.addClass('collapseRoot');
- if (!firstToCollapse.$el.hasClass('collapsed')) {
- firstToCollapse.$el.addClass('animationPhase');
- firstToCollapse.whenAnimationDone('collapseChildren').then(function () {
- this.$el.children('.collapsed .pane-pagination-control').addClass('visible');
- this.$el.children('.collapsed .pane-pagination-control').attr('tabindex', '0');
- }.bind(firstToCollapse));
- }
- _.each(displayInfo.collapsed, function (slideout) {
- slideout.$el.removeClass('active').addClass('collapsed');
- slideout.$el.children('.pane-content').addClass('tabhidden');
- if (slideout.$el[0] !== firstToCollapse.$el[0]) {
- slideout.removeContainerOnlyFromTabOrder();
- }
- });
- for (var i = 1; i < displayInfo.visible.length; i++) {
- displayInfo.visible[i]._paginationLaunchPoint = null;
- }
- displayInfo.firstDisplayedAfterCollapsed._paginationLaunchPoint = firstToCollapse.$el.children('.collapsed .pane-pagination-control')[0];
- }
- }
- },
- /**
- * Gets the available width to display the slideout
- */
- _getAvailableWidth: function _getAvailableWidth() {
- return this.getRootParent().$el.parent().innerWidth();
- },
- /**
- * Finds the first slideout to be collapsed if this is necessary based on the _collapseRootIndex
- *
- * @return {DisplayInfo} displayInfo
- */
- _findFirstToCollapse: function _findFirstToCollapse() {
- var root = null;
- var slideout = this.getRootParent();
- var width = 0;
- var visible = [];
- var searchIsDone = false;
- while (!searchIsDone) {
- if (slideout.open) {
- if (root === null) {
- if (slideout._displayIndex >= this._root.collapseRootIndex) {
- root = slideout;
- } else if (_.isEmpty(visible) || _.last(visible)._displayIndex !== slideout._displayIndex) {
- width += slideout.getWidth();
- visible.push(slideout);
- }
- } else {
- if (slideout._displayIndex === root._displayIndex) {
- root = slideout;
- } else {
- searchIsDone = true;
- }
- }
- }
- slideout = slideout.child;
- searchIsDone = slideout === null || searchIsDone;
- }
- return {
- firstToCollapse: root,
- visible: visible,
- width: width,
- firstDisplayedAfterCollapsed: null,
- collapsed: []
- };
- },
- /**
- * Finds the slideouts to collapse given the display info.
- * @param {object} displayInfo - Information containing the first slideout to collapse if this is necessary
- * @return {object} displayInfo - Updated displayed information with an array of slideouts to collapse and the first visible slideout.
- * The latter is null if there is no slideout to collapse
- */
- _findSlideoutsToCollapse: function _findSlideoutsToCollapse(displayInfo) {
- var lastSlideout = null;
- var slideout;
- var availableWidth = this.getRootParent()._getAvailableWidth();
- var displayLimit = this.getDisplayLimit();
- var visibleAfterCollapsed = [];
- var forceCollapse = false;
- if (displayInfo.firstToCollapse !== null) {
- slideout = displayInfo.firstToCollapse;
- while (slideout !== null) {
- lastSlideout = slideout;
- slideout = slideout.child;
- }
- slideout = lastSlideout;
- var searchIsDone = false;
- var last = true;
- var displayedNbr = displayInfo.visible.length;
- while (!searchIsDone) {
- if (slideout.open === true) {
- if (forceCollapse) {
- displayInfo.collapsed.unshift(slideout);
- } else {
- if (last || displayInfo.width + slideout.getWidth() + Slideout.prototype.PAGINATION_WIDTH < availableWidth && displayedNbr < displayLimit) {
- last = false;
- slideout.$el.removeClass('collapsed').removeClass('collapseRoot').addClass('active');
- if (_.isEmpty(visibleAfterCollapsed) || slideout._displayIndex !== _.first(visibleAfterCollapsed)._displayIndex) {
- displayInfo.width += slideout.getWidth();
- visibleAfterCollapsed.unshift(slideout);
- displayedNbr++;
- }
- } else {
- if (slideout._displayIndex === _.first(visibleAfterCollapsed)._displayIndex) {
- slideout.$el.removeClass('collapsed').removeClass('collapseRoot').addClass('active');
- } else {
- displayInfo.firstDisplayedAfterCollapsed = _.first(visibleAfterCollapsed);
- displayInfo.collapsed.unshift(slideout);
- forceCollapse = true;
- }
- }
- }
- }
- searchIsDone = slideout === displayInfo.firstToCollapse;
- slideout = slideout.parent;
- searchIsDone = slideout === null || searchIsDone;
- }
- }
- displayInfo.visible = displayInfo.visible.concat(visibleAfterCollapsed);
- return displayInfo;
- },
- /**
- * for animating the pin icon on the slideout and also setting pinned boolean.
- */
- _togglePin: function _togglePin() {
- this.setPinned(!this.isPinned());
- },
- _updatePinCss: function _updatePinCss() {
- var $pin = this.$el.find('.pin-icon');
- var ariaLabel;
- if (this.isPinned()) {
- this.$el.find('.pane-content').addClass('pane-pinned');
- if (!this.isFloat()) {
- this.$el.addClass('notransition'); // Disable transitions
- this.$el.addClass('no-float');
- // Trigger a reflow, flushing the CSS changes
- // eslint-disable-next-line
- this.$el[0].offsetHeight;
- this.$el.removeClass('notransition');
- }
- $pin.removeClass('transform-pin');
- ariaLabel = StringResources.get('unpinSlideout');
- $pin.attr('aria-label', ariaLabel);
- } else {
- this.$el.find('.pane-content').removeClass('pane-pinned');
- this.$el.addClass('notransition'); // Disable transitions
- this.$el.removeClass('no-float');
- //Trigger a reflow, flushing the CSS changes
- // eslint-disable-next-line
- this.$el[0].offsetHeight;
- this.$el.removeClass('notransition');
- $pin.addClass('transform-pin');
- ariaLabel = StringResources.get('pinSlideout');
- $pin.attr('aria-label', ariaLabel);
- }
- },
- /**
- * Paginate back. This method will do the following:
- * The child of the first visible slideout is hidden if it exists otherwise the first visible is hidden
- */
- pageBack: function pageBack(event) {
- if (!event.isDefaultPrevented() && this._root._displayInfo.firstDisplayedAfterCollapsed !== null) {
- var firstVisible = this._root._displayInfo.firstDisplayedAfterCollapsed;
- var slideoutToHide = firstVisible.child !== null ? firstVisible.child : firstVisible;
- slideoutToHide.hide();
- event.preventDefault();
- slideoutToHide._setFocusToLaunchPoint();
- }
- },
- /**
- * Indicate when the the current css animation is complete
- * Sets a timeout to avoid none-resolved promise - this is used by the unit tests
- * where no css is loaded
- * @return - a promise that will be resolved when the animation is complete
- */
- whenAnimationDone: function whenAnimationDone(operation) {
- return new Promise(function (resolve) {
- this.$el.off('transitionend webkitTransitionEnd oTransitionEnd');
- this.$el.on('transitionend webkitTransitionEnd oTransitionEnd', function () {
- resolve();
- });
- }.bind(this)).timeout(this.ANIMATION_TIMEOUT).catch(Promise.TimeoutError, function () {
- console.log('failed to detect the end of the slideout animation, force the resolve; operation: ' + operation);
- return Promise.resolve();
- });
- },
- /**
- * Sets the shadow class to the final slideout; remove it for all the others
- */
- _addShadowToFinalSlideoutChild: function _addShadowToFinalSlideoutChild() {
- var current_slideout = this.getRootParent();
- var lastOpenChild = current_slideout;
- while (current_slideout.child !== null) {
- current_slideout.$el.removeClass('shadow');
- current_slideout = current_slideout.child;
- if (current_slideout.open) {
- lastOpenChild = current_slideout;
- }
- }
- lastOpenChild.$el.addClass('shadow');
- },
- /**
- * Create a slideout with the passed options
- * @param {Object} options - slideout properties
- * @return {Object}
- */
- _createSlideout: function _createSlideout(options) {
- return new Slideout(options);
- },
- _setResizable: function _setResizable($content) {
- var isPosRight = this.position === 'right';
- var $paneContent = $content.filter('.pane-content');
- var $resizeHandle = $('<div>').addClass('resize-handle ui-resizable-handle ui-resizable-' + (isPosRight ? 'w' : 'e'));
- var resizable = {
- handles: [$resizeHandle],
- minWidth: this.resizable.min || 300,
- maxWidth: this.resizable.max || 1000,
- direction: isPosRight ? 'left' : 'right'
- };
- if (isPosRight) {
- $resizeHandle.insertBefore($paneContent);
- } else {
- $resizeHandle.insertAfter($paneContent);
- }
- Utils.setIcon($resizeHandle, 'common-handle');
- this.$el.resizable(resizable);
- }
- });
- return Slideout;
- });
- //# sourceMappingURL=Slideout.js.map
- ;
- /*
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI
- *
- * (C) Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/ui/SlideoutRegistry',['../../core-client/js/core-client/ui/core/Events', 'jquery', 'underscore', '../../core-client/js/core-client/ui/Slideout'], function (Events, $, _, Slideout) {
- var ERROR_INVALID_PARAM = 'SlidoutRegistry:openSlideout - Invalid Slideout parameter';
- var ERROR_INVALID_POSITION = 'SlidoutRegistry:openSlideout - Invalid Slideout position';
- var ERROR_INVALID_CONTAINER = 'SlidoutRegistry:openSlideout - Undefined or invalid container';
- var ERROR_ALREADY_OPEN = 'SlidoutRegistry:openSlideout - One slideout is already open';
- var ERROR_CHANGE_CONTAINER_INVALID_CONTAINER = 'SlidoutRegistry:changeContainer - Undefined or invalid container';
- var ERROR_CHANGE_CONTAINER_OPEN_SLIDEOUT = 'SlidoutRegistry:changeContainer - Slideout is open';
- var ERROR_GET_OPEN_SLIDEOUT_INVALID_POSITION = 'SlidoutRegistry:getOpenSlideout - Invalid Slideout position';
- /**
- * Adds the slideout to the container. Prepend for left position, append for right one;
- * @param {jquery} $container - container to update
- * @param {SLideout} slideout - slideout to add
- *
- */
- var _addSlideoutToContainer = function _addSlideoutToContainer($container, slideout) {
- if (slideout.position === 'left') {
- $container.prepend(slideout.$el);
- } else {
- $container.append(slideout.$el);
- }
- };
- /**
- * Builds an error with a toString method
- */
- var _buildError = function _buildError(error) {
- error.toString = function () {
- return error.msg;
- };
- return error;
- };
- /**
- * @throws ERROR_INVALID_POSITION error when it is not left or right
- */
- var _validatePosition = function _validatePosition(position) {
- if (position !== 'right' && position !== 'left') {
- throw _buildError({
- msg: ERROR_INVALID_POSITION,
- position: position
- });
- }
- };
- /**
- * Opens the slideout from an slideout instance; It assumes that the slideout is not rendered when it is not registered
- * @param {Slideout} slideout - the passed slideout
- * @return {Slideout} The passed slideout
- * @throws ERROR_ALREADY_OPEN or ERROR_INVALID_POSITION
- */
- var _openSlideoutFromInstance = function _openSlideoutFromInstance(slideout) {
- var position = slideout.position;
- _validatePosition(position);
- if (!_.isUndefined(this._open[position])) {
- throw _buildError({
- msg: ERROR_ALREADY_OPEN,
- open: this._open[position]
- });
- }
- if (_.isUndefined(this._registered[slideout.getRootId()])) {
- slideout.render();
- _addSlideoutToContainer(this.$container, slideout);
- } else {
- if (slideout.getRootParent() !== this._registered[slideout.getRootId()]) {
- slideout = this._registered[slideout.getRootId()];
- }
- }
- slideout.show();
- return slideout;
- };
- /**
- * Opens the slideout from an object spec
- * @param {object} object - the specs of the slideout to show
- * @return {Slideout}
- * @throws ERROR_INVALID_POSITION or ERROR_ALREADY_OPEN
- */
- var _openSlideoutFromObject = function _openSlideoutFromObject(object) {
- var position = object.position;
- var slideout;
- if (this._registered[object.id]) {
- slideout = this._registered[object.id];
- } else {
- _validatePosition(position);
- if (!_.isUndefined(this._open[position])) {
- throw _buildError({
- msg: ERROR_ALREADY_OPEN
- });
- }
- slideout = new Slideout(object);
- slideout.render();
- _addSlideoutToContainer(this.$container, slideout);
- }
- slideout.show();
- return slideout;
- };
- /**
- * Sets the callback on hide and remove.
- * hide: Unflags the slideout as open and move it to be registered; removes itself from the slideout callback
- * remove: Unregisters the slideout, Unflag it as open if necessary, remove itself and the hide callback
- * @param {Slideout} Slideout - slideout instance to which we attach the callback
- */
- var _setCallbacks = function _setCallbacks(slideout) {
- var hideCallback = function (slideout) {
- if (!slideout.hasOpenChild()) {
- delete this._open[slideout.position];
- this._registered[slideout.getRootId()] = slideout;
- slideout.off('hide', hideCallback);
- }
- }.bind(this, slideout);
- var removeCallback = function (slideout) {
- if (this._open[slideout.position] === slideout) {
- delete this._open[slideout.position];
- }
- delete this._registered[slideout.getRootId()];
- slideout.off('remove', removeCallback);
- slideout.off('hide', hideCallback);
- }.bind(this, slideout);
- slideout.on('hide', hideCallback);
- slideout.on('remove', removeCallback);
- };
- /**
- * @public
- */
- var Registry = Events.extend(
- /**
- * @lends SlideoutRegistry.prototype
- */
- {
- /**
- * @classdesc Class allowing to register a {@link Slideout} when opening it in a specific container
- * @constructs
- * @public
- * @param {object} options - Init properties
- * @param {Jquery} options.$container - container where the slideouts are to be shown
- * application & application.appView
- */
- init: function init(options) {
- Registry.inherited('init', this, arguments);
- $.extend(this, options);
- this._open = {};
- this._registered = {};
- },
- /**
- * Opens the provided slideout
- * @public
- * @param {Object|Slideout} slideout - Object containing the properties of the slideout to show; See {@link Slideout}, Slideout object,
- * @return {Slideout} slideout - the shown slideout; null if there is no container
- * @throws ERROR_ALREADY_OPEN, ERROR_INVALID_POSITION or ERROR_INVALID_CONTAINER
- */
- openSlideout: function openSlideout(slideout) {
- var openSlideout;
- if (!$.prototype.isPrototypeOf(this.$container)) {
- throw _buildError({
- msg: ERROR_INVALID_CONTAINER,
- container: this.$container
- });
- }
- if (Slideout.prototype.isPrototypeOf(slideout)) {
- openSlideout = _openSlideoutFromInstance.call(this, slideout);
- } else if (_.isObject(slideout)) {
- openSlideout = _openSlideoutFromObject.call(this, slideout);
- } else {
- throw _buildError({
- msg: ERROR_INVALID_PARAM,
- parameter: slideout
- });
- }
- this._open[openSlideout.position] = openSlideout.getRootParent();
- _setCallbacks.call(this, this._open[openSlideout.position]);
- return openSlideout;
- },
- /**
- * Returns the open slideout for the given position
- * @public
- * @param {String} position - left or right
- * @return {Slideout} the open slideout for the given position or undefined if none is open or if the position is invalid
- * @throw ERROR_GET_OPEN_SLIDEOUT_INVALID_POSITION
- */
- getOpenSlideout: function getOpenSlideout(position) {
- if (position !== 'left' && position !== 'right') {
- throw _buildError({
- msg: ERROR_GET_OPEN_SLIDEOUT_INVALID_POSITION,
- position: position
- });
- }
- return this._open[position];
- },
- /**
- * Returns array of the open slideouts from the 2 positions: left and right
- * @public
- * @return {Slideout[]} Array of open slideouts; Empty if none is open
- */
- getOpenSlideouts: function getOpenSlideouts() {
- var openSlideouts = [];
- if (!_.isUndefined(this._open.left)) {
- openSlideouts.push(this._open.left);
- }
- if (!_.isUndefined(this._open.right)) {
- openSlideouts.push(this._open.right);
- }
- return openSlideouts;
- },
- /**
- * Gets the registered slideout based on the id
- * @public
- * @param {String} id - id of the slideout
- * @return {Slideout} undefined if not found or id is not a sting
- */
- getRegisteredSlideout: function getRegisteredSlideout(id) {
- var slideout;
- if (_.isString(id)) {
- slideout = this._registered[id];
- }
- return slideout;
- },
- /**
- * Gets the registry container
- * @return {jquery} Container as a jquery object
- */
- getContainer: function getContainer() {
- return this.$container;
- },
- /**
- * Changes the container
- * @public
- * @param {jQuery} $newContainer - new container to move to
- * @throws ERROR_INVALID_CONTAINER is $newContainer is invalid
- */
- changeContainer: function changeContainer($newContainer) {
- if (!$.prototype.isPrototypeOf($newContainer)) {
- throw _buildError({
- msg: ERROR_CHANGE_CONTAINER_INVALID_CONTAINER,
- container: this.$container
- });
- }
- if (this._open.left || this._open.right) {
- throw _buildError({
- msg: ERROR_CHANGE_CONTAINER_OPEN_SLIDEOUT,
- open: this._open
- });
- }
- _.each(this._registered, function (slideout
- /*, id*/
- ) {
- _addSlideoutToContainer($newContainer, slideout);
- }, this);
- this.$container = $newContainer;
- },
- _removeSlideout: function _removeSlideout(slideout) {
- if (slideout) {
- slideout.remove();
- }
- },
- cleanupSlideouts: function cleanupSlideouts() {
- _.each(this._open, function (slideout) {
- if (slideout) {
- slideout.remove();
- }
- });
- _.each(this._registered, function (slideout) {
- if (slideout) {
- slideout.remove();
- }
- });
- }
- });
- return Registry;
- });
- //# sourceMappingURL=SlideoutRegistry.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/ajax/AjaxErrorFactory',['../core-client/js/core-client/errors/BaseError'], function (BaseError) {
- var AjaxErrorFactory = {
- /**
- * Creates a an AjaxError from the jqXHR objects
- * @public
- * @param {Object} jqXHR - jquery XHR object
- * @return {AjaxError} - instance of AjaxError that has code and requestInfo properties
- */
- create: function create(jqXHR, textStatus, errorThrown) {
- var AjaxError = BaseError.extend({
- init: function init(status, options) {
- AjaxError.inherited('init', this, arguments);
- this.name = 'AjaxError';
- this.jqXHR = options.requestInfo.jqXHR;
- this.textStatus = options.requestInfo.textStatus;
- this.errorThrown = options.requestInfo.errorThrown;
- }
- });
- return new AjaxError(jqXHR.statusText, {
- requestInfo: {
- jqXHR: jqXHR,
- textStatus: textStatus,
- errorThrown: errorThrown
- },
- code: jqXHR.status
- });
- }
- };
- return AjaxErrorFactory;
- });
- //# sourceMappingURL=AjaxErrorFactory.js.map
- ;
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/AjaxService',['jquery', '../ajax/AjaxErrorFactory'], function ($, AjaxErrorFactory) {
- var AjaxService = /*#__PURE__*/function () {
- /**
- * @description Constructor
- * @param {Object} - (optional) options.logger - Logger
- * @param {Object} - (optional) @deprecated options.errorDialog -
- */
- function AjaxService(options) {
- var _this = this;
- _classCallCheck(this, AjaxService);
- this._logWarning = function (msg) {
- if (_this._logger && _this._logger.warn) {
- _this._logger.warn('AjaxService', msg);
- }
- };
- this._handleUrlTooLong = function (request, reqInfo, originalParams, urlReducer) {
- var warnMsg = "Request too long. ".concat(JSON.stringify(request), ". Prepared URL length: ").concat(reqInfo.preparedReqLen, " exceeds max configured length ").concat(reqInfo.maxQuerySize, ".");
- _this._logWarning(warnMsg);
- var reducedParams = urlReducer(originalParams);
- warnMsg = "URL reducer invoked and returned reduced params: ".concat(JSON.stringify(reducedParams), ".");
- _this._logWarning(warnMsg);
- reducedParams.skipUrlReducer = true;
- return _this.ajax(reducedParams);
- };
- this._issueRequest = function (request, originalParams) {
- var params = request.params;
- if (params.urlReducer && !params.skipUrlReducer) {
- return _this._checkUrlLength(request).then(function (reqInfo) {
- if (reqInfo.urlTooLong) {
- return _this._handleUrlTooLong(request, reqInfo, originalParams, params.urlReducer);
- }
- return _this.executeProcessedAjax(request.params);
- });
- }
- return _this._sendRequest(request);
- };
- this._sendRequest = function (request) {
- return new Promise(function (resolve, reject) {
- _this._cntr++;
- var requestId = 'xhr' + _this._cntr;
- var jqXHR = _this.ajaxFn(request.params);
- _this._inflightRequests[requestId] = jqXHR;
- jqXHR.then(function (data, textStatus, jqXHR) {
- resolve({
- data: data,
- textStatus: textStatus,
- jqXHR: jqXHR
- });
- }).fail(function (jqXHR, textStatus, errorThrown) {
- if (errorThrown !== 'abort') {
- reject(_this._AjaxErrorFactory.create(jqXHR, textStatus, errorThrown));
- } else {
- resolve({
- textStatus: textStatus,
- jqXHR: jqXHR
- });
- }
- }).done(function () {
- if (_this._inflightRequests[requestId]) {
- delete _this._inflightRequests[requestId];
- }
- });
- });
- };
- this._logger = options && options.logger || console;
- this._configService = options && options.configService;
- this._errorMessageRenderer = options && options.errorDialog || undefined;
- this._requestHandlers = [];
- this._responseHandlers = [];
- this._errorHandler = null;
- this._cntr = 0;
- this._inflightRequests = {};
- }
- /**
- * @description Adds a handler to the request chain that will be called before every request.
- * @param {Object} handler
- * handler - Object with function: prepareRequest(params)
- * @throws if handler is not provided, or does not provide a "prepareRequest" function.
- */
- _createClass(AjaxService, [{
- key: "addRequestHandler",
- value: function addRequestHandler(handler) {
- if (handler && typeof handler.prepareRequest === 'function') {
- this._requestHandlers.push(handler);
- } else {
- throw new Error('Handler must implement function "prepareRequest"');
- }
- }
- /**
- * @description Adds a handler to the response chain which will be called on every response.
- * @param {Object} handler
- * handler - Object with function: handleResponse(data, textStatus, jqXHR)
- * @throws if handler is not provided, or does not provide a "handleResponse" function.
- */
- }, {
- key: "addResponseHandler",
- value: function addResponseHandler(handler) {
- if (handler && typeof handler.handleResponse === 'function') {
- this._responseHandlers.push(handler);
- } else {
- throw new Error('Handler must implement function "handleResponse"');
- }
- }
- /**
- * @description Sets a single handler which will be called on every error response.
- * @param {Object} handler
- * handler - Object with function: handleError(request, error)
- * @throws if handler is not provided, or does not provide a "handleError" function.
- */
- }, {
- key: "setErrorHandler",
- value: function setErrorHandler(handler) {
- if (handler && typeof handler.handleError === 'function') {
- this._errorHandler = handler;
- } else {
- throw new Error('Handler must implement function "handleError"');
- }
- }
- }, {
- key: "_buildRequestObject",
- value: function _buildRequestObject(params) {
- return {
- params: params || {}
- };
- }
- }, {
- key: "ajax",
- value:
- /**
- * @description Send an AJAX request.
- * @param params jQuery style ajax params object
- * @returns {Promise} (A+ Spec)
- */
- function ajax(params) {
- var request = this._buildRequestObject(params); // The _prepareRequest has request handlers that potentially modify the request.
- // If there is a urlReducer, make a copy of the original params.
- var originalParams = params && params.urlReducer ? _objectSpread({}, params) : null;
- return this._prepareRequest(request).then(this._issueRequest.bind(this, request, originalParams)).then(this._handleResponse.bind(this, request), this._handleError.bind(this, request));
- }
- /**
- * @description Send an AJAX request without running requestHandlers.
- * @param params jQuery style ajax params object
- * @returns {Promise} (A+ Spec)
- */
- }, {
- key: "executeProcessedAjax",
- value: function executeProcessedAjax(params) {
- var request = this._buildRequestObject(params);
- return this._executeProcessedAjax(request);
- }
- }, {
- key: "_executeProcessedAjax",
- value: function _executeProcessedAjax(request) {
- return this._sendRequest(request).then(this._handleResponse.bind(this, request), this._handleError.bind(this, request));
- }
- /**
- * @description Prepare AJAX request with configured requestHandlers.
- * @param params jQuery style ajax params object
- * @returns {Promise} (A+ Spec)
- */
- }, {
- key: "prepareRequest",
- value: function prepareRequest(params) {
- var request = this._buildRequestObject(params);
- return this._prepareRequest(request, true);
- }
- /**
- * @description For GET requests, calculate length of URL plus data items as query params.
- * For non-GET requests, calculate length of just URL part.
- * @param preparedReq Request after registered req handlers have processed the req
- * @returns {Integer} length
- */
- }, {
- key: "_getUrlAndParmsLength",
- value: function _getUrlAndParmsLength(params) {
- var url = params.url,
- data = params.data,
- method = params.method;
- var urlLenth = url.length;
- if (method === 'GET') {
- // jQuery will move the content in .data onto URL as query parms.
- var dataQueryItems = '';
- if (typeof data === 'string') {
- var dataItems = data.split('&');
- dataQueryItems = dataItems.reduce(function (urlItems, item) {
- var itemPair = item.split('=');
- return "".concat(urlItems, "&").concat(itemPair[0], "=").concat(encodeURIComponent(itemPair[1]));
- }, '');
- } else if (Array.isArray(data)) {
- dataQueryItems = data.reduce(function (urlItems, d) {
- return "".concat(urlItems, "&").concat(encodeURIComponent(d.name), "=").concat(encodeURIComponent(d.value));
- }, '');
- } else if (_typeof(data) === 'object') {
- for (var d in data) {
- dataQueryItems = "".concat(dataQueryItems, "&").concat(encodeURIComponent(d), "=").concat(encodeURIComponent(data[d]));
- }
- }
- return urlLenth + dataQueryItems.length;
- }
- return urlLenth;
- }
- }, {
- key: "_checkUrlLength",
- value: function _checkUrlLength(request) {
- var _this2 = this;
- return this._configService.getDatasetQuerySize().then(function (maxQuerySize) {
- var preparedReqLen = _this2._getUrlAndParmsLength(request.params);
- return {
- urlTooLong: preparedReqLen > maxQuerySize,
- maxQuerySize: maxQuerySize,
- preparedReqLen: preparedReqLen
- };
- });
- }
- }, {
- key: "_prepareRequest",
- value: function _prepareRequest(request) {
- var promise = Promise.resolve();
- this._requestHandlers.forEach(function (handler) {
- promise = promise.then(handler.prepareRequest.bind(handler, request));
- });
- return promise;
- }
- /**
- * @description Cancels all in-flight requests. Errors reported by these requests (as 'aborted')
- * will be swallowed.
- */
- }, {
- key: "cancelAllRequests",
- value: function cancelAllRequests() {
- var _this3 = this;
- Object.keys(this._inflightRequests).forEach(function (key) {
- try {
- var jqXHR = _this3._inflightRequests[key];
- jqXHR.abort();
- } catch (err) {
- if (_this3._logger && _this3._logger.error) {
- _this3._logger.error('AjaxService.cancelAllRequests', err);
- }
- }
- });
- }
- /**
- * @description Displays an error dialog
- * @deprecated
- * @param {Object} jqXHR - the request
- * @param {String} errMsg - text to display
- */
- }, {
- key: "showError",
- value: function showError(jqXHR, errMsg) {
- if (this._errorMessageRenderer && typeof this._errorMessageRenderer.showError === 'function') {
- return this._errorMessageRenderer.showError(jqXHR, errMsg);
- } else {
- return Promise.reject(new Error('Unable to display error dialog: ' + errMsg));
- }
- }
- }, {
- key: "_handleResponse",
- value: function _handleResponse(request, response) {
- var promise = Promise.resolve();
- this._responseHandlers.forEach(function (handler) {
- promise = promise.then(handler.handleResponse.bind(handler, request, response));
- });
- return promise.then(function () {
- return response;
- });
- }
- }, {
- key: "_handleError",
- value: function _handleError(request, error) {
- if (this._errorHandler) {
- return this._errorHandler.handleError(request, error);
- } else {
- return Promise.reject(error);
- }
- }
- }]);
- return AjaxService;
- }();
- AjaxService.prototype.ajaxFn = $.ajax;
- AjaxService.prototype._AjaxErrorFactory = AjaxErrorFactory;
- return AjaxService;
- });
- //# sourceMappingURL=AjaxService.js.map
- ;
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/ClipboardService',['underscore'], function (_) {
- /**
- * @lends ClipboardService
- **/
- var ClipboardService = /*#__PURE__*/function () {
- /**
- * Contructor for ClipboardService
- * @public
- * @constructs ClipboardService
- * @classdesc Shared clipboard service which has implemented following spec draft:
- * <br> - API will provide async set, get and clear
- * <br> - API will accept and return string/object/number data transparently without changing type
- * <br> - Stringification and parsing of clipboard data will be handled internally for convenience
- * <br> - TODO: Service will rehydrate from localStorage on creation in cases where new window
- * <br> is opened after copying or to prevent data loss/ overwriting when switching between apps
- * <br> - Example clipboard data (guideline, not yet decided):
- * <br> {
- * <br> dashboardSpec: <JSONSpec>,
- * <br> reportingSpec: <V5Spec as Str>,
- * <br> otherData: <any type>
- * <br> }
- * @param {Boolean} initNow - Wether to initialize the service now at creation
- * or later, defaults to false and follows regular
- * glass paradigm of deferred initialization
- * @param {Object} glassContext - glassContext
- **/
- function ClipboardService(initNow, glassContext) {
- _classCallCheck(this, ClipboardService);
- if (initNow) {
- this.initialize(glassContext);
- }
- }
- /**
- * Initializer for clipboard service
- * @public
- * @param {Object} glassContext - glassContext
- **/
- _createClass(ClipboardService, [{
- key: "initialize",
- value: function initialize(glassContext) {
- this.glassContext = glassContext;
- this._clipboardData = '';
- this._storedType = 'string';
- }
- /**
- * Async set data in localStorage. In case of non-existent localStorage
- * We save data simply to this._clipboardData in this shared service
- * @public
- * @param {String | Object} data - object containing the data to set
- * @return {Promise} returns resolve or reject. Reject will propagate error, resolve is empty
- */
- }, {
- key: "set",
- value: function set(data) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- try {
- _this._set(data);
- resolve();
- } catch (e) {
- reject(e);
- }
- });
- }
- /**
- * Asynchronously get data in localStorage. In case of non-existent localStorage
- * We get data from this._clipboardData in this shared service
- * @public
- * @return {Promise<String | Object>} returns a promise which resolves with {JSON} of all data
- */
- }, {
- key: "get",
- value: function get() {
- var _this2 = this;
- return new Promise(function (resolve) {
- resolve(_this2._get());
- });
- }
- /**
- * Asynchronously clears all data in this service and associated localstorage
- * @public
- * @return {Promise} returns a promise which resolves after clearing everything or rejects on err
- */
- }, {
- key: "clear",
- value: function clear() {
- var _this3 = this;
- return new Promise(function (resolve) {
- _this3._clipboardData = '';
- _this3._storedType = 'string';
- resolve();
- });
- }
- /**
- * sets clipboard data
- * @private
- **/
- }, {
- key: "_set",
- value: function _set(str) {
- if (_.isFunction(str)) {
- throw new Error('Exception: Cannot encode functions for clipboard storage');
- }
- this._storedType = _typeof(str);
- if (!_.isString(str)) {
- str = JSON.stringify(str);
- }
- this._clipboardData = str;
- }
- /**
- * gets clipboard data, attempting to return what was set
- * @private
- **/
- }, {
- key: "_get",
- value: function _get() {
- var ret = this._clipboardData;
- if (this._storedType === 'object') {
- ret = JSON.parse(this._clipboardData);
- } else if (this._storedType === 'number') {
- ret = Number(this._clipboardData);
- }
- return ret;
- }
- }]);
- return ClipboardService;
- }();
- return ClipboardService;
- });
- //# sourceMappingURL=ClipboardService.js.map
- ;
- define('text!baglass/app/templates/CoachMarkBubble.html',[],function () { return '<div role="button" tabIndex="0" position="relative"\n\taria-label="{{=it.label}}">\n\t<div title="{{=it.label}}">\n\t\t<svg class="wa-hint-bubble wa-hint-bubble-outside-animated">\n\t\t\t<use style="pointer-events: none;" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-coachmark-outer"></use>\n\t\t</svg>\n\t\t<svg class="wa-hint-bubble wa-hint-bubble-inside-animated">\n\t\t\t<title>{{=it.label}}</title>\n\t\t\t<use style="pointer-events: none;" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-coachmark-inner"></use>\n\t\t</svg>\n\t</div>\n</div>\n';});
- define('text!baglass/app/templates/CoachMarkPopover.html',[],function () { return '<div class="popover coachMarkPopover" role="dialog" aria-labelledby="coachTitle" aria-describedby="coachText">\n\t<div class="arrow"></div>\n\t<div class="coachMarkContent">\n\t\t<div class="popover-title coachMarkTitle"></div>\n\t\t<div type="button" role="button" class="coachMarkClose" tabIndex="0" title="{{=it.closeText}}">\n\t\t\t<svg fill="#3D4852" stroke="#3D4852">\n\t\t\t\t<use style="pointer-events: none;" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-titan-dialog-close"></use>\n\t\t\t</svg>\n\t\t</div>\n\t\t<div class="popover-content coachMarkText"></div>\n\t\t<div class="actionableLink">\n\t\t\t<a href="javascript:void(0);">{{=it.turnOffText}}</a>\n\t\t</div>\n\t</div>\n</div>';});
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2015, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/CoachMark',['../core-client/js/core-client/ui/AccessibleView', 'jquery', 'text!./templates/CoachMarkBubble.html', 'text!./templates/CoachMarkPopover.html', '../nls/StringResources', 'doT', 'underscore', 'bootstrap', // currently required for usage of bspopover
- 'jquery-ui'], function (AccessibleView, $, CoachMarkBubble, CoachMarkPopover, StringResources, dot, _) {
- /**
- * Implements Coach marks functionality
- * @private
- */
- var CoachMark = AccessibleView.extend({
- init: function init(options) {
- this.persistence = options.glassContext.getCoreSvc('.CoachMarkService').getPersistence();
- var label = StringResources.get('coachMarkLabel', {
- title: _.escape(options.title)
- });
- var sHtml = dot.template(CoachMarkBubble)({
- 'label': label
- });
- this._$coachMark = $(sHtml);
- options.launchPoint = this._$coachMark;
- options.enableTabLooping = true;
- CoachMark.inherited('init', this, arguments);
- },
- render: function render($container, isVisible) {
- $('.coachMarkPopover').remove();
- var $coachMark = this._$coachMark;
- var containerId = $container.attr('id');
- $coachMark.addClass('coachMark');
- if (!isVisible) {
- $coachMark.hide();
- }
- $coachMark.data('containerId', containerId);
- $container.append($coachMark);
- $container.addClass('coachMarkContainer');
- var $toolBarParent = $container.closest('.toolpane');
- if ($toolBarParent.hasClass('toolpaneLeft') || $toolBarParent.hasClass('toolpaneRight')) {
- $coachMark.addClass('vertical');
- }
- if (!this.placement) {
- this.placement = 'right';
- if ($toolBarParent.hasClass('toolpaneRight')) {
- this.placement = 'left';
- } else if ($toolBarParent.hasClass('toolpaneTop')) {
- this.placement = 'bottom';
- } else if ($toolBarParent.hasClass('toolpaneBottom')) {
- this.placement = 'top';
- }
- }
- var turnOffText = StringResources.get('coachMarkTurnOffHints');
- var closeText = StringResources.get('coachMarkClose');
- var sHtml = dot.template(CoachMarkPopover)({
- 'turnOffText': turnOffText,
- 'closeText': closeText
- });
- var popoverOptions = {
- placement: this.placement,
- trigger: 'manual',
- container: 'body',
- title: this.title || {},
- content: this.contents || {},
- template: sHtml,
- sanitize: false
- };
- this.$popover = $coachMark.popover(popoverOptions);
- var popoverClickListener = function (event) {
- if (event.which === $.ui.keyCode.ESCAPE || $('.coachMarkPopover:visible').length === 1) {
- this.$popover.popover('hide');
- removeEventListener('blur', popoverBlurListener);
- removeEventListener('touchstart', popoverClickListener, true);
- removeEventListener('click', popoverClickListener, true);
- removeEventListener('resize', popoverClickListener, true);
- $('body').off('keydown');
- var $clickOnCoachMark = $(event.target).closest('.coachMark');
- if ($clickOnCoachMark.length !== 0 && containerId === $clickOnCoachMark.data('containerId')) {
- event.stopPropagation();
- }
- } else if ($('.coachMarkPopover').length === 0 || $('.coachMarkPopover:hidden').length === 1) {
- this.$popover.popover('show');
- }
- }.bind(this); // required for contained iFrames (report studio)
- var popoverBlurListener = function () {
- if (document.activeElement && $(document.activeElement).is('iframe')) {
- this.$popover.popover('hide');
- }
- }.bind(this);
- var escapeListener = function (event) {
- if (event.which === $.ui.keyCode.ESCAPE) {
- this.getLaunchPoint().focus();
- popoverClickListener(event);
- }
- }.bind(this);
- this.$popover.on('shown.bs.popover', function () {
- var $coachMarkPopover = $('.coachMarkPopover');
- $('.coachMarkTitle', $coachMarkPopover).attr('id', 'coachTitle');
- $('.coachMarkText', $coachMarkPopover).attr('id', 'coachText');
- $('.coachMarkClose', $coachMarkPopover).focus();
- this.enableLooping($('.coachMarkContent', $coachMarkPopover));
- $('.coachMarkClose', $coachMarkPopover).on('primaryaction', function (event) {
- this.$popover.popover('hide');
- var readId = this.$popover.data('containerId');
- if (readId) {
- this.persistence.marksAsRead(readId); // hide this coach mark in all open perspectives
- $('.coachMark').filter(function () {
- return $(this).data('containerId') === readId;
- }).hide();
- } else {
- $(event.target).closest('.coachMarkPopover').hide();
- }
- }.bind(this));
- $('.actionableLink a', $coachMarkPopover).on('primaryaction', function () {
- var userProfile = this.glassContext.getCoreSvc('.UserProfile');
- userProfile.preferences[CoachMark.PREFERENCES_KEY] = CoachMark.HIDE_ALL;
- $('.coachMark').hide();
- this.$popover.popover('hide');
- var saveData = {};
- saveData[CoachMark.PREFERENCES_KEY] = CoachMark.HIDE_ALL;
- userProfile.savePreferences(saveData);
- }.bind(this));
- addEventListener('click', popoverClickListener, true);
- addEventListener('resize', popoverClickListener, true);
- addEventListener('touchstart', popoverClickListener, true);
- addEventListener('blur', popoverBlurListener);
- $('body').on('keydown', escapeListener);
- }.bind(this));
- this.$popover.on('hidden.bs.popover', function () {
- removeEventListener('blur', popoverBlurListener);
- removeEventListener('touchstart', popoverClickListener, true);
- removeEventListener('click', popoverClickListener, true);
- removeEventListener('resize', popoverClickListener, true);
- $('body').off('keydown');
- }.bind(this));
- this.$popover.on('primaryaction', function (event) {
- event.stopPropagation();
- this.$popover.popover('show');
- }.bind(this));
- }
- });
- CoachMark.PREFERENCES_KEY = 'showHints';
- CoachMark.HIDE_ALL = 'hideAll';
- return CoachMark;
- });
- //# sourceMappingURL=CoachMark.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2015, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/CoachMarkPersistence',['../core-client/js/core-client/ui/core/Class', 'jquery'], function (Class, $) {
- /**
- * Implement Coach marks persistence functionality
- * @private
- */
- var CoachMarkPersistence = Class.extend({
- init: function init(options) {
- this.glassContext = options.glassContext;
- },
- isRead: function isRead(id) {
- var _this = this;
- var showHints = this.glassContext.getCoreSvc('.UserProfile').preferences.showHints;
- if (showHints === 'hideAll') {
- return Promise.resolve(true);
- } else {
- if (this._readCoachMarks === undefined) {
- return this._getHints().then(function (json) {
- _this._readCoachMarks = json;
- return _this._readCoachMarks[id] === true;
- }).catch(function (err) {
- _this._readCoachMarks = {};
- var jqXHR = err.jqXHR;
- if (jqXHR && jqXHR.status === 404) {
- return false;
- } else {
- _this.glassContext.getCoreSvc('.Logger').error('Internal error: Unable to read coach mark' + err.jqXHR.responseText);
- throw err;
- }
- });
- } else {
- return Promise.resolve(this._readCoachMarks[id] === true);
- }
- }
- },
- marksAsRead: function marksAsRead(id) {
- var _this2 = this;
- if (this._readCoachMarks) {
- this._readCoachMarks[id] = true;
- var jsonData = JSON.stringify(this._readCoachMarks);
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CoachMarkPersistence.SERVICE_URL,
- type: 'PUT',
- 'headers': {
- 'Content-Type': 'application/json'
- },
- data: jsonData
- }).catch(function (err) {
- _this2.glassContext.getCoreSvc('.Logger').error('Internal error: Update coach mark status failed: ' + err.jqXHR.responseText);
- throw err;
- });
- }
- },
- reset: function reset() {
- var _this3 = this;
- this._readCoachMarks = undefined;
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CoachMarkPersistence.SERVICE_URL,
- type: 'DELETE'
- }).then(function () {
- $('.coachMark').show();
- }).catch(function (err) {
- _this3.glassContext.getCoreSvc('.Logger').error('Internal error: unable to delete coach marks status: ' + err.jqXHR.responseText);
- throw err;
- });
- },
- // Don't issue multiple, concurrent requests for the same info...
- _getHints: function _getHints() {
- var _this4 = this;
- if (!this._hintsRequest) {
- this._hintsRequest = this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CoachMarkPersistence.SERVICE_URL,
- type: 'GET',
- headers: {
- 'Accept': 'application/json'
- }
- }).then(function (results) {
- _this4._hintsRequest = null;
- return results.data;
- });
- }
- return this._hintsRequest;
- }
- });
- CoachMarkPersistence.SERVICE_URL = 'v1/users/~/items/uihints';
- return CoachMarkPersistence;
- });
- //# sourceMappingURL=CoachMarkPersistence.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/services/CoachMarkService',['../../core-client/js/core-client/ui/core/Events', '../CoachMark', '../CoachMarkPersistence'], function (Events, CoachMark, CoachMarkPersistence) {
- var CoachMarkService = Events.extend({
- init: function init(glassContext) {
- CoachMarkService.inherited('init', this, arguments);
- this.renderer = CoachMark;
- this.glassContext = glassContext;
- this.persistence = new CoachMarkPersistence({
- glassContext: glassContext
- });
- },
- setRenderer: function setRenderer(renderer) {
- this.renderer = renderer;
- },
- setPersistence: function setPersistence(persistence) {
- this.persistence = persistence;
- },
- getRenderer: function getRenderer() {
- return this.renderer;
- },
- getPersistence: function getPersistence() {
- return this.persistence;
- },
- isCoachMarkEnabled: function isCoachMarkEnabled() {
- if (typeof this.persistence.isEnabled === 'function') {
- return this.persistence.isEnabled().then(function (enabled) {
- if (enabled === true) {
- return true;
- } else {
- return false;
- }
- }).fail(function () {
- return false;
- });
- } else {
- return Promise.resolve();
- }
- },
- disableCoachMarks: function disableCoachMarks() {
- this.trigger('disable:all', {});
- if (typeof this.persistence.disable === 'function') {
- return this.persistence.disable().then(function () {
- return true;
- }).catch(function () {
- return false;
- });
- } else {
- return Promise.resolve();
- }
- },
- enableAndRestart: function enableAndRestart() {
- this.trigger('enable:restart', {});
- if (typeof this.persistence.restart === 'function') {
- return this.persistence.restart().then(function () {
- return true;
- }).catch(function () {
- return false;
- });
- } else {
- return Promise.resolve();
- }
- },
- enableAndContinue: function enableAndContinue() {
- this.trigger('enable:continue', {});
- if (typeof this.persistence.restart === 'function') {
- return this.persistence.restart().then(function () {
- return true;
- }).catch(function () {
- return false;
- });
- } else {
- return Promise.resolve();
- }
- }
- });
- return CoachMarkService;
- });
- //# sourceMappingURL=CoachMarkService.js.map
- ;
- /*
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * (C) Copyright IBM Corp. 2015, 2016
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/RestUrls',[], function () {
- var VERSION = 'v1';
- var RestUrls = {
- JSON_CONTENT_TYPE: 'application/json; charset=utf-8',
- JSON_DATA_TYPE: 'json',
- INSTALL_ENV: VERSION + '/configuration/keys/Glass/installMode',
- SSO_URL: VERSION + '/ui/sso'
- };
- return RestUrls;
- });
- //# sourceMappingURL=RestUrls.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: Glass
- *
- * Copyright IBM Corp. 2019
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/services/ConfigService',['jquery', 'underscore', '../RestUrls', '../../nls/StringResources'], function ($, _, restUrls, StringResources) {
- /**
- * This Class is a utility class to provide Config api for glass
- * @public
- */
- var ConfigService = /*#__PURE__*/function () {
- function ConfigService(options) {
- _classCallCheck(this, ConfigService);
- $.extend(this, options);
- this.CONTENTLOCALES = ConfigService.CONTENTLOCALES;
- this.PRODUCTLOCALES = ConfigService.PRODUCTLOCALES;
- this.TIMEZONES = ConfigService.TIMEZONES;
- this.LEGACYLAUNCHABLE = ConfigService.LEGACYLAUNCHABLE;
- }
- /**
- * Initialize the config service with values harvested from elsewhere...
- * @public
- * @param {Object} context - Config names and values
- */
- _createClass(ConfigService, [{
- key: "initialize",
- value: function initialize(context) {
- if (_.isObject(context)) {
- _.extend(this, _.pick(context, ConfigService.CONTENTLOCALES, ConfigService.PRODUCTLOCALES, ConfigService.TIMEZONES, ConfigService.LEGACYLAUNCHABLE, ConfigService.DEFAULTHOME, ConfigService.DEFAULTLOGIN, ConfigService.PRODUCTVERSION, ConfigService.SSOINFO, ConfigService.PORTAL_PAGES, ConfigService.DATA_SERVICE_QUERY_SIZE, ConfigService.INSTRUMENTATION_CONFIG, ConfigService.DIGITAL_CONTEXT_ENABLED, ConfigService.CLIENT_VALID_DOMAIN_LIST, ConfigService.XSS_CHECKING, ConfigService.CONF_MAPBOX_TOKEN, ConfigService.CONF_MAPBOX_ACCOUNTNAME, ConfigService.CONF_MAPBOX_SECRETTOKEN, ConfigService.MAINTENANCE_MESSAGE, ConfigService.MAINTENANCE_LINK, ConfigService.DISABLE_WHATSNEWSERVICE, ConfigService.DISABLE_ALERTBANNER, ConfigService.DISABLE_GLOBALTOAST));
- if (this[ConfigService.SSOINFO]) {
- this._processSSOInfo(this[ConfigService.SSOINFO]);
- }
- if (this[ConfigService.CONTENTLOCALES]) {
- try {
- this[ConfigService.CONTENTLOCALES] = JSON.parse(this[ConfigService.CONTENTLOCALES]);
- } catch (error) {
- this.glassContext.getCoreSvc('.Logger').error('Error parsing supportContentLocales JSON', error);
- this[ConfigService.CONTENTLOCALES] = undefined;
- }
- }
- if (context.featureRules) {
- try {
- var featureRules = JSON.parse(context.featureRules);
- this.glassContext.getCoreSvc('.FeatureChecker').addRules(featureRules);
- } catch (err) {
- this.glassContext.getCoreSvc('.Logger').error(err);
- }
- }
- } else {
- throw new Error('Invalid configuration context');
- }
- }
- /**
- * Sets config values based on passed in key.
- * @public
- * @param {string} key - The key for the config value. Try using static keys from this class.
- * @param {string} data - The data to store.
- * @return {Promise} result of ajax call to set config value.
- */
- }, {
- key: "setConfigValue",
- value: function setConfigValue(key, data) {
- var _this = this;
- var configData = {};
- configData[key] = _.isObject(data) ? JSON.stringify(data) : data;
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: ConfigService.BASE_URL + ConfigService.GLOBAL,
- type: 'PUT',
- contentType: 'application/json',
- data: JSON.stringify(configData)
- }).then(function () {
- _this[key] = data;
- }).catch(function (err) {
- var error = new Error(ConfigService.ERR_SET_CONFIG_VALUES);
- error.msg = error.message;
- error.causedBy = err;
- throw error;
- });
- }
- /**
- * Retrieve product version for the current user. Always return a resolved promise.
- * @public
- * @return {Promise} promise resolved to either a Json object with user's product version or undefined.
- */
- }, {
- key: "getProductVersion",
- value: function getProductVersion() {
- return this.getConfigValue(ConfigService.PRODUCTVERSION);
- }
- /**
- * Synchronously retrieve product version for the current user.
- * @public
- * @return {string} String with user's product version or undefined.
- */
- }, {
- key: "getVersion",
- value: function getVersion() {
- return this.getConfigValueSync(ConfigService.PRODUCTVERSION);
- }
- /**
- * Retrieve content locales for the current user. Always returns a resolved promise.
- * @public
- * @return {Promise} promise resolved to either a Json object with user's content locales or undefined.
- */
- }, {
- key: "getContentLocales",
- value: function getContentLocales() {
- return this._getConfigList(ConfigService.CONTENTLOCALES, true);
- }
- /**
- * Retrieve product locales for the current user. Always returns a resolved promise.
- * @public
- * @return {Promise} promise resolved to either a Json object with user's product locales or undefined.
- */
- }, {
- key: "getProductLocales",
- value: function getProductLocales() {
- return this._getConfigList(ConfigService.PRODUCTLOCALES, true);
- }
- /**
- * Retrieve time zone for the current user. Always returns a resolved promise.
- * @public
- * @return {Promise} promise resolved to either a Json object with user's time zones or undefined.
- */
- }, {
- key: "getTimeZones",
- value: function getTimeZones() {
- return this._getConfigList(ConfigService.TIMEZONES, true);
- }
- /**
- * Retrieve the system legacy launchable value. Always returns a resolved promise.
- * @public
- * @return {Promise} promise resolved to a value representing the legacy value or undefined.
- */
- }, {
- key: "getLegacyLaunchable",
- value: function getLegacyLaunchable() {
- return this._getConfigList(ConfigService.LEGACYLAUNCHABLE);
- }
- /**
- * Retrieve the system legacy launchable value. Always returns a resolved promise.
- * @public
- * @return {Promise} promise resolved to a value representing the legacy value or undefined.
- */
- }, {
- key: "getDefaultHome",
- value: function getDefaultHome() {
- return this._getConfigList(ConfigService.DEFAULTHOME);
- }
- /**
- * Retrieve the system legacy launchable value. Always returns a resolved promise.
- * @public
- * @return {Promise} promise resolved to a value representing the legacy value or undefined.
- */
- }, {
- key: "getDefaultLogin",
- value: function getDefaultLogin() {
- return this.getConfigValue(ConfigService.DEFAULTLOGIN);
- }
- /**
- * Retrieve the Dataset Service URL Query Size. Always returns a resolved promise.
- * @public
- * @return {Promise} promise resolved to a value representing the dataset service URL query size or undefined.
- */
- }, {
- key: "getDatasetQuerySize",
- value: function getDatasetQuerySize() {
- return this.getConfigValue(ConfigService.DATA_SERVICE_QUERY_SIZE);
- }
- /**
- * Retrieve the XSS Checking Flag
- * @public
- * @return Boolean value representing the XSS checking flag or undefined.
- */
- }, {
- key: "getXSSChecking",
- value: function getXSSChecking() {
- return this[ConfigService.XSS_CHECKING];
- }
- /**
- * Asynchronous retrieval of a given configName
- * @public
- * @param {String} configName
- * @param {boolean} isLocalized
- * @return {Promise} result of ajax call to set config value.
- */
- }, {
- key: "getConfigValue",
- value: function getConfigValue(configName, isLocalized) {
- return this._getHelper(configName, isLocalized, false);
- }
- /**
- * Synchronous retrieval of a given configName from
- * @public
- * @param {String} configName
- * @return {String} resulting config string or empty object
- */
- }, {
- key: "getConfigValueSync",
- value: function getConfigValueSync(configName) {
- return this._getHelperSync(configName);
- }
- /**
- * Get SSO urlLoginParameters
- * @public
- * @return {String} the parameters or undefined
- */
- }, {
- key: "getAllowedUrlLoginParameters",
- value: function getAllowedUrlLoginParameters() {
- return this._getSSOInfo().urlLoginParameters;
- }
- /**
- * Get SSO login url
- * @public
- * @return {String} the login url or undefined
- */
- }, {
- key: "getSSOLoginURL",
- value: function getSSOLoginURL() {
- if (this[ConfigService.SSO_LOGIN]) return this[ConfigService.SSO_LOGIN];
- return this._getSSOInfo().login;
- }
- /**
- * Get SSO logout url
- * @public
- * @return {String} the logout url or undefined
- */
- }, {
- key: "getSSOLogoutURL",
- value: function getSSOLogoutURL() {
- if (this[ConfigService.SSO_LOGOUT]) return this[ConfigService.SSO_LOGOUT];
- return this._getSSOInfo().logout;
- }
- }, {
- key: "getInstrumentationConfig",
- value: function getInstrumentationConfig() {
- return this.getConfigValueSync(ConfigService.INSTRUMENTATION_CONFIG);
- }
- /**
- * Get Digital Context Enabled Flag
- */
- }, {
- key: "isDigitalContextEnabled",
- value: function isDigitalContextEnabled() {
- return this.getConfigValueSync(ConfigService.DIGITAL_CONTEXT_ENABLED);
- }
- }, {
- key: "_getConfigList",
- value: function _getConfigList(configName, isLocalized) {
- return this._getHelper(configName, isLocalized, true);
- }
- }, {
- key: "_getSSOInfo",
- value: function _getSSOInfo() {
- return this.getConfigValueSync(ConfigService.SSOINFO) || {};
- }
- }, {
- key: "_getHelper",
- value: function _getHelper(configName, isLocalized, isJSON) {
- var _this2 = this;
- if (!_.isUndefined(this[configName])) {
- return Promise.resolve(this[configName]);
- } else {
- var apiURL = ConfigService.BASE_URL + configName;
- var ups = this.glassContext.getCoreSvc('.UserProfile');
- if (isLocalized) {
- apiURL += ups.preferences.productLocale;
- }
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: apiURL,
- type: 'GET'
- }).then(function (ajaxResultObj) {
- var ajaxResult = ajaxResultObj.data;
- try {
- var ajaxKey = configName;
- if (isLocalized) {
- ajaxKey += ups.preferences.productLocale;
- }
- if (isJSON) {
- ajaxResult = JSON.parse(ajaxResult[ajaxKey]);
- } else {
- ajaxResult = ajaxResult[ajaxKey];
- }
- if (!_.isUndefined(ajaxResult)) {
- _this2[configName] = ajaxResult;
- }
- } catch (err) {
- var message = '"' + err.message + '" encountered while parsing ' + configName;
- _this2.glassContext.getCoreSvc('.Logger').error(message);
- }
- return _this2[configName];
- }).catchReturn();
- }
- }
- }, {
- key: "_getHelperSync",
- value: function _getHelperSync(configName) {
- return this[configName];
- }
- }, {
- key: "_getFormats",
- value: function _getFormats() {
- return {
- 'HTML': StringResources.get('html'),
- 'PDF': StringResources.get('pdf'),
- 'CSV': StringResources.get('csv'),
- 'spreadsheetML': StringResources.get('spreadsheetML'),
- 'xlsxData': StringResources.get('xlsxData')
- };
- }
- }, {
- key: "_getBaseTextDirections",
- value: function _getBaseTextDirections() {
- return {
- 'RTL': StringResources.get('rtl'),
- 'LTR': StringResources.get('ltr'),
- 'AUTO': StringResources.get('contextual')
- };
- }
- }, {
- key: "_getShowHints",
- value: function _getShowHints() {
- return {
- 'showAll': StringResources.get('showAll'),
- 'hideAll': StringResources.get('hideAll')
- };
- }
- }, {
- key: "clearConfigs",
- value: function clearConfigs() {
- this._contentLocales = undefined;
- this._productLocales = undefined;
- this._timeZoneIDs = undefined;
- this._defaultHome = undefined;
- }
- }, {
- key: "setSSOURL",
- value: function setSSOURL() {
- var _this3 = this;
- if (this[ConfigService.SSOINFO]) {
- return Promise.try(function () {
- return _this3._processSSOInfo(_this3[ConfigService.SSOINFO]);
- });
- } else {
- // TODO: Remove this when ssoInfo is injected by Entry page...
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: restUrls.SSO_URL,
- type: 'GET',
- contentType: restUrls.JSON_CONTENT_TYPE,
- dataType: restUrls.JSON_DATA_TYPE
- }).then(function (results) {
- var ssoData = results.data;
- _this3[ConfigService.SSOINFO] = ssoData;
- return _this3._processSSOInfo(ssoData);
- }).catch(function (err) {
- _this3.glassContext.getCoreSvc('.Logger').error('Internal error: set SSO URL failed: ' + err.jqXHR.responseText);
- throw err;
- });
- }
- }
- }, {
- key: "_processSSOInfo",
- value: function _processSSOInfo(ssoInfo) {
- if (ssoInfo && (ssoInfo.login || ssoInfo.logout)) {
- $.ajaxSetup({
- headers: {
- 'X-CA-SSO': this.glassContext.ajaxCodes.SSO
- }
- });
- }
- }
- }]);
- return ConfigService;
- }();
- ConfigService.BASE_URL = 'v1/configuration/keys/';
- ConfigService.CONTENTLOCALES = 'supportedContentLocales_';
- ConfigService.PRODUCTLOCALES = 'supportedProductLocales_';
- ConfigService.TIMEZONES = 'timeZones_';
- ConfigService.LEGACYLAUNCHABLE = 'Configuration.LegacyLaunchable';
- ConfigService.SSOINFO = 'ssoInfo';
- ConfigService.DEFAULTHOME = 'Glass.welcomePage';
- ConfigService.DEFAULTLOGIN = 'Glass.loginPage';
- ConfigService.PRODUCTVERSION = 'InstallService.productVersion';
- ConfigService.DIGITAL_CONTEXT_ENABLED = 'Glass.digitalContextEnabled';
- ConfigService.PORTAL_PAGES = 'ContentApps/enableMyPortalPages';
- ConfigService.GLOBAL = 'global';
- ConfigService.ERR_SET_CONFIG_VALUES = 'setConfigValue failed';
- ConfigService.DATA_SERVICE_QUERY_SIZE = 'DatasetService/urlQuerySize';
- ConfigService.INSTRUMENTATION_CONFIG = 'instrumentationConfig';
- ConfigService.CLIENT_VALID_DOMAIN_LIST = 'ClientValidDomainList';
- ConfigService.XSS_CHECKING = 'CAF.caf_tpXSSCheckingUsed';
- ConfigService.CONF_MAPBOX_TOKEN = 'Mapbox.token';
- ConfigService.CONF_MAPBOX_SECRETTOKEN = 'Mapbox.secretToken';
- ConfigService.CONF_MAPBOX_ACCOUNTNAME = 'Mapbox.accountName';
- ConfigService.MAINTENANCE_MESSAGE = 'Glass.maintenanceMessage';
- ConfigService.MAINTENANCE_LINK = 'Glass.maintenanceLink';
- ConfigService.DISABLE_WHATSNEWSERVICE = 'Glass.disableWhatsNewAlerts';
- ConfigService.DISABLE_ALERTBANNER = 'Glass.disableAlertBanner';
- ConfigService.DISABLE_GLOBALTOAST = 'Glass.disableGlobalToast';
- ConfigService.SSO_LOGIN = 'Glass.sso_login';
- ConfigService.SSO_LOGOUT = 'Glass.sso_logout';
- return ConfigService;
- });
- //# sourceMappingURL=ConfigService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2017, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/ContextService',[], function () {
- /**
- * @constructs ContextService
- * @classdesc This Class exposes the glass context
- * @public
- */
- var ContextService = function ContextService(opt) {
- this.glassContext = opt.glassContext;
- };
- ContextService.prototype.get = function (key) {
- return this.glassContext.getCoreSvc('.UserProfile')[key];
- };
- return ContextService;
- });
- //# sourceMappingURL=ContextService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/EventsService',['../core-client/js/core-client/ui/core/Events'], function (Events) {
- 'use strict';
- var EventsService;
- EventsService = Events.extend({// nothing special here - for future use
- });
- return EventsService;
- });
- //# sourceMappingURL=EventsService.js.map
- ;
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/FeatureChecker',[], function () {
- 'use strict';
- var isObject = function isObject(obj) {
- return _typeof(obj) === 'object' && !Array.isArray(obj);
- };
- /**
- * @constructor
- */
- var FeatureChecker = function FeatureChecker(rules) {
- this._rules = rules || {};
- };
- /**
- * @param {Object} rules - object describing feature rules.
- */
- FeatureChecker.prototype.setRules = function (rules) {
- this._rules = rules;
- };
- /**
- * @description Update feature rules
- * @param {Object} rules - object describing feature rules.
- */
- FeatureChecker.prototype.addRules = function (rules) {
- if (isObject(rules)) {
- Object.keys(rules).forEach(function (category) {
- if (isObject(rules[category])) {
- if (this._rules[category]) {
- Object.keys(rules[category]).forEach(function (flag) {
- this._rules[category][flag] = rules[category][flag];
- }.bind(this));
- } else {
- // Category doesn't exist; Simply add it.
- this._rules[category] = rules[category];
- }
- }
- }.bind(this));
- }
- };
- /**
- * Checks value against expected;
- * @param {string} category - ba-header associated with the flag. ie: 'ba-save', 'ba-share', etc...
- * @param {string} flag - flag associated with category
- * @param {string} expected - expected values
- * @return {boolean} true if category.flag === expected; false otherwise.
- */
- FeatureChecker.prototype.checkValue = function (category, flag, expected) {
- var ret = false;
- if (category && flag && this._rules[category] && this._rules[category][flag] !== undefined) {
- ret = this._rules[category][flag] === expected;
- }
- return ret;
- };
- /**
- * Gets the value of a rule
- * @param {string} category - ba-header associated with the flag. ie: 'ba-save', 'ba-share', etc...
- * @param {string} flag - flag associated with category
- * @return {string} value of category.flag, or null;
- */
- FeatureChecker.prototype.getFeatureFlag = function (category, flag) {
- var ret = null;
- if (category && flag && this._rules[category]) {
- ret = this._rules[category][flag];
- }
- return ret;
- };
- /**
- * Gets all rules associated with a category
- * @param {string} category - ba-header associated with the flag. ie: 'ba-save', 'ba-share', etc...
- * @return {Object} value of category.flag, or undefined;
- */
- FeatureChecker.prototype.getFeatureFlags = function (category) {
- return category ? this._rules[category] : null;
- };
- /**
- * Serialize the rules
- * @return {string} JSON/string
- */
- FeatureChecker.prototype.toJSON = function () {
- return JSON.stringify(this._rules);
- };
- return FeatureChecker;
- });
- //# sourceMappingURL=FeatureChecker.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BA
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/FeatureRules',[], function () {
- // Default feature flag set for the ba-glass application.
- // Format:
- /*
- return {
- category: {
- flag: 'value',
- other: 'value'
- }
- };
- */
- return {
- 'ba-glass': {
- 'stringOnlyQS': 'enabled'
- }
- };
- });
- //# sourceMappingURL=FeatureRules.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule
- * Contract with IBM Corp.
- */
- define('baglass/app/services/FetchService',['jquery', '../../core-client/js/core-client/ui/core/Class', '../../ajax/AjaxErrorFactory'], function ($, Class, AjaxErrorFactory) {
- /**
- * This Class is a utility class to provide RESTFul APIs for Glass
- */
- var FetchService = Class.extend(
- /**
- * @lends FetchService
- */
- {
- /**
- * @classdesc Class Implementating the Ajax service returning a promise
- * @constructs
- * @public
- * @param {Object} options - options
- * @param {GlassContext} options.glassContext - glass context
- *
- */
- init: function init(options) {
- $.extend(this, options);
- },
- /**
- * Sends an ajax request with jquery
- * @public
- * @param {String} url - url
- * @param {Object} [options] - Ajax options
- * @param {String} [options.type=GET] - method to invokes
- * @param {Object} [options.data] - data to send in case of POST or PUT
- * @param {String} [options.contentType=application/x-www-form-urlencoded; charset=UTF-8] - type of data sent
- * @param {String} [options.dataType] - type of expected data
- * @return {Promise} promise with the returned data
- * @throws {AjaxError|Error}
- *
- */
- sendBaseRequest: function sendBaseRequest(url, options) {
- options = $.extend(true, {}, options, {
- url: url
- });
- return this.glassContext.getCoreSvc('.Ajax').ajax(options).then(function (results) {
- return {
- data: results.data,
- code: results.jqXHR.status
- };
- }).catch(function (error) {
- var jqXHR = error.jqXHR;
- throw AjaxErrorFactory.create(jqXHR, jqXHR.statusText, error);
- });
- },
- /**
- * Sends a request and handles errors; the latter is the difference with sentBaseError
- * It also sends a notification request when the initial one is successful
- * @public
- * @param {String} url - url
- * @param {Object} options - Ajax options
- * @param {String} [options.type=GET] - method to invokes
- * @param {Object} [options.data] - data to send in case of POST or PUT
- * @param {String} [options.contentType=application/x-www-form-urlencoded; charset=UTF-8] - type of data sent
- * @param {String} [options.dataType] - type of expected data
- * @return {Promise} promise with the returned data
- * @throws {AjaxError|Error}
- */
- send: function send(url, options) {
- return this.sendBaseRequest(url, options);
- },
- post: function post(url, options) {
- var getOptions = $.extend(true, {}, options, {
- type: 'POST'
- });
- return this.send(url, getOptions);
- },
- put: function put(url, options) {
- var getOptions = $.extend(true, {}, options, {
- type: 'PUT'
- });
- return this.send(url, getOptions);
- },
- delete: function _delete(url, options) {
- var getOptions = $.extend(true, {}, options, {
- type: 'DELETE'
- });
- return this.send(url, getOptions);
- },
- get: function get(url, options) {
- var getOptions = $.extend(true, {}, options, {
- type: 'GET'
- });
- return this.send(url, getOptions);
- }
- });
- return FetchService;
- });
- //# sourceMappingURL=FetchService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule
- * Contract with IBM Corp.
- */
- define('baglass/app/services/AjaxService',['jquery', '../../core-client/js/core-client/ui/core/Class'], function ($, Class) {
- /**
- * This Class is a utility class to provide RESTFul APIs for Glass
- */
- var AjaxService = Class.extend({
- init: function init(options) {
- $.extend(this, options); // Inject RESTFul methods to class
- $.each(['get', 'put', 'post', 'delete'], function (i, method) {
- AjaxService.prototype[method] = function (path, options) {
- var _options = $.extend({}, options);
- _options.type = method;
- _options.url = path;
- return this.ajax(_options);
- };
- });
- },
- ajax: function ajax(options) {
- var dfd = $.Deferred();
- this.glassContext.getCoreSvc('.Ajax').ajax(options).then(function (results) {
- dfd.resolve(results.data, results.textStatus, results.jqXHR);
- }).catch(function (error) {
- dfd.reject(dfd, error.jqXHR, error.textStatus, error.errorThrown);
- });
- return dfd.promise();
- }
- });
- return AjaxService;
- });
- //# sourceMappingURL=AjaxService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/LogService',[], function () {
- var Logger = function Logger() {
- this.logLevelEnum = {
- 'debug': 50,
- 'info': 40,
- 'warn': 30,
- 'error': 20
- };
- this._level = this.logLevelEnum.error;
- this._active = true;
- this.localStorageKeys = {
- 'isActive': 'com.ibm.ba.config.logging.isActive',
- 'level': 'com.ibm.ba.config.logging.level'
- };
- var loggingConfigActive = this._getLocalStorage(this.localStorageKeys.isActive);
- if (loggingConfigActive !== null) {
- if (typeof loggingConfigActive.toLowerCase === 'function' && loggingConfigActive.toLowerCase() === 'true') {
- this._active = true;
- } else {
- this._active = false;
- }
- }
- var loggingConfigLevel = this._getLocalStorage(this.localStorageKeys.level);
- if (loggingConfigLevel !== null) {
- this._level = loggingConfigLevel;
- }
- };
- Logger.prototype.turnOnLogging = function () {
- this._active = true;
- };
- Logger.prototype.turnOffLogging = function () {
- this._active = false;
- };
- Logger.prototype.isActive = function () {
- return this._active;
- };
- Logger.prototype.getLevel = function () {
- return parseInt(this._level);
- };
- Logger.prototype.setLevelError = function () {
- this._level = this.logLevelEnum['error'];
- };
- Logger.prototype.setLevelWarn = function () {
- this._level = this.logLevelEnum['warn'];
- };
- Logger.prototype.setLevelInfo = function () {
- this._level = this.logLevelEnum['info'];
- };
- Logger.prototype.setLevelDebug = function () {
- this._level = this.logLevelEnum['debug'];
- };
- Logger.prototype.error = function () {
- if (this._active && this._level >= this.logLevelEnum['error']) {
- console.error.apply(console, this._addStack(arguments));
- }
- };
- Logger.prototype.warn = function () {
- if (this._active && this._level >= this.logLevelEnum['warn']) {
- console.warn.apply(console, arguments);
- }
- };
- Logger.prototype.info = function () {
- if (this._active && this._level >= this.logLevelEnum['info']) {
- console.info.apply(console, arguments);
- }
- };
- Logger.prototype.debug = function () {
- if (this._active && this._level >= this.logLevelEnum['debug']) {
- console.debug.apply(console, arguments);
- }
- };
- Logger.prototype.log = function () {
- if (this._active) {
- console.log.apply(console, arguments);
- }
- };
- Logger.prototype.saveConfig = function (level, active) {
- if (level !== undefined) {
- this._level = level;
- }
- if (active !== undefined) {
- this._active = active;
- }
- this._setLocalStorage(this.localStorageKeys.isActive, this._active ? 'true' : 'false');
- this._setLocalStorage(this.localStorageKeys.level, this._level);
- };
- Logger.prototype._setLocalStorage = function (key, value) {
- try {
- window.localStorage.setItem(key, value);
- } catch (err) {
- console.error(err);
- }
- };
- Logger.prototype._getLocalStorage = function (key) {
- var ret = null;
- try {
- ret = window.localStorage.getItem(key) || null;
- } catch (err) {
- console.error(err);
- }
- return ret;
- }; // create a dummy error so error.stack will be defined in IE
- Logger.prototype._addStack = function () {
- var args = Array.prototype.slice.call(arguments);
- var stack = new Error().stack || '';
- if (stack === '') {
- try {
- // eslint-disable-next-line
- var x = y.name;
- } catch (e) {
- stack = e.stack;
- }
- }
- stack = stack.split('\n').map(function (line) {
- return line.trim();
- });
- var arr = stack.splice(stack[0] === 'Error' ? 2 : 1);
- args.push({
- stack: arr
- });
- return args;
- };
- return Logger;
- });
- //# sourceMappingURL=LogService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/utils/RequestIdleCallback',[], function () {
- // Polyfill requestIdleCallback for IE11
- var TIMEOUT = 50;
- var polyfill = {
- requestIdleCallback: function requestIdleCallback(callback) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- return setTimeout(function () {
- callback();
- }, Math.floor(Math.random() * (options.timeout || TIMEOUT)));
- }
- };
- if (!window.requestIdleCallback) {
- window.requestIdleCallback = polyfill.requestIdleCallback;
- }
- return polyfill;
- });
- //# sourceMappingURL=RequestIdleCallback.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/PrefetchService',['underscore', '../utils/RequestIdleCallback'], function (_) {
- var TIMEOUT = 50;
- /**
- * @lends PrefetchService
- **/
- var PrefetchService = /*#__PURE__*/function () {
- /**
- * Contructor for PrefetchService
- * @public
- * @constructs PrefetchService
- * @classdesc The PrefetchService is used to lazily fetch resources that
- * are not needed now, but may be needed in the future. By prefetching
- * these resources in the background while the browser is otherwise idle,
- * the user will not experience the lag associated with fetching them on-demand.
- * @param {Object} glassContext - glassContext
- **/
- function PrefetchService(glassContext) {
- _classCallCheck(this, PrefetchService);
- this._FETCHED = {};
- this.glassContext = glassContext;
- }
- /**
- * @public
- * @description Fetches resources in a given array... one at a time and
- * when the browser is idle.
- * @param {Array} resources - List of file-paths to require.
- * @returns {Promise} resolved when we have tried to prefetch all resources.
- */
- _createClass(PrefetchService, [{
- key: "prefetchResources",
- value: function prefetchResources(resources) {
- var _this = this;
- var chain = Promise.resolve();
- if (_.isArray(resources)) {
- resources.forEach(function (resource) {
- if (_.isString(resource)) {
- if (!_this._FETCHED[resource]) {
- chain = chain.then(_this._requireResource.bind(_this, resource));
- }
- } else {
- _this.glassContext.getCoreSvc('.Logger').warn("Resource ".concat(JSON.stringify(resource), " is not a string..."));
- }
- });
- } else {
- this.glassContext.getCoreSvc('.Logger').warn("Parameter ".concat(JSON.stringify(resources), " is not an array..."));
- }
- return chain;
- }
- }, {
- key: "_requireResource",
- value: function _requireResource(resource) {
- var _this2 = this;
- this._FETCHED[resource] = true;
- return new Promise(function (resolve) {
- window.requestIdleCallback(function () {
- require([resource], resolve, function (err) {
- _this2.glassContext.getCoreSvc('.Logger').warn("Failed to prefetch resource at path: ".concat(resource), err);
- resolve();
- });
- }, {
- timeout: TIMEOUT
- });
- });
- }
- }]);
- return PrefetchService;
- }();
- return PrefetchService;
- });
- //# sourceMappingURL=PrefetchService.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/ServiceRegistry',[], function () {
- var DEFAULT_TIMEOUT = 30000;
- var ServiceRegistry = /*#__PURE__*/function () {
- /**
- * Constructor
- *
- * Options allow injecting different implementations (helps with unit testing)
- *
- * Registry contains a map of services. Some services can be pre-populated at construction time.
- * Others will be fetched when someone needs access to the service.
- *
- * @param options
- * options.services map of pre-setup services
- */
- function ServiceRegistry(options) {
- _classCallCheck(this, ServiceRegistry);
- this.services = options.services || {}; //pre-setup services
- this.deprecated = {};
- this._waitList = {};
- this._declared = {};
- }
- /**
- * get service from registry, follows async model Services can be lazy
- * loaded
- *
- * @param {string } name of service to retrieve
- * @param {number} [timeout] timeout value in ms
- * @return {promise} resolved with service on success, rejected with error on failure
- */
- _createClass(ServiceRegistry, [{
- key: "getSvc",
- value: function getSvc(name, timeout) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- try {
- _this._get(name, resolve, reject, timeout);
- } catch (err) {
- reject(err);
- }
- });
- }
- /**
- * @description Get service from registry synchronously. Avoid if possible and use Promise-based async/API.
- * @throws if service is not found.
- *
- * @param {string } name - name of service to retrieve
- * @return {object} the service
- */
- }, {
- key: "getSvcSync",
- value: function getSvcSync(name) {
- if (this.services[name]) {
- return this.services[name];
- }
- throw new Error('Service "' + name + '" has not been registered');
- }
- /**
- * get service from registry, follows async model Services can be lazy
- * loaded
- * @deprecated
- * @param {string } name of service to retrieve
- * @param {function} callback
- * callback function invoked on service becoming available
- * service obj is passed to the callback. Using this simpler
- * model instead of jQuery Deferred objects to avoid
- * dependency on jQuery
- * @param {function} [errcb]
- * Error callback, called if we are not able to get the service and timeout occurs
- * @param {number} [timeout]
- * timeout value in ms
- */
- }, {
- key: "get",
- value: function get(name, callback, errcb, timeout) {
- this._get(name, callback, errcb, timeout);
- }
- }, {
- key: "exists",
- value: function exists(name) {
- return !!(name && this.services[name]);
- }
- /**
- * @description Destroys an existing service and removes it from the registry.
- * If the service was declared, but not registered, it is removed from the
- * declared list as well.
- */
- }, {
- key: "deregister",
- value: function deregister(name) {
- if (this._declared[name]) {
- delete this._declared[name];
- }
- if (this.exists(name)) {
- if (typeof this.services[name].destroy === 'function') {
- this.services[name].destroy();
- }
- delete this.services[name];
- this._cleanupWaitList(name);
- }
- }
- /**
- * @description Declares a service that will be loaded when required.
- * @param {String} name - the service name
- * @param {String} modulePath - the path to the module to be loaded
- * @param {Object} initializeWith - (optional) An object to be passed to the services' initialize function
- */
- }, {
- key: "declare",
- value: function declare(name, modulePath, initializeWith) {
- if (!name) {
- throw new Error('Illegal service declaration: name missing');
- }
- if (!modulePath) {
- throw new Error('Illegal service declaration: modulePath missing');
- }
- if (!this.exists(name)) {
- if (this._declared[name] && this._declared[name].modulePath !== modulePath) {
- throw new Error('Illegal service declaration. Attempted to re-declare a service with a different module path');
- } else {
- this._declared[name] = {
- modulePath: modulePath,
- initializeWith: initializeWith
- };
- if (this._waitList[name]) {
- this._loadDeclaredService(name);
- }
- }
- }
- }
- }, {
- key: "declared",
- value: function declared(name) {
- return !!this._declared[name];
- }
- }, {
- key: "_get",
- value: function _get(name, callback, errcb, timeout) {
- var _this2 = this;
- var cb = function cb(svc) {
- if (_this2.deprecated[name]) {
- console.warn('The service \'' + name + '\' has been deprecated.');
- if (_this2.deprecated[name]._replacedBy) {
- console.info('The service \'' + name + '\' has been replaced by \'' + svc.replacedBy + '\'.');
- }
- }
- if (callback) {
- callback(svc);
- }
- };
- if (!this.services[name]) {
- if (name[0] === '.' || timeout) {
- if (this._declared[name]) {
- this._loadDeclaredService(name).then(cb);
- } else {
- //any service name that starts with . will be treated as an object that will be registered
- //this is so that we don't do a require to fetch the service
- //a timeout value is associated so that consumers don't wait endlessly
- this._waitForRegister(name, cb, errcb, timeout || DEFAULT_TIMEOUT);
- }
- } else {
- this._loadServiceByModuleName(name, cb, errcb);
- }
- } else {
- cb(this.services[name]);
- }
- }
- /**
- * @deprecated Legacy behaviour; Not sure if this is ever used...
- * @description Services with names not starting with '.' are assumed to
- * be module paths. As a last-ditch effort, we attempt to require and
- * construct the service here.
- */
- }, {
- key: "_loadServiceByModuleName",
- value: function _loadServiceByModuleName(name, cb, errcb) {
- var _this3 = this;
- require([name], function (Service) {
- if (!_this3.services[name]) {
- // The service may have been registered while we were waiting for the requirejs/callback
- _this3.register(name, new Service());
- }
- cb(_this3.services[name]);
- }, function (err) {
- var msg = 'Service module: \'' + name + '\' not found.';
- if (errcb) {
- var error = new Error(msg);
- error.causedBy = err;
- errcb(error);
- } else {
- console.error(msg);
- }
- });
- }
- }, {
- key: "_loadDeclaredService",
- value: function _loadDeclaredService(name) {
- var _this4 = this;
- var modulePath = this._declared[name].modulePath;
- var initArg = this._declared[name].initializeWith;
- delete this._declared[name];
- return new Promise(function (resolve, reject) {
- require([modulePath], function (Service) {
- try {
- if (!_this4.services[name]) {
- // The service may have been registered while we were waiting for the requirejs/callback
- var svc = new Service();
- Promise.resolve().then(function () {
- if (typeof svc.initialize === 'function') {
- return svc.initialize(initArg);
- }
- }).then(function () {
- _this4.register(name, svc);
- resolve(svc);
- });
- } else {
- resolve(_this4.services[name]);
- }
- } catch (err) {
- reject(err);
- }
- }, reject);
- });
- }
- }, {
- key: "_waitForRegister",
- value: function _waitForRegister(name, cb, errcb, timeout) {
- var list = this._waitList[name] || [];
- var timer = setTimeout(this._signalRegisterFailure.bind(this, name, cb, errcb), timeout);
- list.push({
- cb: cb,
- errcb: errcb,
- timer: timer
- });
- this._waitList[name] = list;
- }
- }, {
- key: "_signalRegisterFailure",
- value: function _signalRegisterFailure(name, cb, errcb) {
- var list = this._waitList[name] || [];
- for (var i = list.length - 1; i >= 0; i--) {
- if (list[i].cb === cb) {
- list.splice(i, 1);
- }
- }
- this._waitList[name] = list;
- var error = new Error('Service: \'' + name + '\' not found.');
- if (errcb) {
- errcb(error);
- } else {
- console.error(error);
- }
- }
- }, {
- key: "register",
- value: function register(name, oSvc, options) {
- var _this5 = this;
- if (name && oSvc) {
- var service = oSvc;
- service._registry = this; //allow service to invoke other services
- if (options && options.deprecated) {
- this.deprecated[name] = {};
- }
- if (options && options.replacedBy) {
- this.deprecated[name]._replacedBy = options.replacedBy;
- }
- if (this._declared[name]) {
- delete this._declared[name];
- }
- if (typeof service.__initialize === 'function') {
- Promise.resolve(service.__initialize()).then(function () {
- _this5.services[name] = oSvc;
- _this5._notifyWaitingConsumers(name, oSvc);
- });
- } else {
- this.services[name] = oSvc;
- this._notifyWaitingConsumers(name, oSvc);
- }
- }
- }
- }, {
- key: "_notifyWaitingConsumers",
- value: function _notifyWaitingConsumers(name, oSvc) {
- var list = this._waitList[name] || [];
- for (var i = 0; i < list.length; i++) {
- var fn = list[i].cb;
- if (list[i].timer) {
- clearTimeout(list[i].timer);
- }
- fn(oSvc);
- }
- this._waitList[name] = [];
- }
- }, {
- key: "_cleanupWaitList",
- value: function _cleanupWaitList(name) {
- var list = this._waitList[name] || [];
- for (var i = list.length - 1; i >= 0; i--) {
- if (list[i].timer) {
- clearTimeout(list[i].timer);
- }
- }
- this._waitList[name] = [];
- }
- }, {
- key: "destroy",
- value: function destroy() {
- Object.keys(this.services).forEach(this.deregister.bind(this));
- }
- }]);
- return ServiceRegistry;
- }();
- return ServiceRegistry;
- });
- //# sourceMappingURL=ServiceRegistry.js.map
- ;
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/services/UserProfileService',['../../core-client/js/core-client/ui/core/Class', 'underscore'], function (Class, _) {
- /**
- * This Class exposes a javascript API for the userProfile REST service
- */
- var UserProfileService = Class.extend({
- init: function init(options) {
- this.preferences = {};
- _.extend(this, options);
- },
- updateContext: function updateContext(profile) {
- _.extend(this, profile);
- return Promise.resolve();
- },
- /* Get Methods */
- getHomePagePref: function getHomePagePref() {
- if (_typeof(this.preferences) != undefined) {
- if (this.preferences.hasOwnProperty('homePage')) {
- return this.preferences.homePage;
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
- });
- return UserProfileService;
- });
- //# sourceMappingURL=UserProfileService.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Glass
- * (C) Copyright IBM Corp. 2022
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/WindowProxyService',['baglass/nls/StringResources'], function (StringResources) {
- function _throwError(proxyService, url, isRemote) {
- if (proxyService.config && proxyService.config.dialog) {
- var callback = function callback(evt) {
- if (evt.btn === 'ok') {
- proxyService.context.close().then(function () {
- proxyService.window.location.assign(proxyService.window.location.origin, isRemote);
- });
- }
- };
- proxyService.context.appController.showMessage(StringResources.get('invalidUrl'), StringResources.get('cannotOpenLocation'), 'error', ['ok', 'cancel'], 'small', callback, true, 'LocationDialog');
- }
- throw new Error('Invalid redirect detected: ' + url);
- }
- function _validateUrl(proxyService, targetUrl, isRemote) {
- var _proxyService$context, _proxyService$context4;
- /**
- * check a redirect url against a reference one;
- * related to https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
- * */
- var args = ["url: ".concat(targetUrl), "isRemote: ".concat(isRemote)];
- (_proxyService$context = proxyService.context.getCoreSvc('.Logger')).debug.apply(_proxyService$context, ["validating url:"].concat(args));
- var fromUrlObj = proxyService.window.location;
- if (targetUrl) {
- try {
- var invalidCharsRE = /[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%\-._~:/?#[\]@!$&'()*+,;= ]/;
- var hasJsRE = /javascript:|data:/;
- var url = targetUrl.toString().toLowerCase().trim();
- var hasInvalidCharacters = invalidCharsRE.exec(url) === null ? false : true;
- var hasJs = hasJsRE.exec(url) === null ? false : true;
- var hasFile = url.startsWith('//');
- var targetUrlObj = document.createElement('a');
- targetUrlObj.href = url;
- var hasProtocol = targetUrlObj.protocol && targetUrlObj.protocol.startsWith('http');
- var isValidURL = hasProtocol && !hasInvalidCharacters && !hasJs && !hasFile;
- if (isValidURL && isRemote !== true) {
- isValidURL = targetUrlObj.protocol === fromUrlObj.protocol && targetUrlObj.hostname === fromUrlObj.hostname && targetUrlObj.port === fromUrlObj.port;
- }
- if (isValidURL) {
- var _proxyService$context2;
- (_proxyService$context2 = proxyService.context.getCoreSvc('.Logger')).debug.apply(_proxyService$context2, ["Url validation success:"].concat(args));
- return true;
- }
- } catch (e) {
- var _proxyService$context3;
- (_proxyService$context3 = proxyService.context.getCoreSvc('.Logger')).error.apply(_proxyService$context3, ['Url validation error:'].concat(args, [e]));
- }
- }
- (_proxyService$context4 = proxyService.context.getCoreSvc('.Logger')).error.apply(_proxyService$context4, ["Url validation failed:"].concat(args));
- return false;
- }
- function _assign(url, isRemote) {
- this.context.getCoreSvc('.Logger').info('Navigating to:', "url: ".concat(url), "isRemote: ".concat(isRemote));
- if (_validateUrl(this, url, isRemote)) {
- return this.window.location.assign(url);
- } else {
- _throwError(this, url, isRemote);
- }
- }
- function _replace(url, isRemote) {
- this.context.getCoreSvc('.Logger').info('Navigating to:', "url: ".concat(url), "isRemote: ".concat(isRemote));
- if (_validateUrl(this, url, isRemote)) {
- return this.window.location.replace(url);
- } else {
- _throwError(this, url, isRemote);
- }
- }
- function _reload() {
- this.context.getCoreSvc('.Logger').debug('reloading page...');
- return this.window.location.reload();
- }
- /*
- Provides a standard means of tracking and validating programatic browser window location operations
- by wrapping browser Window object.
- */
- var WindowProxyService = /*#__PURE__*/function () {
- function WindowProxyService() {
- var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var nativeWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
- var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
- dialog: false
- };
- _classCallCheck(this, WindowProxyService);
- this.context = context;
- this.config = config;
- this.window = nativeWindow;
- if (nativeWindow.Proxy) {
- this.proxyWindow = this.proxy(nativeWindow);
- this.context.window = this.proxyWindow;
- } else {
- this.context.getCoreSvc('.Logger').debug('Unable to initialize WindowProxyService. Unsupported browser.');
- }
- }
- /*
- * returns a new Window proxy for the supplied Window object
- * @param {Object} nativeWindow - a browser window
- */
- _createClass(WindowProxyService, [{
- key: "proxy",
- value: function proxy(nativeWindow) {
- var _this = this;
- this.context.getCoreSvc('.Logger').debug('Creating a new Window Proxy service for', nativeWindow);
- var _location = Object.fromEntries(Object.entries(nativeWindow.location));
- _location.assign = _assign.bind(this);
- _location.reload = _reload.bind(this);
- _location.replace = _replace.bind(this);
- _location.toString = nativeWindow.location.toString.bind(nativeWindow.location);
- var locationProxy = new Proxy(_location, {
- set: function set(target, key, value) {
- var urlAttributes = ['href', 'protocol', 'host', 'hostname', 'port', 'pathname', 'search', 'hash', 'origin'];
- _this.context.getCoreSvc('.Logger').info("Setting window.location object '".concat(key, "' to ").concat(value, "..."));
- if (urlAttributes.includes(key)) {
- var _target = new window.URL(target.href);
- try {
- _target[key] = value;
- if (_validateUrl(_this, _target.href)) {
- nativeWindow.location[key] = value;
- } else {
- throw new Error();
- }
- } catch (e) {
- _this.context.getCoreSvc('.Logger').error("Error setting window.location object '".concat(key, "' to ").concat(value, "."));
- _throwError(_this, target.href);
- }
- } else {
- nativeWindow.location[key] = value;
- }
- return true;
- }
- });
- var windowProxy = new Proxy(nativeWindow, {
- set: function set(target, key, value) {
- _this.context.getCoreSvc('.Logger').info("Setting window object '".concat(key, "' to ").concat(value, "..."));
- if (key === 'location') {
- if (_validateUrl(_this, value)) {
- nativeWindow.location = value;
- } else {
- _throwError(_this, value);
- }
- } else {
- target[key] = value;
- }
- return true;
- },
- get: function get(target, key) {
- return key === 'location' ? locationProxy : nativeWindow[key] instanceof Function ? nativeWindow[key].bind(nativeWindow) : nativeWindow[key];
- }
- });
- return windowProxy;
- }
- }]);
- return WindowProxyService;
- }();
- return WindowProxyService;
- });
- //# sourceMappingURL=WindowProxyService.js.map
- ;
- /*
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI
- *
- * (C) Copyright IBM Corp. 2015, 2019
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/ui/SlideoutController',['../../core-client/js/core-client/ui/core/Events', 'jquery', 'underscore', './SlideoutRegistry', '../../core-client/js/core-client/ui/Slideout'], function (Events, $, _, SlideoutRegistry, Slideout) {
- /**
- * Finds the open slideout
- */
- var _findOpenSlideout = function _findOpenSlideout(position) {
- var openSlideout = this.registry.application.getOpenSlideout(position);
- if (!openSlideout) {
- openSlideout = this.registry.appView.getOpenSlideout(position);
- }
- return openSlideout;
- };
- /**
- * Creates the slideout or takes the passed one
- * Verifies if it is already registered
- * @param {String} sceop - requested scope
- * @param {object|Slideout} slideout - slideout or object defining the slideout to open
- * @return {object} object with the slideout to open and the right scope if it is registered
- */
- var _createSlideoutToOpen = function _createSlideoutToOpen(scope, slideout) {
- var newSlideout;
- var realScope = scope;
- if (Slideout.prototype.isPrototypeOf(slideout)) {
- newSlideout = slideout;
- } else {
- newSlideout = new Slideout(slideout);
- }
- var registered = this.registry.application.getRegisteredSlideout(newSlideout.getRootId());
- if (registered) {
- realScope = 'application';
- } else {
- registered = this.registry.appView.getRegisteredSlideout(newSlideout.getRootId());
- if (registered) {
- realScope = 'appView';
- }
- }
- if (registered && registered !== newSlideout.getRootParent()) {
- newSlideout = registered;
- }
- return {
- slideout: newSlideout,
- scope: realScope
- };
- };
- var _openSlideoutCount = 0;
- var _openPerspectiveViewSlideoutCount = 0;
- var _onSlideoutHide = function _onSlideoutHide(scope) {
- if (scope === 'application') {
- _openSlideoutCount = Math.max(0, _openSlideoutCount - 1);
- } else if (scope === 'appView') {
- _openPerspectiveViewSlideoutCount = Math.max(0, _openPerspectiveViewSlideoutCount - 1);
- }
- if (_openSlideoutCount === 0) {
- $('body').removeClass('openedSlideout');
- }
- if (_openPerspectiveViewSlideoutCount === 0) {
- $('body').removeClass('openedAppViewSlideout');
- }
- };
- /**
- * @public
- */
- var Controller = Events.extend(
- /**
- * @lends Controller.prototype
- */
- {
- /**
- * @classdesc Class Controlling the application & appView registries, see {SlideoutRegitry}
- * @constructs
- * @public
- * @param {object} options - Init properties
- * @param {object} options.registry - Object containing the application and appView registries
- * @param {SlideoutRegistry} options.registry.application - Registry for the application
- * @param {SlideoutRegistry} options.registry.appView - Registry for the appView
- * application & application.appView
- */
- init: function init(options) {
- Controller.inherited('init', this, arguments);
- $.extend(this, options);
- _openPerspectiveViewSlideoutCount = 0;
- },
- /**
- * Opens a slideout in a given scope; Hides the one that is potentially already open
- * @param {String} scope - application or appView
- * @param {object|Slideout} - slideout to open defined as an object or an instance
- * @return {Slideout} the open slideout
- * @thorw Error when the scope or the slideout position is invalid
- */
- openSlideout: function openSlideout(scope, slideout) {
- var reusedSlideout = this._checkForSlideoutInstanceReuse(scope, slideout);
- if (reusedSlideout) {
- return reusedSlideout;
- }
- var slideoutToOpen = _createSlideoutToOpen.call(this, scope, slideout);
- var openSlideout = _findOpenSlideout.call(this, slideoutToOpen.slideout.position);
- if (scope === 'application') {
- _openSlideoutCount++;
- $('body').addClass('openedSlideout');
- } else if (scope === 'appView') {
- _openPerspectiveViewSlideoutCount++;
- $('body').addClass('openedAppViewSlideout');
- }
- if (openSlideout) {
- openSlideout.hide({
- hideOnly: openSlideout.hideOnly,
- force: true
- }).done(function () {
- this.registry[slideoutToOpen.scope].openSlideout(slideoutToOpen.slideout);
- this._checkNavBarButtons(slideoutToOpen);
- }.bind(this));
- } else {
- this.registry[slideoutToOpen.scope].openSlideout(slideoutToOpen.slideout);
- this._checkNavBarButtons(slideoutToOpen);
- } // introduced a new class for appView, so now we need to remove the class from the body on hide of the slideout
- // the handler needs to be triggered for appView now, but we don't want to remove/add the handle when the reuseSlideout flag is set
- if (!slideout.reuseSlideout) {
- slideoutToOpen.slideout.off('hide', null, 'slideoutHideHandler');
- slideoutToOpen.slideout.on('hide', _onSlideoutHide.bind(this, scope), 'slideoutHideHandler');
- }
- return slideoutToOpen.slideout;
- },
- /**
- * Check for an opened "appView" slideout that matches the new slideout id.
- * When we have an appView slideout that is already open with the same id, then we will reuse the slideout instance
- * This reused slideout is only enabled when the slidepout option "reuseSlideout=true" is used.
- * @param {String} scope - application or appView
- * @param {object|Slideout} - slideout to open defined as an object or an instance
- * @return {Slideout} the open slideout or null if there is no match
- */
- _checkForSlideoutInstanceReuse: function _checkForSlideoutInstanceReuse(scope, slideout) {
- var id = slideout.id; // when we have an appView slideout that is already open with the same id,
- // and "reuseSlideout" is true, then we will reuse the slideout instance
- var appViewOpenedSlideout = this.registry.appView.getOpenSlideout(slideout.position);
- if (appViewOpenedSlideout && scope === 'appView' && id === appViewOpenedSlideout.id && slideout.reuseSlideout) {
- appViewOpenedSlideout.trigger('hide');
- appViewOpenedSlideout.off();
- appViewOpenedSlideout.setContent(slideout.content);
- this.registry[scope].openSlideout(appViewOpenedSlideout); // <Make sure that we maintain the minimum width if there is one
- var minWidth = slideout.resizable && slideout.resizable.min;
- if (!minWidth) {
- minWidth = parseInt(slideout.width, 10);
- }
- if (minWidth && minWidth > appViewOpenedSlideout.getWidth()) {
- appViewOpenedSlideout.setWidth(minWidth);
- } // This seems to be called when a slideout is open, so we call it here just to be consistent.
- this._checkNavBarButtons({
- scope: scope,
- slideout: appViewOpenedSlideout
- });
- return appViewOpenedSlideout;
- }
- return null;
- },
- _checkNavBarButtons: function _checkNavBarButtons(slideoutToOpen) {
- if (slideoutToOpen.slideout.content) {
- var buttonId = null;
- if (slideoutToOpen.slideout.content.module.indexOf('bi/content_apps/MyContent') !== -1) {
- buttonId = 'com.ibm.bi.contentApps.myContentFoldersSlideout';
- } else if (slideoutToOpen.slideout.content.module.indexOf('bi/content_apps/TeamFolders') !== -1) {
- buttonId = 'com.ibm.bi.contentApps.teamFoldersSlideout';
- }
- if (buttonId && slideoutToOpen.slideout.glassContext) {
- var plugin = slideoutToOpen.slideout.glassContext.findPlugin(buttonId);
- plugin.setPressed();
- slideoutToOpen.slideout.on('hide', plugin.setUnpressed.bind(plugin));
- }
- }
- },
- /**
- * Updates the containers of the registry
- * @param $container
- */
- updateRegistryContainer: function updateRegistryContainer($container) {
- this.registry.application.changeContainer($container);
- if (!this.registry.appView.getContainer()) {
- this.registry.appView.changeContainer($container);
- }
- },
- cleanupSlideoutRegistry: function cleanupSlideoutRegistry() {
- this.registry.application.cleanupSlideouts();
- this.registry.appView.cleanupSlideouts();
- },
- /**
- * Closes all opened slide outs
- *
- * @return {promise} A promise resolved to true after all sliders are closed
- */
- closeAllOpenedSlideouts: function closeAllOpenedSlideouts() {
- var excludeAppViewSlideouts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- var promises = [];
- var slideoutsToClose = this.registry.application.getOpenSlideouts();
- if (!excludeAppViewSlideouts) {
- slideoutsToClose = slideoutsToClose.concat(this.registry.appView.getOpenSlideouts());
- }
- slideoutsToClose.forEach(function (slideout) {
- promises.push(slideout.hide({
- force: true,
- hideOnly: slideout.hideOnly
- }));
- });
- return Promise.all(promises).then(function () {
- return true;
- });
- }
- });
- return Controller;
- });
- //# sourceMappingURL=SlideoutController.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/AppEvents',[], function () {
- var appViewEvent = function appViewEvent(suffix) {
- return suffix ? 'appView' + suffix : 'appview';
- };
- return Object.freeze({
- APPVIEW: appViewEvent(),
- APPVIEW_LOADED: appViewEvent(':loaded')
- });
- });
- //# sourceMappingURL=AppEvents.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2015, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/GlassPlugin',['../../core-client/js/core-client/ui/core/Class', '../../core-client/js/core-client/utils/Utils', '../../core-client/js/core-client/utils/ClassFactory', 'jquery', 'underscore', '../../utils/Utils', '../AppEvents'], function (Class, Utils, ClassFactory, $, _, GlassUtils, AppEvents) {
- /**
- *
- * @public
- */
- var GlassPlugin = Class.extend(
- /**
- * @lends GlassPlugin.prototype
- */
- {
- /**
- * @constructs
- * @classdesc This Class acts as a base class for the GlassPlugin API interface Glass Plugins should implement all public methods in this base class.
- * Abstract methods need to be implemented.
- * @public
- * @param {Object} options - Option with itemSpec and glassContext
- *
- */
- init: function init(options) {
- $.extend(true, this, options);
- this.itemSpec = this.itemSpec || {};
- this.$el = $('<div>');
- GlassUtils.errorProtect(this, ['render', 'show', 'hide', 'changeLabel']);
- },
- /**
- * Gets the container element of the plugin.
- * @public
- * @returns {Object} dom element shown in the perspective
- */
- getRootElement: function getRootElement() {
- return this.$el;
- },
- /**
- * Render the plugin.
- * @public
- * @virtual
- * @returns (Deferred) the returned value is the dom element
- */
- render: function render() {
- this.$el.text(_.unescape(this.itemSpec.label));
- this._addClass(this.$el, this.itemSpec['class']);
- this._setIcon(this.$el);
- this.registerOneTimeCallback(AppEvents.APPVIEW_LOADED);
- return Promise.resolve(this.$el.get()[0]);
- },
- /**
- * Remove the plugin from it's container.
- */
- remove: function remove() {
- this.$el.remove();
- },
- /**
- * attaches the event callbacks using the defined actionController
- * @protected
- *
- */
- attachActionControllerCallbacks: function attachActionControllerCallbacks() {
- console.debug('attachActionControllerCallbacks not implemented');
- },
- /**
- * Enables the plugin
- * @public
- */
- enable: function enable() {
- this._getContainer().removeClass('disabled');
- this._getContainer().children().attr('tabindex', '0');
- },
- /**
- * Disables the plugin
- * @public
- */
- disable: function disable() {
- this._getContainer().addClass('disabled');
- this._getContainer().children().attr('tabindex', '-1');
- },
- /**
- * Makes the plugin visible
- * @public
- */
- show: function show() {
- this._getContainer().show();
- },
- /**
- * Hides the plugin
- * @public
- */
- hide: function hide() {
- this._getContainer().hide();
- },
- /**
- * returns the instance of the associated controller
- * @protected
- * @return {Promise} always resolved with the instance of the controller
- */
- getController: function getController() {
- var _this = this;
- if (!this._loadingController) {
- if (this.itemSpec.actionController) {
- if (!_.isString(this.itemSpec.actionController)) {
- this._loadingController = Promise.reject(new Error('actionController is not a string'));
- } else {
- this._loadingController = ClassFactory.instantiate(this.itemSpec.actionController.trim()).then(function (controller) {
- _this._controller = controller;
- if (_.isFunction(_this._controller.initialize)) {
- return _this._controller.initialize({
- glassContext: _this.glassContext,
- target: {
- plugin: _this,
- itemId: _this.itemSpec.id
- }
- });
- }
- }).then(function () {
- return _this._controller;
- });
- }
- } else {
- this._loadingController = Promise.resolve(this._controller);
- }
- }
- return this._loadingController;
- },
- /**
- * shows coachmark when defines.
- * @protected
- * @return {Promise} when resolved returns a boolean set to false when no coachMark is shown, true otherwise
- */
- showCoachMark: function showCoachMark() {
- var _this2 = this;
- return new Promise(function (resolve) {
- var coachMarkservice = _this2.glassContext.getCoreSvc('.CoachMarkService');
- var Renderer = coachMarkservice.getRenderer();
- var persistence = coachMarkservice.getPersistence();
- var containerId = _this2.itemSpec.id + 'PluginContainer';
- resolve(persistence.isRead(containerId).then(function (isRead) {
- var coachMarkSpec = {};
- $.extend(coachMarkSpec, _this2.itemSpec.coachMark);
- return _this2.getController().then(function (controller) {
- var shown = false;
- if (_.isFunction(controller.getCoachMarkSpec)) {
- var eventContext = {
- glassContext: _this2.glassContext,
- target: {
- coachMark: coachMarkSpec,
- itemId: _this2.itemSpec.id
- }
- };
- coachMarkSpec = controller.getCoachMarkSpec(eventContext) || coachMarkSpec;
- }
- if (!_.isEmpty(coachMarkSpec)) {
- _this2.glassContext.addToOptions(coachMarkSpec);
- _this2.coachMark = new Renderer(coachMarkSpec);
- shown = _this2._getContainer().hasClass('disabled') ? false : !isRead;
- _this2.coachMark.render(_this2._getContainer(), shown);
- }
- return shown;
- });
- }));
- });
- },
- _getContainer: function _getContainer() {
- return this.$container;
- },
- /**
- * Changes the label of the plugin; Label remains unchanged if the passed label is undefined
- * @virtual
- * @public
- * @param {String} label new label
- */
- changeLabel: function changeLabel(label) {
- console.info('GlassPlugin.changeLabel no implemented - passed label is: ' + label);
- },
- /**
- * Changes the icon of the plugin; icon remains unchanged if the passed icon is undefined.
- * @virtual
- * @public
- * @param {String} icon The icon to insert. Can be a web font, an image URL or an svg sprite reference.
- * @param {String} iconTooltip The tooltip to use for this icon, if specified
- * @param {String} ariaLabel The value to use for aria-label or alt attributes. If not specified, defaults to iconTooltip
- */
- changeIcon: function changeIcon(icon, iconTooltip, ariaLabel) {
- if (icon) {
- this.$el.find('svg.svgIcon, img, span.webfont').first().remove();
- Utils.setIcon(this.$el, icon, iconTooltip, ariaLabel);
- } else {
- console.warn('Invalid plugin icon. Icon unchanged.');
- }
- },
- /**
- * Registers a onetime callback asso the passed eventName
- * the callback is an anonymous method which call this.onEventListener if it is defined
- * this is to be invoked in the render method of any sub class
- * @protected
- * @param {String} eventName - name of the event to attach the callback
- */
- registerOneTimeCallback: function registerOneTimeCallback(eventName) {
- var _this3 = this;
- var result = this.glassContext.getCoreSvc('.Events').on(eventName, function (event, eventName) {
- var callback = _.isFunction(_this3.onEventListener) ? _this3.onEventListener : function () {};
- try {
- callback.call(_this3, event, eventName);
- } catch (error) {
- _this3.glassContext.getCoreSvc('.Logger').error('GlassPlugin event callbak failure', event, eventName, error);
- } finally {
- result.remove();
- }
- }, this);
- },
- /**
- * event listener: invokes the method(s) corresponding to the events
- *
- * @protected
- * @return {promise}
- */
- onEventListener: function onEventListener(event, eventName) {
- var _this4 = this;
- var logger = this.glassContext.getCoreSvc('.Logger');
- return this.getController().then(function (controller) {
- if (controller) {
- switch (eventName) {
- case AppEvents.APPVIEW_LOADED:
- if (_this4.appView && _this4.appView === event.appView) {
- _this4._onAppViewLoaded(controller, logger, event, eventName);
- } else {
- logger.info(AppEvents.APPVIEW_LOADED + ' is ignored due to mismatched appView', _this4.appView, event.appView);
- }
- break;
- default:
- logger.warn('unhandled event in plugin', _this4, event, eventName);
- }
- }
- }).catch(function (error) {
- logger.error('error on event callback', _this4, error);
- });
- },
- /**
- * callback corresponding to the appView:loaded event
- * @private
- */
- _onAppViewLoaded: function _onAppViewLoaded(controller, logger) {
- if (_.isFunction(controller.onRender)) {
- controller.onRender({
- glassContext: this.glassContext,
- target: {
- plugin: this,
- itemId: this.itemSpec.id
- }
- });
- }
- this.showCoachMark().catch(function (error) {
- logger.error('failed to show coachmark', error);
- });
- },
- /**
- * ======================Private Helper functions useful for all Plugins==============================
- */
- /** Sets the attribute only if value is defined.
- */
- _setAttr: function _setAttr($plugin, sAttr, sValue) {
- if (sValue) {
- $plugin.attr(sAttr, sValue);
- }
- },
- /** Adds the sClassname if it's defined to the element.
- */
- _addClass: function _addClass($plugin, className) {
- if (className) {
- $plugin.addClass(className);
- }
- },
- _setIcon: function _setIcon($widget) {
- var icon = this.itemSpec.icon;
- Utils.setIcon($widget, icon);
- }
- });
- return GlassPlugin;
- });
- //# sourceMappingURL=GlassPlugin.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Watson Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/Deferred',[], function () {
- 'use strict';
- /**
- * Create a Deferred from a Promise class
- * The reason this function is in common-core is because this is used in client and serveside JS
- * Instantiates the class and uses the promise instance and resolve/reject methods to create a deferred object.
- * @return {[type]} [description]
- */
- return function () {
- var resolve, reject;
- var promise = new Promise(function () {
- resolve = arguments[0];
- reject = arguments[1];
- });
- return {
- resolve: resolve,
- reject: reject,
- promise: promise
- };
- };
- });
- //# sourceMappingURL=Deferred.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * "Restricted Materials of IBM"
- *
- * 5746-SM2
- *
- * (C) Copyright IBM Corp. 2015, 2016
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/MenuActionInterface',['../../core-client/js/core-client/ui/core/Class'], function (Class) {
- /**
- * This class lists all the methods corresponding to the actions supported by a menu
- * It plays the role of an interface, consumer can extend it.
- *
- * @interface
- */
- var MenuActionInterface = Class.extend({
- /**
- * method to be invoked on the press action for a menu item
- * @param {context} which contains the following:
- * <ul>
- * <li>glassContext</li>
- * <li>target: object containing info on the target: plugin and itemId</li>
- * </ul>
- */
- onSelectItem: function
- /* context */
- onSelectItem() {},
- /**
- * method to be invoked for a menu item
- * @param {context} which contains the following:
- * <ul>
- * <li>glassContext</li>
- * <li>target: object containing info on the target: plugin and itemId</li>
- * </ul>
- */
- onRenderItem: function
- /* context */
- onRenderItem() {},
- /**
- * Method invoked when rendering the menu to determine if the item should be displayed
- * @param {context} which contains the following:
- * <ul>
- * <li>glassContext</li>
- * <li>target: object containing info on the target: plugin and itemId</li>
- * <li>activeObject: object for which the menu is displayed, used for the context menu</li>
- * </ul>
- * @return true or false
- */
- isItemVisible: function
- /* context */
- isItemVisible() {
- return true;
- },
- /**
- * Method invoked when rendering the menu to determine if the item should be selected
- * @param {context} which contains the following:
- * <ul>
- * <li>glassContext</li>
- * <li>target: object containing info on the target: plugin and itemId</li>
- * <li>activeObject: object for which the menu is displayed, used for the context menu</li>
- * </ul>
- * @return true or false
- */
- isItemSelected: function
- /* context */
- isItemSelected() {
- return false;
- },
- /**
- * method to be invoked when the menu is rendered
- * @param {context} which contains the following:
- * <ul>
- * <li>glassContext</li>
- * <li>target: object containing info on the target; one is the plugin</li>
- * </ul>
- */
- onRender: function
- /* context */
- onRender() {},
- /**
- * method to be invoked when the menu is opened, before the menuItems are shown.
- * @param {context} which contains the following:
- * <ul>
- * <li>glassContext</li>
- * <li>target: object containing info on the target; one is the plugin</li>
- * </ul>
- */
- onOpen: function
- /* context */
- onOpen() {},
- /**
- * Method to be invoked when loading a coachmark.
- * Can be used to dynamically set the coachmark's title
- * or contents
- * @param {Object} context - The context for this coach mark
- * @param {Object} context.glassContext - The glass context.
- * @param {Object} context.target - The coachMark target for which we want the spec
- * @param {string} context.target.itemId - The id of the item for which we want the
- * coach mark spec
- * @param {Object} context.target.coachMark - The current spec of the coachMark, if any
- * @returns {Object} A coach mark specification, including title and contents.
- */
- getCoachMarkSpec: function
- /* context */
- getCoachMarkSpec() {},
- /**
- * Method invoked when rendering the menu to determine
- * if the item should have a custom label instead of the default one from the spec.
- * @param {context} which contains the following:
- * <ul>
- * <li>glassContext</li>
- * <li>target: object containing info on the target: plugin and itemId</li>
- * </ul>
- * @returns {string} A custom label to override the default one that is in the spec.
- * If returns undefined then the default label from the spec is used.
- */
- getLabel: function
- /* context */
- getLabel() {}
- });
- return MenuActionInterface;
- });
- //# sourceMappingURL=MenuActionInterface.js.map
- ;
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
- /**
- * Licensed Materials - Property of IBM
- *
- * "Restricted Materials of IBM"
- *
- * 5746-SM2
- *
- * (C) Copyright IBM Corp. 2015, 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/MenuActionControllerDispatcher',['underscore', 'jquery', './MenuActionInterface', '../../api/Context'], function (_, $, MenuActionInterface, Context) {
- /**
- * This class lists all the methods corresponding to the actions supported by a menu
- * It plays the role of an interface, consumer can extend it.
- *
- * @interface
- */
- var MenuActionInterfaceDispatcher = MenuActionInterface.extend({
- /**
- *constructor
- *@actionControllers map of featureId with actionControllers:
- *{
- * featureId: path/to/controller
- *}
- */
- init: function init(actionControllers) {
- this._oControllerMap = {};
- this._oItemMap = {};
- _.extend(this._oControllerMap, actionControllers);
- },
- /**
- * Getter for the controller map
- */
- getControllerMap: function getControllerMap() {
- return this._oControllerMap;
- },
- /**
- * Dispatches the callback invocation to the right controller
- * @override
- *
- */
- onSelectItem: function onSelectItem(context) {
- var sItemId = context.target.itemId;
- var oController = this._findController(sItemId);
- if (oController && _.isFunction(oController.onSelectItem)) {
- oController.onSelectItem.call(oController, context);
- } else if (oController && _.isFunction(oController.execute)) {
- var apiContext = new Context(context.glassContext);
- var apiOptions = this._getOptions(context);
- oController.execute.call(oController, apiContext, apiOptions);
- }
- },
- /**
- * Invokes the onRender on right controller
- * @override
- *
- */
- onRender: function onRender(context) {
- _.each(this._oControllerMap, function (oController) {
- if (oController && _.isFunction(oController.onRender)) {
- oController.onRender.call(oController, $.extend(true, {}, context));
- }
- }, this);
- },
- /**
- * Invokes the onOpen on right controller
- * @override
- *
- */
- onOpen: function onOpen(context) {
- var all = _.values(this._oControllerMap).map(function (oController) {
- if (oController && _.isFunction(oController.onOpen)) {
- return new Promise(function (resolve) {
- resolve(oController.onOpen($.extend(true, {}, context)));
- }).catch(function (e) {
- context.glassContext.getCoreSvc('.Logger').warn(e);
- });
- }
- });
- return Promise.all(all);
- },
- /**
- * Invokes the onRemoveItem on right controller
- * @override
- *
- */
- onRemoveItem: function onRemoveItem(context) {
- var sItemId = context.target.itemId;
- var oController = this._findController(sItemId);
- if (oController && _.isFunction(oController.onRemoveItem)) {
- return oController.onRemoveItem.call(oController, $.extend(true, {}, context));
- }
- },
- /**
- * Invokes the onRenderItem on right controller
- * @override
- *
- */
- onRenderItem: function onRenderItem(context) {
- var sItemId = context.target.itemId;
- var oController = this._findController(sItemId);
- if (oController && _.isFunction(oController.onRenderItem)) {
- oController.onRenderItem.call(oController, $.extend(true, {}, context));
- }
- },
- _getOptions: function _getOptions(context) {
- var options;
- if (context.options) {
- options = this._combineOptions(context);
- } else {
- options = context.target.plugin.itemSpec.items[context.target.specItemIndex].options;
- }
- return {
- options: options
- };
- },
- _combineOptions: function _combineOptions(context) {
- var options;
- var pluginOptions = this._checkValidityPluginOptions(context) ? context.target.plugin.itemSpec.items[context.target.specItemIndex].options : {}; // Array will be converted to Object here with index kept as keys
- options = Object.assign({}, context.options);
- if (pluginOptions) {
- // contextOption shouldn't be overwritten when duplicated keys exists
- for (var key in pluginOptions) {
- if (key in options) {
- continue;
- }
- options[key] = pluginOptions[key];
- }
- }
- return options;
- },
- _checkValidityPluginOptions: function _checkValidityPluginOptions(context) {
- var itemExists = context && context.target && context.target.plugin && context.target.plugin.itemSpec && context.target.plugin.itemSpec.items && Array.isArray(context.target.plugin.itemSpec.items);
- var inRange = itemExists && context.target.specItemIndex !== undefined && context.target.specItemIndex !== null && context.target.specItemIndex >= 0 && context.target.specItemIndex < context.target.plugin.itemSpec.items.length;
- var isValidOptions = itemExists && inRange && context.target.plugin.itemSpec.items[context.target.specItemIndex].options && _typeof(context.target.plugin.itemSpec.items[context.target.specItemIndex].options) === 'object';
- return isValidOptions;
- },
- _invokeControllerIsItemVisible: function _invokeControllerIsItemVisible(context) {
- var itemId = context.target.itemId;
- var oController = this._findController(itemId);
- var isVisible = !_.isUndefined(oController);
- if (isVisible && _.isFunction(oController.isItemVisible)) {
- isVisible = oController.isItemVisible.call(oController, context);
- } else if (isVisible && _.isFunction(oController.isVisible)) {
- var apiContext = new Context(context.glassContext);
- var apiOptions = this._getOptions(context);
- isVisible = oController.isVisible.call(oController, apiContext, apiOptions);
- }
- isVisible = _.isBoolean(isVisible) ? isVisible : false;
- return isVisible;
- },
- /**
- * invokes the isItemDisabled on the right controller
- * @override
- */
- isItemDisabled: function isItemDisabled(context) {
- var itemId = context.target.itemId;
- var oController = this._findController(itemId);
- if (oController && _.isFunction(oController.isItemDisabled)) {
- return oController.isItemDisabled.call(oController, context);
- } else {
- return false;
- }
- },
- /**
- * Invokes the isItemVisible on the right controller
- * @override
- *
- */
- isItemVisible: function isItemVisible(context) {
- var contentView = context.glassContext.getCurrentContentView();
- var isVisible;
- if (contentView && _.isFunction(contentView.isMenuItemVisible)) {
- if (contentView.isMenuItemVisible(context) === true) {
- isVisible = this._invokeControllerIsItemVisible(context);
- } else {
- isVisible = false;
- }
- } else {
- isVisible = this._invokeControllerIsItemVisible(context);
- }
- return isVisible;
- },
- /**
- * Invokes the isItemSelected on the right controller
- * @override
- *
- */
- isItemSelected: function isItemSelected(context) {
- var itemId = context.target.itemId;
- var isSelected = false;
- var oController = this._findController(itemId);
- if (oController && _.isFunction(oController.isItemSelected)) {
- isSelected = oController.isItemSelected.call(oController, context);
- isSelected = _.isBoolean(isSelected) ? isSelected : false;
- }
- return isSelected;
- },
- /**
- * Invokes the getLabel on right controller
- * @override
- *
- */
- getLabel: function getLabel(context) {
- var sItemId = context.target.itemId;
- var oController = this._findController(sItemId);
- if (oController && _.isFunction(oController.getLabel)) {
- return oController.getLabel.call(oController, $.extend(true, {}, context));
- }
- },
- /**
- * convert the arrays of items into a map
- */
- buildItemMap: function buildItemMap(aItems) {
- _.reduce(aItems, function (oMap, item) {
- if (item.id) {
- oMap[item.id] = item;
- }
- return oMap;
- }, this._oItemMap);
- },
- /**
- * return the itemMap
- */
- getItemMap: function getItemMap() {
- return this._oItemMap;
- },
- /**
- * Sets the glass menu
- * @param glassMenu - glass menu widget
- */
- setGlassMenu: function setGlassMenu(glassMenu) {
- this._glassMenu = glassMenu;
- },
- _findController: function _findController(sItemId) {
- var oController;
- var oItem = this._oItemMap[sItemId];
- if (oItem) {
- oController = this._oControllerMap[oItem.featureId];
- }
- return oController;
- }
- });
- return MenuActionInterfaceDispatcher;
- });
- //# sourceMappingURL=MenuActionControllerDispatcher.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI ui_commons
- *
- * Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/Menu',['./AccessibleView', '../utils/Utils', '../nls/StringResources', '../utils/BidiUtil', 'underscore', 'jquery', 'jquery-ui'], function (View, uiUtils, StringResources, BidiUtil, _, $) {
- /**
- * This class represents a menu
- */
- var Menu = View.extend({
- /**
- * @lends Menu.prototype
- */
- tagName: 'nav',
- events: {
- 'primaryaction .commonMenuItem': '_onSelectItem',
- 'primaryaction .moduleMenuItem': '_onSelectModuleItem',
- 'escapeaction': '_handleEscape'
- },
- /**
- * @classdesc class representing a menu
- * @augments AccessibleView
- * @constructs
- * @public
- *
- * @param {options}
- * set of initial properties:
- * <ul>
- * <li>spec: specification of the menu</li>
- * </ul>
- *
- */
- init: function init(options) {
- _.extend(this, options.spec);
- this.enableTabLooping = true;
- Menu.inherited('init', this, options.spec);
- this.$el.attr('role', 'navigation');
- this.closeMenu = this._closeMenu.bind(this);
- },
- /**
- * Renders the menu
- *
- * @override
- * @return promise; it is rejected when no specification is set
- * for the menu
- * <ul>
- * <li>resolve Value = dom element representing the
- * menu</li>
- * </ul>
- */
- render: function render() {
- try {
- this.$el.empty();
- this.$el.attr('class', '');
- this.$el.addClass('commonMenu').addClass('commonMenuActive');
- this._itemMap = {};
- var $ul = $('<ul></ul>', {
- 'role': 'menu',
- 'tabIndex': '0'
- }).addClass('commonMenuItems');
- var hasIcon = _.filter(this.items, function (item) {
- return item.icon !== '' && item.icon !== undefined;
- });
- _.each(this.items, function (item) {
- var $item = $('<li></li>', {
- 'role': 'group',
- 'tabIndex': '0'
- }).addClass('commonMenuItem');
- if (item.selected === true) {
- $item.addClass('selected');
- }
- if (item.disabled) {
- $item.addClass('disabled');
- }
- $item.addClass(item.id);
- var domItemId = this._buildDomItemId();
- this._itemMap[domItemId] = item;
- $item.attr('id', domItemId);
- if (item.module) {
- $item.append(this._loadModule($item, item.module));
- $item.removeClass('commonMenuItem');
- $item.addClass('moduleMenuItem');
- } else if (item.type === 'divider') {
- // Make a special type divider as we have to remove tabIndex for accessibility
- $item.addClass(item.type);
- $item.attr('tabIndex', '-1');
- } else {
- var $a = $('<a></a>').addClass('commonMenuLink');
- var $span = $('<span></span>');
- var title = _.isString(item.label) ? item.label : '';
- $a.attr('role', 'menuitem');
- $item.attr('aria-label', title);
- $span.text(title);
- $span.attr('title', BidiUtil.enforceTextDirection(title));
- $span.attr('dir', BidiUtil.resolveBaseTextDir(title));
- if (hasIcon.length && item.indent !== false) {
- $span.addClass('hasIcon');
- }
- if (item.badge) {
- $('<span>').addClass('badge').text(item.badge).appendTo($span);
- }
- $a.append($span);
- uiUtils.setIcon($a, item.icon, item.iconTooltip, null, null, item.iconColor);
- $item.append($a);
- }
- if (item.rightIcon) {
- var $rightIconDiv = $('<div>').addClass('rightIcon').attr('title', item.rightIcon.title);
- uiUtils.setIcon($rightIconDiv, item.rightIcon.icon);
- $item.append($rightIconDiv);
- }
- if (item.removable) {
- var label = item.removeIconLabel || StringResources.get('remove');
- var $removeItem = $('<div></div>', {
- 'role': 'button',
- 'aria-labelledby': domItemId,
- 'title': label,
- 'tabIndex': '0'
- }).addClass('removeItemIcon');
- $removeItem.focus(function (event) {
- $(event.target).parent().addClass('hasFocus');
- });
- $removeItem.blur(function (event) {
- $(event.target).parent().removeClass('hasFocus');
- });
- uiUtils.setIcon($removeItem, 'common-close_16');
- $removeItem.on('primaryaction.bi.commons.ui.menu', this._handleRemoveItem.bind(this, $item));
- $item.append($removeItem);
- }
- $ul.append($item);
- if (item && _.isFunction(item.onRender)) {
- item.onRender($item);
- }
- }, this);
- if (!$ul.is(':empty')) {
- this.$el.append($ul);
- this.enableLooping($ul);
- }
- Menu._registerOpenMenu(this);
- // DO NOT REMOVE THIS: this is required so that, the
- // attached handler does not catch
- // the click event that just happened.
- setTimeout(function () {
- this.setFocus();
- this._attachCloseCallbacks();
- }.bind(this), 200);
- return Promise.resolve(this.el);
- } catch (err) {
- return Promise.reject(err);
- }
- },
- /**
- * Set the focus to an element within the view.
- *
- * @public
- */
- setFocus: function setFocus() {
- this.$el.find('.commonMenuItems').focus();
- },
- _handleRemoveItem: function _handleRemoveItem($item, event) {
- var specItem = this._itemMap[$item.attr('id')];
- event.stopPropagation();
- if (specItem && _.isFunction(specItem.onRemove)) {
- var result = specItem.onRemove();
- Promise.resolve(result).then(function (removeMenuItem) {
- if (removeMenuItem) {
- this._setNextTabFocus($item);
- $item.remove();
- }
- }.bind(this));
- delete this._itemMap[$item.attr('id')];
- }
- },
- _setNextTabFocus: function _setNextTabFocus($el) {
- var $focusEl = $el.next('.commonMenuItem');
- if ($focusEl.length === 0) {
- $focusEl = $el.prev('.commonMenuItem');
- }
- $focusEl.focus();
- },
- _handleEscape: function _handleEscape(event) {
- this._closeMenu(event, false);
- this.getLaunchPoint().focus();
- return false;
- },
- /**
- * @private callback attached to all the items
- * @param the
- * corresponding event
- */
- _onSelectItem: function _onSelectItem(event) {
- var specItem = this._itemMap[event.currentTarget.id];
- event.stopPropagation();
- if (event.gesture) {
- event.gesture.preventDefault();
- }
- this._closeMenu(event, false);
- if (specItem && _.isFunction(specItem.onSelect)) {
- specItem.onSelect();
- }
- },
- _onSelectModuleItem: function _onSelectModuleItem(event) {
- var specItem = this._itemMap[event.currentTarget.id];
- event.stopPropagation();
- this._closeMenu(event, true);
- if (specItem && _.isFunction(specItem.onSelect)) {
- specItem.onSelect();
- }
- },
- /**
- * @private Builds the displayed item id; format is
- * this.viewId_item<random number>.
- */
- _buildDomItemId: function _buildDomItemId() {
- return this.viewId + '_' + _.uniqueId('item');
- },
- /**
- * @private Closes the menu on a given set of events
- */
- _attachCloseCallbacks: function _attachCloseCallbacks() {
- $(document).on('primaryaction.bi.commons.ui.menu', this.closeMenu);
- $(document).on('contextmenu.bi.commons.ui.menu', this.closeMenu);
- $(window).on('resize.bi.commons.ui.menu', this.closeMenu);
- },
- /**
- * @private closes the menu
- */
- _closeMenu: function _closeMenu(event, stayOpen) {
- if (stayOpen) {
- return Promise.resolve();
- }
- if (_.isFunction(this.whenReadyToClose)) {
- return this.whenReadyToClose(event).then(this.remove.bind(this), this.remove.bind(this));
- } else {
- this.remove();
- return Promise.resolve();
- }
- },
- _loadModule: function _loadModule(context, module) {
- require([module], function (Module) {
- var module = new Module({
- '$el': context
- });
- return module.render();
- }.bind(this));
- },
- remove: function remove() {
- Menu._unregisterOpenMenu(this);
- $(document).off('.bi.commons.ui.menu', this.closeMenu);
- $(window).off('.bi.commons.ui.menu', this.closeMenu);
- Menu.inherited('remove', this, arguments);
- }
- });
- /**
- * @private
- */
- Menu._openMenus = [];
- /**
- * @private
- */
- Menu._registerOpenMenu = function (menu) {
- if (!_.contains(Menu._openMenus, menu)) {
- Menu._openMenus.push(menu);
- if (!$('body').hasClass('openedMenu')) {
- $('body').addClass('openedMenu');
- }
- }
- };
- /**
- * @private
- */
- Menu._unregisterOpenMenu = function (menu) {
- Menu._openMenus = _.reject(Menu._openMenus, function (m) {
- return m === menu;
- });
- if (Menu._openMenus.length === 0) {
- $('body').removeClass('openedMenu');
- }
- };
- /**
- * Triggers an event to notify all Menu instances to close themselves.
- * @static
- */
- Menu.hideOpenMenus = function () {
- _.each(Menu._openMenus, function (menu) {
- menu.closeMenu();
- });
- };
- return Menu;
- });
- //# sourceMappingURL=Menu.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Titan
- *
- * Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/GlassContextMenu',['./GlassPlugin', 'jquery', 'underscore', '../../core-client/js/core-client/utils/ClassFactory', '../../core-client/js/core-client/utils/Deferred', './MenuActionControllerDispatcher', '../../core-client/js/core-client/ui/Menu', '../../utils/Utils'], function (GlassPlugin, $, _, ClassFactory, Deferred, ControllerDispatcher, Menu, Utils) {
- /**
- * This Class renders a contextual menu defined in the perspective
- */
- var GlassContextMenu = GlassPlugin.extend(
- /**
- * @lends ContextMenu.prototype
- */
- {
- _ClassFactory: ClassFactory,
- /**
- * @classdesc class representing a context menu
- * @augments GlassPlugin
- * @constructs
- * @public
- * @param {Object} options - set of initial properties
- * @param {Object} options.glassContext - glassContext
- * @param {Object} options.itemSpecs - specification of the menu to show
- * @param {Object} options.activeObject - object for which the menu is shown
- *
- * */
- init: function init(options) {
- $.extend(true, this, options);
- },
- /**
- * Get the container element of the plugin.
- */
- getRootElement: function getRootElement() {
- this.glassContext.getCoreSvc('.Logger').warn('GlassContextMenu::getRootElement() is being deprecated!');
- return this.$el;
- },
- /**
- * Gets the ContextMenu instance associated with this plugin
- * @public
- * @example
- * //Used in the menu controller to reference the menu instance. Useful for getting menu's launchPoint
- * onSelectItem: function(options) {
- * var menu = options.target.plugin.getMenu()
- * var launchPoint = menu.getLaunchPoint();
- * }
- *
- * @returns {Menu} the ContextMenu instance
- */
- getMenu: function getMenu() {
- this.glassContext.getCoreSvc('.Logger').warn('GlassContextMenu::getMenu() is being deprecated!');
- return this._menu;
- },
- /**
- * Renders the plugin.
- * @override
- */
- render: function render() {
- var deferred = new Deferred();
- var aModulePromises = [];
- var aFeatures = [];
- var oControllerMap = {};
- _.each(this.itemSpec.actionControllers, function (module, key) {
- aModulePromises.push(this._createController(module, key));
- aFeatures.push(key);
- }.bind(this));
- Utils.waitForAllOrSomePromises(aModulePromises).done(function () {
- try {
- Menu.hideOpenMenus();
- _.each(aModulePromises, function (item, index) {
- if (item.isFulfilled()) {
- oControllerMap[aFeatures[index]] = item.responseModule;
- }
- });
- this._oControllerDispatcher = this._createControllerDispatcher(oControllerMap);
- var shownItems = [];
- this._oControllerDispatcher.buildItemMap(this.itemSpec.items);
- this._menu = this._createUIMenu(shownItems);
- _.each(this.itemSpec.items, function (item, index) {
- var oEventContext = {
- glassContext: this.glassContext,
- target: {
- plugin: this,
- itemId: item.id,
- activeObject: this.activeObject,
- specItemIndex: index
- },
- options: this.options
- };
- var isVisible = this._oControllerDispatcher.isItemVisible(oEventContext);
- if (isVisible) {
- var uiItem = {};
- $.extend(true, uiItem, item);
- uiItem.name = item.id;
- uiItem.onSelect = this._oControllerDispatcher.onSelectItem.bind(this._oControllerDispatcher, oEventContext);
- uiItem.disabled = this._oControllerDispatcher.isItemDisabled(oEventContext);
- var customLabel = this._oControllerDispatcher.getLabel(oEventContext);
- if (!_.isUndefined(customLabel)) {
- uiItem.label = customLabel;
- }
- var isSelected = this._oControllerDispatcher.isItemSelected(oEventContext);
- if (isSelected) {
- uiItem.selected = true;
- }
- shownItems.push(uiItem);
- }
- }, this);
- this._menu.render().then(function (domMenu) {
- this.$el = $(domMenu);
- var oEventContext = {
- glassContext: this.glassContext,
- target: {
- plugin: this,
- itemId: this.itemSpec.id,
- activeObject: this.activeObject
- }
- };
- this._oControllerDispatcher.onRender(oEventContext);
- deferred.resolve(domMenu);
- }.bind(this), function (reason) {
- deferred.reject({
- msg: GlassContextMenu.errors.FAILURE_RENDERING_MENU,
- causedBy: reason
- });
- });
- } catch (e) {
- deferred.reject({
- msg: GlassContextMenu.errors.FAILURE_RENDERING_MENU,
- causedBy: e
- });
- }
- }.bind(this)).fail(function (reason) {
- deferred.reject({
- msg: GlassContextMenu.errors.FAILURE_RENDERING_MENU,
- causedBy: reason
- });
- });
- return deferred.promise;
- },
- /**
- * Creates the controller dispatcher providing the controller Map
- * @private
- * @param controllerMap
- * @return Instance of the controller Dispatcher
- */
- _createControllerDispatcher: function _createControllerDispatcher(controllerMap) {
- return new ControllerDispatcher(controllerMap);
- },
- /**
- * Creates the UI menu
- * @private
- * @param shownItems array of items to show
- */
- _createUIMenu: function _createUIMenu(shownItems) {
- return new Menu({
- spec: {
- items: shownItems
- }
- });
- },
- _createController: function _createController(module, key) {
- var oEventContext = {
- glassContext: this.glassContext,
- target: {
- plugin: this,
- itemId: this.itemSpec.id
- },
- controllerConfig: this.itemSpec.controllerConfig && this.itemSpec.controllerConfig[key]
- };
- var _controller;
- return this._ClassFactory.instantiate(module).then(function (controller) {
- _controller = controller;
- if (_.isFunction(_controller.initialize)) {
- return _controller.initialize(oEventContext);
- }
- }).then(function () {
- if (_.isFunction(_controller.onOpen)) {
- return _controller.onOpen(oEventContext);
- }
- }).then(function () {
- return _controller;
- });
- }
- });
- GlassContextMenu.errors = {
- FAILURE_RENDERING_MENU: 'Failure when rendering the contextual menu',
- FAILURE_CREATING_CONTROLLER: 'Failure creating one of the menu controllers'
- };
- return GlassContextMenu;
- });
- //# sourceMappingURL=GlassContextMenu.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/utils/WorkArounds',['../core-client/js/core-client/utils/Utils'], function (Utils) {
- return {
- apply: function apply() {
- this._locationOrigin();
- },
- /**
- * From Bug: 178943: Wrong glass URL on Windows 10 Enterprise 2015 LTSB Edition / IE 11 combo
- * In IE11 on Windows 10, window.location.origin is undefined. This work around fills in the origin on the global object.
- */
- _locationOrigin: function _locationOrigin() {
- var w = Utils.getCurrentWindow();
- if (!w.location.origin) {
- w.location.origin = w.location.protocol + '//' + w.location.hostname + (w.location.port ? ':' + w.location.port : '');
- }
- }
- };
- });
- //# sourceMappingURL=WorkArounds.js.map
- ;
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("prop-types"),require("react"),require("underscore"),require("jquery"),require("mobx-state-tree"),require("baglass/core-client/js/core-client/utils/ClassFactory"),require("ca-ui-toolkit-core"),require("mobx-react"),require("mobx"),require("baglass/nls/StringResources"),require("baglass/utils/Utils"),require("baglass/core-client/js/core-client/errors/BaseError"),require("react-dom"),require("baglass/api/Url"),require("baglass/core-client/js/core-client/ui/KeyCodes"),require("baglass/core-client/js/core-client/ui/ToastMessage"),require("baglass/app/utils/CloseViewUtils"),require("baglass/common/ui/SlideoutRegistry"),require("baglass/api/Context"),require("baglass/services/AjaxService"),require("baglass/services/ClipboardService"),require("baglass/app/services/CoachMarkService"),require("baglass/app/services/ConfigService"),require("baglass/services/ContextService"),require("baglass/services/EventsService"),require("baglass/services/FeatureChecker"),require("baglass/app/FeatureRules"),require("baglass/app/services/FetchService"),require("baglass/app/services/AjaxService"),require("baglass/services/LogService"),require("baglass/services/PrefetchService"),require("baglass/services/ServiceRegistry"),require("baglass/app/services/UserProfileService"),require("baglass/services/WindowProxyService"),require("baglass/core-client/js/core-client/utils/PerfUtils"),require("baglass/core-client/js/core-client/ui/Slideout"),require("baglass/common/ui/SlideoutController"),require("baglass/app/plugins/GlassContextMenu"),require("baglass/core-client/js/core-client/ui/Menu"),require("baglass/utils/WorkArounds"));else if("function"==typeof define&&define.amd)define('baglass/glass.webpack.bundle',["prop-types","react","underscore","jquery","mobx-state-tree","baglass/core-client/js/core-client/utils/ClassFactory","ca-ui-toolkit-core","mobx-react","mobx","baglass/nls/StringResources","baglass/utils/Utils","baglass/core-client/js/core-client/errors/BaseError","react-dom","baglass/api/Url","baglass/core-client/js/core-client/ui/KeyCodes","baglass/core-client/js/core-client/ui/ToastMessage","baglass/app/utils/CloseViewUtils","baglass/common/ui/SlideoutRegistry","baglass/api/Context","baglass/services/AjaxService","baglass/services/ClipboardService","baglass/app/services/CoachMarkService","baglass/app/services/ConfigService","baglass/services/ContextService","baglass/services/EventsService","baglass/services/FeatureChecker","baglass/app/FeatureRules","baglass/app/services/FetchService","baglass/app/services/AjaxService","baglass/services/LogService","baglass/services/PrefetchService","baglass/services/ServiceRegistry","baglass/app/services/UserProfileService","baglass/services/WindowProxyService","baglass/core-client/js/core-client/utils/PerfUtils","baglass/core-client/js/core-client/ui/Slideout","baglass/common/ui/SlideoutController","baglass/app/plugins/GlassContextMenu","baglass/core-client/js/core-client/ui/Menu","baglass/utils/WorkArounds"],t);else{var n="object"==typeof exports?t(require("prop-types"),require("react"),require("underscore"),require("jquery"),require("mobx-state-tree"),require("baglass/core-client/js/core-client/utils/ClassFactory"),require("ca-ui-toolkit-core"),require("mobx-react"),require("mobx"),require("baglass/nls/StringResources"),require("baglass/utils/Utils"),require("baglass/core-client/js/core-client/errors/BaseError"),require("react-dom"),require("baglass/api/Url"),require("baglass/core-client/js/core-client/ui/KeyCodes"),require("baglass/core-client/js/core-client/ui/ToastMessage"),require("baglass/app/utils/CloseViewUtils"),require("baglass/common/ui/SlideoutRegistry"),require("baglass/api/Context"),require("baglass/services/AjaxService"),require("baglass/services/ClipboardService"),require("baglass/app/services/CoachMarkService"),require("baglass/app/services/ConfigService"),require("baglass/services/ContextService"),require("baglass/services/EventsService"),require("baglass/services/FeatureChecker"),require("baglass/app/FeatureRules"),require("baglass/app/services/FetchService"),require("baglass/app/services/AjaxService"),require("baglass/services/LogService"),require("baglass/services/PrefetchService"),require("baglass/services/ServiceRegistry"),require("baglass/app/services/UserProfileService"),require("baglass/services/WindowProxyService"),require("baglass/core-client/js/core-client/utils/PerfUtils"),require("baglass/core-client/js/core-client/ui/Slideout"),require("baglass/common/ui/SlideoutController"),require("baglass/app/plugins/GlassContextMenu"),require("baglass/core-client/js/core-client/ui/Menu"),require("baglass/utils/WorkArounds")):t(e["prop-types"],e.react,e.underscore,e.jquery,e["mobx-state-tree"],e["baglass/core-client/js/core-client/utils/ClassFactory"],e["ca-ui-toolkit-core"],e["mobx-react"],e.mobx,e["baglass/nls/StringResources"],e["baglass/utils/Utils"],e["baglass/core-client/js/core-client/errors/BaseError"],e["react-dom"],e["baglass/api/Url"],e["baglass/core-client/js/core-client/ui/KeyCodes"],e["baglass/core-client/js/core-client/ui/ToastMessage"],e["baglass/app/utils/CloseViewUtils"],e["baglass/common/ui/SlideoutRegistry"],e["baglass/api/Context"],e["baglass/services/AjaxService"],e["baglass/services/ClipboardService"],e["baglass/app/services/CoachMarkService"],e["baglass/app/services/ConfigService"],e["baglass/services/ContextService"],e["baglass/services/EventsService"],e["baglass/services/FeatureChecker"],e["baglass/app/FeatureRules"],e["baglass/app/services/FetchService"],e["baglass/app/services/AjaxService"],e["baglass/services/LogService"],e["baglass/services/PrefetchService"],e["baglass/services/ServiceRegistry"],e["baglass/app/services/UserProfileService"],e["baglass/services/WindowProxyService"],e["baglass/core-client/js/core-client/utils/PerfUtils"],e["baglass/core-client/js/core-client/ui/Slideout"],e["baglass/common/ui/SlideoutController"],e["baglass/app/plugins/GlassContextMenu"],e["baglass/core-client/js/core-client/ui/Menu"],e["baglass/utils/WorkArounds"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(e,t,n,r,o,i,s,a,c,u,l,p,f,d,h,y,v,g,b,w,m,C,_,P,S,O,E,x,j,R,k,V,T,M,A,I,D,L,N,G){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/bi/js/glass/baglass/js/baglass/app/",n(n.s=52)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.r(t),n.d(t,"default",(function(){return i}));var i=o((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}));i.POSITION="position",i.PLACEMENT="placement",i.CENTER="center",i.LEADING="leading",i.LOOPS="loops",i.PANE="pane",i.TOOL_ITEMS="toolItems",i.TRAILING="trailing",i.TOP="top",i.BOTTOM="bottom",i.LEFT="left",i.RIGHT="right",i.INVERSE_DIRECTION_MAP={left:"right",right:"left",top:"bottom",bottom:"top"}},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){this.Glass=e,this.eventService=e.getCoreSvc(".Events"),this.logger=e.getCoreSvc(".Logger")};t.default=r},function(e,t){e.exports=i},function(e,t){e.exports=s},function(e,t){e.exports=a},function(e,t){e.exports=c},function(e,t){e.exports=u},function(e,t){e.exports=l},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return a}));var r=n(2),o=n(3),i=n.n(o);function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,o;return t=e,o=[{key:"generatePositionMap",value:function(e){var t={};return e.forEach((function(e){var n=e[r.default.POSITION];if(n){t[n]||(t[n]=[]),e.attr={},e.id&&(e.attr.id=e.id),i.a.isString(e.role)&&(e.attr.role=e.role),e["aria-label"]&&(e.attr["aria-label"]=e["aria-label"]);var o=r.default.INVERSE_DIRECTION_MAP[n]||"right";e.toolItemGroups&&e.toolItemGroups.forEach((function(e){e.toolItems&&e.toolItems.forEach((function(e){e.ddMenuPlacement=e[r.default.PLACEMENT]||o}))})),t[n].push(e)}})),t}},{key:"isContentPane",value:function(e){return i.a.isEmpty(e)}},{key:"convertToolBarsToLayoutObject",value:function(e){var t={};return e&&e.length>0?t=this.generatePositionMap(e):t[r.default.LOOPS]=[],(t[r.default.TOP]||t[r.default.BOTTOM])&&(t.class="paneColumn",t[r.default.LOOPS]=[r.default.TOP,r.default.BOTTOM],t[r.default.PANE]={}),(t[r.default.LEFT]||t[r.default.RIGHT])&&(t[r.default.PANE]?(t[r.default.LEFT]&&(t[r.default.PANE][r.default.LEFT]=t[r.default.LEFT],delete t[r.default.LEFT]),t[r.default.RIGHT]&&(t[r.default.PANE][r.default.RIGHT]=t[r.default.RIGHT],delete t[r.default.RIGHT]),t[r.default.PANE].class="paneRow",t[r.default.PANE][r.default.LOOPS]=[r.default.LEFT,r.default.RIGHT],t[r.default.PANE][r.default.PANE]={}):(t.class="paneRow",t[r.default.LOOPS]=[r.default.LEFT,r.default.RIGHT],t[r.default.PANE]={})),t}}],(n=null)&&s(t.prototype,n),o&&s(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}()},function(e,t){e.exports=p},function(e,t,n){"use strict";n.r(t);var r=Object.freeze({APPVIEW:"appview",APPVIEW_LOADED:"appView:loaded"}),o=n(3),i=n.n(o),s=n(7),a=n.n(s);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Object.assign(this,t),this.registerOneTimeCallback(r.APPVIEW_LOADED)}var t,n,o;return t=e,(n=[{key:"getRootElement",value:function(){this.glassContext.getCoreSvc(".Logger").debug("getRootElement not implemented")}},{key:"render",value:function(){this.glassContext.getCoreSvc(".Logger").debug("render not implemented")}},{key:"remove",value:function(){this.store.setVisible(!1)}},{key:"disable",value:function(){this.store.setDisabled(!0)}},{key:"enable",value:function(){this.store.setDisabled(!1)}},{key:"isVisible",value:function(){return this.store.visible}},{key:"show",value:function(){this.store.setVisible(!0),this.showContainer()}},{key:"hide",value:function(){this.store.setVisible(!1),this.hideContainer()}},{key:"changeLabel",value:function(e){this.store.setLabel(e)}},{key:"changeIcon",value:function(e){this.store.setIconId(e)}},{key:"showContainer",value:function(){var e=this.getContainer();e&&e.show&&e.show()}},{key:"hideContainer",value:function(){var e=this.getContainer();e&&e.hide&&e.hide()}},{key:"getActionController",value:function(){var e=this,t=this.glassContext.getCoreSvc(".Logger");if(!this.controllerDispatcher)if(this.itemSpec.actionController)"string"!=typeof this.itemSpec.actionController?this.controllerDispatcher=Promise.reject(new Error("actionController is not a string")):this.controllerDispatcher=a.a.instantiate(this.itemSpec.actionController.trim()).then((function(t){return e.actionController=t,i.a.isFunction(t.initialize)?e.actionController.initialize({glassContext:e.glassContext,target:{plugin:e,itemId:e.itemSpec.id}}):Promise.resolve()})).then((function(){return e.actionController})).catch((function(e){t.error("failed to retrieve the actionController or invoke its method",e)}));else{if(!this.actionController)return Promise.resolve();this.controllerDispatcher=Promise.resolve(this.actionController)}return Promise.resolve(this.controllerDispatcher)}},{key:"getContainer",value:function(){return this.$container}},{key:"showCoachMark",value:function(){var e=this;return new Promise((function(t){var n=e.glassContext.getCoreSvc(".CoachMarkService"),r=n.getRenderer(),o=n.getPersistence(),s="".concat(e.itemSpec.id,"PluginContainer");t(o.isRead(s).then((function(t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.itemSpec.coachMark);return e.getActionController().then((function(o){var s=!1;if(i.a.isFunction(o.getCoachMarkSpec)){var a={glassContext:e.glassContext,target:{coachMark:n,itemId:e.itemSpec.id}};n=o.getCoachMarkSpec(a)||n}return i.a.isEmpty(n)||(n.glassContext=e.glassContext,e.coachMark=new r(n),s=!e.getContainer().hasClass("disabled")&&!t,e.coachMark.render(e.getContainer(),s)),s}))})))}))}},{key:"registerOneTimeCallback",value:function(e){var t=this,n=this.glassContext.getCoreSvc(".Events").on(e,(function(e,r){var o=i.a.isFunction(t.onEventListener)?t.onEventListener:function(){};try{o.call(t,e,r)}catch(n){t.glassContext.getCoreSvc(".Logger").error("GlassPlugin event callback failure",e,r,n)}finally{n.remove()}}),this)}},{key:"onEventListener",value:function(e,t){var n=this,o=this.glassContext.getCoreSvc(".Logger");return this.getActionController().then((function(i){if(i)switch(t){case r.APPVIEW_LOADED:n.appView&&n.appView===e.appView?n.onAppViewLoaded(i,o,e,t):o.info("".concat(r.APPVIEW_LOADED," is ignored due to mismatched appView"),n.appView,e.appView);break;default:o.warn("unhandled event in plugin",n,e,t)}})).catch((function(e){o.error("error on event callback",n,e)}))}},{key:"onAppViewLoaded",value:function(e,t){i.a.isFunction(e.onRender)&&e.onRender({glassContext:this.glassContext,target:{plugin:this,itemId:this.itemSpec.id}}),this.showCoachMark().catch((function(e){t.error("failed to show coachmark",e)}))}}])&&l(t.prototype,n),o&&l(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=p},function(e,t,n){"use strict";var r,o=n(1),i=n.n(o),s=n(4),a=n.n(s),c=n(3),u=n.n(c),l=n(0),p=n.n(l),f=n(8),d=n(9);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m(e);if(t){var o=m(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return w(this,n)}}function w(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C(e){return e?-1!==e.search(/\.jpeg$|\.jpg$|\.png$|\.gif$|\.svg$/)?function(e){return i.a.createElement("img",{src:e,alt:"Button Icon"})}(e):function(e){return i.a.createElement(f.SVGIcon,{className:"svgIcon",iconId:e,size:"normal",verticalAlign:"middle"})}(e):null}var _=Object(d.observer)(r=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(s,e);var t,n,r,o=b(s);function s(){var e;y(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=o.call.apply(o,[this].concat(n))).setButtonRef=function(t){e.props.store.setButtonRef(t)},e}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.onMount;e&&e()}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.title,r=e.className,o=e.variant,s=e.onClick,a=e.store,c=e.push,u=a.pushed,l=a.disabled,p=a.iconId,d=a.label,h=a.visible,y=C(p),v=!0===Boolean(c)?f.PushButton:f.Button,g=r;return d&&(r?g+=" labelled":g="labelled"),h&&i.a.createElement(v,{id:t,title:n||d,label:d,className:g,variant:y&&o,onClick:s,icon:y,checked:u,disabled:l,intent:"primary",ref:this.setButtonRef})}}])&&v(t.prototype,n),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component))||r;_.propTypes={id:p.a.string,title:p.a.string,push:p.a.string,className:p.a.string,variant:p.a.string,onClick:p.a.func,onMount:p.a.func,store:p.a.object.isRequired};var P=_,S=n(5),O=n(31),E=n.n(O),x=S.types.model({pushed:S.types.optional(S.types.boolean,!1)}).volatile((function(){return{buttonNode:null}})).actions((function(e){return{setButtonRef:function(t){e.buttonNode=t},setPushed:function(t){e.pushed=t}}})),j=S.types.compose(x,E.a).named("ButtonStore"),R=n(15),k=n(51),V=n.n(k);function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=L(e);if(t){var o=L(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return D(this,n)}}function D(e,t){if(t&&("object"===T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(s,e);var t,n,r,o=I(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=o.call(this,e)).onClick=function(){var e=t.glassContext.getCoreSvc(".Logger");return t.getActionController().then((function(){t.triggerOnPress()})).catch((function(t){e.error("failed to retrieve the actionController or invoke its method",t)}))},t.onMount=function(){t.$el=a()(t.getRootElement())},t.render=function(){var e=t.itemSpec,n=e.id,r=e.title,o=e.label,s=e.push;return Promise.resolve(i.a.createElement(P,{id:n,title:r,label:o,className:t.itemSpec.class,variant:"icon",onClick:t.onClick,store:t.store,onMount:t.onMount,push:s}))},t.store=j.create(),t.store.setIconId(t.itemSpec.icon),t.store.setLabel(t.itemSpec.label),t.getActionController().catch((function(e){t.glassContext.getCoreSvc(".Logger").error("failed to retrieve the actionController or invoke its method",e)})),t}return t=s,(n=[{key:"setPressed",value:function(){this.store.setPushed(!0)}},{key:"getRootElement",value:function(){return this.store.buttonNode&&this.store.buttonNode._button&&this.store.buttonNode._button._node}},{key:"setUnpressed",value:function(){this.store.setPushed(!1)}},{key:"getBaseButton",value:function(){return this}},{key:"togglePressed",value:function(){var e=this.store.pushed;return this.store.setPushed(!e),!e}},{key:"setSelected",value:function(){this.setPressed()}},{key:"isPressed",value:function(){return this.store.pushed}},{key:"isEnabled",value:function(){return!this.store.disabled}},{key:"triggerOnPress",value:function(){var e={glassContext:this.glassContext,target:{plugin:this}},t=this.actionController;if(this.itemSpec.push&&(e.pushState=this.togglePressed()),u.a.isFunction(t.onPress))t.onPress(e);else if(u.a.isFunction(t.execute)){var n=new V.a(e.glassContext),r={options:this.itemSpec.options};t.execute(n,r)}}}])&&M(t.prototype,n),r&&M(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(R.default);t.a=N},function(e,t){e.exports=f},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(1)),a=i(n(31)),c=i(n(15)),u=i(n(103)),l=function(e){function t(t){var n=e.call(this,t)||this;return n.render=function(){return Promise.resolve(s.default.createElement(u.default,{store:n.store,className:n.itemSpec.class}))},n.store=a.default.create(),n.store.setIconId(n.itemSpec.icon),n.store.setLabel(n.itemSpec.label),n}return o(t,e),t}(c.default);t.default=l},function(e,t){e.exports=d},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}function c(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(u,e);var t,n,r,c=a(u);function u(){var e;o(this,u);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=c.call.apply(c,[this].concat(n))).onClick=function(){try{e.isActionControllerLoaded(),e.triggerOnPress()}catch(t){e.glassContext.getCoreSvc(".Logger").error(t)}},e}return t=u,(n=[{key:"isActionControllerLoaded",value:function(){if(!this.actionController)throw new Error("Controller has not been registered")}}])&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(n(16).a);t.a=l},function(e,t,n){"use strict";var r,o=n(1),i=n.n(o),s=n(0),a=n.n(s),c=n(8),u=n(9),l=n(10);function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=Object(u.observer)(r=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(s,e);var t,n,r,o=y(s);function s(){return f(this,s),o.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this.props,t=e.store,n=e.onDismiss,r=e.perspective,o=e.onGoToAction,s=t.getAlertsForPerspective(r);return i.a.createElement(c.PersistentBanner,{alerts:Object(l.toJS)(s),onDismiss:n,onGoToAction:o})}}])&&d(t.prototype,n),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component))||r;function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}b.propTypes={store:a.a.object.isRequired,onDismiss:a.a.func,perspective:a.a.string,onGoToAction:a.a.func};var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(s,e);var t,n,r,o=P(s);function s(){var e;m(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=o.call.apply(o,[this].concat(n))).onDismiss=function(t){return e.glassContext.getCoreSvc(".Message").removeAlert(t)},e.onGoToAction=function(t){var n=t.actionId,r=t.actionContext;if(n){var o={glassContext:e.glassContext,actionContext:r};e.glassContext.performAction(n,o)}},e}return t=s,(n=[{key:"render",value:function(){return Promise.resolve(i.a.createElement(b,{store:this.glassContext.getCoreSvc(".Message").getStore(),onDismiss:this.onDismiss,perspective:this.glassContext.getCurrentPerspective(),onGoToAction:this.onGoToAction}))}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(n(15).default);t.a=E},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=a(n(1)),u=a(n(102)),l=c.default.createElement(c.default.Fragment,null),p=function(e){function t(t){var n=e.call(this,t)||this;return n.state={element:l},n.updateElement(),n}return o(t,e),t.prototype.componentDidUpdate=function(e){var t=this.props.render;e.render!==t&&this.updateElement()},t.prototype.updateElement=function(){var e=this,t=this.props.failRenderCallback;this.renderPromise=this.doRender().then((function(t){e.setState({element:t})}),(function(e){return e=e||"unknown plugin render method exception",t&&t(e),Promise.resolve()}))},t.prototype.doRender=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.props.render?this.callRender():l]}))}))},t.prototype.callRender=function(){return i(this,void 0,void 0,(function(){var e,t,n,r,o,i,a;return s(this,(function(s){switch(s.label){case 0:return e=this.props,t=e.render,n=e.renderScope,r=e.options,o=e.postRenderCallback,i=e.containerRef,[4,t.call(n,r)];case 1:return a=s.sent(),o&&o(),a?(c.default.isValidElement(a)||(a=c.default.createElement(u.default,{htmlElement:a,containerRef:i})),[2,a]):[2,l]}}))}))},t.prototype.render=function(){var e=this.state.element;return c.default.createElement(c.default.Fragment,null,e)},t}(c.default.Component);t.default=p},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=s(n(63)),c=s(n(35)),u=s(n(24)),l=function(){function e(e){this.glassContext=e,this.store=a.default.create(),this.notifier=new c.default}return e.prototype.createDialog=function(e){var t=(0,u.default)("dialog");(e=r(r({},e),{id:t})).callback&&"object"==typeof e.callback&&Object.keys(e.callback).length>0&&Object.values(e.callback).filter((function(e){return e&&"function"==typeof e})).length>0&&e&&e.buttons&&Array.isArray(e.buttons)&&((e.buttons.includes("ok")||e.buttons.filter((function(e){return"ok"===e.defaultId})).length>0)&&this.registerCallbackForButton(e,"ok",t),(e.buttons.includes("cancel")||e.buttons.filter((function(e){return"cancel"===e.defaultId})).length>0)&&this.registerCallbackForButton(e,"cancel",t)),this.store.addDialog(e)},e.prototype.registerCallbackForButton=function(t,n,r){this.notifier.register(r+"-dialog-callback-"+n,(function(){t.callback.general&&e.invokeGeneralCallback(t,n),t.callback[n]&&t.callback[n]()}))},e.invokeGeneralCallback=function(e,t){e.callbackScope&&null!==e.callbackScope[t]&&void 0!==e.callbackScope[t]?e.callback.general.call(e.callbackScope[t],{btn:t}):e.callback.general({btn:t})},e.prototype.removeDialog=function(e){return o(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:if(t=this.store.dialogsInPlain,!(n=t&&t.length>0?t[t.length-1]:null))return[3,6];o.label=1;case 1:return o.trys.push([1,4,5,6]),!n.hasCallback||"ok"!==e&&"cancel"!==e?[3,3]:[4,this.notifier.notify(n.key+"-dialog-callback-"+e)];case 2:o.sent(),o.label=3;case 3:return[3,6];case 4:return r=o.sent(),this.glassContext.getCoreSvc(".Logger").error("Failed to execute callback function when a dialog is closed",r),[3,6];case 5:return this.store.removeDialog(),n.hasCallback&&(this.notifier.remove(n.key+"-dialog-callback-ok"),this.notifier.remove(n.key+"-dialog-callback-cancel")),[7];case 6:return[2]}}))}))},e.prototype.getDialogs=function(){return this.store.dialogsInPlain},e.prototype.getStore=function(){return this.store},e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return String(e)+t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(19)),a=i(n(4)),c=i(n(3)),u=i(n(36)),l=function(){function e(e){this.PERSPECTIVE_MODEL_PATH="v1/perspectives/",this.copyObject=function(e){return(0,u.default)(e)},this.glassContext=e,this.url=new s.default,this.modelCache={}}return e.prototype.getModel=function(e,t){var n=this.getPerspectiveUrl(e,t);return this.getPerspectiveModel(n,e)},e.prototype.getModelFromCache=function(e){if(this.modelCache[e]&&JSON.stringify(this.modelCache[e])!==JSON.stringify({}))return this.copyObject(this.modelCache[e])},e.prototype.addModel=function(e,t,n){this.modelCache[this.getPerspectiveUrl(e,n)]=this.copyObject(t)},e.prototype.getPerspectiveUrl=function(e,t){var n=this.PERSPECTIVE_MODEL_PATH+e;if(t&&t.content){var r=c.default.map(this.url.URL_UI_API,(function(e){return e.key})),o=c.default.pick(t.content,r);c.default.keys(o).length>0&&(n+="?"+a.default.param(o))}return n},e.prototype.getPerspectiveModel=function(e,t){return r(this,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return void 0!==(n=this.getModelFromCache(e))?[2,n]:[4,this.glassContext.getCoreSvc(".Ajax").ajax({url:e,type:"GET",perspective:t})];case 1:return r=o.sent(),this.modelCache[e]=this.copyObject(r.data),[2,r.data]}}))}))},e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.glassContext=e,this.qsValueEncoders=[]}return e.prototype.encodeQSValue=function(e){for(var t=0;t<this.qsValueEncoders.length;t+=1)e=this.qsValueEncoders[t](e);return e},e.prototype.registerQSValueEncoder=function(e){this.qsValueEncoders.push(e)},e}();t.default=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.BASE_URL="v1",this.TAXONOMY_URL=this.BASE_URL+'"/metadata/modules/taxonomy"',this.glassContext=e}return e.prototype.initialize=function(e){this.taxonomy=e},e.prototype.getTaxonomy=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return this.taxonomy?[2,this.taxonomy]:(e=this,[4,this.loadTaxonomy()]);case 1:return e.taxonomy=t.sent(),[2,this.taxonomy]}}))}))},e.prototype.loadTaxonomy=function(){return r(this,void 0,void 0,(function(){var t,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.glassContext.getCoreSvc(".Ajax").ajax({url:e.TAXONOMY_URL,type:"GET"})];case 1:return(t=r.sent()).data&&t.data.data&&t.data.data.taxonomy?[2,t.data.data.taxonomy]:(this.glassContext.getCoreSvc(".Logger").error("Unable to parse the returned result when updating the taxonomy data"),[3,3]);case 2:return n=r.sent(),this.glassContext.getCoreSvc(".Logger").error("Error retrieving the taxonomy data",n),[3,3];case 3:return[2,void 0]}}))}))},e}();t.default=i},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=s(n(29)),c=s(n(35)),u=s(n(24)),l=function(){function e(e){this.Glass=e,this.store=a.default.create({disabled:this.isDisabled()}),this.notifier=new c.default}return e.prototype.isDisabled=function(){var e=this.Glass.getCoreSvc(".Config");return!!(!!e&&e.getConfigValueSync("Glass.disableGlobalToast"))},e.prototype.getDisabled=function(){return this.store.disabled},e.prototype.addToast=function(e,t){var n={message:e,options:t};this.addToasts([n])},e.prototype.addToasts=function(e){var t=this;Array.isArray(e)||(e=[e]);for(var n=[],o=0;o<e.length;o+=1){var i=(0,u.default)("toast");e[o]=r(r({message:e[o].message},e[o].options),{id:i}),e[o].onHidden&&!this.getDisabled()&&this.notifier.register(i+"-toast-onhidden",e[o].onHidden),e[o].callback&&!this.getDisabled()&&this.notifier.register(i+"-toast-callback",e[o].callback),e[o].onShown&&!this.getDisabled()&&(this.notifier.register(i+"-toast-onshown",e[o].onShown),n.push(this.notifier.notify(i+"-toast-onshown")))}this.store.addToasts(e),Promise.all(n).then((function(){})).catch((function(e){t.Glass.getCoreSvc(".Logger").error("Failed to execute onShown function when a toast is added",e)}))},e.prototype.removeToastById=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){var n,r,o,s=this;return i(this,(function(i){switch(i.label){case 0:if(null===(n=this.store.getToastInPlainById(e)))return[3,8];r=function(){s.store.removeToastById(e)},i.label=1;case 1:return i.trys.push([1,6,7,8]),t&&n.hasCallback?[4,this.notifier.notify(e+"-toast-callback")]:[3,3];case 2:i.sent(),i.label=3;case 3:return n.hasOnHidden?[4,this.notifier.notify(e+"-toast-onhidden")]:[3,5];case 4:i.sent(),i.label=5;case 5:return[3,8];case 6:return o=i.sent(),this.Glass.getCoreSvc(".Logger").error("Failed to execute onHidden/callback function when a toast is removed",o),[3,8];case 7:return r(),this.notifier.remove(e),[7];case 8:return[2]}}))}))},e.prototype.removeAllToasts=function(){this.store.removeAllToasts()},e.prototype.getToastById=function(e){return this.store.getToastInPlainById(e)},e.prototype.getToasts=function(){return this.store.toastsInPlain},e.prototype.getStore=function(){return this.store},e}();t.default=l},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.containerID=t.globalKeyword=void 0;var o=n(10),i=n(5),s=r(n(11));t.globalKeyword="__global__",t.containerID="toolkit-toastContainer-glassGlobal";var a=i.types.model("ToastModel",{key:i.types.optional(i.types.string,""),stackable:i.types.optional(i.types.boolean,!0),statusType:i.types.union(i.types.literal("info"),i.types.literal("success"),i.types.literal("warning"),i.types.literal("error")),contentString:i.types.optional(i.types.string,""),closeText:i.types.optional(i.types.string,s.default.get("close")),btnLabel:i.types.optional(i.types.string,""),scope:i.types.optional(i.types.string,t.globalKeyword),hasOnHidden:i.types.optional(i.types.boolean,!1),hasOnShown:i.types.optional(i.types.boolean,!1),hasCallback:i.types.optional(i.types.boolean,!1),timedDismiss:i.types.optional(i.types.boolean,!1),milliseconds:i.types.optional(i.types.number,3e3)});var c=i.types.model("ToastStore",{disabled:i.types.optional(i.types.boolean,!1),toastQueue:i.types.optional(i.types.array(a),[]),containerID:i.types.optional(i.types.string,t.containerID)}).views((function(e){return{get toasts(){return e.disabled?[]:e.toastQueue},get toastsInPlain(){return e.disabled?[]:(0,o.toJS)(e.toastQueue)},getToastById:function(t){if(e.disabled)return null;var n=e.toasts.filter((function(e){return e.key===t}));return n.length>0?n[0]:null},getToastInPlainById:function(t){return e.disabled?null:(0,o.toJS)(e.getToastById(t))},getToastsForPerspective:function(n){return e.toasts.filter((function(e){return e.scope===t.globalKeyword||e.scope===n})).sort((function(e,n){return e.scope===n.scope?0:e.scope===t.globalKeyword?1:-1}))},getToastsInPlainForPerspective:function(t){return(0,o.toJS)(e.getToastsForPerspective(t))}}})).actions((function(e){return{addToasts:function(n){Array.isArray(n)||(n=[n]);for(var r=0;r<n.length;r+=1)e.toastQueue=(0,o.observable)(e.toastQueue.concat((i=n[r],s=void 0,s={key:i.id,stackable:!0,statusType:i.type||"success",contentString:i.message,btnLabel:i.btnLabel,scope:i.scope?i.scope:t.globalKeyword,hasOnHidden:!!i.onHidden,hasOnShown:!!i.onShown,hasCallback:!!i.callback,timedDismiss:"success"===i.type||"info"===i.type||!i.type,milliseconds:i.timeBeforeDismiss},a.create(s))));var i,s;e.toastQueue.length>5&&(e.toastQueue=(0,o.observable)(e.toastQueue.slice(Math.max(e.toastQueue.length-5,0))))},removeToastById:function(t){var n=e.toasts.filter((function(e){return e.key!==t}));e.toastQueue=(0,o.observable)(n)},removeAllToasts:function(){e.toastQueue=(0,o.observable)([])}}}));t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=document.createElement("div");e.id="svgIcons",e.style.display="none",document.body.appendChild(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=r.types.model({visible:r.types.optional(r.types.boolean,!0),disabled:r.types.optional(r.types.boolean,!1),iconId:r.types.optional(r.types.union(r.types.string,r.types.undefined),void 0),label:r.types.optional(r.types.union(r.types.string,r.types.undefined),void 0)}).actions((function(e){return{setVisible:function(t){e.visible=t},setDisabled:function(t){e.disabled=t},setLabel:function(t){e.label=t},setIconId:function(t){e.iconId=t}}}));t.default=o},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=a(n(53)),u=a(n(57)),l=a(n(58)),p=a(n(59)),f=a(n(61)),d=a(n(62)),h=a(n(79)),y=a(n(107)),v=a(n(108)),g=a(n(109)),b=a(n(38)),w=a(n(30)),m=n(34),C=n(41),_=a(n(12)),P=a(n(110)),S=function(e){function t(t,n){var r=e.call(this,t)||this;return r.glassMode="mode",r.glassBookmarkMode="bookmark",r.initialize=function(){r.accessibilityController=new c.default(r),r.actionsController=new u.default(r),r.appHomePage=new l.default(r),r.dialogsController=new p.default(r),r.eventsRouter=new f.default(r),r.perspectiveLifeCycle=new h.default(r),r.searchPerspectiveDOM=new y.default(r),r.slideoutController=new v.default(r),r.themeResources=new g.default(r)},r.canExecuteAction=function(e,t){return i(r,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.actionsController.canExecuteAction(e,t)];case 1:return[2,n.sent()]}}))}))},r.performAction=function(e,t){return r.actionsController.performAction(e,t)},r.detectAccessibilityChange=function(e){return r.accessibilityController.detectAccessibilityChange(e)},r.isHighContrastOn=function(){return(0,m.isApplicationInHighContrast)()},r.getHomePageObject=function(e){return r.appHomePage.getHomePageObject(e)},r.resetHome=function(e){return r.appHomePage.resetAppHomePage(e)},r.setDefaultHomePerspective=function(e){r.appHomePage.defaultHomePerspective=e},r.setDefaultThemePath=function(e){r.themeResources.defaultThemePath=e},r.showContextMenu=function(e){r.currentAppView&&r.currentAppView.showContextMenu(e)},r.showEmbedDialog=function(e){return r.dialogsController.showEmbedDialog(e)},r.showErrorMessage=function(e,t,n,o){return r.dialogsController.showErrorMessage(e,t,n,o)},r.showMessage=function(e,t,n,o,i,s,a,c){return r.dialogsController.showMessage(e,t,n,o,i,s,a,c)},r.showResetHomeDialog=function(e){return r.dialogsController.showResetHomeDialog(e)},r.showShareDialog=function(e){return r.dialogsController.showShareDialog(e)},r.emit=function(e,t){return r.eventsRouter.emit(e,t)},r.off=function(e,t,n){return r.eventsRouter.off(e,t,n)},r.on=function(e,t,n){return r.eventsRouter.on(e,t,n)},r.trigger=function(e,t){return r.eventsRouter.trigger(e,t)},r.closeOpenWidgets=function(){return r.perspectiveLifeCycle.closeOpenWidgets()},r.updateCurrentCachedAppView=function(){return r.perspectiveLifeCycle.updateCurrentPerspectiveCache()},r.isLoginViewShown=function(){return r.perspectiveLifeCycle.isLoginViewShown},r.isOpeningAView=function(){return r.perspectiveLifeCycle.isOpeningAPerspective()},r.openAppView=function(e,t){return r.perspectiveLifeCycle.openPerspective(e,t)},r.openLoginView=function(e){return r.perspectiveLifeCycle.openLoginPerspective(e)},r.openPreviousAppView=function(){return r.perspectiveLifeCycle.openPreviousPerspective()},r.close=function(e,t){return r.perspectiveLifeCycle.closeAllPerspectives(e,t)},r.closeAppView=function(e,t,n){return r.perspectiveLifeCycle.closePerspective(e,t,n)},r.findCollection=function(e){return r.searchPerspectiveDOM.findCollection(e)},r.isCollectionContainerAvailable=function(e){return r.searchPerspectiveDOM.isCollectionContainerAvailable(e)},r.findElement=function(e){return r.searchPerspectiveDOM.findElement(e)},r.findPlugin=function(e){return r.searchPerspectiveDOM.findPlugin(e)},r.hideSlideOut=function(e){return r.slideoutController.hideSlideOut(e)},r.showSlideOut=function(e){return r.slideoutController.showSlideOut(e)},r.reloadTheme=function(){return r.themeResources.reloadTheme()},r.showToast=function(e,t){return t&&(t.timeOut=t.timeBeforeDismiss||t.timeOut),new b.default(t).show(e)},r.getUrl=function(e){return r.perspectiveLifeCycle.url.getUrl(e,r)},r.lockGlass=function(){r.getCoreSvc(".Logger").warn("The lockGlass API will no longer be supported after the R7 release. Please update your usage accordingly");var e=document.getElementsByClassName("appview");if(e.length>0){var t=e[0].getElementsByClassName("navbar");t.length>0&&t[0].classList.add("disabled");var n=e[0].getElementsByClassName("appbar");n.length>0&&n[0].classList.add("disabled")}},r.unlockGlass=function(){r.getCoreSvc(".Logger").warn("The unlockGlass API will no longer be supported after the R7 release. Please update your usage accordingly");var e=document.getElementsByClassName("appview");if(e.length>0){var t=e[0].getElementsByClassName("navbar");t.length>0&&t[0].classList.remove("disabled");var n=e[0].getElementsByClassName("appbar");n.length>0&&n[0].classList.remove("disabled")}},r.rootPane=n.$rootPane,(0,C.loadPerspectiveModels)(n.perspectives,r.getCoreSvc(".Perspective"),r.getCoreSvc(".Logger")),(0,w.default)(),P.default.apply(),r}return o(t,e),Object.defineProperty(t.prototype,"currentAppView",{get:function(){return this.currentPerspective},set:function(e){this.currentPerspective=e,this.appController.currentAppView=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mode",{get:function(){return this.glassMode},set:function(e){this.glassMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bookmarkMode",{get:function(){return this.glassBookmarkMode},set:function(e){this.glassBookmarkMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cachedPerspectives",{get:function(){return this.perspectiveLifeCycle.cachedPerspectives},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noCloseOnLastPerspective",{get:function(){return"true"===_.default.getObjectProperty(["context","content","closeWindowOnLastView"],this.currentAppView)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousAppView",{get:function(){return this.previousPerspective},set:function(e){this.previousPerspective=e,this.appController.previousAppView=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveSwitcherRegistry",{get:function(){return this.perspectiveLifeCycle.perspectiveSwitcherRegistry},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"slideoutRegistry",{get:function(){return this.slideoutController.slideoutRegistry},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"windowPoppingState",{get:function(){return this.perspectiveLifeCycle.windowPoppingState},set:function(e){this.perspectiveLifeCycle.windowPoppingState=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentContentView=function(){return this.currentPerspective?this.currentPerspective.getCurrentContentView():null},t.prototype.getCurrentPerspective=function(){return this.currentPerspective?this.currentPerspective.getCurrentPerspective():null},t}(d.default);t.default=S},function(e,t){e.exports=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isApplicationStyledForHighContrast=t.styleApplicationForHighContrast=t.isApplicationInHighContrast=void 0,t.isApplicationInHighContrast=function(){var e=!1,t=document.createElement("div");return t.classList.add("hcDetect"),document.body.appendChild(t),getComputedStyle(t).getPropertyValue("border-top-color")===getComputedStyle(t).getPropertyValue("border-left-color")&&""!==getComputedStyle(t).getPropertyValue("border-left-color")&&(e=!0),document.body.removeChild(t),e},t.styleApplicationForHighContrast=function(){document.body.classList.add("highcontrast")},t.isApplicationStyledForHighContrast=function(){return document.body.classList.contains("highcontrast")}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.cache={}}return e.prototype.register=function(e,t){var n=this;Array.isArray(e)||(e=[e]),e.forEach((function(e){n.cache[e]=t}))},e.prototype.notify=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:if(!Object.prototype.hasOwnProperty.call(this.cache,e))return[3,5];n.label=1;case 1:return n.trys.push([1,,2,4]),t=this.cache[e](e),[3,4];case 2:return[4,t=t||Promise.resolve()];case 3:return n.sent(),[7];case 4:return[2,this.remove(e)];case 5:throw new Error("Notifier::notify '"+e+"' not found")}}))}))},e.prototype.remove=function(e){delete this.cache[e]},e}();t.default=i},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(4));t.default=function(e){return o.default.extend(!0,{},e)}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=a(n(6)),u=a(n(38)),l=function(e){function t(t,n,r,o,i){var s=e.call(this,t)||this;return s.pendingOpenPerspectivePromise=null,s.perspectiveSwitcherRegistry=n,s.perspectiveViewsCache=r,s.glassStore=o,s.perspectivesRegistry=i,s}return o(t,e),t.prototype.attemptToOpenPreviousPerspective=function(e,t,n){if(e>=this.perspectiveSwitcherRegistry.size()&&(e=this.perspectiveSwitcherRegistry.size()-1),!n){var r=void 0,o=this.Glass.previousAppView;return this.perspectiveSwitcherRegistry.containsPerspective(o)||(this.Glass.previousAppView=void 0,o=void 0),(r=o&&o.perspective&&o!==t&&"login"!==o.perspective?o:this.perspectiveSwitcherRegistry.getPerspectiveByIndex(e))?this.Glass.openAppView(r.perspective,r.context):this.Glass.openAppView()}return null},t.prototype.closeOpenWidgets=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.Glass.hideSlideOut(e)];case 1:return t.sent(),u.default.remove(),[2]}}))}))},t.prototype.setHomeFlag=function(e,t){!0===t&&this.perspectiveSwitcherRegistry.clearAllPerspectiveHomeFlags(),e.setHomeFlag(t)},t.prototype.prefetchResources=function(){var e=this.Glass.getRequireJs(),t=e&&e.s&&e.s.contexts&&e.s.contexts._&&e.s.contexts._.config&&e.s.contexts._.config.bundles;t&&this.Glass.getCoreSvc(".Prefetch").prefetchResources(Object.keys(t))},t}(c.default);t.default=l},function(e,t){e.exports=y},function(e,t){e.exports=v},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(n(13)),s=o.types.model({id:o.types.identifier,perspectiveName:o.types.string}).volatile((function(){return{context:{},spec:{}}})).actions((function(e){return{setContext:function(t){e.context=t},setSpec:function(t){e.spec=t}}})).views((function(e){return{get requirejs(){return e.spec.config?e.spec.config.requirejs:void 0},get configStyles(){return e.spec.config?e.spec.config.styles:void 0},get configScripts(){return e.spec.config?e.spec.config.scripts:void 0},get cssStyles(){return e.spec.cssStyles},get svgImages(){return e.spec.svgImages},get contextMenuSettings(){return e.spec.contextMenus},get actions(){return e.spec.actions},get services(){return e.spec.services},get toolBars(){return e.spec.toolBars},get layout(){return i.default.convertToolBarsToLayoutObject(this.toolBars)},get modelId(){return e.context.content&&e.context.content.id?e.context.content.id:e.context.id?e.context.id:e.spec.id?e.spec.id:""},get cacheKey(){return this.modelId?e.perspectiveName+"|"+this.modelId:e.perspectiveName},get contentModule(){return e.spec.content?e.spec.content.module:void 0}}}));t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arePerspectivesEqual=t.isPerspectiveValid=t.loadPerspectiveModels=void 0,t.loadPerspectiveModels=function(e,t,n){try{Array.isArray(e)&&e.forEach((function(e){var n=e.name,r=e.model,o=e.context;t.addModel(n,r,o)}))}catch(e){n.error("Error while loading perspective models",e)}},t.isPerspectiveValid=function(e){return e&&!e.includes("/")&&!e.includes(".")&&!e.includes("%2F")&&!e.includes("%2f")},t.arePerspectivesEqual=function(e,t){return!(!e||!t||e!==t)}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preRenderSetup=t.unloadIcons=t.loadStylesAndIcons=void 0;var s=n(83),a=i(n(85)),c=n(43),u=n(44),l=i(n(45)),p=i(n(87));function f(e,t){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return a.default.loadSVGIcons(e.svgImages,t),n=[],Array.isArray(e.cssStyles)&&(n=n.concat(e.cssStyles)),Array.isArray(e.configStyles)&&(n=n.concat(e.configStyles)),[4,(0,s.loadStyles)(n,t)];case 1:return r.sent(),[2]}}))}))}function d(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return(0,c.configureRequire)(e.requirejs,t.getRequireJs()),(0,u.loadContentViewModule)(e.contentModule),[4,Promise.all([(0,p.default)(e.configScripts),f(e,t.getRequireJs())])];case 1:return n.sent(),[2,(0,l.default)(t,e.services)]}}))}))}t.loadStylesAndIcons=f,t.unloadIcons=function(e,t){a.default.unloadSVGIcons(e.svgImages,t)},t.preRenderSetup=function(e,t){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,d(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),t.getCoreSvc(".Logger").error("Failed to setup perspective",n),n;case 3:return[2]}}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUrlArgs=t.configureRequire=void 0,t.configureRequire=function(e,t){e&&e.forEach((function(e){t.config(e)}))},t.getUrlArgs=function(e){var t;try{t=e.s.contexts._.config.urlArgs}catch(e){}return t?"?"+t:""}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createContentView=t.loadContentViewModule=void 0;var o=r(n(7)),i=r(n(36));function s(e){return o.default.loadModule(e)}t.loadContentViewModule=s,t.createContentView=function(e,t,n){var r=(0,i.default)(e.content);return r.glassContext=t,s(r.module).then((function(e){return new e(r,n)}))}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(86)),a=i(n(7)),c=i(n(3));function u(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return e.services.register(t,n),c.default.isFunction(n.initialize)?[4,n.initialize(e)]:[3,2];case 1:return[2,r.sent()];case 2:return[2,void 0]}}))}))}function l(e,t,n){return r(this,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,a.default.instantiate(n)];case 1:return r=o.sent(),[4,u(e,t,r)];case 2:return[2,o.sent()];case 3:throw i=o.sent(),e.getCoreSvc(".Logger").error("Failed to load the service module",i),i;case 4:return[2]}}))}))}function p(e,t,n){e.services.declare(t,n,e)}function f(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:if(e.services.exists(t))return[3,5];switch(n.priority){case s.default.Immediate:return[3,1];case s.default.Defer:return[3,3];case s.default.Declare:return[3,4]}return[3,4];case 1:return[4,l(e,t,n.module)];case 2:return[2,r.sent()];case 3:return function(e,t,n){setTimeout((function(){l(e,t,n).catch((function(n){e.getCoreSvc(".Logger").error("Error loading service "+t+": "+JSON.stringify(n))}))}),2e3)}(e,t,n.module),[3,5];case 4:p(e,t,n.module),r.label=5;case 5:return[2,void 0]}}))}))}function d(e,t,n){e.services.exists(t)||p(e,t,n)}t.default=function(e,t){return r(this,void 0,void 0,(function(){var n;return o(this,(function(i){switch(i.label){case 0:return e&&t?(n=Object.keys(t).map((function(n){return function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return c.default.isString(n)?[2,d(e,t,n)]:c.default.isObject(n)&&n.module?[4,f(e,t,n)]:[3,2];case 1:return[2,r.sent()];case 2:return e.getCoreSvc(".Logger").warn("Invalid definition for service "+t+": "+JSON.stringify(n)),[2,void 0]}}))}))}(e,n,t[n])})),[4,Promise.all(n)]):[2,void 0];case 1:return i.sent(),[2,void 0]}}))}))}},function(e,t){e.exports=g},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.PLUGINS_RENDER_IN_PROGRESS="PLUGINS_RENDER_IN_PROGRESS",e.PLUGINS_RENDER_SUCCESS="PLUGINS_RENDER_SUCCESS",e.CONTENT_VIEW_LOAD_IN_PROGRESS="CONTENT_VIEW_LOAD_IN_PROGRESS",e.CONTENT_VIEW_LOAD_SUCCESS="CONTENT_VIEW_LOAD_SUCCESS",e.CONTENT_VIEW_LOAD_FAILURE="CONTENT_VIEW_LOAD_FAILURE",e.CONTENT_VIEW_RENDER_SUCCESS="CONTENT_VIEW_RENDER_SUCCESS",e.CONTENT_VIEW_RENDER_FAILURE="CONTENT_VIEW_RENDER_FAILURE"}(r||(r={})),t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=r.types.model({x:r.types.number,y:r.types.number}),i=r.types.model({isVisible:r.types.optional(r.types.boolean,!1),position:r.types.optional(o,{x:0,y:0})}).volatile((function(){return{shownItems:[],selectedItem:{}}})).views((function(e){return{get menuItemsSplitByDivider(){var t=[],n=e.shownItems.reduce((function(e,n){return"divider"===n.type?(e.length>0&&t.push(e),t.push([]),e=[]):e.push(n),e}),[]);return n.length>0&&t.push(n),t}}})).actions((function(e){return{updateItems:function(t){e.shownItems=t},updatePosition:function(t){e.position=t},showMenu:function(){e.isVisible||(e.isVisible=!0)},closeMenu:function(){e.isVisible&&(e.isVisible=!1)},onSelect:function(t){e.selectedItem=t}}}));t.default=i},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.globalKeyword=void 0;var o=n(10),i=n(5);t.globalKeyword="__global__";var s=i.types.model("ActionModel",{id:i.types.optional(i.types.string,""),label:i.types.string,url:i.types.optional(i.types.string,""),actionId:i.types.maybe(i.types.string),actionContext:i.types.frozen(null)}),a=i.types.model("AlertModel",{id:i.types.string,title:i.types.optional(i.types.string,""),message:i.types.optional(i.types.string,""),scope:i.types.optional(i.types.string,t.globalKeyword),action:i.types.optional(s,{label:""})});var c=i.types.model("AlertStore",{disabled:i.types.optional(i.types.boolean,!1),alertList:i.types.optional(i.types.array(a),[])}).views((function(e){return{getAlerts:function(){return e.disabled?[]:e.alertList},getAlertAt:function(t){return e.getAlerts()[t]},getAlertsForPerspective:function(n){return e.getAlerts().filter((function(e){return e.scope===t.globalKeyword||e.scope===n})).sort((function(e,n){return e.scope===n.scope?0:e.scope===t.globalKeyword?1:-1}))}}})).actions((function(e){return{addAlerts:function(t){Array.isArray(t)||(t=[t]),t=function(e){return e.map((function(e){return(e=r({},e)).action&&(e.action=s.create(e.action)),a.create(e)}))}(t),e.alertList=(0,o.observable)(e.alertList.concat(t))},removeAlert:function(t){var n=e.alertList.slice();n.splice(t,1),e.alertList=(0,o.observable)(n)}}}));t.default=c},function(e,t,n){"use strict";function r(e){return!("object"!=typeof e||null==e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){if(!r(t))return t||n||{};if(!r(n))return t;for(var o in n){var i=n[o];i&&"[object Object]"===Object.prototype.toString.call(i)?(t[o]=t[o]||{},e(t[o],i)):void 0!==i&&(t[o]=i)}return t}},function(e,t){e.exports=b},function(e,t,n){e.exports=n(112)},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.idBypassBlockButtonMountpoint=void 0;var s=i(n(6)),a=i(n(1)),c=i(n(17)),u=i(n(33)),l=n(34),p=i(n(54)),f=i(n(55));t.idBypassBlockButtonMountpoint="glass-bypassBlockButton-mountpoint";var d=function(e){function n(t){var n=e.call(this,t)||this;return n.setFocusToMainContent=function(){void 0!==n.Glass.currentAppView&&null!==n.Glass.currentAppView&&"function"==typeof n.Glass.currentAppView.setFocus&&(document.activeElement.blur(),setTimeout((function(){n.Glass.currentAppView.setFocus()}),100))},n.Glass.isHighContrastOn()&&(0,l.styleApplicationForHighContrast)(),n.mountBypassBlockButton(),n.keyPressedSet=new Set,n}return o(n,e),n.prototype.mountBypassBlockButton=function(){var e=document.createElement("div");e.setAttribute("id",t.idBypassBlockButtonMountpoint);var n=document.body;n&&n.childNodes instanceof NodeList&&n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e),c.default.render(a.default.createElement(p.default,{callback:this.setFocusToMainContent}),e)},n.prototype.setFocusToAppbar=function(){if(this.Glass.currentAppView){var e=document.querySelector(".appview.paneColumn:not(.hidden)");if(e){var t=e.querySelector(".appbar");this.focusOnForemostNode(t)}}},n.prototype.focusOnForemostNode=function(e){if(e){var t=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');t.length>0&&t[0].id&&this.Glass.findElement(t[0].id.replace(/\./g,"\\.")).focus()}},n.prototype.shortcutListener=function(e,t){"up"===e?(f.default.isModifierKey(t)||this.removeKeyFromSet(t.which),f.default.isMetaKey(t)&&this.clearKeyInSet()):"down"===e&&(f.default.isModifierKey(t)||this.addKeyIntoSet(t.which),this.processShortcutAction(t))},n.prototype.addKeyIntoSet=function(e){this.keyPressedSet.add(e)},n.prototype.removeKeyFromSet=function(e){this.keyPressedSet.delete(e)},n.prototype.clearKeyInSet=function(){this.keyPressedSet.clear()},n.prototype.processShortcutAction=function(e){var t=this,n={shortcutFocusToAppbar:{enabled:f.default.isShortcutTriggered("focusToAppbar",this.keyPressedSet,e),callback:function(){return t.setFocusToAppbar()}},shortcutFocusToMainContent:{enabled:f.default.isShortcutTriggered("focusToMainContent",this.keyPressedSet,e),callback:function(){return t.setFocusToMainContent()}}};Object.keys(n).forEach((function(r){var o=n[r];o.enabled&&"function"==typeof o.callback&&(f.default.metaKeyEnabled(e)&&t.clearKeyInSet(),o.callback())}))},n.prototype.detectAccessibilityChange=function(e){var t=this;if(e){document.body.classList.add("accessibilityMode");var n=function(e){t.shortcutListener("down",e)},r=function(e){t.shortcutListener("up",e)};document.body.onmousedown=function(){document.body.onmousedown=null,t.detectAccessibilityChange(!1)}.bind(this),document.body.onkeydown=n.bind(this),document.body.onkeyup=r.bind(this)}else{n=function(e){e.which===u.default.TAB&&(document.body.onkeydown=null,t.detectAccessibilityChange(!0)),t.shortcutListener("down",e)},r=function(e){t.shortcutListener("up",e)};document.body.classList.remove("accessibilityMode"),document.body.onkeydown=n.bind(this),document.body.onkeyup=r.bind(this)}},n}(s.default);t.default=d},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(1)),a=n(8),c=i(n(11)),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onclickCallback=function(e){var n=t.props.callback;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),n()},t}return o(t,e),t.prototype.render=function(){return s.default.createElement(a.Button,{label:c.default.get("bypassBlockButtonTitle"),variant:"solid",intent:"primary",onClick:this.onclickCallback,style:{position:"absolute",top:"2px",left:"2px"},autofocus:!0})},t}(s.default.Component);t.default=u},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(33)),i=r(n(56)),s=function(){function e(){}return e.isShortcutTriggered=function(t,n,r){var o=e.shortcutMap[t];return null!=o&&e.verifyKeyset(o,n,r)},e.verifyKeyset=function(e,t,n){return Object.keys(e).every((function(r){if("others"===r){if(e.others.filter((function(e){return t.has(e)})).length!==e.others.length)return!1}else if("ctrlKey"===r&&n){if(!i.default.isDeviceMac()&&!n.ctrlKey||i.default.isDeviceMac()&&!n.metaKey)return!1}else if(n&&!n[r])return!1;return!0}))},e.isModifierKey=function(e){return e&&e.key&&["control","shift","alt","meta"].includes(e.key.toLowerCase())},e.isMetaKey=function(e){return e&&e.key&&"meta"===e.key.toLowerCase()},e.metaKeyEnabled=function(e){return e&&e.metaKey},e.shortcutMap={focusToAppbar:{ctrlKey:!0,shiftKey:!0,others:[o.default.NUM1]},focusToMainContent:{ctrlKey:!0,shiftKey:!0,others:[o.default.NUM2]}},e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.list={mac:["MacIntel","Macintosh"],windows:["Windows","Win32"]},e.isDeviceMac=function(){return navigator&&e.list.mac&&e.list.mac.includes(navigator.platform)},e.isDeviceWindows=function(){return navigator&&e.list.windows&&e.list.windows.includes(navigator.platform)},e}();t.default=r},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.canExecuteAction=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return this.Glass.currentAppView?null===e?[2,!1]:[4,this.Glass.currentAppView.canExecuteAction(e,t)]:[3,2];case 1:return[2,n.sent()];case 2:throw new Error("Internal error: No appview loaded.")}}))}))},t.prototype.performAction=function(e,t){if(this.Glass.currentAppView)return Promise.resolve(this.Glass.currentAppView.performAction(e,t));var n=new Error("Internal error: unable to find an appView");throw this.logger.error(n),n},t}(a(n(6)).default);t.default=c},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c,u=a(n(6)),l=a(n(12)),p=a(n(11)),f=a(n(4));!function(e){e.DEFAULT_HOME_PERSPECTIVE="home"}(c||(c={}));var d=function(e){function t(t){var n=e.call(this,t)||this;return n.initializeHomePageObjects(),n}return o(t,e),Object.defineProperty(t.prototype,"defaultHomePerspective",{set:function(e){this.homePerspectiveDefault=e},enumerable:!1,configurable:!0}),t.prototype.getHomePageObject=function(e){return i(this,void 0,void 0,(function(){var t,n,r,o,i;return s(this,(function(s){switch(s.label){case 0:if(t="number"==typeof e?e:0,n=this.homePageObjs,!(t<n.length))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,n[t]()];case 2:return!(r=s.sent())||r&&0===Object.keys(r).length?[2,this.getHomePageObject(t+1)]:(o={content:{isHomepage:!0}},[2,r=f.default.extend(!0,o,r)]);case 3:return i=s.sent(),this.logger.error("unable to get home page object",i),[3,4];case 4:throw new Error("Unsupported home page index:"+t)}}))}))},t.prototype.resetAppHomePage=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.Glass.getCoreSvc(".UserProfile").resetHome()];case 1:return t.sent(),this.Glass.perspectiveSwitcherRegistry.clearAllPerspectiveHomeFlags(),this.Glass.showToast(p.default.get("resetHomeSuccess"),{type:"success"}),e&&this.Glass.openAppView(),[2]}}))}))},t.prototype.initializeHomePageObjects=function(){this.homePageObjs=[this.getFactoryHomeObj.bind(this)],l.default.isFactoryMode()||this.homePageObjs.unshift(this.getUserHomePageObject.bind(this),this.getSystemHomeObject.bind(this))},t.prototype.getFactoryHomeObj=function(){return{perspective:this.homePerspectiveDefault||c.DEFAULT_HOME_PERSPECTIVE}},t.prototype.getSystemHomeObject=function(){var e=this.Glass.getCoreSvc(".UserProfile");if(e.userProfileSettings&&e.userProfileSettings.ui_homePage){var t=e.userProfileSettings.ui_homePage;return t&&t.content&&"run"===t.content.action&&delete t.content.action,t}return{}},t.prototype.getUserHomePageObject=function(){return i(this,void 0,void 0,(function(){var e,t,n;return s(this,(function(r){switch(r.label){case 0:e=this.Glass.getCoreSvc(".UserProfile"),r.label=1;case 1:return r.trys.push([1,4,,5]),e.preferences&&e.preferences.homePage?[3,3]:[4,e.updateContext()];case 2:r.sent(),r.label=3;case 3:if(t=void 0,e.preferences&&(t=e.preferences.homePage),!t)return[2,{}];try{return[2,JSON.parse(t)]}catch(e){throw this.logger.error("Not valid JSON format. Invalid home page specification.",e),new Error("Not valid JSON format. Invalid home page specification.")}return[3,5];case 4:return n=r.sent(),this.logger.error("Unable to get user home object",n),[2,{}];case 5:return[2]}}))}))},t}(u.default);t.default=d},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=a(n(6)),u=a(n(1)),l=a(n(17)),p=a(n(60)),f=a(n(11)),d=function(e){function t(t){var n=e.call(this,t)||this;return n.mountComponent(),n}return o(t,e),t.prototype.mountComponent=function(){var e=document.createElement("div");e.setAttribute("id","glass-dialog-mountpoint"),l.default.render(u.default.createElement(p.default,{store:this.Glass.getCoreSvc(".Dialog").getStore(),Glass:this.Glass}),document.body.appendChild(e))},t.prototype.showErrorMessage=function(e,t,n,r){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return[4,this.showMessage(e,t,"error",["ok"],"300px",n,r)];case 1:return[2,o.sent()]}}))}))},t.prototype.showMessage=function(e,t,n,r,o,a,c,u){return i(this,void 0,void 0,(function(){var i=this;return s(this,(function(s){return[2,new Promise((function(s){try{var l={message:e,title:t,type:n,buttons:r,width:o,callback:{general:a},htmlContent:c,className:u,callbackScope:{ok:i}};i.Glass.getCoreSvc(".Dialog").createDialog(l),s()}catch(e){throw i.logger.error(e),e}}))]}))}))},t.prototype.showResetHomeDialog=function(e){return i(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,new Promise((function(n){try{var r={message:e,title:f.default.get("invalidHomePageTitle"),type:"warning",buttons:["ok","cancel"],htmlContent:!1,callback:{ok:function(){return t.Glass.resetHome(!0)}}};t.Glass.getCoreSvc(".Dialog").createDialog(r),n()}catch(e){throw t.logger.error(e),e}}))]}))}))},t.prototype.showShareDialog=function(e){return i(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return t={urlMap:e,isEmbed:!1},n=this.Glass.getUrl(t),r={title:f.default.get("shareDialogTitle"),type:"share",width:"500px",buttons:["copy","cancel"],htmlContent:!1,payload:{url:n}},[4,this.showNewModalDialog(r)];case 1:return[2,o.sent()]}}))}))},t.prototype.showEmbedDialog=function(e){return i(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return t={urlMap:e,isEmbed:!0},n=this.Glass.getUrl(t),r={title:f.default.get("embedDialogTitle"),type:"embed",width:"500px",buttons:["copy","cancel"],htmlContent:!1,payload:{url:n}},[4,this.showNewModalDialog(r)];case 1:return[2,o.sent()]}}))}))},t.prototype.showNewModalDialog=function(e){return i(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,new Promise((function(n){try{t.Glass.getCoreSvc(".Dialog").createDialog(e),n()}catch(e){throw t.logger.error("Modal Error: Failed to load modal",e),e}}))]}))}))},t}(c.default);t.default=d},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=s(n(1)),c=n(8),u=n(9),l=n(10),p=s(n(11)),f=function(e){function t(t){var n=e.call(this,t)||this;return n.state={embedWidth:500,embedHeight:400},n.isIOSdevice=/iPad/i.test(navigator.userAgent),n.buttonLabelMap={copy:"copyText",ok:"ok",cancel:"cancel",close:"close"},n}return o(t,e),t.prototype.bindOnClose=function(e){for(var t=this.props.Glass,n=0;n<e.length;n+=1)e[n].onClose=function(){return t.getCoreSvc(".Dialog").removeDialog()};return e},t.prototype.copyToClipboard=function(){this.targetTextarea.select(),document.execCommand("copy")},t.prototype.buttonsEmbedShareDialog=function(e){var t=this,n=this.props.Glass;return a.default.createElement(c.Dialog.Footer,null,e.buttons.map((function(r){return a.default.createElement(c.Dialog.Button,{id:"copy"===r?"copy_button":r,className:"button dialogButton "+("copy"===r?"primary":"secondary"),key:""+e.key+r,label:p.default.get(t.buttonLabelMap[r]),primary:"copy"===r,onClick:function(){"cancel"===r?n.getCoreSvc(".Dialog").removeDialog(r):"copy"===r&&t.copyToClipboard()},style:{margin:"0px 0px 0px 16px"}})})))},t.prototype.urlGenerator=function(e){if("embed"===e.type){var t=this.state,n=t.embedWidth,r=t.embedHeight;return'<iframe src="'+(e.payload&&e.payload.url?e.payload.url.replace(/&/g,"&"):"")+'" width="'+n+'" height="'+r+'"></iframe>'}return e.payload&&e.payload.url?e.payload.url:""},t.prototype.urlDisplay=function(e){var t=this;return a.default.createElement("textarea",{className:"displayedURLOrCode","aria-label":p.default.get("share"===e.type?"shareDialogCodeLabel":"embedDialogCodeLabel"),tabIndex:0,readOnly:!this.isIOSdevice,style:{width:"100%",height:"96px"},ref:function(e){t.targetTextarea=e},value:this.urlGenerator(e)})},t.prototype.nodeEmbedDialog=function(e){var t=this,n=this.state,r=n.embedWidth,o=n.embedHeight;return a.default.createElement(a.default.Fragment,null,a.default.createElement(c.Dialog.Body,null,a.default.createElement("div",{className:"embedDialogText",style:{marginBottom:"24px"},"aria-label":p.default.get("embedDialogText")},p.default.get("embedDialogText")),a.default.createElement("div",{className:"embedDialogSizeAdjustor",style:{marginBottom:"16px"}},a.default.createElement("div",{style:{width:"50%",display:"inline-block"}},a.default.createElement("div",null,p.default.get("embedURLWidthLabel")),a.default.createElement(c.NumberInput,{id:"GlassMessageDialog_embedWidth",value:r,scale:1,max:1e5,onValueAccept:function(e,n){return Number(e)===Number(n)&&t.setState({embedWidth:e})}})),a.default.createElement("div",{style:{width:"50%",display:"inline-block"}},a.default.createElement("div",null,p.default.get("embedURLHeightLabel")),a.default.createElement(c.NumberInput,{id:"GlassMessageDialog_embedHeight",value:o,scale:1,max:1e5,onValueAccept:function(e,n){return Number(e)===Number(n)&&t.setState({embedHeight:e})}}))),this.urlDisplay(e)),this.buttonsEmbedShareDialog(e))},t.prototype.nodeShareDialog=function(e){return a.default.createElement(a.default.Fragment,null,a.default.createElement(c.Dialog.Body,null,a.default.createElement("div",{className:"shareDialogText",style:{marginBottom:"16px"},"aria-label":p.default.get("shareDialogText")},p.default.get("shareDialogText")),this.urlDisplay(e)),this.buttonsEmbedShareDialog(e))},t.prototype.nodeGeneralDialog=function(e){var t=this,n=this.props.Glass;return a.default.createElement(a.default.Fragment,null,e.isHTMLContent?a.default.createElement(c.Dialog.Body,{dangerouslySetInnerHTML:{__html:e.message}}):a.default.createElement(c.Dialog.Body,null,a.default.createElement("div",{className:"messageBox "+e.type},e.message)),a.default.createElement(c.Dialog.Footer,null,e.buttons.map((function(r){var o="object"==typeof r&&r.text?r.text:p.default.get(t.buttonLabelMap["string"==typeof r?r:"ok"]),i="object"==typeof r&&r.defaultId?r.defaultId:r,s="ok"===r||"object"==typeof r&&"ok"===r.defaultId;return a.default.createElement(c.Dialog.Button,{key:""+e.key+o,id:i,className:"button dialogButton "+(s?"primary":"secondary"),label:o,primary:s,onClick:function(){return n.getCoreSvc(".Dialog").removeDialog(i)},style:{margin:"0px 0px 0px 16px"}})}))))},t.prototype.renderBodyFooter=function(e){var t;switch(e.type){case"info":case"error":case"warning":t=this.nodeGeneralDialog(e);break;case"share":t=this.nodeShareDialog(e);break;case"embed":t=this.nodeEmbedDialog(e);break;default:t=this.nodeGeneralDialog(e)}return t},t.prototype.render=function(){var e=this,t=this.props.store,n=this.bindOnClose((0,l.toJS)(t?t.dialogs:[]));return n&&n.map((function(t){return a.default.createElement(c.Dialog,{size:t.size,width:t.width,className:t.className,startingFocusIndex:-1,onClose:t.onClose,style:{zIndex:9999999}},a.default.createElement(c.Dialog.SubHeader,null,t.subTitle),a.default.createElement(c.Dialog.Header,null,t.title),e.renderBodyFooter(t))}))},t=i([u.observer],t)}(a.default.Component);t.default=f},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=function(e){function t(t){var n=e.call(this,t)||this;return n.attachApplicationEventListeners(),n.attachUnhandledRejectionListenerToWindow(),n.attachPopStateListenerToWindow(),n}return o(t,e),t.prototype.off=function(e,t,n){this.eventService.off(e,t,n)},t.prototype.on=function(e,t,n){this.eventService.on(e,t,n)},t.prototype.emit=function(e,t){this.eventService.trigger(e,t)},t.prototype.trigger=function(e,t){this.eventService.trigger(e,t)},t.prototype.attachApplicationEventListeners=function(){var e=this;this.on("appView:titleChange",(function(t){e.trigger("change:title",t),t.value&&(document.title=t.value)}))},t.prototype.attachPopStateListenerToWindow=function(){var e=this;this.Glass.trackHistory&&(window.onpopstate=function(t){return i(e,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return(e=t.state)?(this.Glass.windowPoppingState=!0,[4,this.Glass.openAppView(e.perspective,e)]):[3,2];case 1:n.sent(),this.Glass.windowPoppingState=!1,n.label=2;case 2:return[2]}}))}))})},t.prototype.attachUnhandledRejectionListenerToWindow=function(){var e=this;window.addEventListener("unhandledrejection",(function(t){t.preventDefault(),t&&t.detail&&t.detail.reason&&e.logger.error(t.detail.reason)}))},t}(a(n(6)).default);t.default=c},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(23)),i=r(n(25)),s=r(n(26)),a=r(n(27)),c=r(n(28)),u=r(n(64)),l=r(n(65)),p=r(n(66)),f=r(n(67)),d=r(n(68)),h=r(n(69)),y=r(n(70)),v=r(n(71)),g=r(n(72)),b=r(n(12)),w=r(n(73)),m=r(n(74)),C=r(n(75)),_=r(n(76)),P=r(n(77)),S=r(n(78)),O=function(){function e(e){this.appController=e.appController,this.authInfo=e.authInfo,this.cacheAppViews=e.cacheAppViews,this.installInfo=e.installInfo,this.versionInfo=e.versionInfo,this.trackHistory=e.trackHistory,this.requirejs=e.requirejs,this.coreServices={},this.services=new _.default({}),this.registerAllCoreServices(),this.registerLegacyServices(),this.profile=this.profile||{},this.ajaxCodes={SSO:441,UNAUTHORIZED:441,AUTH_DENIED:401};var t=b.default.getQueryDataParameterMap(this);this.isAppEmbedded=t&&"embedded"===t.shareMode,this.isPrefetchSvcDisabled=t&&"disabled"===t.prefetchsvc}return e.prototype.getSvc=function(e,t){return this.services.getSvc(e,t)},e.prototype.getSvcSync=function(e){var t=null;try{t=this.services.getSvcSync(e)}catch(e){return t}return t},e.prototype.getCoreSvc=function(e){if(!this.coreServices[e])try{throw new Error('Service "'+e+'" is not a core service and may not be available synchronously...')}catch(e){this.getCoreSvc(".Logger").warn(e)}return this.services.getSvcSync(e)},e.prototype.registerCoreService=function(e,t){this.coreServices[e]=!0,this.services.register(e,t)},e.prototype.addToOptions=function(e){var t=e||{};return t.glassContext=this,t.Glass=this,t},e.prototype.isDevInstall=function(){var e=!1;return"string"==typeof this.installInfo&&(e="development"===this.installInfo.toLowerCase()),e},e.prototype.hasCapability=function(e){var t=this.getCoreSvc(".UserProfile").capabilities;return!!t&&t.includes(e)},e.prototype.isEmbedded=function(){return!!this.isAppEmbedded},e.prototype.isPrefetchDisabled=function(){return!!this.isPrefetchSvcDisabled},e.prototype.getRequireJs=function(){return this.requirejs},e.prototype.registerAllCoreServices=function(){var e=new f.default(this.addToOptions());this.registerCoreService(".Logger",new m.default),this.registerCoreService(".WindowProxy",new S.default(this,window,{dialog:!0})),this.registerCoreService(".Ajax",new u.default({configService:e})),this.registerCoreService(".Logger",new m.default),this.registerCoreService(".Context",new d.default(this.addToOptions())),this.registerCoreService(".CoachMarkService",new p.default(this)),this.registerCoreService(".FeatureChecker",new y.default(v.default)),this.registerCoreService(".Events",new h.default),this.registerCoreService(".Perspective",new i.default(this)),this.registerCoreService(".UserProfile",new P.default(this.addToOptions())),this.registerCoreService(".Config",e),this.registerCoreService(".Clipboard",new l.default(this)),this.registerCoreService(".Prefetch",new C.default(this)),this.registerCoreService(".Taxonomy",new a.default(this)),this.registerCoreService(".URLEncoder",new s.default(this)),this.registerCoreService(".Toast",new c.default(this)),this.registerCoreService(".Dialog",new o.default(this))},e.prototype.registerLegacyServices=function(){var e=this,t={ajax:new w.default(this.addToOptions()),fetch:new g.default(this.addToOptions()),userProfile:this.getCoreSvc(".UserProfile"),config:this.getCoreSvc(".Config"),logger:this.getCoreSvc(".Logger")};Object.keys(t).forEach((function(n){e.services.register(n,t[n]),e.services[n]=t[n]}))},e.prototype.getSSOLoginURL=function(){return this.getCoreSvc(".Logger").info('Glass.getSSOLoginURL has been deprecated... use getCoreSvc(".Config").getSSOLoginURL() instead.'),this.getCoreSvc(".Config").getSSOLoginURL()},e.prototype.getSSOLogoutURL=function(){return this.getCoreSvc(".Logger").info('Glass.getSSOLogoutURL has been deprecated... use getCoreSvc(".Config").getSSOLogoutURL() instead.'),this.getCoreSvc(".Config").getSSOLogoutURL()},e.prototype.getAllowedUrlLoginParameters=function(){return this.getCoreSvc(".Logger").info('Glass.getAllowedUrlLoginParameters has been deprecated... use getCoreSvc(".Config").getAllowedUrlLoginParameters() instead.'),this.getCoreSvc(".Config").getAllowedUrlLoginParameters()},e.prototype.setSSOURL=function(){return this.getCoreSvc(".Logger").info('Glass.setSSOURL has been deprecated... use getCoreSvc(".Config").setSSOURL() instead.'),this.getCoreSvc(".Config").setSSOURL()},e}();t.default=O},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),o=n(5),i=o.types.model({url:o.types.optional(o.types.string,"")}),s=o.types.model({defaultId:o.types.string,text:o.types.string}),a=o.types.model("DialogModel",{key:o.types.optional(o.types.string,""),message:o.types.optional(o.types.string,""),title:o.types.string,subTitle:o.types.optional(o.types.string,""),type:o.types.enumeration("dialogType",["info","error","share","embed","warning"]),buttons:o.types.optional(o.types.array(o.types.union(o.types.string,s)),[]),width:o.types.optional(o.types.string,""),hasCallback:o.types.optional(o.types.boolean,!1),isHTMLContent:o.types.optional(o.types.union(o.types.boolean,o.types.null),!1),className:o.types.optional(o.types.string,""),size:o.types.enumeration("dialogSize",["small","large"]),payload:o.types.optional(i,{})});var c=o.types.model("DialogStore",{dialogStack:o.types.optional(o.types.array(a),[])}).views((function(e){return{get dialogs(){return e.dialogStack},get dialogsInPlain(){return(0,r.toJS)(e.dialogStack)}}})).actions((function(e){return{addDialog:function(t){e.dialogStack=(0,r.observable)(e.dialogStack.concat(function(e){var t={message:e.message,title:e.title,subTitle:e.subTitle,type:e.type,buttons:e.buttons&&Array.isArray(e.buttons)?e.buttons:[],width:e.width,hasCallback:e.callback&&"object"==typeof e.callback&&Object.keys(e.callback).length>0&&Object.values(e.callback).filter((function(e){return e&&"function"==typeof e})).length>0,isHTMLContent:e.htmlContent,className:e.className,size:"error"===e.type?"small":"large",key:e.id,payload:e.payload};return a.create(t)}(t)))},removeDialog:function(){e.dialogStack=(0,r.observable)(e.dialogStack.slice(0,e.dialogStack.length-1))},removeAllDialogs:function(){e.dialogStack=(0,r.observable)([])}}}));t.default=c},function(e,t){e.exports=w},function(e,t){e.exports=m},function(e,t){e.exports=C},function(e,t){e.exports=_},function(e,t){e.exports=P},function(e,t){e.exports=S},function(e,t){e.exports=O},function(e,t){e.exports=E},function(e,t){e.exports=x},function(e,t){e.exports=j},function(e,t){e.exports=R},function(e,t){e.exports=k},function(e,t){e.exports=V},function(e,t){e.exports=T},function(e,t){e.exports=M},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(6)),a=i(n(1)),c=i(n(17)),u=i(n(80)),l=i(n(81)),p=i(n(82)),f=i(n(88)),d=i(n(90)),h=i(n(104)),y=i(n(105)),v=i(n(106)),g=i(n(19)),b=function(e){function t(t){var n=e.call(this,t)||this;return n.closeOpenWidgets=function(){return n.openPerspectiveController.closeOpenWidgets()},n.updateCurrentPerspectiveCache=function(){return n.perspectiveViewsCache.updateCache(n.Glass.currentAppView)},n.isOpeningAPerspective=function(){return n.openPerspectiveController.isOpeningAPerspective()},n.openLoginPerspective=function(e){return n.openPerspectiveController.openLoginPerspective(e)},n.openPerspective=function(e,t){return n.openPerspectiveController.openPerspective(e,t)},n.openPreviousPerspective=function(){return n.openPerspectiveController.openPreviousPerspective()},n.closeAllPerspectives=function(e,t){return n.closePerspectiveController.closeAllPerspectives(e,t)},n.closePerspective=function(e,t,r){return n.closePerspectiveController.closePerspective(e,t,r)},n.perspectiveSwitcherRegistry=new v.default(n.Glass),n.perspectiveViewsCache=new y.default(n.Glass),n.urlHelper=new g.default,n.initializeGlassUIRender(),n.openPerspectiveController=new p.default(n.Glass,n.perspectiveSwitcherRegistry,n.perspectiveViewsCache,n.glassStore,n.perspectivesRegistry,n.perspectivesFactory,n.urlHelper),n.closePerspectiveController=new u.default(n.Glass,n.perspectiveSwitcherRegistry,n.perspectiveViewsCache,n.glassStore,n.perspectivesRegistry),n}return o(t,e),Object.defineProperty(t.prototype,"cachedPerspectives",{get:function(){return this.perspectiveViewsCache.getCachedPerspectives()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoginViewShown",{get:function(){return!!this.openPerspectiveController.loginView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.urlHelper},enumerable:!1,configurable:!0}),t.prototype.getMountPointForGlassUI=function(){return this.Glass.rootPane.length>0&&this.Glass.rootPane[0]?this.Glass.rootPane[0]:document.getElementById("main")},t.prototype.initializeGlassUIRender=function(){this.glassStore=l.default.create(),this.perspectivesRegistry=new h.default(this.glassStore),this.perspectivesFactory=new d.default(this.perspectivesRegistry,this.Glass);try{c.default.render(a.default.createElement(f.default,{perspectiveRegistry:this.perspectivesRegistry,glassStore:this.glassStore}),this.getMountPointForGlassUI())}catch(e){this.logger.error("Mount point is not correctly set for Glass UI",e,this.Glass.rootPane)}},t}(s.default);t.default=b},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=a(n(37)),u=a(n(39)),l=a(n(11));var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.closeAllPerspectives=function(e,t){var n=this.perspectiveViewsCache.getDirtyCachedViews();if(e||!0!==t||0!==n.length){if(!e&&n.length>0)return t?function(e){var t=l.default.get("unsavedViewsMsg")+"\n\r";return e.forEach((function(e){t+=e.getTitle(!0)+"\r"})),t}(n):this.closeAllPerspectivesWithConfirmation();var r=this.closeAllPerspectiveViews(t,!0);return t?void 0:new Promise((function(e,t){r.then(e,t)}))}},t.prototype.closePerspective=function(e,t,n){return i(this,void 0,void 0,(function(){var r,o;return s(this,(function(i){return r={perspective:e},t&&(r.content={id:t}),o=this.perspectiveViewsCache.getCachedViewByPerspectiveNameAndContext(e,r),[2,this.closePerspectiveView(o,null,null,n)]}))}))},t.prototype.closeAllPerspectivesWithConfirmation=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,u.default.waitForCloseConfirmation(this.Glass)];case 1:return e.sent(),this.closeAllPerspectiveViews(!1,!0),[2]}}))}))},t.prototype.closeAllPerspectiveViews=function(e,t){return i(this,void 0,void 0,(function(){var n,r=this;return s(this,(function(o){return e&&this.Glass.currentAppView.updateRenderState(!0),this.Glass.previousAppView=void 0,n=[],this.perspectiveViewsCache.getCacheKeys().forEach((function(e){var o=r.perspectiveViewsCache.getCachedView(e);o.cleanupSlideoutController();var i=r.closePerspectiveView.bind(r,o,!0,t);n.push(i())})),this.perspectiveViewsCache.clearCache(),[2,Promise.all(n)]}))}))},t.prototype.closePerspectiveView=function(e,t,n,r){return i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return e?!e.shouldShowCloseConfirmationDialog()||t?[3,2]:[4,u.default.waitForCloseConfirmation(this.Glass,r)]:[3,6];case 1:o.sent(),o.label=2;case 2:return e!==this.Glass.currentAppView?[3,4]:[4,this.closeOpenWidgets()];case 3:o.sent(),o.label=4;case 4:return[4,this.removePerspective(e,r)];case 5:o.sent(),this.removePerspectiveEvents(e),this.cleanSwitcherRegistry(e,n),this.Glass.previousAppView===e&&(this.Glass.previousAppView=void 0),this.perspectiveViewsCache.removeCachedView(e.cacheKey),null==n&&this.postPerspectiveClose(),o.label=6;case 6:return[2,!0]}}))}))},t.prototype.cleanSwitcherRegistry=function(e,t){var n=this.perspectiveSwitcherRegistry.getIndexOfPerspective(e);this.Glass.perspectiveSwitcherRegistry.removePerspective(e),e===this.Glass.currentAppView&&(-1===n&&(n=0),this.attemptToOpenPreviousPerspective(n,e,t))},t.prototype.postPerspectiveClose=function(){var e=this.Glass.noCloseOnLastPerspective;0===this.perspectiveSwitcherRegistry.size()&&e&&window.close(),this.pendingOpenPerspectivePromise=null},t.prototype.removePerspective=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return this.perspectivesRegistry.remove(e.perspectiveModel.id),this.glassStore.removePerspectiveModel(e.perspectiveModel.id),[4,e.remove(!0,t)];case 1:return[2,n.sent()]}}))}))},t.prototype.removePerspectiveEvents=function(e){this.Glass.off("change:title",void 0,e.viewId)},t}(c.default);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(10),i=r.types.model({perspectiveModels:r.types.optional(r.types.array(r.types.string),[]),registeredPerspectives:r.types.optional(r.types.array(r.types.string),[]),currentPerspective:r.types.optional(r.types.string,"")}).actions((function(e){return{addPerspectiveModel:function(t){e.perspectiveModels.push(t.id)},removePerspectiveModel:function(t){var n=e.perspectiveModels.filter((function(e){return e!==t}));e.perspectiveModels=(0,o.observable)(n)},registerPerspective:function(t){e.registeredPerspectives.push(t)},deregisterPerspective:function(t){e.registeredPerspectives.remove(t)},setCurrentPerspective:function(t){e.currentPerspective=t}}}));t.default=i},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t},c=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var p=l(n(37)),f=a(n(10)),d=l(n(24)),h=l(n(40)),y=n(41),v=n(42),g=l(n(14)),b=l(n(12)),w=l(n(11)),m=l(n(19)),C=l(n(4));var _=function(e){function t(t,n,r,o,i,s,a){var c=e.call(this,t,n,r,o,i)||this;return c.perspectivesFactory=s,c.urlHelper=a,c}return o(t,e),t.prototype.isOpeningAPerspective=function(){return void 0!==this.pendingOpenPerspectivePromise&&null!==this.pendingOpenPerspectivePromise},t.prototype.openLoginPerspective=function(e){return c(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return e=void 0===e?{}:e,this.isOpeningAPerspective()?e&&e.content&&e.content.origin&&e.content.origin.relogin?(this.pendingOpenPerspectivePromise=null,[3,3]):[3,1]:[3,3];case 1:return[4,this.openPendingPerspective()];case 2:r.sent(),r.label=3;case 3:return r.trys.push([3,6,7,8]),[4,this.closeOpenWidgets()];case 4:return r.sent(),[4,this.renderPerspective("login",e,this.Glass.currentAppView)];case 5:return t=r.sent(),this.loginView=t,[2,t];case 6:throw n=r.sent(),this.handleOpenLoginViewError(),n;case 7:return this.Glass.reloadTheme(),[7];case 8:return[2]}}))}))},t.prototype.openPerspective=function(e,t){return c(this,void 0,void 0,(function(){var n,r;return u(this,(function(o){switch(o.label){case 0:return[4,this.openPendingPerspective()];case 1:o.sent(),o.label=2;case 2:return o.trys.push([2,6,,7]),"login"===e?(this.pendingOpenPerspectivePromise=this.openLoginPerspective(t),[2,this.pendingOpenPerspectivePromise]):[4,this.closeOpenWidgets()];case 3:return o.sent(),[4,this.buildPerspectiveContext(e,t)];case 4:return n=o.sent(),this.pendingOpenPerspectivePromise=this.showPerspective(n.perspectiveName,n.context),[4,this.pendingOpenPerspectivePromise];case 5:return[2,o.sent()];case 6:return r=o.sent(),this.pendingOpenPerspectivePromise=this.handleOpenPerspectiveError(r),[2,this.pendingOpenPerspectivePromise];case 7:return[2]}}))}))},t.prototype.openPreviousPerspective=function(){return this.Glass.previousAppView&&this.perspectiveViewsCache.getCachedView(this.Glass.previousAppView.cacheKey)?this.openPerspective(this.Glass.previousAppView.perspective,this.Glass.previousAppView.context):this.isOpeningAPerspective()?this.openPerspective():null},t.prototype.displayPerspective=function(e,t){return e&&"function"==typeof e.hasHomeFlag&&this.setHomeFlag(e,e.hasHomeFlag()),t&&"function"==typeof t.hide&&(t.hide(),this.perspectiveSwitcherRegistry.size()>0&&this.perspectiveViewsCache.updateCache(t)),"login"!==e.perspective&&this.loginView&&(this.removeLoginView(),this.Glass.reloadTheme()),e.show(),this.Glass.trigger("appView:loaded",{perspective:e.perspective,context:e.context,appView:e}),e.setFocus(),this.perspectiveSwitcherRegistry.addPerspective(e),this.Glass.unlockGlass(),this.Glass.isEmbedded()||this.Glass.isPrefetchDisabled()||this.prefetchResources(),e},t.prototype.deactivateCurrentPerspective=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return this.Glass.currentAppView?[4,this.Glass.currentAppView.deactivate()]:[3,2];case 1:e.sent(),"login"!==this.Glass.currentAppView.perspective&&(this.Glass.previousAppView=this.Glass.currentAppView),e.label=2;case 2:return[2]}}))}))},t.prototype.getPerspectiveModel=function(e,t){return c(this,void 0,void 0,(function(){var n,r,o;return u(this,(function(i){switch(i.label){case 0:return[4,this.Glass.getCoreSvc(".Perspective").getModel(e,t)];case 1:return n=i.sent(),r=C.default.extend(!0,{},n,t),(o=h.default.create({id:"login"===e?"login":(0,d.default)("id"),perspectiveName:e||r.perspective})).setSpec(r),o.setContext(t),[2,o]}}))}))},t.prototype.openHomePerspective=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(o){switch(o.label){case 0:return t="number"==typeof e?e:0,[4,this.Glass.getHomePageObject(t)];case 1:n=o.sent(),o.label=2;case 2:return o.trys.push([2,5,,6]),"login"===n.perspective?[2,this.openLoginPerspective(n)]:[4,this.closeOpenWidgets()];case 3:return o.sent(),[4,this.buildPerspectiveContext(n.perspective,n)];case 4:return r=o.sent(),[2,this.showPerspective(r.perspectiveName,r.context)];case 5:return o.sent(),this.logger.warn("Failed to open home page:",t,n.perspective),[2,this.openHomePerspective(t+1)];case 6:return[2]}}))}))},t.prototype.renderPerspective=function(e,t,n){return c(this,void 0,void 0,(function(){var r,o,i;return u(this,(function(s){switch(s.label){case 0:if((0,y.isPerspectiveValid)(e))return[3,1];throw new g.default(w.default.get("invalidPerspectiveErrorMessage"));case 1:return[4,this.getPerspectiveModel(e,t)];case 2:return r=s.sent(),"login"!==e&&this.updateUserProfileContext(r),[4,this.deactivateCurrentPerspective()];case 3:return s.sent(),[4,(0,v.preRenderSetup)(r,this.Glass)];case 4:return s.sent(),[4,this.renderPerspectiveView(r)];case 5:return o=s.sent(),this.perspectiveViewsCache.cacheView(e,r.spec,o),i=function(e,t,n,r){var o=JSON.parse(JSON.stringify(e));return o.content=r.content,o.perspective=n||t.perspectiveName,!o.id&&t.modelId&&(o.id=t.modelId),o}(t,r,e,o),o.context=i,[2,this.displayPerspective(o,n)]}}))}))},t.prototype.renderPerspectiveView=function(e){var t=this;this.glassStore.addPerspectiveModel(e),this.perspectivesFactory.create(e),this.glassStore.setCurrentPerspective(e.id);var n=this.perspectivesRegistry.getPerspectiveById(e.id),r=n.getPerspectiveController();this.Glass.currentAppView=r;var o=n.getPerspectiveStore();return new Promise((function(e,n){f.when((function(){return o.contentViewRendered}),(function(){return e(r)})),f.when((function(){return o.contentViewRenderFailed}),(function(){t.logger.error(new Error("AppView Error: Error creating the AppView")),n()}))}))},t.prototype.showCachedPerspective=function(e,t,n){return c(this,void 0,void 0,(function(){return u(this,(function(r){switch(r.label){case 0:return e&&n?e===this.Glass.currentAppView?[3,2]:[4,this.Glass.currentAppView.deactivate()]:[3,3];case 1:return r.sent(),[2,this.showContentView(e,t,n)];case 2:return[2,this.showContentView(e,t,n)];case 3:throw new Error("Cached appview and/or its context can not be null.")}}))}))},t.prototype.showNonCachedPerspective=function(e,t,n){return c(this,void 0,void 0,(function(){var r,o;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),function(e){return e.isHomepage||e.content&&e.content.isHomepage}(t)?[3,2]:[4,this.Glass.getHomePageObject()];case 1:return r=i.sent(),!function(e,t,n){return t&&t.perspective===n&&e.content&&t.content&&e.content.pathRef===t.content.pathRef}(t,r,e)?t.isHomepage=!1:t.isHomepage=!0,[2,this.renderPerspective(e,t,n)];case 2:return t.isHomepage=!0,t.content&&delete t.content.isHomepage,[2,this.renderPerspective(e,t,n)];case 3:return o=i.sent(),this.handleShowNonCachedPerspectiveError(o,t),[3,4];case 4:return[2,null]}}))}))},t.prototype.showContentView=function(e,t,n){return c(this,void 0,void 0,(function(){return u(this,(function(r){switch(r.label){case 0:return this.Glass.previousAppView=this.Glass.currentAppView,this.Glass.currentAppView=e,this.glassStore.setCurrentPerspective(e.perspectiveModel.id),[4,e.showContentView(n)];case 1:return r.sent(),t&&(n.perspective=t),[2,e]}}))}))},t.prototype.showPerspective=function(e,t){return c(this,void 0,void 0,(function(){var n,r,o;return u(this,(function(i){switch(i.label){case 0:return n=this.perspectiveViewsCache.getCachedViewByPerspectiveNameAndContext(e,t),r=this.Glass.currentAppView,(0,y.arePerspectivesEqual)(n,r)?[2,n]:n?[4,this.showCachedPerspective(n,e,t)]:[3,2];case 1:return i.sent(),o=n.hasHomeFlag()||t&&t.isHomepage,this.setHomeFlag(n,o),[2,this.displayPerspective(n,r)];case 2:return[4,this.showNonCachedPerspective(e,t,r)];case 3:return[2,i.sent()]}}))}))},t.prototype.buildPerspectiveContext=function(e,t){return c(this,void 0,void 0,(function(){var n,r;return u(this,(function(o){switch(o.label){case 0:return n=this.buildNewPerspectiveContext(e,t),void 0!==e&&void 0===n.content.pathRef?[2,{context:n,perspectiveName:e}]:[4,this.getDefaultActionUrlMap(n.content)];case 1:return r=o.sent(),[2,{context:function(e,t,n){var r=t;return void 0===e&&(r.isDefaultAction=!0),r.isHomepage=t.isHomepage||n&&n.isHomepage,r.content=n,r}(e,n,r),perspectiveName:void 0===e?r.perspective:e}]}}))}))},t.prototype.buildNewPerspectiveContext=function(e,t){var n=t||{};return n.content=n.content||{},n.content.perspective=e,this.Glass.currentAppView&&this.Glass.currentAppView.context&&this.Glass.currentAppView.context.content&&(n=this.urlHelper.updateContextWithCurrentUIFilters(this.Glass.currentAppView.context.content,n)),n},t.prototype.getDefaultActionUrlMap=function(e){return c(this,void 0,void 0,(function(){var t,n,r,o,i;return u(this,(function(s){switch(s.label){case 0:return e&&(e.pathRef||e.objRef)?[4,this.urlHelper.getObjInfoFromContent(this.Glass,e)]:[3,3];case 1:return t=s.sent(),C.default.extend(!0,t,e),void 0===t.id&&(t.id=t.objRef),t.perspective?[2,t]:[4,b.default.getSharedResourceActionController(this.Glass,t.type)];case 2:return n=s.sent(),r={urlMap:t,mode:m.default.MODES.DEFAULT_ACTION,Glass:this.Glass,glassContext:this.Glass},[2,this.urlHelper.getUrlMap(n,this.Glass,r)];case 3:return e&&e.perspective?[3,5]:[4,this.Glass.getHomePageObject()];case 4:return o=s.sent(),i={perspective:o.perspective},C.default.extend(!0,i,e,o.content),i.pathRef?[2,this.getDefaultActionUrlMap(i)]:[2,i];case 5:return[2,null]}}))}))},t.prototype.handleOpenLoginViewError=function(){var e=w.default.get("customLoginPerspectiveNotFound"),t=w.default.get("defaultToIBMLoginPage");this.Glass.showErrorMessage(t,e,(function(){var e=window.location.href;e.includes("/",e.length-1)?window.location.href=e+"?factoryMode=true":window.location.href=e+"&factoryMode=true"}))},t.prototype.handleOpenPerspectiveError=function(e){return c(this,void 0,void 0,(function(){var t,n,r,o=this;return u(this,(function(i){switch(i.label){case 0:if(this.logger.error("openAppView",e),t=function(e){var t=!0===e?"errLoadingViewShowHome":"errLoadingView";o.Glass.showToast(w.default.get(t),{type:"error",preventDuplicates:!1})},n=function(){var e=w.default.get("errLoadingView"),t=w.default.get("errorLabel");return o.Glass.showErrorMessage(e,t),o.Glass.currentAppView},0!==this.perspectiveSwitcherRegistry.size())return[3,4];this.pendingOpenPerspectivePromise=null,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.openHomePerspective()];case 2:return r=i.sent(),t(!0),[2,r];case 3:return i.sent(),n(),[3,4];case 4:return t(),[2,null]}}))}))},t.prototype.handleShowNonCachedPerspectiveError=function(e,t){var n=e.message,r="Error";throw e.ajaxOptions&&e.ajaxOptions.url?(n="Glass Perspective Service : "+e.ajaxOptions.url,r=w.default.get("error404NotFound")):"BaseError"===e.name?r="Error: "+w.default.get("invalidPerspectiveErrorTitle"):404===e.code&&(r=w.default.get("perspective404ErrorTitle"),n=w.default.get("perspective404ErrorMessage"),t.isHomepage&&(n=w.default.get("perspective404HomeErrorMessage"))),this.logger.error("Perspective Error: Failed to load the requested perspective"),this.Glass.showErrorMessage(n,r),e},t.prototype.openPendingPerspective=function(){var e=this;try{return this.pendingOpenPerspectivePromise=Promise.resolve(this.pendingOpenPerspectivePromise).finally((function(){e.pendingOpenPerspectivePromise=null})),this.pendingOpenPerspectivePromise}catch(e){return this.logger.error("openAppView - previous attempt failed",e),Promise.resolve()}},t.prototype.removeLoginView=function(){this.perspectivesRegistry.remove("login"),this.loginView.getContentPane().remove(),this.loginView.remove(!0),this.loginView=void 0},t.prototype.updateUserProfileContext=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.Glass.getCoreSvc(".UserProfile").updateContext(e.context)];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.error("Perspective Error: Could not get the account info",t),this.Glass.showErrorMessage(w.default.get("unableGetAccountInfo"),w.default.get("accountInfoTitle")),[3,3];case 3:return[2]}}))}))},t}(p.default);t.default=_},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadStyles=t.disableStylesFromInactivePerspectives=void 0;var s=n(43),a=n(84),c=i(n(4));function u(e){return r(this,void 0,void 0,(function(){var t,n;return o(this,(function(r){switch(r.label){case 0:return t=function(e){return e.includes("?")&&(e=e.substring(0,e.indexOf("?"))),e}(e),(n=function(e){return document.querySelector('head style[styleid="'+e+'"], head link[styleid="'+e+'"]')}(t))?(n.setAttribute("media","all"),[3,3]):[3,1];case 1:return[4,(0,a.loadStylesheet)(c.default.ajax,e,[{name:"styleid",type:t},{name:"loader",type:"ba-glass"},{name:"type",type:"text/css"},{name:"media",type:"all"}])];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))}function l(e,t){for(var n=t.querySelectorAll('head link[rel="stylesheet"], head style[loader="ba-glass"]'),r=0;r<n.length;r+=1){var o=n[r],i=o.getAttribute("styleid");i&&!e.includes(i)&&o.setAttribute("media","none")}}t.disableStylesFromInactivePerspectives=l,t.loadStyles=function(e,t){return r(this,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return e?(n=(0,s.getUrlArgs)(t),r=e.map((function(e){return n&&(e+=n),u(e)})),[4,Promise.all(r)]):[3,2];case 1:return i=o.sent(),l(e,document),[2,i];case 2:return[2,[]]}}))}))}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadStylesheet=t.updateRelativeUrlsInCssFile=void 0;var i=["data:","//",'url("/',"url('/","url(/"],s=['url("./','url("',"url('./","url('","url(./","url("];function a(e,t){if(!t||!t.includes("/"))return e;try{var n=t.split("/");n.pop();var r=n.join("/"),o=e.match(/url\([^)]+\)/g);o&&o.length>0&&o.filter((function(e){for(var t=0;t<i.length;t+=1)if(e.includes(i[t]))return!1;return!0})).forEach((function(t){for(var n=0;n<s.length;n+=1){var o=s[n];if(t.includes(o)){var i=t.replace(o,""+o.replace("./","")+r+"/");e=e.replace(t,i);break}}}))}catch(e){console.error(e)}return e}t.updateRelativeUrlsInCssFile=a,t.loadStylesheet=function(e,t,n){return void 0===n&&(n=[]),r(this,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return r=new Promise((function(r,o){e(t).then((function(e){var o=a(e,t),i=document.createElement("style");i.innerHTML=o,n.forEach((function(e){return i.setAttribute(e.name,e.type)})),document.getElementsByTagName("head")[0].appendChild(i),r(i)})).catch(o)})),i=new Promise((function(e,t){setTimeout(t,12e4)})),[4,Promise.race([r,i])];case 1:return[2,o.sent()]}}))}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return c}));var r=n(7),o=n.n(r),i=n(30),s=n.n(i);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"loadSVGIcons",value:function(e){var t=this;e&&e.forEach((function(e){t.setSVGIcons(e)}))}},{key:"unloadSVGIcons",value:function(e){var t=this;e&&e.forEach((function(e){t.unsetSVGIcons(e)}))}},{key:"setSVGIcons",value:function(e){var t=this.getSVGId(e);document.getElementById(t)||this.loadSVGModule(e).then((function(e){var n=document.createElement("div");n.setAttribute("id",t),n.innerHTML=e;var r=document.getElementById("svgIcons");r||s()(),r.appendChild(n)})).catch((function(){throw new Error("failed to load svg icon: ".concat(e))}))}},{key:"unsetSVGIcons",value:function(e){var t=this.getSVGId(e),n=document.getElementById(t);n&&n.parentNode&&n.parentNode.removeChild(n)}},{key:"loadSVGModule",value:function(e){return o.a.loadModule("text!".concat(e,"!strip"))}},{key:"getSVGId",value:function(e){return e.replace(/[^\w]/g,"_")}}],(n=null)&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Immediate="immediate",e.Defer="defer",e.Declare="declare"}(r||(r={})),t.default=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(7));t.default=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return e?(t=e.map((function(e){return s.default.loadModule(e)})),[4,Promise.all(t)]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=s(n(1)),c=n(9),u=s(n(89)),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.getPerspectiveView=function(e){var t=this.props,n=t.glassStore,r=t.perspectiveRegistry.getPerspectiveById(e);return a.default.createElement(u.default,{key:e,perspectiveStore:r.getPerspectiveStore(),glassStore:n},r.getPerspectiveView())},t.prototype.render=function(){var e=this,t=this.props.glassStore;return a.default.createElement(a.default.Fragment,null,t.registeredPerspectives.map((function(t){return e.getPerspectiveView(t)})))},t=i([c.observer],t)}(a.default.Component);t.default=l},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=s(n(1)),c=n(9),u=s(n(2)),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.getClassNames=function(){var e=this.props,t=e.perspectiveStore,n=e.glassStore,r="appview";t.perspectiveModel.id!==n.currentPerspective&&(r+=" hidden");var o=t.perspectiveModel.layout;return o[u.default.LOOPS]&&o.class&&(r+=" "+o.class),r},t.prototype.render=function(){var e=this.props.children;return a.default.createElement("div",{className:this.getClassNames()},e)},t=i([c.observer],t)}(a.default.Component);t.default=l},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(91)),i=function(){function e(e,t){this.glassContext=t,this.perspectivesRegistry=e}return e.prototype.create=function(e){var t=this;e?(Array.isArray(e)||(e=[e]),e.forEach((function(e){t.perspectivesRegistry.add(e.id,new o.default(e,t.glassContext))}))):this.glassContext.getCoreSvc(".Logger").error("Error creating the perspective, perspectiveModels is undefined")},e}();t.default=i},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(1)),i=r(n(92)),s=r(n(101)),a=r(n(111)),c=r(n(48));var u=function(){function e(e,t){this.perspectiveStore=function(e){return s.default.create({perspectiveModel:e,contextMenuStore:c.default.create()})}(e),this.perspectiveController=function(e,t){return new i.default(e,t)}(this.perspectiveStore,t),this.perspectiveView=function(e,t,n){return o.default.createElement(a.default,{appView:e,glassContext:n,perspectiveStore:t,toolBars:t.perspectiveModel.toolBars,addPluginRenderToQueue:e.addPluginRenderToQueue,onPerspectiveViewMounted:e.renderAllPlugins,onContentContainerMounted:e.setContentContainerMounted,onNoContentViewFound:e.resolveViewRenderPromise,successContentViewRenderCallback:e.successContentViewRenderCallback,failureContentViewRenderCallback:e.failureContentViewRenderCallback,getContentView:e.getCurrentContentView})}(this.perspectiveController,this.perspectiveStore,t),this.registeredPlugins={}}return e.prototype.registerPlugin=function(e,t){this.registeredPlugins[e]=t},e.prototype.getRegisteredPlugin=function(e){return this.registeredPlugins[e]?this.registeredPlugins[e]:null},e.prototype.getPerspectiveController=function(){return this.perspectiveController},e.prototype.getPerspectiveStore=function(){return this.perspectiveStore},e.prototype.getPerspectiveView=function(){return this.perspectiveView},e}();t.default=u},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=u(n(4)),p=u(n(3)),f=s(n(10)),d=u(n(14)),h=u(n(39)),y=u(n(93)),v=u(n(94)),g=u(n(95)),b=u(n(46)),w=u(n(11)),m=u(n(19)),C=u(n(12)),_=u(n(96)),P=n(42),S=u(n(99)),O=u(n(47)),E=u(n(100)),x=n(44),j=function(){function e(e,t){var n=this;this.onContentViewReadyToLoad=function(){try{n.loadContentView()}catch(e){n.glassContext.getCoreSvc(".Logger").error("Error loading Content View",e)}},this.loadContentView=function(){var e=O.default.CONTENT_VIEW_LOAD_IN_PROGRESS;n.perspectiveStore.updateRenderState(e);var t=n._getContextForContentView();return(0,x.createContentView)(t,n.glassContext,n).then((function(e){return n.postContentViewCreation(t,e)})).catch((function(e){var t=O.default.CONTENT_VIEW_LOAD_FAILURE;n.perspectiveStore.updateRenderState(t),n.glassContext.getCoreSvc(".Logger").error("Failure showing the content view",e)}))},this.addPluginRenderToQueue=function(e){n.pluginsRenderQueue.push(e)},this.renderAllPlugins=function(){return Promise.all(n.pluginsRenderQueue).then((function(e){e.forEach((function(e){if(e&&e.pluginId){var t=e.pluginId,r=e.plugin;n.registerPlugin(t,r)}}));var t=O.default.PLUGINS_RENDER_SUCCESS;n.perspectiveStore.updateRenderState(t)}))},this.setContentContainerMounted=function(e){n.perspectiveStore.setContainerMounted(!0),n.setContentPane(e)},this.successContentViewRenderCallback=function(){var e=n.getCurrentContentView();e&&(p.default.isFunction(e.on)?(e.on("change:title",n._triggerTitleChange),e.on("change:dirty",n._triggerStateChange),e.on("change:state",n._triggerStateChange)):(e.triggerTitleChange=n._triggerTitleChange,e.triggerStateChange=n._triggerStateChange)),n._triggerTitleChange({value:n.getTitle()}),y.default.createPerformanceMark({component:"glass",name:"renderContentView",state:"end"}),n.perspectiveStore.updateRenderState(O.default.CONTENT_VIEW_RENDER_SUCCESS)},this.failureContentViewRenderCallback=function(e){n.glassContext.getCoreSvc(".Logger").error("ContentView Error","Failed loading content view",e),e&&e.message&&""!==e.message&&n.glassContext.showErrorMessage(e.message,"Error",null,null),n.perspectiveStore.updateRenderState(O.default.CONTENT_VIEW_RENDER_FAILURE)},this.resolveViewRenderPromise=function(){n.perspectiveStore.updateRenderState(O.default.CONTENT_VIEW_RENDER_SUCCESS)},this.setContextMenuItemsAndPosition=function(e,t){var r=n.perspectiveStore.contextMenuStore;r&&(r.updatePosition(t),r.updateItems(e),r.showMenu())},this._getContextForContentView=function(){var e=r({},n.perspectiveModel.spec)||{};e.content||(e.content=n.defaultContent);var t=e.content;return t&&!t.module&&(e.module=n.defaultContent.module),e},this._triggerStateChange=function(){n.updateRenderState(!0)},this._triggerTitleChange=function(e){n.glassContext.trigger("appView:titleChange",{value:e.value,appView:n})},this.getCurrentContentView=function(){return n.currentContentView},this.perspectiveStore=e,this.perspectiveModel=this.perspectiveStore.perspectiveModel,this.perspective=this.perspectiveModel.perspectiveName,this.glassContext=t,this.defaultContent=this.perspectiveModel.spec.content,this.pluginsRenderQueue=[],this.registeredPlugins={},this._slideoutController=new g.default({registry:{application:t.slideoutRegistry,appView:new b.default}}),this._url=new m.default,this.isHomepage=!1,f.when((function(){return n.perspectiveStore.viewReadyToLoadContentView}),this.onContentViewReadyToLoad)}return e.prototype.postContentViewCreation=function(e,t){var n=this;return this.prependContentView(t),this._updateSlideoutContainer().then((function(){n._setCurrentContentView(t,e),y.default.createPerformanceMark({component:"glass",name:"renderContentView",state:"start"});var r=O.default.CONTENT_VIEW_LOAD_SUCCESS;n.perspectiveStore.updateRenderState(r)}))},e.prototype.prependContentView=function(e){this.$contentViewDomContainer=this.getContentPane(),this.$contentViewDomContainer.prepend(e.$el)},e.prototype.showContextMenu=function(e){return a(this,void 0,void 0,(function(){var t;return c(this,(function(n){switch(n.label){case 0:return(t=this.perspectiveModel.contextMenuSettings)?[4,(0,_.default)(t,e,this.glassContext)]:[3,2];case 1:return[2,n.sent()];case 2:return[2,null]}}))}))},e.prototype.show=function(){(0,P.loadStylesAndIcons)(this.perspectiveModel,this.glassContext)},e.prototype.hide=function(){(0,P.unloadIcons)(this.perspectiveModel,this.glassContext)},e.prototype.deactivate=function(){var e=this;return this.glassContext.getCoreSvc(".Events").trigger("deactivate"),this.currentContentView&&this.currentContentView.deactivate&&!this.currentContentView.deactivated?Promise.resolve(this.currentContentView.deactivate()).then((function(){e.currentContentView.deactivated=!0})):Promise.resolve()},e.prototype.remove=function(e,t){var n=this;return!e&&this.shouldShowCloseConfirmationDialog()?h.default.waitForCloseConfirmation(this.glassContext,t).then((function(){return n._remove()})):this._remove()},e.prototype._remove=function(){var e=this;if(this.deactivate(),this===this.glassContext.currentAppView&&this.glassContext.perspectiveSwitcherRegistry.size()>1){var t=this.glassContext.perspectiveSwitcherRegistry.getPerspectiveByIndex(0),n=t.getContentPane();n&&t._slideoutController.updateRegistryContainer(n)}return Promise.resolve().then((function(){return e.currentContentView&&p.default.isFunction(e.currentContentView.remove)?(e.contentViewRemoved=!0,e.currentContentView.remove()):Promise.resolve()})).catch((function(t){e.glassContext.getCoreSvc(".Logger").error("An error occurred while removing the content view",t)})).then(this._postRemove.bind(this))},e.prototype._postRemove=function(){this.setContentPane(void 0)},e.prototype.isDirty=function(){return this.currentContentView&&p.default.isFunction(this.currentContentView.isDirty)&&this.currentContentView.isDirty()},e.prototype.shouldShowCloseConfirmationDialog=function(){return!!this.isDirty()&&(!this.currentContentView||!p.default.isFunction(this.currentContentView.shouldShowCloseConfirmationDialog)||this.currentContentView.shouldShowCloseConfirmationDialog())},e.prototype.getTitle=function(e){var t=this.currentContentView&&p.default.isFunction(this.currentContentView.getTitle)?this.currentContentView.getTitle():this.perspectiveModel.perspectiveName;return void 0===t&&(t=w.default.get("unavailable")),!e&&this.isDirty()&&(t+=" *"),t},e.prototype.getIcon=function(){return this.currentContentView&&p.default.isFunction(this.currentContentView.getIcon)&&this.currentContentView.getIcon()},e.prototype.getIconTooltip=function(){return this.currentContentView&&p.default.isFunction(this.currentContentView.getIconTooltip)&&this.currentContentView.getIconTooltip()},e.prototype.getIconColor=function(){var e="";try{e=this.currentContentView&&p.default.isFunction(this.currentContentView.getIconColor)&&this.currentContentView.getIconColor()}catch(e){this.glassContext.getCoreSvc(".Logger").warn("issue getting icon color from current content view",e)}return e||(e="#1d3458"),e},e.prototype.getContentPane=function(){return this.$contentPane},e.prototype.setContentPane=function(e){this.$contentPane=e},e.prototype._updateSlideoutContainer=function(){var e=this;return new Promise((function(t){var n=e.getContentPane();if(n)try{e._slideoutController.updateRegistryContainer(n),t()}catch(r){e.glassContext.getCoreSvc(".Logger").warn("Failed to update slideout container. Slideouts stuck open in previous view. Closing and trying again...",r),e.glassContext.closeOpenWidgets().then((function(){e._slideoutController.updateRegistryContainer(n),t()})).catch((function(){e._slideoutController.updateRegistryContainer(n),t()}))}else t()}))},e.prototype.showContentView=function(e){var t=this;return this._updateSlideoutContainer().then((function(){(e=e||{}).content||(e.content=t.defaultContent);var n=e.content;return n&&!n.module&&(n.module=t.defaultContent.module),t.currentContentView?t._setContentView(e):Promise.resolve()}))},e.prototype._setContentView=function(e){var t=this;return this.currentContentView.activate&&this.currentContentView.deactivated?this.currentContentView.activate(e.content).then((function(){return t._setContentViewHelper(e)})):Promise.resolve(this._setContentViewHelper(e))},e.prototype._setContentViewHelper=function(e){return this._setCurrentContentView(this.currentContentView,e),this.currentContentView},e.prototype.onViewRendered=function(){var e=this;return new Promise((function(t,n){f.when((function(){return e.perspectiveStore.contentViewRendered}),(function(){return t(e)})),f.when((function(){return e.perspectiveStore.contentViewRenderFailed}),(function(){return n()}))}))},e.prototype.registerPlugin=function(e,t){p.default.isString(e)&&(this.registeredPlugins[e]=t)},e.prototype.performAction=function(e,t){var n=this.perspectiveModel.actions;return n?Promise.resolve(S.default.performAction(e,t,n)):Promise.reject(new d.default("Internal error: unable to find action for "+e))},e.prototype.canExecuteAction=function(e,t){var n=this.perspectiveModel.actions;return n?S.default.canExecuteAction(e,t,n):Promise.reject(new d.default("Internal error: unable to find action for "+e))},e.prototype.openSlideout=function(e){return this.glassContext.addToOptions(e),this._openSlideout("appView",e)},e.prototype.closeAllOpenedSlideouts=function(e){return this._slideoutController.closeAllOpenedSlideouts(e)},e.prototype._openSlideout=function(e,t){return t.parent&&!Object.prototype.isPrototypeOf.call(v.default,t)?t.parent.addChild(t):this._slideoutController.openSlideout(e,t)},e.prototype._setCurrentContentView=function(e,t){this.context=t,this.content=t.content,this.currentContentView=e,this.updateRenderState(!1),this.currentContentView.deactivated=!1,e.show()},e.prototype.setAsHome=function(e){var t=this;return Promise.resolve().then((function(){var n=t.getType();return p.default.isUndefined(n)?t._setAsHome({perspective:t.perspectiveModel.perspectiveName,id:t.context&&t.context.id}):C.default.getSharedResourceActionController(t.glassContext,n).then((function(r){var o={urlMap:{objRef:t.content?t.content.objRef:void 0,type:n},mode:m.default.MODES.CURRENT};return t.content.mode&&(o.urlMap.mode=t.content.mode),p.default.extend(o,e),t._url.getUrlMap(r,t.glassContext,o).then(t._setAsHome.bind(t))}))}))},e.prototype.setHomeFlag=function(e){this.context.isHomepage=!0===e},e.prototype.hasHomeFlag=function(){return!0===this.context.isHomepage},e.prototype._setAsHome=function(e){var t=this._url.getContextFromUrlMap(e),n={homePage:JSON.stringify(t)};return this.glassContext.getCoreSvc(".UserProfile").savePreferences(n).then(this.setHomeFlag.bind(this,!0))},e.prototype.getType=function(){var e=this.currentContentView;return!p.default.isUndefined(e)&&p.default.isFunction(e.getType)?e.getType():E.default[this.perspective]},e.prototype.getContent=function(e){var t,n=this.currentContentView;return!p.default.isUndefined(n)&&p.default.isFunction(n.getContent)&&(t=n.getContent(e)),t},e.prototype._updateHistory=function(e,t,n,r){if(!this.context.content.options||!this.context.content.options.ignoreInWindowHistory){e.name=e.perspective;try{!0===r||this===this.glassContext.previousAppView?window.history.replaceState(e,t,n):window.history.pushState(e,t,n)}catch(e){}}},e.prototype.updateRenderState=function(e){var t=this._getContext(),n=this.getTitle();if(this.glassContext.trackHistory&&!this.glassContext.windowPoppingState&&"login"!==this.perspective&&t.content){var r=this._getContext({mode:"bookmark"}),o=p.default.omit(r,"content");Object.assign(o,this.content);var i=Object.assign(this._url.getPublicMap({urlMap:o}),r.content);delete i.module;var s=this._url.getUrl({urlMap:i},this.glassContext);this.glassContext.previousAppView&&"login"!==this.glassContext.previousAppView.perspective?this._updateHistory(t,n,s,e):this._updateHistory(t,n,s,!0)}this._triggerTitleChange({value:n})},e.prototype._getContext=function(e){var t={perspective:this.perspective},n=this.perspectiveModel.modelId;if(n&&(t.id=n),this.currentContentView){var r=this.getContent(e)||this.content;r&&(t.content=r)}return t},e.prototype.cleanupSlideoutController=function(){this._slideoutController.cleanupSlideoutRegistry()},e.prototype.getCurrentPerspective=function(){return this.perspective},e.prototype.setFocus=function(){!p.default.isUndefined(this.currentContentView)&&p.default.isFunction(this.currentContentView.setFocus)&&this.currentContentView.setFocus()},e.prototype.$=function(e){return(0,l.default)(".appview:not(.hidden)").find(e)},e}();t.default=j},function(e,t){e.exports=A},function(e,t){e.exports=I},function(e,t){e.exports=D},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContextMenuErrors=void 0;var s,a=i(n(97)),c=i(n(98)),u=i(n(3)),l=i(n(4));function p(e,t,n){return{msg:e,menuId:t,menuSpecs:n}}function f(e,t,n,i){return r(this,void 0,void 0,(function(){var r,a,c,u;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.render()];case 1:return r=o.sent(),a=(0,l.default)(r),(0,l.default)("body").append(a),function(e,t){var n=e.pageX,r=e.pageY,o=t.outerWidth()+3,i=t.outerHeight()+3,s=window.innerWidth,a=window.innerHeight;s-n<o?t.css("left",s-o):t.css("left",n),a-r<i?t.css("top",a-i):t.css("top",r)}(t,a),[3,3];case 2:throw c=o.sent(),(u=p(s.FAILURE_RENDERING_MENU,n,i)).causedBy=c,u;case 3:return[2]}}))}))}!function(e){e.INVALID_MENU_ID="Menu id is not a valid string",e.NOT_FOUND_MENU_ID="The menu was not found with the provided id",e.FAILURE_RENDERING_MENU="The menu failed to render"}(s=t.ContextMenuErrors||(t.ContextMenuErrors={})),t.default=function(e,t,n){return r(this,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return c.default.hideOpenMenus(),function(e,t){if(!e||!u.default.isString(e.menuId))throw p(s.INVALID_MENU_ID,e&&e.menuId,t);if(!u.default.isArray(t))throw p(s.NOT_FOUND_MENU_ID,e.menuId,t)}(t,e),r=function(e,t){var n=e.reduce((function(e,t){return t.id&&(e[t.id]=t),e}),{});if(!n[t])throw p(s.NOT_FOUND_MENU_ID,t,e);return n}(e,t.menuId),[4,f(new a.default({itemSpec:r[t.menuId],activeObject:t.activeObject,glassContext:n,options:t.options}),t.position,t.menuId,e)];case 1:return o.sent(),[2]}}))}))}},function(e,t){e.exports=L},function(e,t){e.exports=N},function(e,t,n){"use strict";n.r(t);var r=n(3),o=n.n(r),i=n(14),s=n.n(i),a=n(7),c=n.n(a),u={};function l(e,t){var n=e[t].controller;return u[n]?Promise.resolve(u[n]):function(e){return c.a.instantiate(e)}(n).then((function(e){return u[n]=e,e}))}function p(e,t,n,r,o){var i=n+1;return i>=e.length?"canExecute"!==o||!0!==r&&!1!==r?Promise.reject(r):Promise.resolve(r):d(e,t,i,o)}function f(e,t,n,r,i){return"defaultAction"===i?function(e,t,n,r){if(o.a.isFunction(e.doAction))return Promise.resolve(e.doAction(n)).catch((function(e){return p(t,n,r,e,"defaultAction")}));var i=new s.a("doAction is not defined on the controller");return p(t,n,r,i,"defaultAction")}(e,t,n,r):"canExecute"===i?Promise.resolve(!0):Promise.resolve()}function d(e,t,n,r){return l(e,n).then((function(i){var a;return o.a.isFunction(i.canExecute)?!0===i.canExecute(t)?f(i,e,t,n,r):("defaultAction"===r?a=new s.a("Action controller can not execute this object."):"canExecute"===r&&(a=!1),p(e,t,n,a,r)):f(i,e,t,n,r)})).catch((function(o){return p(e,t,n,o,r)}))}function h(e,t,n,r){var o=r.find((function(t){return t.id===e}));return o?function(e,t,n,r){return e&&e.length>0?d(e,t,0,r):Promise.reject(new s.a("Internal error: no controller defined for ".concat(n)))}(o.items,t,e,n):Promise.reject(new s.a("Internal error: unable to find action for ".concat(e)))}function y(e,t,n,r){return r?h(e,t,n,r):Promise.reject(new s.a("No action controllers defined."))}var v={performAction:function(e,t,n){return y(e,t,"defaultAction",n)},canExecuteAction:function(e,t,n){return y(e,t,"canExecute",n)}};t.default=v},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.dashboard="exploration",e.authoring="report",e.classicviewer="interactiveReport",e.datasets="dataSet2",e.modeller="module",e.savedoutput="output"}(r||(r={})),t.default=r},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(n(3)),s=r(n(47)),a=r(n(40)),c=r(n(48)),u=s.default.PLUGINS_RENDER_IN_PROGRESS,l=s.default.PLUGINS_RENDER_SUCCESS,p=s.default.CONTENT_VIEW_LOAD_SUCCESS,f=s.default.CONTENT_VIEW_LOAD_FAILURE,d=s.default.CONTENT_VIEW_RENDER_SUCCESS,h=s.default.CONTENT_VIEW_RENDER_FAILURE,y=o.types.model({containerMounted:o.types.optional(o.types.boolean,!1),perspectiveModel:a.default,renderState:o.types.optional(o.types.enumeration("RenderState",i.default.values(s.default)),u),visible:o.types.optional(o.types.boolean,!1),contextMenuStore:c.default}).views((function(e){return{get viewReadyToLoadContentView(){return e.renderState===l&&e.containerMounted},get contentViewLoadedSuccessfully(){return e.renderState===p||e.renderState===d},get contentViewLoadFailed(){return e.renderState===f},get contentViewRendered(){return e.renderState===d},get contentViewRenderFailed(){return e.renderState===h},get loaded(){return e.renderState===d||e.renderState===f||e.renderState===h}}})).actions((function(e){return{setVisibility:function(t){e.visible=t},updateRenderState:function(t){e.renderState=t},setContainerMounted:function(t){e.containerMounted=t}}}));t.default=y},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return d}));var r=n(1),o=n(0),i=n.n(o);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function p(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(i,e);var t,n,r,o=l(i);function i(){return a(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.htmlElement,n=e.containerRef;n&&t&&t.parentNode!==n&&n.appendChild(t)}},{key:"render",value:function(){return null}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(r.Component);d.propTypes={htmlElement:i.a.object.isRequired,containerRef:i.a.instanceOf(Element).isRequired}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=s(n(1)),c=n(8),u=n(9),l=s(n(3)),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.render=function(){var e=this.props,t=e.store,n=e.className,r=t.disabled,o=t.iconId,i=t.label,s=n+(r?" disabled":" enabled");return t.visible&&a.default.createElement("div",{className:s},o&&a.default.createElement(c.SVGIcon,{className:"svgIcon",iconId:o,size:"normal",verticalAlign:"middle"}),l.default.unescape(i))},t=i([u.observer],t)}(a.default.Component);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.perspectives={},this.glassStore=e}return e.prototype.add=function(e,t){this.perspectives[e]=t,this.glassStore.registerPerspective(e)},e.prototype.remove=function(e){this.glassStore.deregisterPerspective(e),delete this.perspectives[e]},e.prototype.getPerspectiveById=function(e){return this.perspectives[e]},e}();t.default=r},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};function s(e,t){var n=e;return t&&t.content&&t.content.id?n+="|"+t.content.id:t&&t.id&&(n+="|"+t.id),n}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var n=e.call(this,t)||this;return n.cache={},n}return o(t,e),Object.defineProperty(t.prototype,"perspectiveViewsCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),t.prototype.cacheView=function(e,t,n){if(this.Glass.cacheAppViews&&"login"!==e){var r=s(e,t);n.cacheKey=r,this.cache[r]=n}},t.prototype.clearCache=function(){this.cache={}},t.prototype.getCacheKeys=function(){return Object.keys(this.cache)},t.prototype.getCachedPerspectives=function(){return Object.values(this.cache)},t.prototype.getCachedView=function(e){return this.cache[e]},t.prototype.getCachedViewByPerspectiveNameAndContext=function(e,t){return this.cache[s(e,t)]},t.prototype.getDirtyCachedViews=function(){var e=this,t=[];return this.getCacheKeys().forEach((function(n){var r=e.getCachedView(n);r.shouldShowCloseConfirmationDialog()&&t.push(r)})),t},t.prototype.removeCachedView=function(e){this.getCachedView(e)&&delete this.cache[e]},t.prototype.updateCache=function(e){var t=s(e.perspective,e.context);if(e.context){var n=e.context.id,r=e.context?e.context.id:void 0,o=r||n,i=void 0,a=void 0,c={};e.contentViewRemoved||(i=e.getContent(e.context.content))&&(a=i.id?i.id:r,e.context.content=i,e.content=i,a!==o&&(e.id=a),delete this.cache[t],c={id:a},this.cacheView(e.perspective,c,e))}},t}(i(n(6)).default);t.default=a},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var n=e.call(this,t)||this;return n.registry=[],n}return o(t,e),t.prototype.addPerspective=function(e){e&&"login"!==e.perspective&&!this.registry.includes(e)&&this.registry.push(e)},t.prototype.clearAllPerspectiveHomeFlags=function(){this.registry.forEach((function(e){e.setHomeFlag(!1)}))},t.prototype.containsPerspective=function(e){return this.registry.includes(e)},t.prototype.getIndexOfPerspective=function(e){return this.registry.indexOf(e)},t.prototype.getPerspectiveByIndex=function(e){return this.registry[e]},t.prototype.removePerspectiveAtIndex=function(e){this.registry.splice(e,1)},t.prototype.removePerspective=function(e){var t=this.getIndexOfPerspective(e);-1===t?t=0:this.registry.splice(t,1)},t.prototype.size=function(){return this.registry.length},t}(i(n(6)).default);t.default=s},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=a(n(6)),u=a(n(45)),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.findCollection=function(e){return i(this,void 0,void 0,(function(){var t,n,r,o,i;return s(this,(function(s){switch(s.label){case 0:return this.Glass.currentAppView&&"login"!==this.Glass.currentAppView.perspective?(t=this.Glass.currentAppView.perspectiveModel.spec).collectionContainers&&(i=t.collectionContainers.find((function(t){return t.id===e})))?[2,i.items]:[3,4]:[3,1];case 1:return n=this.Glass.getCoreSvc(".Perspective"),"generic_iframe",[4,n.getModel("generic_iframe")];case 2:return r=s.sent(),[4,this.declarePerspectiveServices(r)];case 3:if(s.sent(),(o=r.collectionContainers)&&(i=o.find((function(t){return t.id===e}))))return[2,i.items];s.label=4;case 4:return[2,null]}}))}))},t.prototype.isCollectionContainerAvailable=function(e){if(this.Glass.currentAppView){var t=this.Glass.currentAppView.perspectiveModel.spec;if(t.collectionContainers)if(t.collectionContainers.find((function(t){return t.id===e})))return!0}return!1},t.prototype.findElement=function(e){if("string"==typeof e&&this.Glass.currentAppView){var t=document.querySelector(".appview.paneColumn:not(.hidden)");if(t)return t.querySelector("#"+e)}return null},t.prototype.findPlugin=function(e){return"string"==typeof e&&this.Glass.currentAppView?this.Glass.currentAppView.registeredPlugins[e]:null},t.prototype.declarePerspectiveServices=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:if(!e||!e.services)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(0,u.default)(this.Glass,e.services)];case 2:return n.sent(),[3,4];case 3:return t=n.sent(),this.logger.error("Failed to load perspective services",t),[3,4];case 4:return[2]}}))}))},t}(c.default);t.default=l},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=a(n(6)),u=a(n(46)),l=function(e){function t(t){var n=e.call(this,t)||this;return n.slideoutRegistry=new u.default,n}return o(t,e),t.prototype.showSlideOut=function(e){var t;return this.Glass.addToOptions(e),this.Glass.currentAppView&&(t=this.Glass.currentAppView._openSlideout("application",e)),t},t.prototype.hideSlideOut=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.Glass.currentAppView?[4,this.Glass.currentAppView.closeAllOpenedSlideouts(e)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,null]}}))}))},t}(c.default);t.default=l},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s,a=i(n(6)),c=i(n(12));!function(e){e.THEME_PATH="v1/plugins/themes/current/css/palette.css",e.BASE_URL="http://ibm.com/"}(s||(s={}));var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),Object.defineProperty(t.prototype,"defaultThemePath",{set:function(e){this.themePath=e},enumerable:!1,configurable:!0}),t.prototype.reloadTheme=function(){var e=(new Date).getTime();!function(e){var t=document.querySelector("head").getElementsByClassName("themeressource");Array.from(t).forEach((function(t){var n=new URL(t.href);n.searchParams.set("v",String(e)),t.href=n.href}))}(String(e)),this.reloadPalette(String(e))},t.prototype.reloadPalette=function(e){this.theme&&this.theme.remove();var t=document.createElement("link");t.type="text/css",t.rel="stylesheet";var n=new URL(this.themePath||s.THEME_PATH,s.BASE_URL);n.searchParams.set("v",String(e)),c.default.isFactoryMode()&&n.searchParams.set("factoryMode","true");var r=n.href.split(s.BASE_URL)[1];t.href=r,document.head.appendChild(t)},t}(a.default);t.default=u},function(e,t){e.exports=G},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(0),s=n.n(i),a=n(9),c=n(17),u=n.n(c),l=n(8),p=n(3),f=n.n(p),d=n(22),h=n.n(d);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=C(e);if(t){var o=C(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m(this,n)}}function m(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(s,e);var t,n,r,i=w(s);function s(){var e;v(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=i.call.apply(i,[this].concat(n))).wrappedRender=function(){var t=e.props.contentView,n=t.renderTimeout||20,r=new Promise((function(e,t){return setTimeout(t,1e3*n)})),i=t.render().then((function(e){if(e&&f.a.isElement(e)||o.a.isValidElement(e))return e;var n=t.el||t.$el&&t.$el[0];if(!n)throw new Error("contentview does not contain el property");if(!f.a.isElement(n))throw new Error("el property should be an html element");return n})).catch((function(e){return Promise.reject(e)}));return Promise.race([r,i])},e}return t=s,(n=[{key:"getContentViewContainer",value:function(){var e=this.props.containerRef;return e&&e.current?e.current:null}},{key:"render",value:function(){var e=this.props,t=e.contentView,n=e.failRenderCallback,r=e.postRenderCallback;return o.a.createElement(h.a,{render:t&&this.wrappedRender,failRenderCallback:n,postRenderCallback:r,containerRef:this.getContentViewContainer()})}}])&&g(t.prototype,n),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R(e);if(t){var o=R(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return j(this,n)}}function j(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}_.propTypes={contentView:s.a.object,failRenderCallback:s.a.func,postRenderCallback:s.a.func,containerRef:s.a.object};var k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}(s,e);var t,n,r,i=x(s);function s(){return S(this,s),i.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e,t=this.props,n=t.containerRef,r=t.successContentViewRenderCallback,i=t.failureContentViewRenderCallback,s=t.getContentView,a=t.perspectiveStore,c=a.contentViewLoadedSuccessfully?s():null;return o.a.createElement(o.a.Fragment,null,o.a.createElement(_,{contentView:c,containerRef:n,postRenderCallback:r,failRenderCallback:i}),!a.loaded&&(e=o.a.createElement("div",{className:"loadingIndicatorContainer"},o.a.createElement("div",{className:"loading_indicator"},o.a.createElement(l.ProgressIndicator,{size:"large"}))),u.a.createPortal(e,document.body)))}}])&&O(t.prototype,n),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.PureComponent);k.propTypes={containerRef:s.a.object,getContentView:s.a.func,successContentViewRenderCallback:s.a.func,failureContentViewRenderCallback:s.a.func,perspectiveStore:s.a.object};var V=Object(a.observer)(k),T=n(13),M=n(2),A=n(4),I=n.n(A),D=n(7),L=n.n(D),N=n(18),G=n.n(N),F=n(16),B=n(20),U=n(21),H=o.a.createContext();function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function K(e,t){return(K=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=J(e);if(t){var o=J(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(e,t){if(t&&("object"===q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function J(e){return(J=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $={Label:G.a,"glass/app/plugins/GlassPlugin":G.a,Button:F.a,SynchronousButton:B.a,"baglass/app/plugins-react/PersistentBannerController":U.a};var X=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K(e,t)}(s,e);var t,n,r,i=z(s);function s(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(n=i.call(this,e,t)).failRenderCallback=function(e){if(e){var t=n.props.itemSpec;n.context.glassContext.getCoreSvc(".Logger").error("Plugin Error","Failed to render plugin ".concat(t.id),e)}n.pluginRenderPromise.resolve()},n.postRenderCallback=function(){var e=n.props.itemSpec,t=n.state.plugin;if(f.a.isFunction(t.attachActionControllerCallbacks))try{t.attachActionControllerCallbacks()}catch(e){}var r={pluginId:e.id,plugin:t};n.pluginRenderPromise.resolve(r)},n.createPluginContainerRef=function(e){n.pluginContainer=e},(0,t.addPluginRenderToQueue)(new Promise((function(e,t){n.pluginRenderPromise={resolve:e,reject:t}}))),n}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this,t=this.props.itemSpec;this.createPluginPromise=this.instantiatePlugin(t).catch((function(n){e.context.glassContext.getCoreSvc(".Logger").error(n,"Failed to instantiate plugin, ".concat(t.id)),e.pluginRenderPromise.resolve(n)}))}},{key:"getPluginOptions",value:function(){var e=this.props,t=e.appView,n=e.itemSpec;return{glassContext:this.context.glassContext,$container:I()(this.pluginContainer),appView:t,itemSpec:n}}},{key:"getBuiltInPlugin",value:function(e){var t=this.getPluginOptions(),n=new(0,$[e])(t);return Promise.resolve(n)}},{key:"instantiatePlugin",value:function(e){var t=this;return this.createPluginInstance(e[this.keywords.type]).then((function(e){return f.a.isEmpty(e)||!e.render?Promise.reject(new Error("Invalid Plugin, may be missing render method")):f.a.isFunction(e.initialize)?e.initialize().then((function(){return e})):Promise.resolve(e)})).then((function(e){return t.setState({plugin:e}),Promise.resolve()}))}},{key:"createPluginInstance",value:function(e){return function(e){return void 0!==$[e]}(e)?this.getBuiltInPlugin(e):this.dynamicallyLoadPlugin(e)}},{key:"dynamicallyLoadPlugin",value:function(e){var t=this.getPluginOptions(),n=this.keywords.pluginID[e]||e;return L.a.instantiate(n,t)}},{key:"render",value:function(){var e=this.props.itemSpec,t=(this.state||{}).plugin;return o.a.createElement("div",{className:"pluginContainer",id:"".concat(e.id,"PluginContainer"),ref:this.createPluginContainerRef},o.a.createElement(h.a,{render:t&&t.render,renderScope:t,options:this.getPluginOptions(),postRenderCallback:this.postRenderCallback,failRenderCallback:this.failRenderCallback,containerRef:this.pluginContainer}))}}])&&W(t.prototype,n),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);X.contextType=H,X.prototype.keywords={type:"type",pluginID:{Menu:"baglass/app/plugins/GlassMenu"}},X.propTypes={appView:s.a.object,itemSpec:s.a.object},X.contextTypes={addPluginRenderToQueue:s.a.func,glassContext:s.a.object};var Y=n(12),Z=n.n(Y);function ee(e){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ne(e,t){return(ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function re(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=se(e);if(t){var o=se(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return oe(this,n)}}function oe(e,t){if(t&&("object"===ee(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ie(e)}function ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e){return(se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ne(e,t)}(s,e);var t,n,r,i=re(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=i.call(this,e)).createDOMReference=function(e){t.itemContainer=e},t.itemContainer=o.a.createRef(),Z.a.errorProtect(ie(t),["render"]),t}return t=s,(n=[{key:"render",value:function(){var e=this.props,t=e.position,n=e.id,r=e.plugins,i=e.appView;return o.a.createElement("div",{className:t,id:n,ref:this.createDOMReference},r&&r.map((function(e){return o.a.createElement(X,{key:f.a.uniqueId("GlassPluginContainer_"),itemSpec:e,appView:i})})))}}])&&te(t.prototype,n),r&&te(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);function ce(e){return(ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function le(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pe(e,t){return(pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=he(e);if(t){var o=he(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return de(this,n)}}function de(e,t){if(t&&("object"===ce(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ae.propTypes={appView:s.a.object,id:s.a.string,position:s.a.string,plugins:s.a.oneOfType([s.a.array,s.a.object])};var ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pe(e,t)}(s,e);var t,n,r,i=fe(s);function s(){return ue(this,s),i.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this.props,t=e.toolItemGroups,n=e.appView;return t.map((function(e){return o.a.createElement(ae,{key:f.a.uniqueId("ToolItemGroup_"),appView:n,plugins:e[M.default.TOOL_ITEMS],position:e.position,id:e.id})}))}}])&&le(t.prototype,n),r&&le(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);function ve(e){return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function we(e,t){return(we=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function me(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_e(e);if(t){var o=_e(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ce(this,n)}}function Ce(e,t){if(t&&("object"===ve(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _e(e){return(_e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ye.propTypes={toolItemGroups:s.a.array,appView:s.a.object};var Pe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&we(e,t)}(s,e);var t,n,r,i=me(s);function s(){return ge(this,s),i.apply(this,arguments)}return t=s,(n=[{key:"getPositionMap",value:function(){var e=this.props.toolBarSpec,t=T.default.generatePositionMap(e.toolItemGroups);return t[M.default.CENTER]||(t[M.default.CENTER]=[],t[M.default.CENTER].push({id:"".concat(e.attr.id,"_").concat(M.default.CENTER),position:M.default.CENTER})),t}},{key:"getToolPaneClassNames",value:function(){var e=this.props,t=e.toolBarSpec,n=e.placement,r=n.charAt(0).toUpperCase()+n.slice(1),o="toolpane toolpane".concat(r);return t.class?"".concat(t.class," ").concat(o):o}},{key:"render",value:function(){var e=this.props,t=e.toolBarSpec,n=e.appView,r=t.toolItemGroups?this.getPositionMap():null,i=[M.default.LEADING,M.default.CENTER,M.default.TRAILING];return o.a.createElement("div",{key:"toolPaneKey".concat(t.id),id:t.id,className:this.getToolPaneClassNames(),role:t.attr?t.attr.role:"","aria-label":t.attr?t.attr["aria-label"]:void 0},r&&i.map((function(e){return r[e]&&o.a.createElement(ye,{key:f.a.uniqueId("ToolItemGroupLayout_"),toolItemGroups:r[e],appView:n})})))}}])&&be(t.prototype,n),r&&be(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);function Se(e){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function je(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ke(e);if(t){var o=ke(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Re(this,n)}}function Re(e,t){if(t&&("object"===Se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ke(e){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Pe.propTypes={toolBarSpec:s.a.object,placement:s.a.string,appView:s.a.object};var Ve=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xe(e,t)}(s,e);var t,n,r,i=je(s);function s(){return Oe(this,s),i.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this.props,t=e.toolBars,n=e.placement,r=e.appView;return t?t.map((function(e){return o.a.createElement(Pe,{key:f.a.uniqueId("ToolBar_"),toolBarSpec:e,placement:n,appView:r})})):null}}])&&Ee(t.prototype,n),r&&Ee(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);function Te(e){return(Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function De(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var o=Ne(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Le(this,n)}}function Le(e,t){if(t&&("object"===Te(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ne(e){return(Ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Ve.propTypes={toolBars:s.a.array,placement:s.a.string,appView:s.a.object};var Ge=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ie(e,t)}(s,e);var t,n,r,i=De(s);function s(){return Me(this,s),i.apply(this,arguments)}return t=s,(n=[{key:"getClassNames",value:function(){var e=this.props.classNames;return e?"".concat("pane paneContent"," ").concat(e):"pane paneContent"}},{key:"render",value:function(){var e=this.props,t=e.containerRef,n=e.role,r=e.onScroll,i=e.children;return o.a.createElement("div",{key:f.a.uniqueId("paneContent_"),className:this.getClassNames(),ref:t,role:n,onScroll:r},i)}}])&&Ae(t.prototype,n),r&&Ae(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);function Fe(e){return(Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ue(e,t){return(Ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=We(e);if(t){var o=We(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qe(this,n)}}function qe(e,t){if(t&&("object"===Fe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function We(e){return(We=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Ge.propTypes={classNames:s.a.string,containerRef:s.a.object,role:s.a.string,onScroll:s.a.func,children:s.a.oneOfType([s.a.arrayOf(s.a.node),s.a.node])};var Ke=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ue(e,t)}(s,e);var t,n,r,i=He(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=i.call(this,e)).onContentScroll=function(){t.contentPaneContainerRef.current&&(t.contentPaneContainerRef.current.scrollLeft=0)},t.contentPaneContainerRef=o.a.createRef(),t}return t=s,(n=[{key:"componentDidMount",value:function(){(0,this.props.onContentContainerMounted)(I()(this.contentPaneContainerRef.current))}},{key:"render",value:function(){var e=this.props,t=e.classNames,n=e.children;return o.a.createElement(Ge,{classNames:t,role:"main",containerRef:this.contentPaneContainerRef,onScroll:this.onContentScroll},n&&o.a.cloneElement(n,{containerRef:this.contentPaneContainerRef}))}}])&&Be(t.prototype,n),r&&Be(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);function ze(e){return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Je(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $e(e,t){return($e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ze(e);if(t){var o=Ze(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ye(this,n)}}function Ye(e,t){if(t&&("object"===ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ze(e){return(Ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Ke.propTypes={classNames:s.a.string,children:s.a.element,onContentContainerMounted:s.a.func};var et=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$e(e,t)}(s,e);var t,n,r,i=Xe(s);function s(){return Qe(this,s),i.apply(this,arguments)}return t=s,(n=[{key:"getLayoutPaneContainerClassName",value:function(){var e=this.props.paneData;return e&&e[M.default.PANE]&&e[M.default.PANE].class?e[M.default.PANE].class:""}},{key:"getContentPaneContainerClassNames",value:function(){var e=this.getLayoutPaneContainerClassName(),t="contentViewPane";return e&&(t+=" ".concat(e)),t}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.paneData,r=e.appView,i=e.onContentContainerMounted,s=n&&T.default.isContentPane(n[M.default.PANE]);return o.a.createElement(o.a.Fragment,null,n&&n[M.default.LOOPS]&&n[M.default.LOOPS].map((function(e){return o.a.createElement(Ve,{key:f.a.uniqueId("ToolBarLayout_"),toolBars:n[e],placement:e,appView:r})})),s?o.a.createElement(Ke,{classNames:this.getContentPaneContainerClassNames(),onContentContainerMounted:i},t):o.a.createElement(Ge,{className:this.getLayoutPaneContainerClassName()},t))}}])&&Je(t.prototype,n),r&&Je(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);function tt(e){return(tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rt(e,t){return(rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=st(e);if(t){var o=st(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return it(this,n)}}function it(e,t){if(t&&("object"===tt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function st(e){return(st=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}et.propTypes={appView:s.a.object,children:s.a.oneOfType([s.a.arrayOf(s.a.node),s.a.node]),paneData:s.a.object,onContentContainerMounted:s.a.func},n.d(t,"default",(function(){return at}));var at=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rt(e,t)}(s,e);var t,n,r,i=ot(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=i.call(this,e)).hasContentView=!1,t}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.onNoContentViewFound,n=e.onPerspectiveViewMounted;this.hasContentView||t(),n()}},{key:"getViewContext",value:function(){var e=this.props;return{addPluginRenderToQueue:e.addPluginRenderToQueue,glassContext:e.glassContext}}},{key:"createContentPane",value:function(){var e=this.props,t=e.successContentViewRenderCallback,n=e.failureContentViewRenderCallback,r=e.perspectiveStore,i=e.getContentView;return o.a.createElement(V,{successContentViewRenderCallback:t,failureContentViewRenderCallback:n,perspectiveStore:r,getContentView:i})}},{key:"constructNextLayoutPane",value:function(e){var t=this.props,n=t.appView,r=t.onContentContainerMounted;return T.default.isContentPane(e)?(this.hasContentView=!0,this.createContentPane()):o.a.createElement(et,{appView:n,onContentContainerMounted:r,layoutsRenderPromise:this.layoutRenderComplete,paneData:e},this.constructNextLayoutPane(e[M.default.PANE]))}},{key:"render",value:function(){var e=this.props,t=e.toolBars,n=e.appView,r=e.onContentContainerMounted,i=T.default.convertToolBarsToLayoutObject(t),s=this.getViewContext();return o.a.createElement(H.Provider,{value:s},o.a.createElement(et,{appView:n,onContentContainerMounted:r,layoutsRenderPromise:this.layoutRenderComplete,paneData:i},this.constructNextLayoutPane(i[M.default.PANE])))}}])&&nt(t.prototype,n),r&&nt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.Component);at.propTypes={appView:s.a.object,glassContext:s.a.object,toolBars:s.a.array,perspectiveStore:s.a.object,addPluginRenderToQueue:s.a.func,onPerspectiveViewMounted:s.a.func,onContentContainerMounted:s.a.func,successContentViewRenderCallback:s.a.func,failureContentViewRenderCallback:s.a.func,getContentView:s.a.func,onNoContentViewFound:s.a.func}},function(e,t,n){"use strict";n.r(t);var r=n(32),o=n.n(r),i=n(49),s=n.n(i),a=n(29),c=n.n(a),u=n(15),l=n(18),p=n.n(l),f=n(16),d=n(20),h=n(21),y=n(27),v=n.n(y),g=n(26),b=n.n(g),w=n(28),m=n.n(w),C=n(23),_=n.n(C),P=n(25),S=n.n(P),O=n(50),E=n.n(O);n.d(t,"Glass",(function(){return o.a})),n.d(t,"AlertStore",(function(){return s.a})),n.d(t,"ToastStore",(function(){return c.a})),n.d(t,"GlassPluginController",(function(){return u.default})),n.d(t,"IconLabelPluginController",(function(){return p.a})),n.d(t,"ButtonPluginController",(function(){return f.a})),n.d(t,"SyncButtonPluginController",(function(){return d.a})),n.d(t,"PersistentBannerPluginController",(function(){return h.a})),n.d(t,"TaxonomyService",(function(){return v.a})),n.d(t,"URLEncoderService",(function(){return b.a})),n.d(t,"ToastService",(function(){return m.a})),n.d(t,"MessageDialogService",(function(){return _.a})),n.d(t,"PerspectiveLoader",(function(){return S.a})),n.d(t,"ExtendObject",(function(){return E.a}))}])}));
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/JQueryAria',['jquery'], function ($) {
- /**
- * Sets a JQuery object as a button with the necessary aria attributes
- * @param {Object} options - aria options
- * @param {Boolean} [options.haspopup] - corresponds to aria-haspopup
- * @param {String} [options.label] - text content of the button
- * @param {String} [options.title] - title attribute; label is used if undefined
- * @param {String} [options.id] - id of the element
- * @return {Jquery} The current Jquery object allowinf chaining the calls
- * @example
- * @example
- * //Sets a div as a button
- * var $element = $('<div>');
- * $element.ariaButton({label: 'some label'}).addClass('some class');
- */
- $.fn.ariaButton = function (options) {
- return this.each(function (index, element) {
- var $el = $(element);
- $el.attr('type', 'button');
- $el.attr('role', 'button');
- if (options) {
- if (options.haspopup === true) {
- $el.attr('aria-haspopup', 'true');
- }
- $el.text(options.label);
- $el.attr('title', options.title ? options.title : options.label);
- $el.attr('id', options.id);
- }
- });
- };
- });
- //# sourceMappingURL=JQueryAria.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/JQueryExt',['jquery', '../ui/KeyCodes', './EventHelper', './JQueryAria'], function ($, KeyCodes) {
- // Add a custom event that will handle both click and tap. This custom event will cancel the simulated clicks on mobile
- $.event.special.clicktap = {
- add: function add(obj) {
- var isHandled = false;
- $(this).on('click.clicktap_' + obj.guid, obj.selector, function (e) {
- if (isHandled) {
- if (obj.data && obj.data.allowPropagationDefaultAction) {
- return true;
- }
- // We already handled this click, so we don't call the handler.
- // We also stop the propagation so other handlers don't end up being triggered.
- e.stopPropagation();
- isHandled = false;
- return false;
- } else {
- return obj.handler.apply(this, arguments);
- }
- }).on('tap.clicktap_' + obj.guid, obj.selector, function (e) {
- e.pageX = e.gesture.center.pageX; // set pageX for 'tap' event
- e.pageY = e.gesture.center.pageY;
- isHandled = true;
- return obj.handler.apply(this, arguments);
- });
- },
- remove: function remove(obj) {
- $(this).off('.clicktap_' + obj.guid);
- }
- };
- /**
- * Add a custom event that handles click, tap and keypress of enter & space keys
- * Note on the implementation:
- * - cancels the simulated clicks on mobile
- * - key press is ignored when the element is a button because the browser automically triggers a click for those;
- * The event sequence is the following:
- * Without JAWS:
- * - for enter: keydown->click->keyup; in this case, the keyup event is attached to the current active element which can be
- * different from the initial one.
- * for example: Pressing a button in dialog which closes it and sets the focus on a div which has a button role.
- * - for space: keydown->keyup->click
- * With JAWS: the click event is triggered only for elements with a button role.
- * Corollary: only non-button elements have their handler attached to the keydown and keyup events
- * - on keydown, we flag the fact that the handler is to be invoked at keyup time; this is to handle the case where
- * click and keyup events are attached to different elements.
- * - limitation:
- * - handler defined for non-button parent & child elements: when the propagation is stopped in the child handler,
- * parent handler can be invoked on keyup only.
- */
- $.event.special.primaryaction = {
- add: function add(obj) {
- var isTapHandled = false;
- var ENTERKEY = KeyCodes.ENTER;
- var SPACEKEY = KeyCodes.SPACE;
- var isKeytoProcess = false;
- $(this).on('click.primaryaction_' + obj.guid, obj.selector, function (e) {
- isKeytoProcess = false;
- if (isTapHandled) {
- if (obj.data && obj.data.allowPropagationDefaultAction) {
- return true;
- }
- // We already handled this click, so we don't call the handler.
- // We also stop the propagation so other handlers don't end up being triggered.
- e.stopPropagation();
- isTapHandled = false;
- return false;
- } else {
- return obj.handler.apply(this, arguments);
- }
- }).on('tap.primaryaction_' + obj.guid, obj.selector, function (e) {
- isTapHandled = true;
- e.pageX = e.gesture.center.pageX;
- e.pageY = e.gesture.center.pageY;
- return obj.handler.apply(this, arguments);
- }).on('keydown.primaryaction_' + obj.guid, obj.selector, function (e) {
- var key = e.which || e.keyCode;
- isKeytoProcess = (key === ENTERKEY || key === SPACEKEY) && !$(e.target).is('button');
- }).on('keyup.primaryaction_' + obj.guid, obj.selector, function (e) {
- var key = e.which || e.keyCode;
- if ((key === ENTERKEY || key === SPACEKEY) && !$(e.target).is('button') && isKeytoProcess === true) {
- isKeytoProcess = false;
- return obj.handler.apply(this, arguments);
- } else {
- isKeytoProcess = false;
- }
- });
- },
- remove: function remove(obj) {
- $(this).off('.primaryaction_' + obj.guid);
- }
- };
- /**
- * Add a custom event that will handle both escape and ctrl+[
- * Note on the implementation:
- * - Handler is invoked on keyup event only.
- * - For escape, keyup invokes the handler regardless of any keys pressed after keydown
- * - For ctrl+[, keyup invokes the handler only if the ctrl+[ keydown event had occurred just before.
- * - iPad + AppleKeyboard + VoiceOver combination does not provide the expected keycodes on keyup.
- * - As a result, on keyup, we only check that ctrl is held, and that the ctrl+[ keydown had occurred just before.
- * - Corollary: If a key is pressed down before [, letting go of that key will invoke the handler.
- * - On keydown, we flag the fact that the handler is to be invoked at keyup time; this is ensure the event can only
- * happen once, and it allows us to check the keycodes in keydown, where they are available.
- */
- $.event.special.escapeaction = {
- add: function add(obj) {
- var ESCAPEKEY = KeyCodes.ESCAPE;
- var SQUARE_OPEN_BRACKET = KeyCodes.OPEN_BRACKET;
- var isCtrlBracketToProcess = false;
- $(this).on('keydown.escapeaction_' + obj.guid, obj.selector, function (e) {
- var key = e.which || e.keyCode;
- isCtrlBracketToProcess = key === SQUARE_OPEN_BRACKET && e.ctrlKey;
- }).on('keyup.escapeaction_' + obj.guid, obj.selector, function (e) {
- var key = e.which || e.keyCode;
- if (key === ESCAPEKEY) {
- isCtrlBracketToProcess = false;
- return obj.handler.apply(this, arguments);
- }
- if (e.ctrlKey && isCtrlBracketToProcess) {
- isCtrlBracketToProcess = false;
- return obj.handler.apply(this, arguments);
- }
- isCtrlBracketToProcess = false;
- });
- },
- remove: function remove(obj) {
- $(this).off('.escapeaction_' + obj.guid);
- }
- };
- /**
- * Add a custom event that handles "DELETE" and "CTRL+SECOND" key down & up events
- * Note on the implementation:
- * - Handler is invoked on keyup event only.
- * - For DELETE, keyup invokes the handler regardless of any keys pressed after keydown
- * - For CTRL+SECOND, keyup invokes the handler only if CTRL+SECOND keydown event had occurred just before.
- * This key combination workarounds the issue that on IPAD+Apple Wireless keyboard+VoiceOver, the DELETE key
- * event can not be captured
- */
- $.event.special.deleteaction = {
- add: function add(obj) {
- var isCtrlSecondEventKeyDowned = false;
- $(this).on('keydown.deleteaction_' + obj.guid, obj.selector, function (e) {
- var key = e.which || e.keyCode;
- isCtrlSecondEventKeyDowned = key === KeyCodes.SECOND && e.ctrlKey;
- }).on('keyup.deleteaction_' + obj.guid, obj.selector, function (e) {
- var key = e.which || e.keyCode;
- //invokes the handler as long as DELETE keycode is received in keyup event
- if (key === KeyCodes.DELETE) {
- isCtrlSecondEventKeyDowned = false;
- return obj.handler.apply(this, arguments);
- }
- //Otherwise, invokes the handler handler if CTRL+SECOND were flagged keydown-ed
- if (e.ctrlKey && isCtrlSecondEventKeyDowned) {
- isCtrlSecondEventKeyDowned = false;
- return obj.handler.apply(this, arguments);
- }
- isCtrlSecondEventKeyDowned = false;
- });
- },
- remove: function remove(obj) {
- $(this).off('.deleteaction_' + obj.guid);
- }
- };
- return $;
- });
- //# sourceMappingURL=JQueryExt.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2015, 2021
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/AppController',['../core-client/js/core-client/ui/core/Class', 'baglass/glass.webpack.bundle', '../core-client/js/core-client/utils/ClassFactory', '../core-client/js/core-client/utils/JQueryExt', 'jquery-ui'], function (Class, GlassWebpackBundle, ClassFactory) {
- var Glass = GlassWebpackBundle.Glass,
- ExtendObject = GlassWebpackBundle.ExtendObject;
- /**
- * @public
- */
- var AppController = Class.extend(
- /**
- * @lends AppController.prototype
- */
- {
- _ClassFactory: ClassFactory,
- /**
- * @classdesc Main class giving access to method managing the perspectives
- * @constructs
- * @public
- * @param {Object}
- * options - set of initial properties
- */
- init: function init(options) {
- AppController.inherited('init', this, arguments);
- ExtendObject(this, options);
- var config = {
- appController: this,
- trackHistory: options.trackHistory !== false && options.trackHistory !== 'false',
- cacheAppViews: options.cacheAppViews !== false && options.cacheAppViews !== 'false',
- installInfo: options.installInfo,
- versionInfo: options.versionInfo,
- authInfo: options.authInfo,
- requirejs: requirejs
- };
- this.Glass = new Glass(config, options);
- this.glassContext = this.Glass;
- this.Glass.initialize();
- this.Glass.getCoreSvc('.Logger').setLevelWarn();
- },
- /** MOVED TO GLASS */
- getCurrentContentView: function getCurrentContentView() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.getCurrentContentView is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.getCurrentContentView();
- },
- // Actions API
- canExecuteAction: function canExecuteAction(id, object) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.canExecuteAction is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.canExecuteAction(id, object);
- },
- performAction: function performAction(id, object) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.performAction is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.performAction(id, object);
- },
- // Accessibility API
- isHighContrastOn: function isHighContrastOn() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.isHighContrastOn is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.isApplicationStyledForHighContrast();
- },
- detectAccessibilityChange: function detectAccessibilityChange(accessibilityMode) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.detectAccessibilityChange is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.detectAccessibilityChange(accessibilityMode);
- },
- // Context Menu API
- showContextMenu: function showContextMenu(args) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.showContextMenu is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.showContextMenu(args);
- },
- // Dialog Toast API
- showErrorMessage: function showErrorMessage(error, title, callback, htmlContent) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.showErrorMessage is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.showErrorMessage(error, title, callback, htmlContent);
- },
- showMessage: function showMessage(msg, title, type, buttons, width, callback, htmlContent, className) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.showMessage is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.showMessage(msg, title, type, buttons, width, callback, htmlContent, className);
- },
- showEmbedDialog: function showEmbedDialog(model) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController. is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.showEmbedDialog(model);
- },
- showResetHomeDialog: function showResetHomeDialog(errMessage) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.showEmbedDialog is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.showResetHomeDialog(errMessage);
- },
- showShareDialog: function showShareDialog(model) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.showShareDialog is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.showShareDialog(model);
- },
- // Events API
- emit: function emit(eventName, event) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.emit is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.trigger(eventName, event);
- },
- on: function on(eventName, handler, context) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.on is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.on(eventName, handler, context);
- },
- off: function off(eventName, handler, context) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.off is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.off(eventName, handler, context);
- },
- trigger: function trigger(eventName, event) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.trigger is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.trigger(eventName, event);
- },
- // Home Page API
- setDefaultHomePerspective: function setDefaultHomePerspective(perspective) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.setDefaultHomePerspective is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.setDefaultHomePerspective(perspective);
- },
- resetHome: function resetHome(isCurrentViewBroken) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.resetHome is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.resetHome(isCurrentViewBroken);
- },
- // Perspective LifeCycle API
- closeAppView: function closeAppView(perspective, id, options) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.closeAppView is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.closeAppView(perspective, id, options);
- },
- close: function close(force, isBrowser) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.close is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.close(force, isBrowser);
- },
- getCurrentPerspective: function getCurrentPerspective() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.getCurrentPerspective is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.getCurrentPerspective();
- },
- isOpeningAView: function isOpeningAView() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.isOpeningAView is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.isOpeningAView();
- },
- isLoginViewShown: function isLoginViewShown() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.isLoginViewShown is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.isLoginViewShown();
- },
- openAppView: function openAppView(perspective, context) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.openAppView is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.openAppView(perspective, context);
- },
- openLoginView: function openLoginView(context) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.openLoginView is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.openLoginView(context);
- },
- openPreviousAppView: function openPreviousAppView() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.openPreviousAppView is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.openPreviousAppView();
- },
- // Search Perspective DOM API
- findCollection: function findCollection(id) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.findCollection is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.findCollection(id);
- },
- findElement: function findElement(id) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.findElement is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.findElement(id);
- },
- findPlugin: function findPlugin(id) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.findPlugin is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.findPlugin(id);
- },
- // Slideout API
- hideSlideOut: function hideSlideOut(excludeAppViewSlideouts) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.hideSlideOut is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.hideSlideOut(excludeAppViewSlideouts);
- },
- showSlideOut: function showSlideOut(options) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.showSlideOut is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.showSlideOut(options);
- },
- // Toast API
- showToast: function showToast(message, options) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.showToast is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.showToast(message, options);
- },
- // Theme API
- reloadTheme: function reloadTheme() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.reloadTheme is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.reloadTheme();
- },
- // URL API
- getUrl: function getUrl(context) {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.getUrl is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.getUrl(context);
- },
- // Other
- updateCurrentCachedAppView: function updateCurrentCachedAppView() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.updateCurrentCachedAppView is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.updateCurrentCachedAppView();
- },
- /** TO BE DEPRECATED */
- lockGlass: function lockGlass() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.lockGlass is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.lockGlass();
- },
- unlockGlass: function unlockGlass() {
- // this.Glass.getCoreSvc('.Logger').warn('Usage of glassContext.appController.unlockGlass is deprecated. Please update your usage according to the documentation here : https://pages.github.ibm.com/BusinessAnalytics/glass-documentation/docs/documentation/api/api_glass/');
- return this.Glass.unlockGlass();
- }
- });
- return AppController;
- });
- //# sourceMappingURL=AppController.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Titan
- *
- * Copyright IBM Corp. 2015, 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/Button',['./core/View', 'jquery', 'underscore', '../utils/Utils', '../utils/JQueryExt'], function (View, $, _, utils) {
- /**
- * This Class is the Glass provided button widget
- */
- var Button = View.extend({
- tagName: 'button',
- events: {
- 'primaryaction': '_onSelect'
- },
- /**
- *@constructs
- *@buttonSpec specification of the button
- */
- init: function init(args) {
- Button.inherited('init', this, args.buttonSpec);
- _.extend(this, args.buttonSpec);
- },
- /**
- * Render the plugin.
- * @override
- */
- render: function render() {
- this.$el.ariaButton(this);
- utils.addClass(this.$el, 'button');
- utils.addClass(this.$el, this['class']);
- utils.setIcon(this.$el, this.icon, this.title);
- this._initializePressState();
- return Promise.resolve(this.el);
- },
- /**
- * Sets a push button in the pressed state; Does nothing if this is regular button; i.e. not a push one
- * @public
- */
- setPressed: function setPressed() {
- this.$el.addClass('pushed');
- this.$el.attr('aria-pressed', 'true');
- this.$el.attr('aria-checked', 'true');
- },
- /**
- * Sets a push button in the unpressed state; Does nothing if this is regular button; i.e. not a push one
- * @public
- */
- setUnpressed: function setUnpressed() {
- this.$el.removeClass('pushed');
- this.$el.blur();
- this.$el.attr('aria-pressed', 'false');
- this.$el.attr('aria-checked', 'false');
- },
- /**
- * toggles the pressed state; Does nothing if this is regular button; i.e. not a push one
- * @public
- * @return {Boolean} the pressed state it is toggled into: true if pressed false otherwise
- */
- togglePressed: function togglePressed() {
- if (this.isPressed() === true) {
- this.setUnpressed();
- } else {
- this.setPressed();
- }
- return this.isPressed();
- },
- /**
- * sets the button as selected; selection is different from push, as it is exclusive, for now: you can have only one
- * selected button; set the selection state only if it is not a push button
- *
- */
- setSelected: function setSelected() {
- var $activeButton = $('.currentlySelected');
- if ($activeButton[0]) {
- $activeButton.removeClass('currentlySelected');
- }
- if (!this.push) {
- this.$el.addClass('currentlySelected');
- }
- },
- /**
- * Gets the states of a pushed button
- * @public
- * @return {Boolean} true if pressed; false otherwise
- */
- isPressed: function isPressed() {
- return this.$el.hasClass('pushed');
- },
- /**
- * Sets a button to the disabled state
- * @public
- */
- disable: function disable() {
- this.$el.addClass('disabled');
- this.$el.attr('aria-disabled', 'true');
- this.$el.attr('tabindex', '-1');
- },
- /**
- * Sets a button to the enabled state
- * @public
- */
- enable: function enable() {
- this.$el.removeClass('disabled');
- this.$el.attr('aria-disabled', 'false');
- this.$el.attr('tabindex', '0');
- },
- /**
- * Gets the enabled state of a button
- * @public
- * @return {Boolean} true if disabled; false otherwise
- */
- isEnabled: function isEnabled() {
- return !this.$el.hasClass('disabled');
- },
- /**
- * @private
- * callback attached to all the items
- * @param the corresponding event
- */
- _onSelect: function _onSelect(event) {
- if (this.isEnabled() === true) {
- if (this.push) {
- this.togglePressed();
- }
- if (_.isFunction(this.onSelect)) {
- this.onSelect(event);
- }
- }
- },
- _initializePressState: function _initializePressState() {
- if (this.push) {
- this.setUnpressed();
- }
- },
- remove: function remove() {
- Button.inherited('remove', this, arguments);
- }
- });
- return Button;
- });
- //# sourceMappingURL=Button.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2015, 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/Button',['./GlassPlugin', 'jquery', 'underscore', '../../core-client/js/core-client/ui/Button', '../../api/Context', '../AppEvents'], function (GlassPlugin, $, _, CommonButton, Context, AppEvents) {
- /**
- * This Class is the Glass provided button widget
- */
- var Button = GlassPlugin.extend(
- /**
- * @lends GlassButton.prototype
- */
- {
- /**
- * @classdesc Represent a button in the Nav/App bars
- * @constructs
- * @public
- * @param {Object} - itemSpec specification of the button
- */
- init: function init() {
- Button.inherited('init', this, arguments);
- },
- /**
- * Render the plugin.
- * @override
- */
- render: function render() {
- var buttonSpecArgs = this._updateButtonSpec();
- this._createCommonButton(buttonSpecArgs);
- this.registerOneTimeCallback(AppEvents.APPVIEW_LOADED);
- return this.button.render();
- },
- /**
- * create the callback the controller.onPress/execute method with the onSelect
- * @override
- */
- attachActionControllerCallbacks: function attachActionControllerCallbacks() {
- var context = this.glassContext.addToOptions({
- target: {
- plugin: this
- }
- });
- var logger = this.glassContext.getCoreSvc('.Logger');
- var thisPlugin = this;
- var baseButton = this.getBaseButton();
- baseButton.onSelect = function () {
- var _this = this;
- return thisPlugin.getController().then(function (controller) {
- _this.setSelected();
- if (_this.push) {
- context.pushState = _this.isPressed();
- }
- if (_.isFunction(controller.onPress)) {
- controller.onPress(context);
- } else if (_.isFunction(controller.execute)) {
- var apiContext = new Context(context.glassContext);
- var apiOptions = {
- options: context.target.plugin.itemSpec.options
- };
- controller.execute(apiContext, apiOptions);
- }
- }).catch(function (error) {
- logger.error('failed to retrieved the actionController or invoke its method', error);
- });
- };
- },
- /**
- * @override
- */
- changeLabel: function changeLabel(label) {
- if (_.isString(label)) {
- this.$el.contents().last()[0].nodeValue = label;
- }
- },
- /**
- * Set the state of the button as pressed
- * Do nothing if the base button is not defined
- * @public
- */
- setPressed: function setPressed() {
- if (this.getBaseButton()) {
- this.getBaseButton().setPressed();
- }
- },
- /**
- * Set the state of the button as unpressed
- * Do nothing if the base button is not defined
- * @public
- */
- setUnpressed: function setUnpressed() {
- if (this.getBaseButton()) {
- this.getBaseButton().setUnpressed();
- }
- },
- /**
- * getter
- * @return {Button} The ui_common button which is contained in this plugin
- */
- getBaseButton: function getBaseButton() {
- return this.button;
- },
- _updateButtonSpec: function _updateButtonSpec() {
- var buttonSpecArgs = {
- buttonSpec: {
- 'id': this.itemSpec.id,
- 'class': this.itemSpec['class'],
- 'label': this.itemSpec.label,
- 'title': this.itemSpec.title,
- 'icon': this.itemSpec.icon,
- 'push': this.itemSpec.push
- }
- };
- if (this.itemSpec.label) {
- if (buttonSpecArgs.buttonSpec['class']) {
- buttonSpecArgs.buttonSpec['class'] = buttonSpecArgs.buttonSpec['class'] + ' labelled';
- } else {
- buttonSpecArgs.buttonSpec['class'] = 'labelled';
- }
- }
- return buttonSpecArgs;
- },
- _createCommonButton: function _createCommonButton(buttonSpecArgs) {
- this.button = new CommonButton(buttonSpecArgs);
- this.$el = this.button.$el;
- }
- });
- return Button;
- });
- //# sourceMappingURL=Button.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * "Restricted Materials of IBM"
- *
- * 5746-SM2
- *
- * (C) Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/ButtonActionInterface',['../../core-client/js/core-client/ui/core/Class'], function (Class) {
- /**
- * This class lists all the methods corresponding to the actions supported by a button
- * It plays the role of an interface, consumer can extend it.
- *
- * @interface
- */
- var ButtonActionInterface = Class.extend({
- /**
- * method to be invoked on the press action
- * @param {Object} context - The context for this item
- * @param {Object} context.glassContext - The glass context.
- * @param {Object} context.target - containing info on the target; one is the plugin
- * @param {string} context.target.itemId - The id of the pressed item
- */
- onPress: function onPress(context) {
- console.info('I am pressed', context.target.itemId);
- },
- /**
- * method to be invoked when the button is rendered
- * @param {Object} context - The context for this item
- * @param {Object} context.glassContext - The glass context.
- * @param {Object} context.target - containing info on the target; one is the plugin
- * @param {string} context.target.itemId - The id of the rendered item
- */
- onRender: function
- /* context */
- onRender() {},
- /**
- * Method to be invoked when loading a coachmark.
- * Can be used to dynamically set the coachmark's title
- * or contents
- * @param {Object} context - The context for this coach mark
- * @param {Object} context.glassContext - The glass context.
- * @param {Object} context.target - The coachMark target for which we want the spec
- * @param {string} context.target.itemId - The id of the item for which we want the
- * coach mark spec
- * @param {Object} context.target.coachMark - The current spec of the coachMark, if any
- * @returns {Object} A coach mark specification, including title and contents.
- */
- getCoachMarkSpec: function
- /* context */
- getCoachMarkSpec() {}
- });
- return ButtonActionInterface;
- });
- //# sourceMappingURL=ButtonActionInterface.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2015, 2016
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('baglass/core-client/js/core-client/utils/StringMeasurementUtils',['jquery', 'underscore'], function ($, _) {
- 'use strict';
- var canvas = document.createElement('canvas');
- var context = canvas.getContext('2d');
- var charWidthCache = {};
- var StringMeasurementUtils = function StringMeasurementUtils() {};
- StringMeasurementUtils.prototype.getNodeFont = function ($node) {
- var font = $node.css(['font-variant', 'font-weight', 'font-size', 'font-family']);
- return _.values(font).join(' ');
- };
- StringMeasurementUtils.prototype.charWidth = function (char, font) {
- if (charWidthCache[font] === undefined) {
- charWidthCache[font] = {};
- }
- var res = charWidthCache[font][char];
- if (res === undefined) {
- context.font = font;
- // Repeat the character n times to increase the precision of measureText on IE which returns an integer
- var n = 10;
- var metrics = context.measureText(Array(n + 1).join(char));
- res = metrics.width / n;
- charWidthCache[font][char] = res;
- }
- return res;
- };
- StringMeasurementUtils.prototype.getTextWidth = function (text, font, force) {
- if (force) {
- context.font = font;
- return context.measureText(text).width;
- }
- var i = text.length;
- var strLen = 0;
- while (i--) {
- strLen += this.charWidth(text[i], font);
- }
- return strLen;
- };
- StringMeasurementUtils.prototype.charsInWidth = function (text, font, size, maxStrLength, forward) {
- var strLen = 0;
- for (var i = 0; i < maxStrLength; i++) {
- var char = text[forward ? i : text.length - 1 - i];
- var len;
- if (charWidthCache[font] !== undefined && (len = charWidthCache[font][char]) === undefined) {
- len = this.charWidth(char, font);
- }
- strLen += len;
- // In IE, the measured width precision is not 100% accurate, when we are 1px from the desired length, compute the real easurement
- if (strLen >= size - 1 && strLen < size) {
- var realText = forward ? text.substring(0, i + 1) : text.substring(text.length - i - 1);
- var realLen = this.getTextWidth(realText, font, true);
- if (realLen >= size) {
- return i;
- }
- }
- if (strLen >= size) {
- return i;
- }
- }
- return maxStrLength;
- };
- StringMeasurementUtils.prototype.isZoomTextOnly = function () {
- var pt = 14;
- var $div = $('<div>').css('font-size', pt);
- var zoomTextOnly = parseInt($div.css('font-size')) !== pt;
- $div.remove();
- return zoomTextOnly;
- };
- StringMeasurementUtils.prototype.getIntCSSProp = function ($node, prop) {
- return parseInt($node.css(prop));
- };
- StringMeasurementUtils.prototype.getLineCount = function ($node, isZoomTextOnly) {
- if (isZoomTextOnly === undefined) {
- isZoomTextOnly = this.isZoomTextOnly();
- }
- var lineCount = 1;
- var lineHeight = this.getIntCSSProp($node, 'line-height');
- var maxHeight = this.getIntCSSProp($node, 'max-height');
- if (lineHeight > 0 && maxHeight > 0 && $node.css('white-space') !== 'nowrap' && !isZoomTextOnly) {
- // If we set css line-height and white-space wrap and firefox zoom text only is zoom 100%
- lineCount = Math.max(1, parseInt(maxHeight / lineHeight));
- }
- return lineCount;
- };
- StringMeasurementUtils.prototype.getAvailableWidth = function ($node, lineCount) {
- if (lineCount === undefined) {
- lineCount = this.getLineCount($node);
- }
- var nodeRect = $node[0].getBoundingClientRect();
- var $nodePadding = $node.outerWidth() - $node.width();
- var availableWidth = (Math.floor(nodeRect.width) - $nodePadding) * lineCount;
- // Removes the width of the children nodes such as the icon in the switcher
- availableWidth -= $node.children().length ? $node.children().width() : 0;
- return availableWidth;
- };
- StringMeasurementUtils.prototype.getStringWidth = function ($node, lineCount, availableWidth) {
- var isZoomTextOnly = this.isZoomTextOnly();
- if (availableWidth === undefined) {
- availableWidth = this.getAvailableWidth($node);
- }
- if (lineCount === undefined) {
- lineCount = this.getLineCount($node, isZoomTextOnly);
- }
- var stringWidth;
- var maxHeight = this.getIntCSSProp($node, 'max-height');
- if (lineCount > 1 || $node.is('INPUT') || isZoomTextOnly && maxHeight > 0) {
- var value = $node.val() || $node.text();
- var font = this.getNodeFont($node);
- stringWidth = this.getTextWidth(value, font, true);
- } else {
- stringWidth = availableWidth + $node[0].scrollWidth - $node[0].offsetWidth;
- }
- return stringWidth;
- };
- return new StringMeasurementUtils();
- });
- //# sourceMappingURL=StringMeasurementUtils.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2015, 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('baglass/core-client/js/core-client/utils/ContentFormatter',['jquery', 'underscore', './StringMeasurementUtils'], function ($, _, StringMeasurement) {
- 'use strict';
- var ELLIPSIS_STR = '…';
- var NBSP = '\xA0';
- var ZWSP = '\u200B';
- function getFirstTextNode(nodeWithText) {
- return _.find(nodeWithText.childNodes, function (node) {
- return node.nodeType === Node.TEXT_NODE && node.nodeValue.length > 0;
- });
- }
- var ContentFormatter = function ContentFormatter() {};
- function stringFittingInWidth(stringValue, font, size, maxStrLength, forward) {
- if (stringValue.length === 0) {
- return '';
- }
- var len = StringMeasurement.charsInWidth(stringValue, font, Math.floor(size), maxStrLength, forward);
- if (forward) {
- return stringValue.substring(0, len).trim();
- } else {
- // Remove truncated words after the ellipsis
- var cutFrom = stringValue.length - len;
- var previousChars = stringValue.substring(cutFrom - 1, cutFrom + 1);
- if (previousChars.indexOf(' ') === -1) {
- // There are no spaces at the beginning, we must be truncating a word.
- var nextWord = stringValue.indexOf(' ', cutFrom);
- if (nextWord !== -1) {
- cutFrom = nextWord;
- }
- }
- return stringValue.substring(cutFrom).trim();
- }
- }
- ContentFormatter.prototype.updateEllipsesBasedOnWidth = function (nodeWithText, lengthAvailable, stringWidth, lineCount) {
- var overflowHeight = lineCount > 1 && nodeWithText.scrollHeight - 2 - nodeWithText.offsetHeight > 0;
- var $nodeWithText = $(nodeWithText);
- var newValue = null;
- var textNode;
- var isInput = $nodeWithText.is('INPUT');
- var initialStringValue;
- if (isInput) {
- textNode = null;
- initialStringValue = $nodeWithText.val();
- } else {
- textNode = getFirstTextNode(nodeWithText);
- initialStringValue = textNode ? textNode.nodeValue : '';
- }
- // Checking for ELLIPSIS_STR prevent multiple string shortening to introduce ... in the title
- if (initialStringValue.indexOf(ELLIPSIS_STR) === -1) {
- // If we're dealing with an input, then the full text should be displayed when it gets focus. No need to
- // add an aria-label since it will cause issues with reading the controls label
- if (!isInput) {
- $nodeWithText.attr('aria-label', initialStringValue);
- }
- $nodeWithText.attr('title', initialStringValue);
- }
- // Add a zero width space between words as in MultiPage will have an invisible space between the i and the P.
- var stringValue = initialStringValue.replace(/([a-z])([a-z])([A-Z])([a-z])/g, '$1' + '$2' + ZWSP + '$3' + '$4').trim();
- if (lengthAvailable > 0 && (lengthAvailable < stringWidth - 1 || overflowHeight)) {
- var font = StringMeasurement.getNodeFont($nodeWithText);
- var spaceWidth = StringMeasurement.getTextWidth(NBSP, font);
- var ellipsisWidth = StringMeasurement.getTextWidth(ELLIPSIS_STR, font);
- if (lengthAvailable > ellipsisWidth) {
- var textSpaceAvailable = lengthAvailable / 2;
- var leftText, rightText;
- if (lineCount > 1) {
- // When multiple lines, the first line contains half of the text and the ellipsis
- // The second line contains the truncated second half starting on a word boundary
- leftText = stringFittingInWidth(stringValue, font, textSpaceAvailable - ellipsisWidth - spaceWidth, stringValue.length, true);
- rightText = stringFittingInWidth(stringValue, font, textSpaceAvailable - spaceWidth, stringValue.length - leftText.length, false);
- } else {
- // When single line, compute the space of the second half in order to start on a word boundary
- // The first half might have a longer content to fit the space left
- rightText = stringFittingInWidth(stringValue, font, textSpaceAvailable - spaceWidth, stringValue.length, false);
- var rightTextWidth = StringMeasurement.getTextWidth(rightText, font);
- leftText = stringFittingInWidth(stringValue, font, lengthAvailable - rightTextWidth - ellipsisWidth - spaceWidth * 2, stringValue.length - rightText.length, true);
- }
- if (leftText.length + rightText.length < stringValue.length) {
- // Use a non-breakable space to keep the ... next to the previous letter
- if (leftText.length > 0) {
- leftText += NBSP;
- }
- if (rightText.length > 0) {
- rightText = (lineCount > 1 ? ZWSP : NBSP) + rightText;
- }
- newValue = leftText + ELLIPSIS_STR + rightText;
- } else if (leftText.length > 0 && rightText.length > 0) {
- // Add a zero width space in the center of a word to fit it on the first line
- newValue = leftText + ZWSP + rightText;
- } else {
- newValue = leftText + rightText;
- }
- } else {
- newValue = '';
- }
- } else {
- // Sets the newValue to stringValue in order to keep the ZWSP
- if (stringValue !== initialStringValue) {
- newValue = stringValue;
- }
- }
- if (newValue !== null) {
- if (isInput) {
- $nodeWithText.val(newValue);
- } else if (textNode) {
- textNode.nodeValue = newValue;
- }
- }
- };
- ContentFormatter.prototype.middleShortenString = function (node) {
- var $node = $(node);
- var lineCount = StringMeasurement.getLineCount($node);
- var availableWidth = StringMeasurement.getAvailableWidth($node, lineCount);
- var stringWidth = StringMeasurement.getStringWidth($node, lineCount, availableWidth);
- this.updateEllipsesBasedOnWidth($node[0], availableWidth, stringWidth, lineCount);
- };
- ContentFormatter.prototype.resizeInput = function (node) {
- var $node = $(node);
- if ($node.is('INPUT')) {
- var availableWidth = StringMeasurement.getAvailableWidth($node) + 1;
- var stringWidth = StringMeasurement.getStringWidth($node);
- // Set the width of the input to the smallest needed. Needed so that the
- // edit pencil shows up beside the input field.
- if (stringWidth < availableWidth) {
- $node.css('width', stringWidth + 10 + 'px');
- } else {
- $node.css('width', availableWidth + 10 + 'px');
- }
- }
- };
- return new ContentFormatter();
- });
- //# sourceMappingURL=ContentFormatter.js.map
- ;
- /* Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI
- *
- * Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/DropDownMenu',['./core/View', 'jquery', 'underscore', './Button', './Menu', '../utils/ContentFormatter', '../utils/BidiUtil', 'bootstrap'], function (View, $, _, Button, Menu, ContentFormatter, BidiUtil) {
- /**
- * This Class is the Glass provided DropDownMenu widget
- */
- var DropDownMenu = View.extend({
- /**
- *@constructs
- *@DropDownMenuSpec specification of the DropDownMenu
- */
- init: function init(args) {
- DropDownMenu.inherited('init', this, args.dropDownMenuSpec);
- _.extend(this, args.dropDownMenuSpec);
- },
- /**
- * Render the plugin.
- * @override
- */
- render: function render() {
- var className = 'menu ';
- if (this['class']) {
- className += this['class'];
- }
- var spec = {
- 'id': this.id,
- 'title': BidiUtil.enforceTextDirection(this.title),
- 'label': BidiUtil.enforceTextDirection(this.label),
- 'class': className,
- 'icon': this.icon,
- 'haspopup': true
- };
- var button = this._createMenuButton(spec);
- button.onSelect = this._onMenuSelect.bind(this);
- return button.render().then(function (el) {
- this.$el = button.$el;
- this._setTitle();
- this.menuButton = button;
- this.menuButtonDom = el;
- return el;
- }.bind(this));
- },
- /**
- * getter
- * @return {Button} the button which shows the menu when is primaryactioned; undefined if the dropdown menu is not rendered
- */
- getButton: function getButton() {
- return this.menuButton;
- },
- setMenuItems: function setMenuItems(shownItems, showPopover, event) {
- this.items = shownItems;
- if (showPopover) {
- return this._onMenuSelect(event);
- } else {
- return Promise.resolve();
- }
- },
- _setTitle: function _setTitle() {
- if (this.$el && this.$el.length) {
- if (this.title) {
- $(this.$el).attr('title', this.title);
- } else if (this.label) {
- $(this.$el).attr('title', this.label);
- }
- }
- },
- _onMenuSelect: function _onMenuSelect() {
- Menu.hideOpenMenus();
- if (!this.$ddPopover) {
- var $activeButton = $('.currentlySelected');
- if ($activeButton[0]) {
- $activeButton.removeClass('currentlySelected');
- }
- this.$el.addClass('currentlySelected');
- this.contentMenu = this._createMenu(this.items);
- return this.contentMenu.render().then(function (menuDomEl) {
- this.contentMenu.whenReadyToClose = this._closePopover.bind(this);
- var menuClass = 'popover glass-menu ';
- if (this['class']) {
- menuClass += this['class'];
- }
- var popoverOptions = {
- placement: this.ddMenuPlacement,
- trigger: 'manual',
- container: 'body',
- content: function content() {
- return $(menuDomEl);
- },
- template: '<div class="' + menuClass + '" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>',
- html: true
- };
- this._showPopover(popoverOptions);
- }.bind(this));
- } else {
- return Promise.resolve();
- }
- },
- _createMenuButton: function _createMenuButton(spec) {
- return new Button({
- buttonSpec: spec
- });
- },
- _createMenu: function _createMenu(itemsList) {
- return new Menu({
- spec: {
- items: itemsList
- }
- });
- },
- _showPopover: function _showPopover(options) {
- // Bootstrap empties the title when opening the pop-up, setting data-selector to true prevent bootstrap from updating the title.
- // See: http://stackoverflow.com/questions/27235776/can-i-still-use-the-title-attribute-on-bootstrap-popovers
- this.$el.attr('data-selector', 'true');
- this.$ddPopover = this.$el.popover(options);
- this.$ddPopover.popover('show');
- this.popupId = this.$ddPopover.attr('aria-describedby');
- this._updatePopupover();
- },
- _updatePopupover: function _updatePopupover() {
- var $popupEl = $('#' + this.popupId);
- var popupItems = $popupEl.find('.commonMenuItem');
- _.each(popupItems, function (item) {
- var $anchorEl = $(item).find('a');
- var $iconEl = $anchorEl.find('svg');
- var $spanEl = $(item).find('span');
- var aWidth = $anchorEl.width();
- var spanPadding = $spanEl.innerWidth() - $spanEl.width();
- var maxSpanWidth = aWidth - $iconEl.outerWidth(true) - spanPadding;
- if ($spanEl.length) {
- ContentFormatter.updateEllipsesBasedOnWidth($spanEl[0], maxSpanWidth, $spanEl.width());
- }
- }, this);
- },
- /**
- * @private
- * closes the popover
- */
- _closePopover: function _closePopover() {
- return new Promise(function (resolve, reject) {
- if (this.$ddPopover) {
- this.$ddPopover.on('hidden.bs.popover', function () {
- this._removePopover();
- resolve();
- }.bind(this));
- // Hack-fix for bootstrap popover not dispatching 'hidden.bs.popover' event
- setTimeout(function () {
- this._removePopover();
- resolve();
- }.bind(this), 250);
- this.$el.removeClass('currentlySelected');
- this.$el.blur();
- this.$ddPopover.popover('hide');
- } else {
- reject(new Error('Failed to close popover'));
- }
- }.bind(this));
- },
- _removePopover: function _removePopover() {
- if (this.$ddPopover) {
- this.$ddPopover.off('hidden.bs.popover');
- this.$ddPopover.popover('destroy');
- this.$ddPopover = null;
- $('#' + this.popupId).remove();
- }
- },
- remove: function remove() {
- this._removePopover();
- DropDownMenu.inherited('remove', this, arguments);
- },
- closeDropDownMenu: function closeDropDownMenu(event) {
- if (this.contentMenu) {
- var contentMenu = this.contentMenu;
- this.contentMenu = null;
- return contentMenu.closeMenu(event, false);
- } else {
- return this._closePopover(event);
- }
- }
- });
- return DropDownMenu;
- });
- //# sourceMappingURL=DropDownMenu.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Titan
- *
- * Copyright IBM Corp. 2015, 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/GlassMenu',['./GlassPlugin', 'jquery', 'underscore', '../../core-client/js/core-client/utils/ClassFactory', './MenuActionControllerDispatcher', '../../core-client/js/core-client/ui/DropDownMenu', '../../core-client/js/core-client/ui/Button', '../AppEvents'], function (GlassPlugin, $, _, ClassFactory, ControllerDispatcher, DropDownMenu, Button, AppEvents) {
- /**
- * This Class is the Glass provided Menu widget
- */
- var GlassMenu = GlassPlugin.extend(
- /**
- * @lends GlassMenu.prototype
- */
- {
- _ClassFactory: ClassFactory,
- /**
- * @classdesc class representing a menu
- * @augments GlassPlugin
- * @constructs
- * @public
- * @param {Object} options - set of initial properties
- *
- * */
- init: function init(options) {
- $.extend(true, this, options);
- var spec = this.itemSpec;
- if (spec.labelOnly === undefined) {
- if (!spec.icon) {
- spec.labelOnly = 'true';
- } else if (spec.label) {
- spec.labelOnly = 'false';
- }
- }
- GlassMenu.inherited('init', this, [spec]);
- },
- /**
- * @override
- */
- changeLabel: function changeLabel(label) {
- if (_.isString(label)) {
- this.$el.contents().last()[0].nodeValue = label;
- }
- },
- /**
- * Gets the button element of the menu.
- * @public
- * @example
- * //Used in the item controller to pass the launch point when opening a slideout
- * var options = itemSpec.options;
- * options.launchPoint = context.target.plugin.getButtonElement();
- * context.glassContext.showSlideOut(options);
- *
- * @return {JqueryObject} the button element when it is defined
- */
- getButtonElement: function getButtonElement() {
- return this.activeObject;
- },
- /**
- * getter
- * @public
- * @return {DropDownMenu} the dropdown menu object; undefined if not rendered.
- */
- getDropdownMenu: function getDropdownMenu() {
- return this.ddMenu;
- },
- /**
- * getter
- * @public
- * @return {Button} the default action button; undefined if not rendered or there is no default action
- */
- getDefaultActionButton: function getDefaultActionButton() {
- return this.defaultButton;
- },
- /**
- * Setting the action controller is necessary at this stage, as the action attribute needs to be set for each item
- * @override
- */
- render: function render() {
- this.registerOneTimeCallback(AppEvents.APPVIEW_LOADED);
- this._createMenu();
- return this.ddMenu.render().then(function (menu) {
- this.$el = $(menu);
- this.activeObject = this.ddMenu.$el;
- if (this.defaultButton) {
- this.$el = $('<div id = "' + this.id + '" >');
- return this.defaultButton.render().then(function
- /* el */
- () {
- this.$el.append(this.defaultButton.$el);
- this.$el.append(this.ddMenu.menuButton.$el);
- this.$el.addClass('inlineFlex');
- return this.$el[0];
- }.bind(this));
- } else {
- return this.$el[0];
- }
- }.bind(this));
- },
- /**
- * create the callback the controller.onPress/execute method with the onSelect
- * @override
- */
- attachActionControllerCallbacks: function attachActionControllerCallbacks() {
- this.ddMenu.menuButton.onSelect = this._handleMenuClick.bind(this);
- if (this.defaultButton) {
- this.defaultButton.onSelect = this._handleDefaultAction.bind(this);
- }
- },
- /**
- * get the controller dispatcher
- */
- getController: function getController() {
- var aModulePromises = [];
- var aFeatures = [];
- var oControllerMap = {};
- if (!this._loadingController) {
- this._loadingController = new Promise(function (resolve) {
- _.each(this.itemSpec.actionControllers, function (module, key) {
- aModulePromises.push(this._loadController(module, key));
- aFeatures.push(key);
- }.bind(this));
- resolve(Promise.all(aModulePromises).then(function (controllers) {
- _.each(controllers, function (item, index) {
- oControllerMap[aFeatures[index]] = item;
- });
- this._controller = this._createControllerDispatcher(oControllerMap);
- return this._controller;
- }.bind(this)));
- }.bind(this));
- }
- return this._loadingController;
- },
- _loadController: function _loadController(module, key) {
- return this._ClassFactory.instantiate(module).then(function (controller) {
- if (_.isFunction(controller.initialize)) {
- var oEventContext = {
- glassContext: this.glassContext,
- target: {
- plugin: this,
- itemId: this.itemSpec.id
- },
- controllerConfig: this.itemSpec.controllerConfig && this.itemSpec.controllerConfig[key]
- };
- return Promise.resolve(controller.initialize.apply(controller, [oEventContext])).then(function () {
- return controller;
- });
- } else {
- return controller;
- }
- }.bind(this));
- },
- /**
- * Creates the menu and the default action menu if required
- */
- _createMenu: function _createMenu() {
- var menuButtonSpec;
- var defaultActionItem = this._findDefaultActionItem();
- if (defaultActionItem) {
- var defaultButtonSpec;
- menuButtonSpec = {
- dropDownMenuSpec: {
- 'id': this.id + '.menu',
- 'title': this.title,
- 'icon': 'common-dropdown',
- 'class': 'button menu comboBox',
- 'ddMenuPlacement': this.ddMenuPlacement,
- 'items': []
- }
- };
- var title = _.isUndefined(defaultActionItem.title) ? defaultActionItem.label : defaultActionItem.title;
- defaultButtonSpec = {
- 'id': this.id + '.default',
- 'title': title,
- 'icon': this.icon,
- 'class': this['class'] + ' menu defaultButton',
- 'item': defaultActionItem
- };
- this.defaultButton = new Button({
- buttonSpec: defaultButtonSpec
- });
- } else {
- if (this.label) {
- if (_.isUndefined(this['class'])) {
- this['class'] = 'dropDownImage';
- } else {
- this['class'] += ' dropDownImage';
- }
- }
- menuButtonSpec = {
- dropDownMenuSpec: {
- 'id': this.id,
- 'label': this.label,
- 'title': this.title,
- 'icon': this.icon,
- 'class': this['class'],
- 'ddMenuPlacement': this.ddMenuPlacement,
- 'items': []
- }
- };
- }
- this.ddMenu = this._createDropDownMenu(menuButtonSpec);
- },
- _handleMenuClick: function _handleMenuClick(event) {
- var logger = this.glassContext.getCoreSvc('.Logger');
- return this._updateMenuItemsList().then(function (shownItems) {
- this.ddMenu.setMenuItems(shownItems, true, event);
- }.bind(this)).catch(function (error) {
- logger.error('failure in the onSelect callback', error);
- });
- },
- /**
- * Creates the controller dispatcher providing the controller Map
- * @private
- * @param controllerMap
- * @return Instance of the controller Dispatcher
- */
- _createControllerDispatcher: function _createControllerDispatcher(controllerMap) {
- return new ControllerDispatcher(controllerMap);
- },
- _createDropDownMenu: function _createDropDownMenu(menuSpec) {
- return new DropDownMenu(menuSpec);
- },
- _handleDefaultAction: function
- /* event */
- _handleDefaultAction() {
- var _this = this;
- var logger = this.glassContext.getCoreSvc('.Logger');
- return this.getController().then(function (controller) {
- var featureController = controller.getControllerMap()[_this.defaultButton.item.featureId];
- var context = {
- glassContext: _this.glassContext,
- target: {
- plugin: _this,
- itemId: _this.defaultButton.item.id,
- specItemIndex: _this.defaultButton.item.index,
- index: 0
- }
- };
- if (featureController && _.isFunction(featureController.onSelectItem)) {
- featureController.onSelectItem.call(featureController, context);
- }
- }).catch(function (error) {
- logger.error('failed to call the default action', error);
- });
- },
- _findDefaultActionItem: function _findDefaultActionItem() {
- var defaultActionItem;
- var itemIndex;
- if (_.isString(this.defaultAction)) {
- defaultActionItem = _.find(this.itemSpec.items, function (item, index) {
- itemIndex = index;
- return item.id === this.defaultAction;
- }.bind(this));
- }
- if (defaultActionItem) {
- defaultActionItem.index = itemIndex;
- }
- return defaultActionItem;
- },
- _updateMenuItemsList: function _updateMenuItemsList() {
- var _this2 = this;
- var oEventContext = {
- glassContext: this.glassContext,
- target: {
- plugin: this,
- itemId: this.itemSpec.id
- }
- };
- return this.getController().then(function (controller) {
- return controller.onOpen(oEventContext).then(function () {
- var shownItems = [];
- controller.buildItemMap(this.itemSpec.items);
- var idx = 0;
- _.each(this.itemSpec.items, function (item, index) {
- var oEventContext = {
- glassContext: this.glassContext,
- target: {
- plugin: this,
- itemId: item.id,
- specItemIndex: index
- }
- };
- var isVisible = controller.isItemVisible(oEventContext);
- if (isVisible) {
- oEventContext.target.index = idx++;
- var uiItem = {};
- $.extend(true, uiItem, item);
- uiItem.name = item.id;
- uiItem.onSelect = function ($menuItem) {
- oEventContext.target.activeObject = $menuItem;
- controller.onSelectItem.call(controller, oEventContext);
- }.bind(this);
- uiItem.onRemove = function ($menuItem) {
- oEventContext.target.activeObject = $menuItem;
- return controller.onRemoveItem.call(controller, oEventContext);
- }.bind(this);
- uiItem.onRender = function ($menuItem) {
- oEventContext.target.activeObject = $menuItem;
- controller.onRenderItem.call(controller, oEventContext);
- }.bind(this);
- var customLabel = controller.getLabel(oEventContext);
- if (!_.isUndefined(customLabel)) {
- uiItem.label = customLabel;
- }
- var isSelected = controller.isItemSelected(oEventContext);
- if (isSelected) {
- uiItem.selected = true;
- }
- shownItems.push(uiItem);
- }
- }, this);
- return shownItems;
- }.bind(_this2));
- });
- },
- closeGlassMenu: function closeGlassMenu() {
- return new Promise(function (resolve, reject) {
- this.ddMenu.closeDropDownMenu({}).then(resolve, reject);
- }.bind(this));
- }
- });
- GlassMenu.errors = {
- FAILURE_CREATING_CONTROLLER: 'Failure creating one of the menu controllers'
- };
- return GlassMenu;
- });
- //# sourceMappingURL=GlassMenu.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/SynchronousButton',['underscore', './Button', '../../api/Context'], function (_, Button, Context) {
- /**
- * A special type of button that calls its controller synchronously on click.
- * This is required for native/browser functions that are not permitted to be
- * executed from an asynchronous callback.
- *
- * Example: Requesting HTML5/FullScreen
- *
- */
- var SynchronousButton = Button.extend({
- initialize: function initialize() {
- return this.getController();
- },
- getControllerSync: function getControllerSync() {
- if (!this._controller) {
- throw new Error('Controller has not been registered');
- } else {
- return this._controller;
- }
- },
- /**
- * create the callback the controller.onPress/execute method with the onSelect
- * @override
- */
- attachActionControllerCallbacks: function attachActionControllerCallbacks() {
- var context = this.glassContext.addToOptions({
- target: {
- plugin: this
- }
- });
- var logger = this.glassContext.getCoreSvc('.Logger');
- var thisPlugin = this;
- var baseButton = this.getBaseButton();
- baseButton.onSelect = function () {
- try {
- var result;
- var controller = thisPlugin.getControllerSync();
- this.setSelected();
- if (this.push) {
- context.pushState = this.isPressed();
- }
- if (_.isFunction(controller.onPress)) {
- result = controller.onPress(context);
- } else if (_.isFunction(controller.execute)) {
- var apiContext = new Context(context.glassContext);
- var apiOptions = {
- options: context.target.plugin.itemSpec.options
- };
- result = controller.execute(apiContext, apiOptions);
- }
- return Promise.resolve(result).catch(function (err) {
- logger.error(err);
- });
- } catch (err) {
- logger.error(err);
- return Promise.resolve();
- }
- };
- }
- });
- return SynchronousButton;
- });
- //# sourceMappingURL=SynchronousButton.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/plugins/all',['./Button', './ButtonActionInterface', './GlassMenu', './SynchronousButton'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/dialogs/BaseDialog',['../AccessibleView', 'jquery', 'underscore', '../../nls/StringResources', '../Button', '../../utils/Utils'], function (AccessibleView, $, _, stringResources, Button, Utils) {
- 'use strict';
- var BaseDialog = AccessibleView.extend({
- _buttons: ['ok', 'cancel'],
- _showCloseX: true,
- _width: null,
- init: function init(options) {
- this._dialogId = _.uniqueId('modalDialog_');
- this._queryId = '#' + this._dialogId;
- this._footerButtons = [];
- /**
- * Flag to indicate whether to render the header in the dialog.
- * The header will be rendered by default if options.showHeader is undefined.
- */
- this._showHeader = true;
- // set dialog options
- this.setDialogOptions(options);
- this.enableTabLooping = true;
- //force a default id if none was set
- if (!this.id) {
- this.id = 'com-ibm-ca-dialogDefaultId';
- }
- BaseDialog.inherited('init', this, arguments);
- },
- setDialogOptions: function setDialogOptions(options) {
- // process options
- if (options) {
- // set width as necessary
- if (options.width) {
- this._width = options.width;
- }
- // set closeX button option
- if (options.showCloseX === false) {
- this._showCloseX = options.showCloseX;
- }
- // Check for buttons passed in and override defaults.
- if (options.buttons) {
- this._buttons = options.buttons;
- }
- this.titleAriaLabel = options.titleAriaLabel;
- this._showHeader = options.showHeader === undefined ? true : options.showHeader;
- }
- },
- destroy: function destroy() {
- $(this._queryId).remove();
- $('body').removeClass('openedDialog');
- },
- remove: function remove() {
- this.destroy();
- },
- hide: function hide() {
- this._setFocusToLaunchPoint();
- $(this._queryId).removeClass('show');
- this.destroy();
- },
- open: function open() {
- this.showBlocker();
- this.show();
- },
- showBlocker: function showBlocker() {
- var nBlocker = $(this._queryId);
- if (!nBlocker.length) {
- nBlocker = $('<div>', {
- 'id': this._dialogId,
- 'class': 'dialogBlocker show'
- });
- if (this.blockerClass) {
- nBlocker.addClass(this.blockerClass);
- }
- if (this.className) {
- nBlocker.addClass(this.className);
- }
- // set the blocker height (works with scrollbars)
- nBlocker.height($(document).height());
- var nBlockerCell = $('<div>', {
- 'id': this._dialogId + 'Container',
- 'class': 'dialogBlockerCell'
- });
- $('body').append(nBlocker.append(nBlockerCell.text(stringResources.get('loading'))));
- nBlocker.on('keydown', this.onKey.bind(this));
- }
- this._container().parent().on('primaryaction', null, { allowPropagationDefaultAction: true }, function (event) {
- Utils.setEventProperty(event, Utils.EVENT_DIALOG, true);
- });
- },
- show: function show() {
- var nContainer = this._container();
- // set width as necessary
- if (this._width) {
- nContainer.css('max-width', this._width);
- }
- // build dialog as necessary
- if (nContainer.length) {
- nContainer.empty();
- // assemble dialog
- var $contentDiv = $('<div>', {
- 'class': 'modalDialog',
- 'role': 'dialog',
- 'aria-labelledby': this.getId(),
- 'aria-describedby': this.getContentId()
- });
- if (this._showHeader === true) {
- var header;
- header = $('<div>', { 'class': 'dialogHeader' });
- var title = this.renderTitle($('<header>', {
- 'class': 'dialogTitle',
- 'aria-label': this.titleAriaLabel || this.title,
- 'role': 'banner',
- 'id': this.getId()
- }));
- var closeX = this.renderCloseX();
- // pop the title and closeX into the header
- header.append(title, closeX);
- $contentDiv.append(header);
- }
- var content = this.renderContent($('<div>', {
- 'class': 'dialogContent',
- 'id': this.getContentId()
- }));
- var footer = this.renderFooter($('<footer>'));
- $contentDiv.append(content, footer);
- nContainer.append($contentDiv);
- this.enableLooping($contentDiv);
- this.setFocus();
- $('body').addClass('openedDialog');
- }
- },
- /**
- * @public
- * Returns the contentId attribute. The contentId is placed on the dialog content and aria-describedby on the dialog.
- */
- getContentId: function getContentId() {
- return this.contentId;
- },
- /**
- * @public
- * Returns the id attribute. The id is placed on the dialog title and aria-labelledby on the dialog.
- */
- getId: function getId() {
- return this.id;
- },
- /**
- * @public
- * Sets the focus on a dialog element. The default is set to
- */
- setFocus: function setFocus() {
- var footer = this._container().find('footer');
- var firstBtn = footer.find('.dialogButton')[0];
- if (firstBtn) {
- firstBtn.focus();
- }
- },
- renderContent: function renderContent(n) {
- n.text('Dialog Content');
- return n;
- },
- renderTitle: function renderTitle(n) {
- n.text('Dialog Title');
- return n;
- },
- /**
- * This function adds a CSS class that will cause the dialog to be centered vertically.
- * This could potentially be affected by additional styles in extended dialog classes.
- **/
- verticalAlignDialog: function verticalAlignDialog() {
- this._container().addClass('dialogVerticalAlign');
- },
- renderCloseX: function renderCloseX() {
- // only render if required
- if (!this._showCloseX) {
- return null;
- }
- // create button
- var closeX = $('<div>', {
- 'class': 'dialogCloseX',
- 'title': stringResources.get('close'),
- 'aria-label': stringResources.get('close'),
- 'role': 'button',
- 'tabIndex': '0'
- });
- Utils.setIcon(closeX, 'dismiss_16');
- closeX.on('primaryaction', this.cancel.bind(this));
- return closeX;
- },
- findFooterButton: function findFooterButton(buttonId) {
- var button = _.find(this._footerButtons, function (button) {
- return button.id === buttonId;
- });
- return button;
- },
- renderFooter: function renderFooter(n) {
- var footerContainer = $('<div>', { 'class': 'footerContainer' });
- // loop though button collection and process
- for (var i = 0, iLen = this._buttons.length; i < iLen; i++) {
- var btnSpec = this._getButtonDef(this._buttons[i]);
- var button = new Button({
- buttonSpec: {
- 'class': 'dialogButton ' + btnSpec.type,
- 'label': btnSpec.text,
- 'onSelect': btnSpec.handler.bind(this),
- 'id': btnSpec.defaultId
- }
- });
- if (typeof btnSpec.style === 'string' && btnSpec.style !== '') {
- button.$el[0].style.cssText = btnSpec.style;
- }
- this._footerButtons.push(button);
- button.render();
- footerContainer.append(button.$el);
- }
- n.append(footerContainer);
- return n;
- },
- /**
- * This function takes a given button id or partial definition and updates it to return a complete definition.
- *
- * A button can be an id such as: "ok", "cancel", or "close" OR
- * a button can be an object containing one or more of the following options:
- * {
- * text: String label to display
- * handler: Callback function
- * defaultId: If specified this will use the spec specified by the id (i.e. "ok") for missing info
- * type: "primary" or "secondary" will set the class and visuals accordingly. "destructive"
- * is not currently supportted but might be in the future
- * }
- *
- * @param button Button id or partial spec object
- * @returns Object Complete button spec.
- **/
- _getButtonDef: function _getButtonDef(button) {
- // define the default button spec
- var buttonsDef = {
- 'ok': { 'text': stringResources.get('ok'), 'handler': this.ok, 'type': 'primary', defaultId: 'ok' },
- 'cancel': { 'text': stringResources.get('cancel'), 'handler': this.cancel, 'type': 'secondary', defaultId: 'cancel' },
- 'close': { 'text': stringResources.get('close'), 'handler': this.cancel, 'type': 'primary', defaultId: 'close' }
- };
- // if object is passed then fill in missing otherwise lookup and return
- if ((typeof button === 'undefined' ? 'undefined' : _typeof(button)) === 'object') {
- // check for defaultId
- if (button.defaultId) {
- // default text if necessary
- if (!button.text) {
- button.text = buttonsDef[button.defaultId].text;
- }
- // default handler if necesssary
- if (!button.handler) {
- button.handler = buttonsDef[button.defaultId].handler;
- }
- // default type if necesssary
- if (!button.type) {
- button.type = buttonsDef[button.defaultId].type;
- }
- }
- // return
- return button;
- }
- return buttonsDef[button];
- },
- onKey: function onKey(evt) {
- var keyCode = evt.keyCode;
- if (keyCode === 27) {
- this.cancel();
- return false;
- }
- return true;
- },
- ok: function ok() {
- this.hide();
- },
- cancel: function cancel() {
- this.hide();
- },
- /**
- *
- */
- enableOk: function enableOk(bEnabled) {
- var btn = $('.dialogButton', this._container()).eq(0);
- btn.toggleClass('disabled', bEnabled === false); // if bEnabled is undefined, it means true.
- if (bEnabled === false) {
- btn.attr('disabled', 'disabled');
- } else {
- btn.removeAttr('disabled');
- }
- },
- disableOk: function disableOk() {
- this.enableOk(false);
- },
- _container: function _container() {
- return $(this._queryId + 'Container');
- }
- });
- return BaseDialog;
- });
- //# sourceMappingURL=BaseDialog.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/dialogs/GenericViewDialog',['./BaseDialog', 'underscore'], function (BaseDialog, _) {
- var Dialog = null;
- Dialog = BaseDialog.extend({
- _buttons: ['ok', 'cancel'],
- _okCallback: null,
- _cancelCallback: null,
- init: function init(options) {
- this.id = options.id || this.id;
- this.title = options.title;
- this.view = new options.viewClass(options.viewOptions);
- this._okCallback = options.okCallback;
- this._cancelCallback = options.cancelCallback;
- Dialog.inherited('init', this, arguments);
- },
- destroy: function destroy() {
- if (this.view) {
- this.view.remove();
- }
- Dialog.inherited('destroy', this, arguments);
- },
- renderContent: function renderContent(n) {
- var result = this.view.render();
- if (_.isFunction(this.view.setFocus)) {
- this.setFocus = function () {
- if (result && result.done) {
- result.done(function () {
- this.view.setFocus();
- }.bind(this));
- } else {
- this.view.setFocus();
- }
- }.bind(this, result);
- }
- n.append(this.view.$el);
- return n;
- },
- renderTitle: function renderTitle(n) {
- n.text(this.title);
- return n;
- },
- ok: function ok() {
- Dialog.inherited('ok', this, arguments);
- if (this._okCallback) {
- return this._okCallback();
- }
- },
- cancel: function cancel(event) {
- if (event && event.gesture) {
- event.gesture.preventDefault();
- }
- Dialog.inherited('cancel', this, arguments);
- if (this._cancelCallback) {
- return this._cancelCallback();
- }
- },
- open: function open() {
- Dialog.inherited('open', this, arguments);
- if (this.view.onOpen) {
- this.view.onOpen();
- }
- },
- /**
- * Call the view onHide after hide baseclass.
- */
- hide: function hide() {
- Dialog.inherited('hide', this, arguments);
- if (_.isFunction(this.view.onHide)) {
- this.view.onHide();
- }
- }
- });
- return Dialog;
- });
- //# sourceMappingURL=GenericViewDialog.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI UI Commons
- *
- * Copyright IBM Corp. 2016, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/views/PreviewView',['../../core-client/js/core-client/ui/View', 'jquery'], function (BaseView, $) {
- /**
- * Preview view. This class renders a preview of a perspective in an iFrame.
- *
- * @param {Object} options
- * @param {Object} options.glassContext - Glass context object
- * @param {Object} options.urlMap - A map of key/value pairs to be converted into a queryString. See: Url.getUrl
- * }
- */
- var PreviewView = BaseView.extend({
- events: {},
- init: function init(options) {
- PreviewView.inherited('init', this, arguments);
- $.extend(this, options);
- },
- render: function render() {
- return new Promise(function (resolve, reject) {
- try {
- var urlMap = $.extend({
- ui_preview: true,
- factoryMode: null
- }, this.urlMap);
- if (urlMap.perspective === 'login') {
- urlMap.perspective = 'IBMlogin';
- }
- var src = this.glassContext.getUrl({
- urlMap: urlMap
- }); // Negative tab-index prevents keyboard navigation to the iFrame
- var $iFrame = $('<iframe>', {
- frameBorder: 0,
- src: src,
- tabindex: '-1'
- }).css({
- width: '100%',
- flex: '1 1 auto'
- });
- var overlay = $('<div>').addClass('previewDialogOverlay');
- this.$el = $iFrame.add(overlay); // Prevent the login perspective from focusing the user on the user name field
- $iFrame.on('load', function () {
- $(document.activeElement).on('blur', function (e) {
- setTimeout(function () {
- // using 'setTimeout' to let the event pass the run loop
- if (document.activeElement === $iFrame[0]) {
- // return the focus on the previous element when the iFrame tries to steal focus
- $(e.target).focus();
- }
- }, 0);
- });
- resolve(this.el);
- }.bind(this));
- } catch (err) {
- reject(err);
- }
- }.bind(this));
- }
- });
- return PreviewView;
- });
- //# sourceMappingURL=PreviewView.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2016, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/ui/PreviewDialog',['../../core-client/js/core-client/ui/dialogs/GenericViewDialog', '../../nls/StringResources', '../views/PreviewView'], function (GenericViewDialog, StringResources, PreviewView) {
- 'use strict';
- var PreviewDialog = GenericViewDialog.extend({
- /**
- * @classdesc Class that displays a preview of a perspective in a modal dialog.
- * @constructs PreviewDialog
- * @public
- * @param {Object} glassContext // Glass context object.
- * @param {String} urlMap // A map of key/value pairs to be converted into a queryString. See: Url.getUrl
- *
- * @example :
- * var dialog = new PreviewDialog({ glassContext: glassContext, urlMap: {perspective: 'home'} });
- * dialog.open();
- */
- init: function init(options) {
- this.options = options;
- var dialogOptions = {
- buttons: ['close'],
- viewClass: PreviewView,
- title: StringResources.get('previewDialogTitle'),
- className: 'previewDialog',
- viewOptions: {
- glassContext: options.glassContext,
- urlMap: options.urlMap
- }
- };
- PreviewDialog.inherited('init', this, [dialogOptions]);
- }
- });
- return PreviewDialog;
- });
- //# sourceMappingURL=PreviewDialog.js.map
- ;
- /*
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/ui/SlideoutView',['../../core-client/js/core-client/ui/View'], function (BaseView) {
- /**
- * @public
- */
- var SlideoutView = BaseView.extend(
- /**
- * @lends SlideoutView.prototype
- */
- {
- /**
- *
- *@classdesc Abstract Base class used by {@link Slideout} to show the content of the panel.
- * It corresponds to the object created from the content.module property passed when instantiating a slideout.
- * Contributor should extend this class.
- *@constructs
- *@public
- */
- init: function init() {
- BaseView.inherited('init', this, arguments);
- },
- /**
- * Invokes by {@link Slideout} in order to populate the content of a panel
- * @public
- * @abstract
- * @returns {Promise} Promise which passes the dom element when resolved
- */
- render: function render() {
- return Promise.resolve(this.el);
- },
- /**
- * Set the focus to an element within the view.
- * The default behaviour is to set theh focus to the root element
- * @public
- */
- setFocus: function setFocus() {
- this.$el.focus();
- },
- /**
- * Decides whether or not the containing slideout can be hidden/closed; invoked in the {@link Slideout#hide} method
- * @public
- * @param {Object} - set of options
- * @param {Boolean} [options.isEscape=false] - true when it is an escaped hiding; See the parmaters in {@link Slideout#hide}
- * @return {Boolean|promise} true/false or promise; rejected promise is equivalent to false; The default implementation returns true
- */
- canHide: function
- /* options */
- canHide() {
- return true;
- }
- });
- return SlideoutView;
- });
- //# sourceMappingURL=SlideoutView.js.map
- ;
- define('text!baglass/common/ui/properties/templates/DoubleLineWithInput.html',[],function () { return '<div class="inputRow flex property_{{=it.id}}">\n\t{{? it.label}}\n\t<div class="propertyName singleLine hide l_{{=it.name}}" id="row_{{=it.id}}">{{=it.label}}</div>\n\t{{?}}\n</div>\n<div class="inputRow flex property_{{=it.id}}">\n\t\t<input type="{{=it.inputType || \'password\'}}" aria-labelledby="row_{{=it.id}} com-ibm-ca-confirmPassword" placeholder="{{?it.placeholder}} {{=it.placeholder}} {{?}}"\n\t\t\tclass="propertyValue toggleEdit{{=it.id}} {{? it.editable === true}}editable{{=it.id}}{{?}} handleReturnKey v_{{=it.name}}" />\n</div>\n';});
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2015, 2016, 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('baglass/common/ui/properties/DoubleLineWithInput',['../../../core-client/js/core-client/ui/View', 'text!./templates/DoubleLineWithInput.html', 'jquery', 'doT'], function (View, template, $, dot) {
- 'use strict';
- var DoubleLineWithInput = View.extend({
- ellipses: true,
- /**
- * Creates a property with single line and read-only link.
- * @param {object} options - properties
- * @param {string} options.name - property name
- * @param {string} options.label - property label
- * @param {string} options.placeholder - property placeholder
- * @param {string} options.value - first row property value
- * @param {string} options.id - unique id
- * @param {function} [options.editCallback] - callback to the onkeyup action
- * @param {function} [options.editClick] - callback to the edit click action
- */
- init: function init(options) {
- if (options.editable || options.editCallback) {
- if (!this.events) {
- this.events = {};
- }
- this.events['keyup .editable' + options.id] = '_handleEditKeyup';
- this.events['clicktap .toggleEdit' + options.id] = '_handleEditClick';
- }
- DoubleLineWithInput.inherited('init', this, arguments);
- $.extend(this, options);
- },
- render: function render() {
- var sHtml = dot.template(template)({
- 'label': this.label,
- 'editable': this.editCallback || this.editable ? true : false,
- 'inputType': this.inputType,
- 'placeholder': this.placeholder,
- 'value': this.value,
- 'id': this.id,
- 'name': this.name
- });
- this.$el.append(sHtml);
- },
- _handleEditClick: function _handleEditClick() {
- if (this.editClick) {
- this.editClick(this.name);
- }
- },
- _handleEditKeyup: function _handleEditKeyup() {
- if (this.editCallback) {
- this.editCallback(this.name);
- }
- },
- setFocus: function setFocus() {
- this.$el.find('input').first().focus();
- }
- });
- return DoubleLineWithInput;
- });
- //# sourceMappingURL=DoubleLineWithInput.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/ui/SubmitPasswordDialog',['../../core-client/js/core-client/ui/dialogs/GenericViewDialog', '../../nls/StringResources', '../../core-client/js/core-client/utils/ClassFactory', '../ui/properties/DoubleLineWithInput', 'jquery'], function (GenericViewDialog, StringResources, ClassFactory, DoubleLineWithInput, $) {
- 'use strict'; //NOSONAR: meant to be strict
- var SubmitPasswordDialog = GenericViewDialog.extend({
- _ClassFactory: ClassFactory,
- /**
- * constructor
- * @options {object}
- */
- init: function
- /* dialogOptions */
- init() {},
- openSubmitPasswordDialog: function openSubmitPasswordDialog(dialogOptions) {
- this.oldPasswordName = 'oldPassword';
- this.newPasswordName = 'newPassword';
- this.confirmPasswordName = 'confirmNewPassword';
- var deferred = $.Deferred();
- this._ClassFactory.loadModule('../ui/properties/PropertyUIControl').done(function (dialogPropertyUIControl) {
- dialogOptions.id = 'submitPasswordDialogTitle';
- dialogOptions.viewClass = dialogPropertyUIControl;
- var inputToFocus;
- if (dialogOptions.viewOptions.displayPrompts) {
- dialogOptions.viewOptions.items = this._getCreateCredentialItems(dialogOptions.viewOptions.displayPrompts);
- inputToFocus = dialogOptions.viewOptions.displayPrompts[0].name;
- } else {
- dialogOptions.viewOptions.items = this._getUpdatePasswordItems();
- inputToFocus = this.oldPasswordName;
- }
- this._ClassFactory.instantiate('../ui/dialogs/GenericViewDialog', dialogOptions).then(function (oDialog) {
- this.dialog = oDialog;
- this.dialog.view.setFocus = function () {
- dialogPropertyUIControl.prototype.setFocus.call(this, inputToFocus);
- }.bind(this.dialog.view);
- this.dialog.view.$el.addClass('submitPasswordDialog');
- this.dialog.open();
- $('.dialogButton.primary').addClass('disabled');
- $('.dialogBlockerCell').addClass('inputDialog');
- }.bind(this), deferred.reject);
- deferred.resolve(this);
- }.bind(this), deferred.reject);
- return deferred.promise();
- },
- _showPassword: function _showPassword(propertyName, propertyValue) {
- if (propertyValue) {
- this.dialog.view.$el.find('input:password').each(function (key, value) {
- $(value).attr('type', 'text');
- });
- } else {
- var $passwordInputs = $('input[class*="' + this.oldPasswordName + '"],input[class*="' + this.newPasswordName + '"],input[class*="' + this.confirmPasswordName + '"]');
- $passwordInputs.each(function (key, value) {
- $(value).attr('type', 'password');
- });
- }
- },
- _addSelectedClassAndLabel: function _addSelectedClassAndLabel(className) {
- var $editingClass = $('.editing');
- if ($editingClass[0]) {
- $editingClass.removeClass('editing');
- }
- var $label = $('div[class*="' + className + '"]');
- $label.addClass('editing');
- var $separator = $label.parent().nextAll('.separator:first');
- if ($separator[0]) {
- $separator.addClass('editing');
- }
- },
- _enableOk: function _enableOk(bEnabled) {
- var btn = $('.dialogButton').eq(0); // if bEnabled is undefined, it means true.
- btn.toggleClass('disabled', bEnabled === false);
- if (bEnabled === false) {
- btn.attr('disabled', 'disabled');
- } else {
- btn.removeAttr('disabled');
- }
- },
- _checkPasswordMatch: function _checkPasswordMatch() {
- var $confirmPW = $('input[class*="' + this.confirmPasswordName + '"]');
- var password = $('input[class*="' + this.newPasswordName + '"]').val();
- var confirmPassword = $confirmPW.val();
- var $lastSeparator = $confirmPW.parent().next('.separator');
- var $message;
- if (password !== confirmPassword) {
- this._enableOk(false);
- $message = $('.confirm');
- if ($message[0]) {
- $message.removeClass('confirm');
- $message.addClass('warning');
- $message.html(StringResources.get('passwordNotMatch'));
- } else if ($('.warning').length === 0) {
- $message = $('<div class="inputRow"><div id="com-ibm-ca-confirmPassword" class="warning" aria-live="assertive">' + StringResources.get('passwordNotMatch') + '</div></div>');
- $message.insertAfter($lastSeparator);
- }
- } else if (password && confirmPassword && password === confirmPassword) {
- this._enableOk(true);
- $message = $('.warning');
- if ($message[0]) {
- $message.removeClass('warning');
- $message.addClass('confirm');
- $message.html(StringResources.get('passwordMatch'));
- }
- } else {
- this._enableOk(false);
- $('.warning').parent().remove();
- $('.confirm').parent().remove();
- }
- },
- _getCreateCredentialItems: function _getCreateCredentialItems(displayPrompts) {
- var credentialsTextItems = [];
- var credentialsNoEchoItems = [];
- $.each(displayPrompts, function (key, prompt) {
- if (prompt.type === 'text') {
- credentialsTextItems.push({
- module: DoubleLineWithInput,
- name: prompt.name,
- placeholder: prompt.caption + ' ' + (prompt.value || ''),
- inputType: 'text'
- }, {
- type: 'Separator'
- });
- } else if (prompt.type === 'textnoecho') {
- this.newPasswordName = prompt.name;
- credentialsNoEchoItems.push({
- module: DoubleLineWithInput,
- name: this.newPasswordName,
- label: StringResources.get('password'),
- placeholder: StringResources.get('password'),
- editClick: this._addSelectedClassAndLabel.bind(this),
- editCallback: this._checkPasswordMatch.bind(this)
- }, {
- type: 'Separator'
- }, {
- module: DoubleLineWithInput,
- name: this.confirmPasswordName,
- editCallback: this._checkPasswordMatch.bind(this),
- label: StringResources.get('confirmPassword'),
- placeholder: StringResources.get('confirmPassword'),
- editClick: this._addSelectedClassAndLabel.bind(this)
- }, {
- type: 'Separator'
- }, {
- type: 'CheckBox',
- name: 'showPassword',
- label: StringResources.get('showPassword'),
- controlOnLeft: true,
- checked: false,
- onChange: this._showPassword.bind(this)
- });
- }
- }.bind(this));
- return credentialsTextItems.concat(credentialsNoEchoItems);
- },
- _getUpdatePasswordItems: function
- /* displayPrompts */
- _getUpdatePasswordItems() {
- return [{
- 'module': DoubleLineWithInput,
- 'name': this.oldPasswordName,
- 'editable': true,
- 'label': StringResources.get(this.oldPasswordName),
- 'placeholder': StringResources.get(this.oldPasswordName),
- 'editClick': this._addSelectedClassAndLabel.bind(this)
- }, {
- 'type': 'Separator'
- }, {
- 'module': DoubleLineWithInput,
- 'name': this.newPasswordName,
- 'label': StringResources.get(this.newPasswordName),
- 'placeholder': StringResources.get(this.newPasswordName),
- 'editCallback': this._checkPasswordMatch.bind(this),
- 'editClick': this._addSelectedClassAndLabel.bind(this)
- }, {
- 'type': 'Separator'
- }, {
- 'module': DoubleLineWithInput,
- 'name': this.confirmPasswordName,
- 'editCallback': this._checkPasswordMatch.bind(this),
- 'label': StringResources.get(this.confirmPasswordName),
- 'placeholder': StringResources.get(this.confirmPasswordName),
- 'editClick': this._addSelectedClassAndLabel.bind(this)
- }, {
- 'type': 'Separator'
- }, {
- 'type': 'CheckBox',
- 'name': 'showPassword',
- 'label': StringResources.get('showPassword'),
- 'controlOnLeft': true,
- 'checked': false,
- 'onChange': this._showPassword.bind(this)
- }];
- }
- });
- return SubmitPasswordDialog;
- });
- //# sourceMappingURL=SubmitPasswordDialog.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/ui/all',['./PreviewDialog', './SlideoutView', './SubmitPasswordDialog'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/views/all',['./PreviewView'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Cognos Analytics
- * (C) Copyright IBM Corp. 2016, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/utils/ThemeUtils',[], function () {
- return {
- DEFAULT_BRAND_TEXT: 'IBM Cognos Analytics',
- DEFAULT_BRAND_TEXT_SMALL: 'IBM Cognos Analytics',
- DEFAULT_BRAND_ICON: 'common-CA_Avatar_Colour_64',
- DEFAULT_BRAND_ICON_SMALL: 'common-CA_Avatar_Black_24',
- THEME_URL: 'v1/plugins/themes/current/spec.json',
- /**
- * Returns current theme value from server
- * If the request fails, default values will be provided
- *
- * @public
- * @param {GlassContext} glassContext
- * @returns Resolved promise with current theme value
- */
- getCurrentThemeValues: function getCurrentThemeValues(glassContext) {
- return glassContext.getCoreSvc('.Ajax').ajax({
- url: this.THEME_URL,
- type: 'GET'
- }).then(function (result) {
- return result.data;
- }).catch(function () {
- return {
- brandText: this.DEFAULT_BRAND_TEXT,
- brandTextSmall: this.DEFAULT_BRAND_TEXT_SMALL,
- images: {
- brandIcon: this.DEFAULT_BRAND_ICON,
- brandIconSmall: this.DEFAULT_BRAND_ICON_SMALL
- }
- };
- }.bind(this));
- }
- };
- });
- //# sourceMappingURL=ThemeUtils.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: BI Glass
- *| (C) Copyright IBM Corp. 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('baglass/core-client/js/core-client/utils/UrlUtils',[], function () {
- var UrlUtils = function UrlUtils() {};
- UrlUtils.prototype.base64Encode = function (urlString) {
- if (!urlString) {
- return null;
- }
- var b64String = btoa(urlString);
- return b64String.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
- };
- UrlUtils.prototype.base64Decode = function (urlString) {
- if (!urlString) {
- return null;
- }
- var encodedString = urlString.replace(/-/g, '+').replace(/_/g, '/');
- var remainder = encodedString.length % 4;
- if (remainder === 2) {
- encodedString += '==';
- } else if (remainder === 3) {
- encodedString += '=';
- }
- return atob(encodedString);
- };
- return new UrlUtils();
- });
- //# sourceMappingURL=UrlUtils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017, 2022
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /* global navigator */
- define('caglass/ajax/CAAuthentication',['underscore', 'jquery', 'baglass/utils/Utils', 'baglass/core-client/js/core-client/utils/Utils', 'baglass/core-client/js/core-client/utils/BrowserUtils', 'baglass/core-client/js/core-client/utils/Deferred', 'baglass/core-client/js/core-client/utils/UrlUtils', 'baglass/nls/StringResources', 'baglass/core-client/js/core-client/errors/BaseError'], function (_, $, GlassUtils, Utils, BrowserUtils, Deferred, urlUtils, StringResources, BaseError) {
- var CAAuthentication = function CAAuthentication() {};
- /**
- * Entry point API for CA login called in bi-commons component re: Entry.js.
- * @public
- * @param [glassContext] - the global glassContext object
- * @param origin {initialLogin: true} for initial login
- * {relogin: true} for relogin
- * @return successful login to set up glassContext.authInfo object
- * or open a LoginView page to ask credentials until successful.
- */
- CAAuthentication.prototype.login = function (glassContext, origin) {
- var _this = this;
- var originInfo = origin || {
- initialLogin: true
- };
- if (_.isUndefined(originInfo.initialLogin)) {
- originInfo.initialLogin = true;
- }
- if (originInfo.skipCALogin === true) {
- var error = new Error();
- error.redirectUrl = originInfo.redirectUrl;
- error.state = {
- skipCALogin: true
- };
- return this._promptForExternalLogin(glassContext, error, {
- relogin: true
- });
- } else {
- return this._isLoggedIn(glassContext, originInfo)["catch"](function (error) {
- return _this._promptForLogin(glassContext, error, originInfo);
- });
- }
- };
- CAAuthentication.prototype._isLoggedIn = function (glassContext, origin) {
- var _this2 = this;
- return new Promise(function (resolve, reject) {
- _this2._getAuthInfo(glassContext, origin).then(function (authInfo) {
- _this2._processSuccessfulLogin(glassContext, authInfo, origin).then(function () {
- resolve(authInfo);
- });
- }, function (error) {
- reject(_this2._processAuthenticationError(glassContext, error.jqXHR, origin));
- });
- });
- };
- /**
- * Retrieves the authInfo to check if a user is already logged in
- * Note: in the case of a initialo login, the queryString is checked to see
- * if CAMNamespace is specified. this allows to check the login against a dedicated namespace
- * @private
- * @param {Object} glassContext
- * @param {Object} origin
- * @return {Promise} resolved with the authInfo when already logged-in, rejected otherwise
- */
- CAAuthentication.prototype._getAuthInfo = function (glassContext, origin) {
- var url = CAAuthentication.LOGIN_URL;
- if (origin && origin.relogin === true && glassContext.authInfo.isAnonymous !== true) {
- url += '?h_CAM_action=logonAs';
- } else {
- if (origin && origin.initialLogin === true && origin.queryString) {
- url = this._buildURLWithQueryString(url, origin.queryString, glassContext);
- }
- }
- return glassContext.getCoreSvc('.Ajax').ajax({
- type: origin.requestMethod,
- url: url,
- contentType: 'application/json; charset=utf-8',
- dataType: 'json',
- skipErrorHandling: true
- }).then(function (response) {
- return response.data;
- });
- };
- CAAuthentication.prototype._buildURLWithQueryString = function (url, queryString, glassContext) {
- var definedNamespace = queryString.CAMNamespace;
- if (!_.isString(definedNamespace) && !_.isUndefined(definedNamespace)) {
- glassContext.getCoreSvc('.Logger').info('There can only be 1 namespace in the queryString. Ignoring.');
- }
- var allowedParameters = GlassUtils.getFilteredLoginParameters(glassContext, queryString);
- var urlParams = allowedParameters.map(function (param) {
- var name = encodeURIComponent(param.name);
- var value = encodeURIComponent(param.value);
- return "".concat(name, "=").concat(value);
- }).join('&');
- if (urlParams) {
- url += "?".concat(urlParams);
- }
- return url;
- };
- /**
- * Login for legacy application
- * @param {Object} glassContext - glass context
- * @param {Object} origin - info of origin calling prompt for login
- */
- CAAuthentication.prototype.legacyLogin = function (glassContext, origin) {
- return this.submitCredentials(glassContext, {})["catch"](function (error) {
- return this._promptForLogin(glassContext, error, origin);
- }.bind(this));
- };
- /**
- * Perform a secondary login
- * @param {GlassContext} glassContext
- */
- CAAuthentication.prototype.secondaryLogin = function (glassContext, processedError) {
- var originInfo = {
- secondaryLogin: true,
- newWindow: true
- };
- if (processedError) {
- originInfo.authError = processedError;
- }
- return this.submitCredentials(glassContext, {}).then(function (authInfo) {
- Utils.getCurrentWindow().location.reload();
- return authInfo;
- })["catch"](function (error) {
- return this._promptForLogin(glassContext, error, originInfo);
- }.bind(this));
- };
- /**
- * Perform an external login
- * @param {GlassContext} glassContext
- * @param {Object} error - error describing how to prompt
- * @param {Object} origin - info of origin calling prompt for login
- * @return a promise when opening a new window tab otherwise no promise returned because of the current page reloaded
- */
- CAAuthentication.prototype.externalLogin = function (glassContext, error, origin) {
- var originInfo = origin ? origin : {};
- if (!originInfo.redirectUrl) {
- originInfo.redirectUrl = Utils.getCurrentWindow().location.href;
- }
- return this._promptForLogin(glassContext, error, originInfo);
- };
- CAAuthentication.prototype._promptForLogin = function (glassContext, error, origin) {
- var promise;
- var ssoLoginUrl = glassContext.getSSOLoginURL();
- if (ssoLoginUrl && !GlassUtils.isFactoryMode()) {
- promise = this._promptWithSSOLoginUrl(ssoLoginUrl);
- } else {
- if (error.isExternalLogin === true) {
- promise = this._promptForExternalLogin(glassContext, error, origin);
- } else {
- promise = this._promptForInternalLogin(glassContext, error, origin);
- }
- }
- return promise;
- };
- CAAuthentication.prototype._promptWithSSOLoginUrl = function (ssoLoginUrl) {
- var currentWindow = Utils.getCurrentWindow();
- if (!currentWindow.__ca_ssologin_in_progress__) {
- var builtUrl = GlassUtils.buildRedirectURL(ssoLoginUrl, currentWindow.location.href);
- currentWindow.location.assign(builtUrl);
- currentWindow.__ca_ssologin_in_progress__ = new Promise(function () {});
- }
- return currentWindow.__ca_ssologin_in_progress__;
- };
- CAAuthentication.prototype._promptForInternalLogin = function (glassContext, error, origin) {
- var curWindow = Utils.getCurrentWindow();
- if (!curWindow.__ca_login_in_progress__) {
- curWindow.__ca_login_in_progress__ = new Deferred();
- var originInfo = _.extend(origin) || {};
- originInfo.authInfo = glassContext.authInfo;
- $(curWindow).one('ca.loginSuccessful', this._onLoginSuccessful.bind(this, glassContext, originInfo));
- $(curWindow).on('popstate.ca_login', this._onPopStateFromLogin.bind(this, glassContext, originInfo));
- var context = {
- content: {
- origin: originInfo
- }
- };
- glassContext.appController.openLoginView(context);
- }
- return curWindow.__ca_login_in_progress__.promise;
- }; // jshint ignore:line
- CAAuthentication.prototype._onPopStateFromLogin = function (glassContext, originInfo) {
- if (Utils.getCurrentWindow().__ca_login_in_progress__) {
- var context = {
- content: {
- origin: originInfo
- }
- };
- if (originInfo.secondaryLogin) {
- var error = new BaseError('Login was cancelled by the user.');
- Utils.getCurrentWindow().__ca_login_in_progress__.reject(error);
- Utils.getCurrentWindow().__ca_login_in_progress__ = undefined;
- } else if (originInfo.initialLogin) {
- glassContext.appController.openLoginView(context);
- }
- }
- }; // jshint ignore:line
- CAAuthentication.prototype._onLoginSuccessful = function (glassContext, origin, event, result) {
- var isMobile = navigator.userAgent.indexOf('CAMOBILE') != -1;
- var mobileService = glassContext.getSvcSync('.MobileCompleteAuthentication');
- if (isMobile && mobileService) {
- mobileService.onSuccess();
- return;
- }
- Utils.getCurrentWindow().__ca_login_in_progress__.resolve(result);
- Utils.getCurrentWindow().__ca_login_in_progress__ = undefined;
- $(Utils.getCurrentWindow()).off('popstate.ca_login');
- if (result && result.stayAnonymous === true) {
- glassContext.appController.openPreviousAppView();
- } else if (origin.relogin === true && glassContext.authInfo.differentAccountLogin !== true) {
- if (!glassContext.appController.isOpeningAView()) {
- glassContext.appController.openPreviousAppView();
- }
- } else if (origin.legacyLogin !== true && origin.initialLogin !== true && origin.secondaryLogin !== true) {
- this._reloadPage();
- }
- };
- CAAuthentication.prototype._promptForExternalLogin = function (glassContext, error, origin) {
- var curWindow = glassContext.window || Utils.getCurrentWindow();
- var loginUrl = error.redirectUrl;
- var state = error.state;
- state.isMobile = navigator.userAgent.indexOf('CAMOBILE') != -1;
- if (!curWindow.__ca_external_login_in_progress__) {
- curWindow.__ca_external_login_in_progress__ = new Deferred();
- if (Utils.isInIframe(curWindow) || origin && (origin.relogin === true || origin.authtc === true)) {
- if (state.skipCALogin === true && origin.authtc !== true) {
- loginUrl += '?state=' + urlUtils.base64Encode(JSON.stringify(state));
- } else {
- state = _.extend(state, _.omit(origin, 'authInfo'));
- state.newWindow = true;
- loginUrl += '&state=' + urlUtils.base64Encode(JSON.stringify(state));
- }
- if (BrowserUtils.isIE() && Utils.isInIframe(curWindow)) {
- // Post-Message events between the child window and parent iframe don't work
- // on IE11 in a cross-domain scenario.
- //
- // This solution uses localStorage / StorageEvents to detect when the log-in
- // was successful.
- try {
- curWindow.localStorage.removeItem('externalLoginResult');
- var storageEventHandler = function storageEventHandler(evt) {
- var externalLoginResult;
- if (evt.key && evt.key === 'externalLoginResult') {
- externalLoginResult = evt.newValue;
- }
- if (externalLoginResult) {
- curWindow.removeEventListener('storage', storageEventHandler);
- var data = JSON.parse(externalLoginResult);
- curWindow.localStorage.removeItem('externalLoginResult');
- curWindow.postMessage(data, curWindow.location.origin);
- }
- };
- curWindow.addEventListener('storage', storageEventHandler);
- } catch (err) {
- glassContext.getCoreSvc('.Logger').error(err);
- }
- }
- curWindow.addEventListener('message', this._onExternalLoginComplete.bind(this, glassContext), {
- once: true
- });
- this._externalWindow = curWindow.open(loginUrl, '');
- } else {
- if (origin && origin.redirectUrl) {
- state = _.extend(_.clone(state), _.omit(origin, ['authInfo', 'authError']));
- state.redirectUrl = origin.redirectUrl;
- } else {
- state.redirectUrl = curWindow.location.href;
- }
- loginUrl += '&state=' + urlUtils.base64Encode(JSON.stringify(state));
- curWindow.location.assign(loginUrl, true);
- }
- }
- return curWindow.__ca_external_login_in_progress__.promise;
- };
- /**
- * Event handler for onExternalLoginComplete from a second browser tab
- * @private
- * @param [glassContext] - the global glassContext object
- * @param [event] - event handler triggered by a window.postMessage from a second browser tab
- */
- CAAuthentication.prototype._onExternalLoginComplete = function (glassContext, event) {
- Utils.getCurrentWindow().__ca_external_login_in_progress__.resolve(event.data);
- delete Utils.getCurrentWindow().__ca_external_login_in_progress__;
- if (!event.data) {
- Utils.getCurrentWindow().location.assign(event.origin);
- }
- if (this._externalWindow) {
- this._externalWindow.close();
- this._externalWindow = null;
- }
- };
- /**
- * Submit user credentials to UPS/CAM for authentication
- * @public
- * @param [glassContext] - the global glassContext object
- * @param [loginPrompts] - the login prompts JSON object originally returned from UPS/CAM
- * @param [origin] - location origin object used to pass on queryString
- */
- CAAuthentication.prototype.submitCredentials = function (glassContext, loginPrompts, origin) {
- var _this3 = this;
- return new Promise(function (resolve, reject) {
- var ajaxOptions = {
- type: 'POST',
- url: CAAuthentication.LOGIN_URL,
- data: JSON.stringify(loginPrompts),
- contentType: 'application/json; charset=utf-8',
- dataType: 'json',
- skipErrorHandling: true
- };
- glassContext.getCoreSvc('.Ajax').ajax(ajaxOptions).then(function (response) {
- var authInfo = response.data;
- _this3._processSuccessfulLogin(glassContext, authInfo, origin).then(function () {
- resolve(authInfo);
- });
- }, function (error) {
- reject(_this3._processAuthenticationError(glassContext, error.jqXHR, origin));
- });
- });
- };
- /**
- * Submit login tokens to UPS/CAM for authentication
- * Once we attempt a login to bi/v1/login, we handle any errors returned.
- * Expected errors include 441 responses with displayObjects. Otherwise something went horribly wrong and we'll return the error itself to the caller.
- * @public
- * @param [glassContext] - the global glassContext object
- * @param [tokens] - the query strings returned from external provide such as IBM BlueID
- * @return authentication info object when successful or an Error object when failed.
- */
- CAAuthentication.prototype.submitLoginTokens = function (glassContext, tokens) {
- var _this4 = this;
- var ajaxOptions = {
- type: 'GET',
- url: CAAuthentication.LOGIN_URL,
- data: tokens,
- skipErrorHandling: true
- };
- return glassContext.getCoreSvc('.Ajax').ajax(ajaxOptions)["catch"](function (error) {
- return _this4.recoverFromCamError(glassContext, error, tokens);
- });
- };
- CAAuthentication.prototype.recoverFromCamError = function (glassContext, error, origin) {
- var processedError = this._processAuthenticationError(glassContext, error.jqXHR);
- if (processedError.displayObjects && processedError.displayObjects.length > 0) {
- var originInfo = _.extend(origin) || {};
- originInfo.authError = processedError;
- return this._promptForLogin(glassContext, processedError, originInfo);
- }
- return Promise.reject(error);
- };
- CAAuthentication.prototype._reloadPage = function () {
- var currentWindow = Utils.getCurrentWindow();
- if (currentWindow.external && currentWindow.external.HasOnClose) {
- return currentWindow.external.OnClose(0);
- }
- currentWindow.location = currentWindow.location.pathname;
- };
- CAAuthentication.prototype._isDifferentPrimaryUser = function (oldAccountId, accountInfo) {
- return oldAccountId && accountInfo && accountInfo.id !== oldAccountId;
- };
- CAAuthentication.prototype._processSuccessfulLogin = function (glassContext, authInfo, origin) {
- if (glassContext.authInfo && glassContext.authInfo.isAnonymous === true) {
- return Promise["try"](function () {
- if (origin && origin.relogin === true) {
- return authInfo;
- } else {
- this._reloadPage();
- }
- }.bind(this));
- } else {
- var oldAccountId = glassContext && glassContext.profile && glassContext.profile.account && glassContext.profile.account.id;
- var userProfileSvc = glassContext.getCoreSvc('.UserProfile');
- return Promise["try"](function () {
- return userProfileSvc.getAccountInfo(authInfo);
- }).then(function (accountInfo) {
- if (this._isDifferentPrimaryUser(oldAccountId, accountInfo)) {
- this._reloadPage();
- }
- }.bind(this))["catch"](function (e) {
- glassContext.getCoreSvc('.Logger').error('Failed to get user account', e);
- }).then(function () {
- glassContext.authInfo = authInfo;
- glassContext.appController.reloadTheme();
- if (userProfileSvc.updatePreferences) {
- return userProfileSvc.updatePreferences(!oldAccountId);
- }
- });
- }
- };
- /**
- * Store user credentials to UPS/CAM for authentication
- * @public
- * @param {Object} glassContext the global glassContext object
- * @return {Object} authentication info object when successful or throws Error object when failed.
- */
- CAAuthentication.prototype.storeCredentials = function (glassContext) {
- var _this5 = this;
- var url = CAAuthentication.LOGIN_URL;
- var ajaxOptions = {
- data: {
- h_CAM_action: 'generateTC'
- },
- type: 'GET',
- url: url,
- contentType: 'application/json; charset=utf-8',
- dataType: 'json',
- skipErrorHandling: true
- };
- return glassContext.getCoreSvc('.Ajax').ajax(ajaxOptions).fail(function (error) {
- var authErr = _this5._processAuthenticationError(glassContext, error.jqXHR);
- if (authErr.isExternalLogin === true) {
- var origin = {
- redirectUrl: authErr.redirectUrl,
- authtc: true
- };
- return _this5.externalLogin(glassContext, authErr, origin).fail(function (loginErr) {
- glassContext.appController.showToast(loginErr, {
- 'type': 'error'
- });
- throw loginErr;
- });
- } else {
- throw authErr;
- }
- });
- };
- CAAuthentication.prototype.processAuthenticationError = function (glassContext, jqXHR, origin) {
- return this._processAuthenticationError(glassContext, jqXHR, origin);
- };
- CAAuthentication.prototype._processAuthenticationError = function (glassContext, jqXHR, origin) {
- var error = new Error();
- error.httpCode = jqXHR.status;
- error.jqXHR = jqXHR;
- try {
- this._processAuthDisplayObjects(error, jqXHR);
- this._processAuthErrorCodeAndMessage(glassContext, error, jqXHR);
- this._processLoginParameters(glassContext, error, origin);
- } catch (e) {
- error.code = CAAuthentication.LOGIN_FATAL;
- error.message = StringResources.get('invalidLoginResponse');
- }
- return error;
- };
- CAAuthentication.prototype._processAuthDisplayObjects = function (error, jqXHR) {
- error.displayObjects = [];
- if (jqXHR.responseJSON.promptInfo && jqXHR.responseJSON.promptInfo.displayObjects) {
- error.displayObjects = jqXHR.responseJSON.promptInfo.displayObjects;
- var state = {};
- var dispObjects = error.displayObjects;
- for (var i = 0; i < dispObjects.length; i++) {
- if (dispObjects[i].name === CAAuthentication.CAM_REDIRECT_URL_NAME) {
- error.isExternalLogin = true;
- error.redirectUrl = dispObjects[i].value;
- } else {
- state[dispObjects[i].name] = dispObjects[i].value;
- }
- }
- if (error.isExternalLogin === true) {
- error.state = state;
- }
- }
- };
- CAAuthentication.prototype._processAuthErrorCodeAndMessage = function (glassContext, error, jqXHR) {
- this._processAuthErrorCode(error, jqXHR);
- this._processAuthErrorMessage(glassContext, error, jqXHR);
- if (error.code === CAAuthentication.LOGIN_UNKNOWN_LOGIN_ERROR && error.message === '') {
- error.message = StringResources.get('credentialSubmitError');
- }
- };
- CAAuthentication.prototype._processAuthErrorCode = function (error, jqXHR) {
- var code = jqXHR.responseJSON.errorCodeString;
- if (code === 'camAuthUserRecoverable') {
- error.code = CAAuthentication.LOGIN_INVALID_CREDENTIALS;
- } else if (code === 'camAuthUnrecoverable') {
- error.code = CAAuthentication.LOGIN_DEADEND;
- } else {
- error.code = CAAuthentication.LOGIN_UNKNOWN_LOGIN_ERROR;
- }
- };
- CAAuthentication.prototype._processAuthErrorMessage = function (glassContext, error, jqXHR) {
- if (jqXHR.responseJSON.messages.length > 0) {
- var camMessages = jqXHR.responseJSON.messages;
- var messageNbr = camMessages.length;
- if (jqXHR.status !== glassContext.ajaxCodes.UNAUTHORIZED) {
- error.message = camMessages[0].messageString ? camMessages[0].messageString : camMessages[0];
- } else {
- var camMessageString = camMessages[messageNbr - 1].messageString ? camMessages[messageNbr - 1].messageString : camMessages[messageNbr - 1];
- if (camMessageString.search('CAM-AAA-0036') !== -1 || camMessageString.search('CAM-AAA-0125') !== -1) {
- error.message = StringResources.get('invalidLogin');
- } else {
- error.message = camMessageString;
- }
- }
- } else {
- error.message = '';
- }
- };
- /**
- * Processes LoginParameters passed in by the queryString and attaches them to the CAM response object for the next login request if they are configured as allowed.
- * @private
- * @param [glassContext] - glassContext object
- * @param [error] - error object from CAM Response
- * @param [origin] - origin request object that includes any urlLoginParameters in the queryString
- */
- CAAuthentication.prototype._processLoginParameters = function (glassContext, error, origin) {
- var queryString = '';
- if (origin) {
- queryString = origin.queryString;
- var allowedParameters = GlassUtils.getFilteredLoginParameters(glassContext, queryString);
- if (error.state) {
- for (var i = 0; i < allowedParameters.length; i++) {
- error.state[allowedParameters[i].name] = allowedParameters[i].value;
- }
- }
- this._appendLoginParams(error, allowedParameters);
- }
- };
- /**
- * Appends passed in loginParameters if they do not already exist as a hidden display object on the passed in error.
- * @private
- * @param [error] - error object from CAM Response
- * @param [loginParameters] - allowed login parameters configure in glass that exist in the queryString
- */
- CAAuthentication.prototype._appendLoginParams = function (error, loginParameters) {
- var displayObjectNames = [];
- if (error.displayObjects) {
- _.each(error.displayObjects, function (displayObj) {
- if (displayObjectNames.indexOf(displayObj.name) == -1) {
- displayObjectNames.push(displayObj.name);
- }
- });
- _.each(loginParameters, function (loginParam) {
- var objectIndex = displayObjectNames.indexOf(loginParam.name);
- if (objectIndex == -1) {
- loginParam.type = 'hidden';
- error.displayObjects.push(loginParam);
- } else {
- if (error.displayObjects[objectIndex].type == null) {
- error.displayObjects[objectIndex].type = 'hidden';
- }
- }
- });
- }
- };
- CAAuthentication.BASE_URL = 'v1';
- CAAuthentication.LOGIN_URL = CAAuthentication.BASE_URL + '/login';
- CAAuthentication.CAM_REDIRECT_URL_NAME = 'camRedirectURL';
- CAAuthentication.LOGIN_FATAL = 'LOGIN_FATAL';
- CAAuthentication.LOGIN_DEADEND = 'LOGIN_DEADEND';
- CAAuthentication.LOGIN_UNKNOWN_LOGIN_ERROR = 'LOGIN_UNKNOWN_LOGIN_ERROR';
- CAAuthentication.LOGIN_INVALID_CREDENTIALS = 'LOGIN_INVALID_CREDENTIALS';
- return CAAuthentication;
- });
- //# sourceMappingURL=CAAuthentication.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/ajax/CASimpleAuthentication',['./CAAuthentication'], function (BaseAuthentication) {
- /**
- * Temporary classes which simplifies the login flow based
- */
- var CAAuthentication = function CAAuthentication() {};
- CAAuthentication.prototype = Object.create(new BaseAuthentication());
- CAAuthentication.prototype._processSuccessfulLogin = function (glassContext, authInfo, origin) {
- var _this = this;
- glassContext.authInfo = authInfo;
- return Promise.resolve(authInfo).then(function () {
- if (origin && origin.relogin && !origin.newWindow) {
- if (authInfo.updatedco) {
- return glassContext.getCoreSvc('.DigitalContext').initialize().then(function () {
- return _this._reloadIfDifferentUserLogin(glassContext, authInfo);
- });
- }
- return _this._reloadIfDifferentUserLogin(glassContext, authInfo);
- }
- });
- };
- CAAuthentication.prototype._reloadIfDifferentUserLogin = function (glassContext, authInfo) {
- var _this2 = this;
- var oldAccountId = glassContext && glassContext.profile && glassContext.profile.account && glassContext.profile.account.id;
- var userProfileSvc = glassContext.getCoreSvc('.UserProfile');
- return Promise["try"](function () {
- return userProfileSvc.getAccountInfo(authInfo);
- }).then(function (accountInfo) {
- if (_this2._isDifferentPrimaryUser(oldAccountId, accountInfo)) {
- _this2._reloadPage();
- authInfo.differentAccountLogin = true;
- return authInfo;
- }
- })["catch"](function (e) {
- glassContext.getCoreSvc('.Logger').error('Failed to get user account', e);
- });
- };
- return CAAuthentication;
- });
- //# sourceMappingURL=CASimpleAuthentication.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2015
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/nls/GlassResources',{
- 'root': true,
- 'cs': true,
- 'da': true,
- 'de': true,
- 'es': true,
- 'fi': true,
- 'fr': true,
- 'hr': true,
- 'hu': true,
- 'it': true,
- 'ja': true,
- 'kk': true,
- 'ko': true,
- 'no': true,
- 'nb': true,
- 'nl': true,
- 'pl': true,
- 'pt': true,
- 'pt-br': true,
- 'ro': true,
- 'ru': true,
- 'sl': true,
- 'sv': true,
- 'th': true,
- 'tr': true,
- 'zh': true,
- 'zh-cn': true,
- 'zh-tw': true
- });
- //# sourceMappingURL=GlassResources.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * (C) Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/nls/root/GlassResources',{
- "credentialCreate": "Create",
- "communicationErrorMessage": "A network error has occurred. Http code: %{code}",
- "maintenanceLink": "More info",
- "credentialChange": "Renew",
- "maintenanceTitle": "Maintenance",
- "credentialRenewed": "Your credentials were renewed with your current user ID and password.",
- "communicationErrorTitle": "Communication Error",
- "ok": "OK",
- "credentialCreateSuccess": "You have successfully created your credentials",
- "secondaryLoginRefresh": "Refresh the page now?",
- "secondaryLoginSuccess": "Successfully logged into an additional Namespace. The page must be refreshed to use your new capabilities.",
- "errLoadingView": "The specified view is no longer available. The default home view is being displayed instead.",
- "wrongPassword": "Unable to authenticate",
- "error404NotFound": "Error 404 resource not found"
- });
- //# sourceMappingURL=GlassResources.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2015
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/nls/StringResources',['i18n!caglass/nls/GlassResources', 'baglass/core-client/js/core-client/utils/Lexicon'], function (GlassResources, Lexicon) {
- 'use strict';
- var lexicon = new Lexicon({
- data: GlassResources,
- allowMissing: true,
- verbose: false
- });
- return {
- /**
- * Get the string resource for the given key and interpolation options
- *
- * @param key The key of the string to return
- * @param interpolationOptions Optional interpolation options (see poly.t documentation for details)
- * @returns The string to display
- */
- get: function get(key, interpolationOptions) {
- var translated = lexicon.translate(key, interpolationOptions);
- if (translated !== key) {
- return translated;
- }
- return Lexicon.NOT_TRANSLATED + '(' + key + ')';
- }
- };
- });
- //# sourceMappingURL=StringResources.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2016, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/ajax/CAErrorHandler',['baglass/core-client/js/core-client/ui/core/Class', './CAAuthentication', 'jquery', 'caglass/nls/StringResources'], function (Class, CAAuthentication, $, StringResources) {
- var CAErrorHandler = Class.extend({
- init: function init(options) {
- this.CAM_LOCATION = 'X-CAM-Location';
- this.isOpeningLoginView = false;
- $.extend(this, options);
- },
- handleError: function handleError(ajaxResponse, options, glassContext) {
- var jqxhrStatus = ajaxResponse.jqXHR.status;
- return Promise.resolve().then(function () {
- if (jqxhrStatus === glassContext.ajaxCodes.UNAUTHORIZED) {
- return this._getCAAuthentication().login(glassContext, {
- relogin: true
- }).then(function () {
- return {
- retry: true
- };
- });
- } else if (jqxhrStatus === glassContext.ajaxCodes.AUTH_DENIED) {
- var jsonObj = JSON.parse(ajaxResponse.jqXHR.responseText);
- if (jsonObj.origin === 'siteminder' && jsonObj.redirectUrl) {
- return this._getCAAuthentication().login(glassContext, {
- relogin: true,
- skipCALogin: true,
- redirectUrl: jsonObj.redirectUrl
- }).then(function () {
- return {
- retry: true
- };
- });
- }
- }
- if (jqxhrStatus === 503) {
- this._showError(jqxhrStatus, glassContext);
- }
- return {
- retry: false
- };
- }.bind(this));
- },
- _getCAAuthentication: function _getCAAuthentication() {
- return new CAAuthentication();
- },
- _showError: function _showError(jqxhrStatus, glassContext) {
- glassContext.appController.showErrorMessage(StringResources.get('communicationErrorMessage', {
- code: jqxhrStatus
- }), StringResources.get('communicationErrorTitle'));
- }
- });
- return CAErrorHandler;
- });
- //# sourceMappingURL=CAErrorHandler.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Watson Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/ajax/HandleError',['./CAErrorHandler'], function (CAErrorHandler) {
- var HandleError = function HandleError(glassContext) {
- this.glassContext = glassContext;
- this.caErrorHandler = new CAErrorHandler();
- };
- HandleError.prototype.handleError = function (request, error) {
- if (request.params.skipErrorHandling === true) {
- return Promise.reject(error);
- } else {
- return this._getErrorHandler().handleError(error, {}, this.glassContext).then(function (result) {
- if (result.retry === true) {
- return this.glassContext.getCoreSvc('.Ajax').ajax(request.params);
- } else {
- return Promise.reject(error);
- }
- }.bind(this), function (handleError) {
- this.glassContext.getCoreSvc('.Logger').error('error while processing the initial error', error);
- return Promise.reject(handleError);
- }.bind(this));
- }
- };
- HandleError.prototype._getErrorHandler = function () {
- return this.caErrorHandler;
- };
- return HandleError;
- });
- //# sourceMappingURL=HandleError.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Watson Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/ajax/HandleResponse',[], function () {
- var HandleResponse = function HandleResponse(glassContext) {
- this.glassContext = glassContext;
- };
- HandleResponse.prototype.handleResponse = function (request) {
- return Promise["try"](function () {
- if (this.glassContext.services.exists('.Notification')) {
- this.glassContext.getSvc('.Notification').then(function (notificationSvc) {
- notificationSvc.pollForNewNotifications(request.params);
- });
- }
- }.bind(this))["catch"](function () {});
- };
- return HandleResponse;
- });
- //# sourceMappingURL=HandleResponse.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Watson Analytics (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/ajax/PrepareRequest',['baglass/utils/Utils'], function (GlassUtils) {
- var PrepareRequest = function PrepareRequest(glassContext) {
- this.glassContext = glassContext;
- };
- PrepareRequest.prototype.prepareRequest = function (request) {
- this._addDefaultHeaders(request);
- if (this._isServiceUrl(request.params.url)) {
- request.params.url = this._screenUrl(request.params.url);
- }
- };
- PrepareRequest.prototype._addDefaultHeaders = function (request) {
- var params = request.params;
- params.headers = params.headers || {};
- params.headers['X-XSRF-TOKEN'] = GlassUtils.getCookieValue('XSRF-TOKEN');
- if (GlassUtils.isFactoryMode()) {
- params.headers.X_BI_UI_FACTORYMODE = 'true';
- }
- if (this._shouldAddOverrideHeader(request.params.type || request.params.method)) {
- this._addOverrideHeader(request, request.params.type || request.params.method);
- }
- return Promise.resolve();
- };
- PrepareRequest.prototype._shouldAddOverrideHeader = function (requestType) {
- var configService = this.glassContext.getCoreSvc('.Config');
- var xssCheckingEnabled = configService.getXSSChecking();
- if (this.MASKED_METHODS.indexOf(requestType) >= 0 && xssCheckingEnabled) {
- return true;
- }
- return false;
- };
- PrepareRequest.prototype._addOverrideHeader = function (request, requestType) {
- request.params.headers['X-Http-Method-Override'] = requestType;
- request.params.type = 'POST';
- request.params.method = 'POST';
- };
- PrepareRequest.prototype._screenUrl = function (url) {
- //url component needs update not the query component
- var urlComponents = url.split('?');
- urlComponents[0] = urlComponents[0].replace('/.', '/_dot_');
- urlComponents[0] = urlComponents[0].replace(/~/g, '_tilde_');
- url = urlComponents.join('?');
- return url;
- };
- PrepareRequest.prototype._isServiceUrl = function (url) {
- return url && url.indexOf('v1/') >= 0;
- };
- PrepareRequest.prototype.MASKED_METHODS = ['PUT', 'DELETE'];
- return PrepareRequest;
- });
- //# sourceMappingURL=PrepareRequest.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Glass
- * (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/ajax/PrepareRequestURL',['underscore', 'baglass/app/services/ConfigService', 'baglass/utils/Utils'], function (_, ConfigService, GlassUtils) {
- var PrepareRequestURL = /*#__PURE__*/function () {
- function PrepareRequestURL(glassContext) {
- _classCallCheck(this, PrepareRequestURL);
- this.glassContext = glassContext;
- }
- _createClass(PrepareRequestURL, [{
- key: "prepareRequest",
- value: function prepareRequest(request) {
- if (this._isGET(request) && this.glassContext.getCoreSvc('.Config').getXSSChecking() === true) {
- this._CAFEncode(request);
- }
- }
- }, {
- key: "_CAFEncode",
- value: function _CAFEncode(request) {
- var encodingService = this.glassContext.getCoreSvc('.CAFEncoding');
- var currentDataObject = this._getDataObject(request.params.data);
- if (request.params.url) {
- var queryString = this._getQueryString(request.params.url);
- var qsObject = GlassUtils.deparam(queryString, false);
- _.extend(currentDataObject, qsObject);
- request.params.url = request.params.url.replace('?' + queryString, '');
- }
- this._encodeObject(currentDataObject, encodingService);
- request.params.data = currentDataObject;
- request.params.headers[PrepareRequestURL.XSS_ENCODING_HEADER] = true;
- }
- }, {
- key: "_isGET",
- value: function _isGET(request) {
- return request.params.method && request.params.method.toUpperCase() === 'GET' || request.params.type && request.params.type.toUpperCase() === 'GET' || request.params.method === undefined && request.params.type === undefined;
- }
- }, {
- key: "_encodeObject",
- value: function _encodeObject(objToEncode, encodingService) {
- for (var item in objToEncode) {
- if (_.isObject(objToEncode[item])) {
- this._encodeObject(objToEncode[item], encodingService);
- } else if (_.isString(objToEncode[item])) {
- objToEncode[item] = encodingService.encode(objToEncode[item]);
- }
- }
- }
- }, {
- key: "_getQueryString",
- value: function _getQueryString(url) {
- return url.indexOf('?') !== -1 ? url.substring(url.indexOf('?') + 1) : '';
- }
- }, {
- key: "_getDataObject",
- value: function _getDataObject(data) {
- var result = {};
- if (!_.isUndefined(data)) {
- if (_.isString(data)) {
- _.extend(result, this._parseDataString(data));
- } else if (_.isObject(data)) {
- _.extend(result, data);
- }
- }
- return result;
- }
- }, {
- key: "_parseDataString",
- value: function _parseDataString(str) {
- try {
- return JSON.parse(str);
- } catch (e) {
- return GlassUtils.deparam(str, false);
- }
- }
- }]);
- return PrepareRequestURL;
- }();
- PrepareRequestURL.XSS_ENCODING_HEADER = 'X-CA-XSSEncoded';
- return PrepareRequestURL;
- });
- //# sourceMappingURL=PrepareRequestURL.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/ajax/all',['./CASimpleAuthentication', './CAErrorHandler', './HandleError', './HandleResponse', './PrepareRequest', './PrepareRequestURL'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2016, 2018
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('baglass/api/BaseOpener',['../core-client/js/core-client/ui/core/Class', '../nls/StringResources', '../core-client/js/core-client/errors/BaseError'], function (BaseClass, StringResources, BaseError) {
- 'use strict'; //NOSONAR
- var BaseOpener = BaseClass.extend({
- _context: null,
- /**
- * Handler if the action handler is invoked from a menu item.
- */
- onSelectItem: function onSelectItem(context) {
- this.getCustomSpec = this._getMenuItemCustomSpec;
- this.onPress(context);
- },
- /**
- * Keyboard press handler to open object.
- *
- * @public
- * @param {object} context-glass context
- */
- onPress: function onPress(context) {
- this._context = context;
- return this._sendRequest().then(function (data) {
- return this._openObject(data);
- }.bind(this));
- },
- /**
- * A function that returns options defined in a perspective's contibution.json
- *
- * @public
- * @returns {object} an item spec from contribution
- */
- getCustomSpec: function getCustomSpec() {
- var oItemSpec = this._context.target.plugin.itemSpec;
- return oItemSpec;
- },
- _getMenuItemCustomSpec: function _getMenuItemCustomSpec() {
- var oItemSpec = this._context.target.plugin.itemSpec.items[this._context.target.specItemIndex];
- return oItemSpec;
- },
- /**
- * A function to return a custom list of parameters to be used
- * during REST call for the object itself
- *
- * @public
- * @returns {string} comma separated list of parameters
- */
- getRequestParameters: function getRequestParameters() {
- return 'ancestors,owner,modificationTime,permissions,defaultName';
- },
- _openObject: function _openObject(oData) {
- return Promise.resolve(this.getActionId(oData)).then(function (actionId) {
- if (!actionId) {
- throw new BaseError('Undefined actionId');
- }
- return this._context.glassContext.performAction(actionId, this._buildPayload(oData, actionId));
- }.bind(this)).then(function () {
- return this._context.glassContext.getSvc('.Content');
- }.bind(this)).then(function (contentSvc) {
- // We've succesfully done a defaultAction, try adding the object to the MRU list
- return contentSvc.addToMRU(oData);
- }).catch(function (e) {
- this._showToastOnLaunchError(oData);
- throw e;
- }.bind(this));
- },
- _sendRequest: function _sendRequest() {
- return this._buildRequestURL().then(function (url) {
- return this._context.glassContext.getCoreSvc('.Ajax').ajax({
- url: url,
- type: 'GET',
- dataType: 'json',
- data: {
- 'fields': this.getRequestParameters()
- }
- });
- }.bind(this)).then(function (response) {
- return response.data.data[0];
- }).catch(function (error) {
- var jqXHR = error.requestInfo.jqXHR;
- var messages = '';
- var responseJSON = jqXHR.responseJSON;
- if (responseJSON) {
- if (responseJSON.messages) {
- messages = jqXHR.responseJSON.messages.join('\n');
- } else if (responseJSON.cause) {
- try {
- var cause = JSON.parse(responseJSON.cause);
- messages = cause.messages.join('\n');
- } catch (e) {
- //if we get here, 'cause' is not a json object
- messages = responseJSON.cause;
- }
- }
- } else {
- messages = jqXHR.responseText;
- if (messages === '' && error.code === 404) {
- messages = StringResources.get('error404NotFound');
- }
- }
- this._context.glassContext.showErrorMessage(messages, 'Error');
- }.bind(this));
- },
- _buildRequestURL: function _buildRequestURL() {
- var customSpec = this.getCustomSpec();
- return this._context.glassContext.getSvc('.Content').then(function (contentSvc) {
- if (customSpec.options.id) {
- return contentSvc.getBaseObjectsURL() + '/' + encodeURIComponent(customSpec.options.id);
- } else {
- return contentSvc.getPathUrl(customSpec.options.path);
- }
- }.bind(this));
- },
- _buildPayload: function _buildPayload(oData, actionId) {
- return {
- 'glassContext': this._context.glassContext,
- 'target': {
- 'activeObject': {
- 'aSelectedContext': [oData]
- },
- 'itemId': actionId
- }
- };
- },
- _showToastOnLaunchError: function _showToastOnLaunchError(oData) {
- var objName = oData['defaultName'];
- this._context.glassContext.showToast(StringResources.get('openPerspectiveFailed', {
- 'name': objName
- }), {
- 'type': 'error'
- });
- },
- /**
- * An action Id getter function.
- *
- * @public
- * @returns {string} the action id of module used to open this object
- */
- getActionId: function getActionId(data) {
- return 'com.ibm.bi.contentApps.defaultAction.' + data.type;
- }
- });
- return BaseOpener;
- });
- //# sourceMappingURL=BaseOpener.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2016, 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('caglass/api/DashboardOpener',['baglass/api/BaseOpener'], function (BaseOpener) {
- 'use strict';
- var DashboardOpener = BaseOpener.extend({});
- return DashboardOpener;
- });
- //# sourceMappingURL=DashboardOpener.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2016, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/api/ExtensionViewAdaptor',['baglass/api/ExtensionViewAdaptor', 'jquery', '../ajax/CAAuthentication', 'baglass/utils/Utils', 'baglass/core-client/js/core-client/utils/Utils', 'baglass/core-client/js/core-client/utils/ClassFactory', 'underscore'], function (ExtensionViewAdaptor, $, CAAuthentication, Utils, CoreUtils) {
- /**
- * 2.0 ExtensionView adaptor
- *
- */
- var ContentView = ExtensionViewAdaptor.extend({
- /**
- * @typedef {Object} LoginError
- * @property {string} message - error message
- */
- /**
- * @override
- * @public
- * @param {Object[]} loginPrompts - object containing the login prompts
- * @param {string} loginPrompts[].name - name of the login prompt
- * @param {string} loginPrompts[].value - value of the login prompt
- * @return {Promise<undefined|LoginError>} - promise resolved with no object when the login is successful, rejected with an error when it fails,
- *
- */
- signin: function signin(loginPrompts) {
- return this._getCAAuthentication().submitCredentials(this.glassContext, {
- parameters: loginPrompts
- }).then(function (authInfo) {
- $(CoreUtils.getCurrentWindow()).trigger('ca.loginSuccessful', authInfo);
- return;
- });
- },
- /**
- * @override
- * @public
- * @return {Promise} - promise resolved with no object when the login is successful, rejected with an error when it fails,
- *
- */
- render: function render() {
- var _this = this;
- if (this.origin && this.origin.queryString && this.origin.queryString.CAMUsername && this.origin.queryString.CAMPassword) {
- var queryString = this.origin.queryString;
- var loginParams = Utils.getFilteredLoginParameters(this.glassContext, queryString);
- return this.signin(loginParams).then(function () {
- return Promise.resolve();
- })["catch"](function () {
- return _this._openLoginView();
- });
- } else {
- return this._openLoginView();
- }
- },
- _openLoginView: function _openLoginView() {
- return this.doRender();
- },
- _getCAAuthentication: function _getCAAuthentication() {
- return new CAAuthentication();
- }
- });
- return ContentView;
- });
- //# sourceMappingURL=ExtensionViewAdaptor.js.map
- ;
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
- /*
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: GLASS
- *
- * (C) Copyright IBM Corp. 2019
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/app/NavbarButtonSlideoutController',['../core-client/js/core-client/ui/core/Class', 'jquery', 'underscore'], function (BaseClass, $, _) {
- 'use strict';
- /**
- * This Class is Glass Push-able navigation bar button slideout ontroller
- */
- var NavbarButtonSlideoutController = BaseClass.extend(
- /**
- * @lends NavbarButtonSlideoutController.prototype
- */
- {
- /**
- * @classdesc class representing a menu
- * @augments Class
- * @constructs
- * @public
- *
- * @param {object}
- * options The options object
- * @param {object}
- * options.glasscontext The glass context
- * @param {boolean}
- * options.isAppviewScope Whether the slideout is Application or AppView scope. Default=false
- */
- init: function init(options) {
- $.extend(true, this, options);
- },
- _slideout: null,
- /**
- * Keyboard press handler for pushable button.
- * push/unpush the button opens/hides slideout
- *
- * @public
- * @param {object} context-glass context
- */
- onPress: function onPress(context) {
- if (context.pushState === true) {
- this._onPush(context);
- } else {
- this._onUnpush(context);
- }
- },
- _onPush: function _onPush(context) {
- var slideout = this._pushHandler(context);
- this.onShowCallback(context, slideout);
- },
- /**
- * @private
- * @returns {object} a glass slideout object
- */
- _pushHandler: function _pushHandler(context) {
- var itemSpec = this.getCustomSpec(context);
- var slideout = this._openSlideout(context, itemSpec.options);
- slideout.on('show', function (plugin) {
- if (_.isFunction(plugin.setPressed)) {
- plugin.setPressed();
- }
- }.bind(this, context.target.plugin));
- slideout.on('hide', function (plugin) {
- // there is a case when a menu item of GlassMenu triggers onSelectItem() function of FolderOpener controller
- // thus, plugin is GlassMenu which, in turn, doesn't have a definition of setUnpressed() function
- if (_.isFunction(plugin.setUnpressed)) {
- plugin.setUnpressed();
- }
- }.bind(this, context.target.plugin));
- slideout.setLaunchPoint(context.target.plugin.getRootElement());
- this._slideout = slideout;
- return slideout;
- },
- _openSlideout: function _openSlideout(context, options) {
- this._sendInstrumentationEvt(context, options);
- if (this.isAppviewScope) {
- return context.glassContext.currentAppView.openSlideout(options);
- } else {
- return context.glassContext.showSlideOut(options);
- }
- },
- _onUnpush: function _onUnpush(context) {
- this.onHideCallback(context);
- },
- /**
- * A getter function that returns the class member variable '_slideout'
- * @public
- * @returns {object} slideout object
- */
- getSlideout: function getSlideout() {
- return this._slideout;
- },
- /**
- * A setter function that sets a slideout object to the class member variable '_slideout'
- * @private
- * @param {object} slideout - slideout object such as object returned by glass context application controller's showSlideout method
- */
- _setSlideout: function _setSlideout(slideout) {
- this._slideout = slideout;
- },
- /**
- * A function that returns a predefined slideout object itemspec
- * @public
- * @param {object} context - glass context
- * @returns {object} a Slideout item spec
- */
- getCustomSpec: function getCustomSpec(context) {
- var oItemSpec = context.target.plugin.itemSpec;
- if (oItemSpec.options && oItemSpec.options.content) {
- oItemSpec.options.id = oItemSpec.id + '.' + oItemSpec.options.content.module + '.global';
- }
- return oItemSpec;
- },
- /**
- * A function that sends an instrumentation event
- * @private
- * @param {object} context - glass context
- * @param {object} options - options defined in the itemSpec
- */
- _sendInstrumentationEvt: function _sendInstrumentationEvt(context, options) {
- var instrumentationService = context.glassContext.getCoreSvc('.Instrumentation');
- if (instrumentationService.enabled && options && options.instrumentation && options.instrumentation.enabled) {
- instrumentationService.track(_objectSpread({
- type: options.instrumentation.type,
- objectType: options.instrumentation.objectType,
- action: options.instrumentation.action,
- uiElement: options.instrumentation.uiElement,
- milestoneName: options.instrumentation.action + '_' + options.instrumentation.objectType + '_' + options.instrumentation.uiElement
- }, options.instrumentation.CTA && {
- CTA: options.instrumentation.CTA
- }));
- }
- },
- /**
- * A function that is triggered after a slideout opens
- * subclass can override it for its own purpose
- * @param {object} context - glass context
- */
- onShowCallback: function onShowCallback() {//Override when necessary
- },
- /**
- * A function that works as a callback after a slideout is hidden
- * subclass can override it for its own purpose
- * @param {object} context - glass context
- */
- onHideCallback: function onHideCallback() {//Override when necessary
- }
- });
- return NavbarButtonSlideoutController;
- });
- //# sourceMappingURL=NavbarButtonSlideoutController.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2016, 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('caglass/api/FolderOpener',['underscore', 'baglass/app/NavbarButtonSlideoutController'], function (_, NavbarButtonSlideoutController) {
- 'use strict';
- var FolderOpener = NavbarButtonSlideoutController.extend({
- _getDefaultItemSpec: function _getDefaultItemSpec() {
- return {
- 'hideOnly': true,
- 'position': 'left',
- 'width': '400px',
- 'perspective': 'home',
- 'label': 'Untitled Label',
- 'resizable': true,
- 'content': {
- 'module': 'bi/content_apps/GenericFolderWideView',
- 'trackBreadcrumbs': true,
- 'showFilter': true,
- 'showAddFolder': true,
- 'showBreadcrumbs': true,
- 'showSort': true
- }
- };
- },
- /**
- * A function that returns an itemSpec for slideout
- *
- * @public
- * @param {object} context - glass context
- * @returns {object} a Slideout item spec
- */
- getCustomSpec: function getCustomSpec(context) {
- var oItemSpec;
- if (_.isNumber(context.target.specItemIndex) && _.isArray(context.target.plugin.itemSpec.items)) {
- oItemSpec = context.target.plugin.itemSpec.items[context.target.specItemIndex];
- } else {
- oItemSpec = context.target.plugin.itemSpec;
- }
- var oTargetOptionSpec = this._getDefaultItemSpec();
- if (oItemSpec.options) {
- if (oItemSpec.options.id) {
- oTargetOptionSpec.content.id = 'folder.' + oItemSpec.options.id;
- oTargetOptionSpec.content.folder = oItemSpec.options.id;
- } else if (oItemSpec.options.path) {
- oTargetOptionSpec.content.id = 'folder.' + oItemSpec.options.path;
- oTargetOptionSpec.content.folder = oItemSpec.options.path;
- }
- if (oItemSpec.options.showNewItem !== undefined || (oItemSpec.options.content && oItemSpec.options.content.showNewItem) !== undefined) {
- oTargetOptionSpec.content.showNewItem = oItemSpec.options.showNewItem || oItemSpec.options.content && oItemSpec.options.content.showNewItem; //don't show the addFolder button if we have a new button as it will contain its own.
- if (oTargetOptionSpec.content.showNewItem === true) {
- oTargetOptionSpec.content.showAddFolder = false;
- }
- }
- oTargetOptionSpec.id = oItemSpec.id + '.' + oTargetOptionSpec.content.module + '.global';
- if (oItemSpec.label) {
- oTargetOptionSpec.label = oItemSpec.label;
- }
- if (_.isBoolean(oItemSpec.options.skipAncestors)) {
- oTargetOptionSpec.content.skipAncestors = oItemSpec.options.skipAncestors;
- }
- }
- oItemSpec.options = oTargetOptionSpec;
- return oItemSpec;
- },
- /**
- * Called when the context menu item is selected.
- *
- * @public
- * @param {context} which contains the following:
- * <ul>
- * <li>glassContext</li>
- * <li>target: object containing info on the target including plugin and itemId</li>
- * </ul>
- */
- onSelectItem: function onSelectItem(context) {
- context.pushState = true;
- this.onPress(context);
- }
- });
- return FolderOpener;
- });
- //# sourceMappingURL=FolderOpener.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2016, 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('caglass/api/ReportOpener',['baglass/api/BaseOpener'], function (BaseOpener) {
- 'use strict'; //NOSONAR: Meant to be strict
- var ReportOpener = BaseOpener.extend({
- getRequestParameters: function getRequestParameters() {
- return 'ancestors,owner,modificationTime,permissions,defaultName,runInAdvancedViewer';
- }
- });
- return ReportOpener;
- });
- //# sourceMappingURL=ReportOpener.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/api/all',['./DashboardOpener', './ExtensionViewAdaptor', './FolderOpener', './ReportOpener'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/common/ui/OfflineOnlineDialog',['ca-ui-toolkit-core', 'react', 'react-dom', 'prop-types', '../../nls/StringResources'], function (uiToolkit, React, ReactDOM, PropTypes, StringResources) {
- var Dialog = uiToolkit.Dialog,
- ProgressIndicator = uiToolkit.ProgressIndicator;
- function OfflineOnlineDialog(props) {
- var refreshButtonCallback = function refreshButtonCallback() {
- window.location.reload();
- };
- var dialogTitle = StringResources.get('offlineErrorTitle');
- var dialogContent = StringResources.get('offlineErrorMessage');
- var refreshButton = StringResources.get('refreshButton');
- var dialogProps = {
- size: 'small',
- minWidth: '400px',
- maxWidth: '500px',
- clickaway: false,
- startingFocusIndex: -1
- };
- var progressIndicatorProps = {
- tabIndex: -1,
- variant: 'bar',
- size: 'normal',
- determinate: false
- };
- if (!props.online) {
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dialog, dialogProps, /*#__PURE__*/React.createElement(Dialog.Header, null, dialogTitle), /*#__PURE__*/React.createElement(Dialog.Body, null, dialogContent), /*#__PURE__*/React.createElement(ProgressIndicator, progressIndicatorProps), /*#__PURE__*/React.createElement(Dialog.Footer, null, /*#__PURE__*/React.createElement(Dialog.Button, {
- label: refreshButton,
- onClick: refreshButtonCallback
- }))));
- }
- return null;
- }
- OfflineOnlineDialog.propTypes = {
- online: PropTypes.bool
- };
- return OfflineOnlineDialog;
- });
- //# sourceMappingURL=OfflineOnlineDialog.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Business Analytics (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/OfflineOnlineService',['react', 'react-dom', '../common/ui/OfflineOnlineDialog'], function (React, ReactDOM, OfflineOnlineDialog) {
- var OfflineOnlineService = /*#__PURE__*/function () {
- function OfflineOnlineService() {
- var _this = this;
- _classCallCheck(this, OfflineOnlineService);
- /**TODO :
- * when state management is introduced abstract offline/online
- * event listeners from OfflineModule into this service
- */
- window.addEventListener('offline', function () {
- _this.renderDialog(false);
- });
- window.addEventListener('online', function () {
- _this.renderDialog(true);
- });
- var offlineOnlineContainer = document.createElement('div');
- offlineOnlineContainer.id = 'offlineOnlineDialogContainer';
- document.getElementById('main').appendChild(offlineOnlineContainer);
- }
- _createClass(OfflineOnlineService, [{
- key: "renderDialog",
- value: function renderDialog(onlineStatus) {
- var container = document.getElementById('offlineOnlineDialogContainer');
- ReactDOM.render( /*#__PURE__*/React.createElement(OfflineOnlineDialog, {
- online: onlineStatus
- }), container);
- }
- }]);
- return OfflineOnlineService;
- }();
- return OfflineOnlineService;
- });
- //# sourceMappingURL=OfflineOnlineService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017,2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/services/CAUserProfileService',['baglass/app/services/UserProfileService', 'underscore', 'baglass/core-client/js/core-client/errors/BaseError', 'baglass/core-client/js/core-client/utils/BidiUtil', 'jquery', 'baglass/utils/Utils'], function (UserProfileService, _, BaseError, BidiUtil, $, GlassUtils) {
- /**
- * This Class exposes a JavaScript API for the userProfile REST service
- */
- var CAUserProfileService = UserProfileService.extend({
- /**
- * Initialize the CAUserProfileService with seeded values and updates glassContext
- */
- initialize: function initialize(context) {
- if (_.isObject(context)) {
- if (context.authInfo && context.capabilities && context.userAccount) {
- _.extend(this, _.pick(context, 'userAccount', 'tenants', 'credentials', 'userProfileSettings', 'capabilities', 'authInfo', 'preferences'));
- if (this.preferences) {
- var biDirectionalFeaturesEnabled = this.preferences.biDirectionalFeaturesEnabled || false;
- var textDirection = this.preferences.baseTextDirection || '';
- this._setBidiPrefs(textDirection, biDirectionalFeaturesEnabled.toString(), this.preferences.contentLocale || 'en');
- }
- return this.glassContext.getCoreSvc('.Config').getLegacyLaunchable().then(function (legacyLaunchable) {
- return this._updateContextWithAccountInfo(this.userAccount, this.capabilities, legacyLaunchable, this.authInfo);
- }.bind(this)).then(function (account) {
- if (this.userAccount && (this.userAccount.isSystemAdmin || this.userAccount.isTenantAdmin)) {
- this._setUserTenantName(account, this.tenants);
- this._bindToAdminEvent();
- }
- return account;
- }.bind(this));
- } else {
- return Promise.reject(new Error('Context must contain authInfo, capabilities and userAccount properties'));
- }
- } else {
- return Promise.reject(new Error('Invalid context'));
- }
- },
- logout: function logout() {
- this._clearCache();
- this.glassContext.profile = {};
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.LOGIN_URL,
- type: 'DELETE'
- });
- },
- updatePreferences: function updatePreferences(isFirstLogin) {
- return this._catchLogReturn(this._getPreferences(isFirstLogin
- /* useCache - yes on first login; no otherwise */
- ), {}).then(function (preferences) {
- this._setPreferences(preferences);
- }.bind(this));
- },
- _clearCache: function _clearCache() {
- //assuming that the user profile settings endpoint always returns the settings for the primary user. Confirm this with serge and test it.
- CAUserProfileService.inherited('updateContext', this, [{
- userProfileSettings: null,
- capabilities: null,
- preferences: null,
- tenants: null,
- userAccount: null,
- credentials: null,
- authInfo: null
- }]);
- this.glassContext.getCoreSvc('.Config').clearConfigs();
- },
- disableLoggingSession: function disableLoggingSession() {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- type: 'DELETE',
- url: CAUserProfileService.SESSIONLOGGING_URL
- });
- },
- getUserAccount: function getUserAccount(useCache) {
- if (!_.isEmpty(this.userAccount) && useCache === true) {
- return Promise.resolve(this.userAccount);
- } else {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.USER_ACCOUNT_URL,
- type: 'GET'
- }).then(function (data) {
- this.userAccount = data.data;
- return this.userAccount;
- }.bind(this))["catch"](function (error) {
- var errObj = new BaseError('Internal error retrieving user account:' + error.message, error);
- this.glassContext.getCoreSvc('.Logger').warn(errObj);
- throw errObj;
- }.bind(this));
- }
- },
- getPortalPages: function getPortalPages() {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.USER_PORTALPAGES_URL,
- type: 'GET'
- }).then(function (data) {
- return data.data;
- });
- },
- addPortalPage: function addPortalPage(id) {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- headers: {
- Accept: 'application/json',
- 'Content-Type': 'application/json'
- },
- url: CAUserProfileService.USER_PORTALPAGES_URL,
- type: 'POST',
- data: JSON.stringify({
- target: id
- })
- });
- },
- deletePortalPage: function deletePortalPage(id) {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.USER_PORTALPAGES_URL + '/' + encodeURIComponent(id),
- type: 'DELETE'
- });
- },
- resetHome: function resetHome() {
- var homePagePref = {
- 'homePage': ''
- };
- return this.savePreferences(homePagePref);
- },
- savePreferences: function savePreferences(preferences) {
- return this._saveEmail({
- 'email': preferences.email
- }).then(this._savePreferences.bind(this, preferences)).then(this._setPreferences.bind(this, preferences));
- },
- _savePreferences: function _savePreferences(preferences) {
- if (preferences && !$.isEmptyObject(preferences)) {
- // Update the rest of the preferences through ups.
- var jsonData = JSON.stringify(_.omit(preferences, 'email'));
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.PREFERENCES_URL,
- type: 'PUT',
- 'headers': {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json'
- },
- data: jsonData
- });
- }
- },
- _saveEmail: function _saveEmail(preferences) {
- return Promise["try"](function () {
- if (preferences.email !== undefined && this.glassContext.profile.account._meta && this.glassContext.profile.account._meta.schemaInfo.email.modifiable) {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: 'v1/users_ex/' + this.glassContext.getCoreSvc('.UserProfile').preferences.id,
- type: 'PUT',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json'
- },
- data: JSON.stringify({
- 'email': preferences.email
- })
- }).then(function (response) {
- if (response.data.errorCode === 1) {
- // Request is failed.
- this.glassContext.getCoreSvc('.Logger').error('Update email failed');
- } else {
- this.glassContext.profile.account.email = preferences.email;
- this.userAccount.email = preferences.email;
- }
- }.bind(this));
- }
- }.bind(this));
- },
- /*
- * @param {Object} dataSourceCredential - mandatory : set of mandatory passed in arguments
- * {
- * @param {boolean} dataSourceCredential.perm : true when permanent credential, false when credential lasts only for user session
- * @param {String} dataSourceCredential.dataSourceName: "GoSales",
- * @param {String} dataSourceCredential.dataSourceConnectionName: "GoSales_connection",
- * @param {Object} dataSourceCredential.credentials:
- * {
- * "value": [{
- * "userName": "gosales",
- * "password": "Cognos_1"
- * }]
- * }
- * @return ajax response
- */
- saveDataSourceCredential: function saveDataSourceCredential(dataSourceCredential) {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.DATASOURCE_CREDENTIAL_PATH,
- type: 'POST',
- 'headers': {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json'
- },
- data: JSON.stringify(dataSourceCredential)
- }).then(function (response) {
- return response.data;
- });
- },
- _saveCredentials: function _saveCredentials() {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.CREDENTIALS_URL,
- type: 'POST',
- 'headers': {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json'
- },
- data: '{}',
- skipErrorHandling: true
- }).then(function (response) {
- return response && response.data;
- })["catch"](function (err) {
- throw err.jqXHR;
- });
- },
- resetCredentials: function resetCredentials() {
- return this._saveCredentials();
- },
- getAccountInfo: function getAccountInfo(authInfo) {
- return Promise["try"](this._getAccountInfo.bind(this, authInfo));
- },
- _getAccountInfo: function _getAccountInfo(authInfo) {
- var configSvc = this.glassContext.getCoreSvc('.Config');
- var reqAccount = this.getUserAccount();
- var reqCredentials = this._getCredentials().catchReturn();
- var reqDefaultHome = this._catchLogReturn(configSvc.getDefaultHome(), {});
- var reqUserProfileSettings = this._catchLogReturn(this._getUserProfileSettings(), {});
- var reqCapabilites = this._catchLogReturn(this.getCapabilities(), {});
- var reqLegacyLaunchable = this._catchLogReturn(configSvc.getLegacyLaunchable(), {});
- return Promise.all([reqAccount, reqCredentials, reqUserProfileSettings, reqCapabilites, reqLegacyLaunchable, reqDefaultHome]).spread(function (accountInfo, credentials, userProfileSettings, capabilities, legacyLaunchable) {
- return this._updateContextWithAccountInfo(accountInfo, capabilities, legacyLaunchable, authInfo);
- }.bind(this)).then(function (account) {
- if (this.userAccount && (this.userAccount.isSystemAdmin || this.userAccount.isTenantAdmin)) {
- return this.fetchTenants().then(function (tenants) {
- this.tenants = tenants;
- this._setUserTenantName(account, tenants);
- this._bindToAdminEvent();
- return account;
- }.bind(this))["catch"](function (err) {
- this.glassContext.getCoreSvc('.Logger').warn(err);
- this.tenants = undefined;
- return account;
- }.bind(this));
- } else {
- return account;
- }
- }.bind(this));
- },
- updateIdentity: function updateIdentity(useCache) {
- this.glassContext.getCoreSvc('.Logger').warn('The `updateIdentity` method of CAUserProfileService has been deprecated, to update the isSystemAdmin or isTenantAdmin data please use `getUserAccount` method instead.');
- return this.getUserAccount(useCache);
- },
- /**
- * Sets the tenantName in the account object when a tenantID is set
- * @param {Object} account - account object
- * @param {Array} tenants - array of tenants
- */
- _setUserTenantName: function _setUserTenantName(account, tenants) {
- if (account.tenantID) {
- var tenant = _.findWhere(tenants, {
- tenantID: account.tenantID
- });
- if (tenant && tenant.defaultName) {
- account.tenantName = tenant.defaultName;
- } else {
- this.glassContext.getCoreSvc('.Logger').error('tenant name not set for ' + account.tenantID + ', the id is used to set the tenant name');
- account.tenantName = account.tenantID;
- }
- } else {
- this.glassContext.getCoreSvc('.Logger').debug('user is not part of a tenant: no tenant name is set in the account object');
- }
- },
- _getPreferences: function _getPreferences(useCache) {
- if (!_.isEmpty(this.preferences) && useCache === true) {
- return Promise.resolve(this.preferences);
- } else {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.PREFERENCES_URL,
- type: 'GET'
- }).then(function (data) {
- this.preferences = data.data;
- return this.preferences;
- }.bind(this));
- }
- },
- _getCredentials: function _getCredentials(useCache) {
- if (!_.isEmpty(this.credentials) && useCache === true) {
- return Promise.resolve(this.credentials);
- } else {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.CREDENTIALS_URL,
- type: 'GET'
- }).then(function (data) {
- this.credentials = data.data;
- return this.credentials;
- }.bind(this));
- }
- },
- _getUserProfileSettings: function _getUserProfileSettings() {
- if (!this.userProfileSettings) {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.USER_PROFILE_SETTINGS,
- type: 'GET',
- dataType: 'json'
- }).then(function (settings) {
- this.userProfileSettings = settings.data;
- return this.userProfileSettings;
- }.bind(this))["catch"](function (err) {
- this.glassContext.getCoreSvc('.Logger').error('Internal error retrieving user profile settings:' + err.message);
- this.userProfileSettings = CAUserProfileService.defaultUserSettings;
- return this.userProfileSettings;
- }.bind(this));
- } else {
- return Promise.resolve(this.userProfileSettings);
- }
- },
- getCapabilities: function getCapabilities() {
- if (!this.capabilities) {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.CAPABILITIES_PATH,
- type: 'GET'
- }).then(function (results) {
- this.capabilities = results.data.userCapabilities;
- return this.capabilities;
- }.bind(this))["catch"](function (error) {
- throw new BaseError('Internal error retrieving capabilities:' + error.textStatus, error);
- });
- } else {
- return Promise.resolve(this.capabilities);
- }
- },
- _updateContextWithAccountInfo: function _updateContextWithAccountInfo(accountInfo, capabilities, legacyLaunchable, authInfo) {
- this.hasCredentials = this.credentials ? true : false;
- this.glassContext.primaryUserChanged = false;
- this.glassContext.profile.account = accountInfo;
- var extraAccountInfo = {
- 'displayName': accountInfo.defaultName,
- 'isAnonymous': authInfo ? authInfo.isAnonymous : undefined,
- 'showLogIn': authInfo ? authInfo.canCallLogon : undefined
- };
- _.extend(this.glassContext.profile.account, extraAccountInfo);
- this.glassContext.legacyLaunchable = legacyLaunchable === 1;
- if (authInfo) {
- this.glassContext.cafContextId = authInfo.cafContextId;
- }
- return accountInfo;
- },
- _setPreferences: function _setPreferences(preferences) {
- if (!this.preferences) {
- this.preferences = {};
- }
- $.extend(true, this.preferences, preferences);
- var biDirectionalFeaturesEnabled = preferences && preferences.biDirectionalFeaturesEnabled || false;
- this._setBidiPrefs(preferences && preferences.baseTextDirection || '', biDirectionalFeaturesEnabled.toString(), preferences && preferences.contentLocale || 'en');
- },
- _setBidiPrefs: function _setBidiPrefs(textDir, bidiSupport, contentLocale) {
- BidiUtil.setUserPreferredTextDir(textDir, bidiSupport);
- BidiUtil.setUserPreferredContentLocale(contentLocale);
- },
- fetchTenants: function fetchTenants(useCache) {
- var _this = this;
- if (!_.isEmpty(this.tenants) && useCache === true) {
- return Promise.resolve(this.tenants);
- }
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: CAUserProfileService.TENANTS_PATH,
- type: 'GET'
- }).then(function (response) {
- _this.tenants = response.data.data;
- return _this.tenants;
- })["catch"](function (err) {
- throw new BaseError('Internal error retrieving tenants:' + err.message, err);
- });
- },
- updateTenants: function updateTenants() {
- return this.fetchTenants().then(function (tenants) {
- this.tenants = tenants;
- return tenants;
- }.bind(this))["catch"](function (errObj) {
- this.glassContext.getCoreSvc('.Logger').warn(errObj);
- }.bind(this));
- },
- isSysAdmin: function isSysAdmin() {
- return this.getUserAccount(true).then(function (userAccount) {
- return userAccount.isSystemAdmin;
- }.bind(this));
- },
- isTenantAdmin: function isTenantAdmin() {
- return this.getUserAccount(true).then(function (userAccount) {
- return userAccount.isTenantAdmin;
- }.bind(this));
- },
- getHomePage: function getHomePage() {
- var home = this._getMutableHomePage();
- return this._buildHomePageObject(home);
- },
- getFactoryHomePage: function getFactoryHomePage() {
- return this._buildHomePageObject(CAUserProfileService.defaultUserSettings.ui_homePage);
- },
- _getMutableHomePage: function _getMutableHomePage() {
- if (GlassUtils.isFactoryMode()) {
- return CAUserProfileService.defaultUserSettings.ui_homePage;
- }
- if (this.preferences && !_.isEmpty(this.preferences.homePage)) {
- try {
- return JSON.parse(this.preferences.homePage);
- } catch (err) {
- this.glassContext.getCoreSvc('.Logger').error('error parsing home page', err);
- return CAUserProfileService.defaultUserSettings.ui_homePage;
- }
- }
- if (this.userProfileSettings && this.userProfileSettings.ui_homePage) {
- var home = this.userProfileSettings.ui_homePage;
- if (home && home.content && home.content.action === 'run') {
- delete home.content.action;
- }
- return home;
- }
- return CAUserProfileService.defaultUserSettings.ui_homePage;
- },
- _buildHomePageObject: function _buildHomePageObject(home) {
- var context = {
- content: {
- isHomePage: true
- }
- };
- return $.extend(true, context, home);
- },
- getProductLocale: function getProductLocale() {
- return this.preferences && this.preferences.productLocale;
- },
- getAccountID: function getAccountID() {
- return this.userAccount && this.userAccount.id;
- },
- // TODO: This is awful.
- // Admin needs to either use the .Events service to send this message, or
- // better yet - "glassContext.getCoreSvc('.UserProfile').updateTenants()"
- _bindToAdminEvent: function _bindToAdminEvent() {
- $(document).on('com.ibm.cognos.bi.admin.updatetenantlist', this.updateTenants.bind(this));
- },
- _catchLogReturn: function _catchLogReturn(promise, returned) {
- return Promise.resolve(promise)["catch"](function (err) {
- this.glassContext.getCoreSvc('.Logger').error(err.message || err);
- return returned;
- }.bind(this));
- }
- });
- CAUserProfileService.BASE_URL = 'v1';
- CAUserProfileService.LOGIN_URL = CAUserProfileService.BASE_URL + '/login';
- CAUserProfileService.PREFERENCES_URL = CAUserProfileService.BASE_URL + '/users/~/preferences';
- CAUserProfileService.USER_ACCOUNT_URL = CAUserProfileService.BASE_URL + '/users/~/account';
- CAUserProfileService.USER_PORTALPAGES_URL = CAUserProfileService.BASE_URL + '/users/~/my_portalPages';
- CAUserProfileService.CREDENTIALS_URL = CAUserProfileService.BASE_URL + '/users/~/credentials';
- CAUserProfileService.CAPABILITIES_PATH = CAUserProfileService.BASE_URL + '/users/~/capabilities';
- CAUserProfileService.TENANTS_PATH = CAUserProfileService.BASE_URL + '/tenants';
- CAUserProfileService.DATASOURCE_CREDENTIAL_PATH = CAUserProfileService.BASE_URL + '/users/~/credentials/datasources';
- CAUserProfileService.USER_PROFILE_SETTINGS = CAUserProfileService.BASE_URL + '/users/~/user_profile_settings';
- CAUserProfileService.SESSIONLOGGING_URL = CAUserProfileService.BASE_URL + '/glug/sessions/current';
- CAUserProfileService.defaultUserSettings = {
- ui_excludedFeatures: {},
- ui_homePage: {
- perspective: 'home'
- },
- ui_theme: 'IBM'
- };
- return CAUserProfileService;
- });
- //# sourceMappingURL=CAUserProfileService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2017, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule
- * Contract with IBM Corp.
- */
- define('caglass/app/services/LogoutService',['baglass/core-client/js/core-client/utils/Utils', 'underscore'], function (Utils, _) {
- var LogoutService = function LogoutService() {
- this._preLogoutActions = [];
- this._postLogoutActions = [];
- };
- /**
- *
- * logs out and shows the custom logout page or the CA login page
- * @public
- * @param {Object} context
- *
- */
- LogoutService.prototype.logOut = function (context) {
- return this._preLogout(context.glassContext)["finally"](function () {
- var redirectToLogin = function () {
- var ssoLogout = context.glassContext.getSSOLogoutURL();
- if (ssoLogout) {
- this._redirectBrowser(ssoLogout);
- } else {
- this._redirectBrowser(window.location.pathname);
- }
- }.bind(this);
- this.registerPostLogout(redirectToLogin);
- return context.glassContext.services.userProfile.logout();
- }.bind(this)).then(this._postLogout.bind(this, context.glassContext));
- };
- /**
- *
- * Registers a pre logout action
- * the actions are invoked in the order of registration
- * a failure does not stop the logout process
- * @public
- * @param {Function} action - method invoked before logout
- */
- LogoutService.prototype.registerPreLogout = function (action) {
- if (_.isFunction(action)) {
- this._preLogoutActions.push(action);
- } else {
- throw new Error(action + ' is not a function');
- }
- };
- /**
- *
- * Registers a post logout action
- * the actions are invoked in the order of registration
- * a failure does not stop the logout process
- * @public
- * @param {Function} action - method invoked before logout
- */
- LogoutService.prototype.registerPostLogout = function (action) {
- if (_.isFunction(action)) {
- this._postLogoutActions.push(action);
- } else {
- throw new Error(action + ' is not a function');
- }
- };
- /**
- * Redirects to the passed url
- * @private
- * @param {String} url - url to redirect once logout is complete
- */
- LogoutService.prototype._redirectBrowser = function (url) {
- Utils.getCurrentWindow().location = url;
- };
- /**
- * invokes all the preLogout actions in order of registration
- * @private
- * @return {Object} promise resolved when all the actions are executed, resolved or rejected
- */
- LogoutService.prototype._preLogout = function (glassContext) {
- return this._invokeActions(glassContext, this._preLogoutActions, 'preLogout');
- };
- /**
- * invokes all the postLogout actions in order of registration
- * @private
- * @return {Object} promise resolved when all the actions are executed, resolved or rejected
- */
- LogoutService.prototype._postLogout = function (glassContext) {
- return this._invokeActions(glassContext, this._postLogoutActions, 'postLogout');
- };
- /**
- * invokes the passed array of actions
- * @private
- * @param {Object} glassContext - glassContext
- * @param {Function[]} actions - actions to invoke
- * @param {String} type - type of actions, preLogout or postLogout
- * @returns {Promise} - promised resolved once all the actions are invoked whether they fail or not
- */
- LogoutService.prototype._invokeActions = function (glassContext, actions, type) {
- var reducer = function reducer(previous, current) {
- return previous.then(function () {
- return current(glassContext);
- })["catch"](function (error) {
- glassContext.getCoreSvc('.Logger').error('failure while executing an action of type ' + type, error);
- });
- };
- return actions.reduce(reducer, Promise.resolve());
- };
- return LogoutService;
- });
- //# sourceMappingURL=LogoutService.js.map
- ;
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/utils/CAUtils',['jquery'], function ($) {
- var CAUtils = function CAUtils() {};
- /**
- * Parses the supplied href and returns a string scrubbed of any `CAMNamespace=...` key, value that appears before an anchor `#`
- * @public
- * @param {String} - href string
- * @returns {String} - href string sans CAMNamespace=... key value
- */
- CAUtils.prototype.removeCAMNamespaceHref = function (href) {
- var regExp = /([?&])(CAMNamespace=\w*[^#&]*&?)/g;
- var queryString = href.substring(0, href.indexOf('#'));
- if (queryString.length > 0) {
- return queryString.replace(regExp, '$1').concat(href.substring(href.indexOf('#')));
- }
- return href.replace(regExp, '$1');
- };
- /**
- * Parses redirectUrl and correctly appends updatedco=true
- * @public
- * @param {String} - href string
- * @returns {String} - href string including updatedco=true key value
- */
- CAUtils.prototype.addUpdateDcoToQuerystring = function (href, updateDco) {
- var questionMarkParamsRegExp = /([?])(.*)/;
- var updatedcoRegExp = /updatedco=\w+/;
- var queryString = href.substring(0, href.indexOf('#'));
- if (queryString.length > 0) {
- return queryString.replace(questionMarkParamsRegExp, "?updatedco=".concat(updateDco, "&$2")).concat(href.substring(href.indexOf('#')));
- } else if (questionMarkParamsRegExp.test(href)) {
- return href.replace(questionMarkParamsRegExp, "?updatedco=".concat(updateDco, "&$2"));
- }
- return updatedcoRegExp.test(href) ? href : href.concat("?updatedco=".concat(updateDco));
- };
- /**
- * Removes the loading spinner initially shown on start up of the application
- * @public
- */
- CAUtils.prototype.removeLoadingSpinner = function (glassContext) {
- $('#ba-splash-styles').remove();
- $('.ba-splash').remove();
- glassContext.getCoreSvc('.Events').off('appView:loaded', undefined, 'removeLoadingSpinnerFunction');
- };
- CAUtils.prototype.preventWritesToObject = function (obj) {
- var propNames = Object.getOwnPropertyNames(obj);
- var _iterator = _createForOfIteratorHelper(propNames),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var name = _step.value;
- var value = obj[name];
- obj[name] = value && _typeof(value) == 'object' ? this.preventWritesToObject(value) : value;
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- return Object.freeze(obj);
- };
- return new CAUtils();
- });
- //# sourceMappingURL=CAUtils.js.map
- ;
- define('caglass/ba-instrumentation/dist/bundle',[],function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){var i,r;i=[n,e,n(1),n(6)],void 0===(r=function(t,e,n,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentationService=n.default,e.BluemixAnalytics=i}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r,o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},a=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&(n[i[r]]=t[i[r]])}return n};i=[n,e,n(2)],void 0===(r=function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.analyticsKey="_analytics",this.bluemixKey="bluemixAnalytics",this.instrumentationKey="instrumentation",this.bluemixLoaded=!1,this.category="Offering Interface",this.digitalDataKey="digitalData",this.segmentApiKey="analytics"}return t.prototype.initialize=function(t,e){var i=this;if(this.glassContext=t,this.configBuilder=new n.default(e),this.eventQueue=[],this._logger=this.glassContext.getCoreSvc(".Logger"),!0===e.enabled&&""!==e.key)return this.configureAnalytics(),this.requireBluemixScript(this.configBuilder.config.scriptURL).then(function(){var t=i.configBuilder.buildTraits(),e=i.configBuilder.buildContext();i.bluemixLoaded=!0,window[i.bluemixKey].identify(t,e),i.configBuilder.config.autoSPAEnabled||i.registerPageEventListener()}).catch(function(t){i.configBuilder.disableService();i.logger.error("InstrumentationService is not enabled, Bluemix script failed to load",t)});var r="InstrumentationService was not enabled. Config: "+JSON.stringify(this.configBuilder.config);return Promise.resolve(r)},Object.defineProperty(t.prototype,"config",{get:function(){return this.configBuilder.config},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"logger",{get:function(){return this._logger||console},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return!0===this.bluemixLoaded&&void 0!==window[this.analyticsKey]&&this.configBuilder.config.enabled},enumerable:!0,configurable:!0}),t.prototype.resetAnalyticsCookie=function(){var t=this;return new Promise(function(e,n){if(t.enabled&&Object.prototype.hasOwnProperty.call(window,t.segmentApiKey))try{return window[t.segmentApiKey].reset(),e()}catch(e){t.logger.error(e),n()}})},t.prototype.track=function(t){try{if(this.enabled){var e=this.configBuilder.trackEventPayload(),n=this.configBuilder.buildContext();t.productTitle=this.configBuilder.config.productTitle;var i=t.type,r=a(t,["type"]),s=o({},r,e);this.callAction(window[this.bluemixKey].trackEvent,i,s,n)}}catch(t){this.logger.warn("Failed to call a trackEvent as instrumentation is disabled")}},t.prototype.page=function(t){try{if(this.enabled){var e=this.configBuilder.pageEventPayload(),n=this.configBuilder.buildContext();this.callAction(window[this.bluemixKey].pageEvent,this.category,t,e,n)}}catch(e){this.logger.warn("Failed to call a pageEvent for '"+t+"' as instrumentation is disabled")}},t.prototype.isBluemixAnalyticsLoaded=function(){return!!window[this.bluemixKey]},t.prototype.sendQueuedEvents=function(){for(;this.eventQueue.length>0;){var t=this.eventQueue.shift(),e=t.fn,n=t.args;e.apply(void 0,n)}},t.prototype.callAction=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.isBluemixAnalyticsLoaded()?t.apply(void 0,e):this.eventQueue.push({fn:t,args:e})},t.prototype.configureAnalytics=function(){this.category=this.configBuilder.config.category||this.category,window[this.analyticsKey]=this.configBuilder.buildAnalyticsKey(),window[this.digitalDataKey]=this.configBuilder.buildDigitalDataKey(this.category),window[this.instrumentationKey]=this.configBuilder.buildDDO()},t.prototype.requireBluemixScript=function(t){var e=this;return new Promise(function(n,i){var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.addEventListener("load",function(){if(e.isBluemixAnalyticsLoaded())return e.sendQueuedEvents(),n();i("The bluemix script loaded but did not successfully initialize: window.bluemixAnalytics was not created.")}),r.addEventListener("error",function(){i("Error loading script '"+t+"'")}),r.addEventListener("abort",function(){i("Script loading aborted '"+t+"'")}),document.head.appendChild(r)})},t.prototype.registerPageEventListener=function(){var t=this;try{this.glassContext.getCoreSvc(".Events").on("appView:loaded",function(e){var n=e.context.content.perspective;t.page(n)})}catch(t){this.logger.warn("Failed to register page listener for instrumentation on core service .Events 'appView:loaded'")}},t}();e.default=i}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r,o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};i=[n,e,n(3)],void 0===(r=function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r,a=new n.default;!function(t){t.accountId="accountId",t.accountIdType="accountIdType",t.browserLanguage="browserLanguage",t.capabilities="capabilities",t.gbt10="GBT10",t.gbt15="GBT15",t.gbt17="GBT17",t.gbt20="GBT20",t.gbtlvlcd="GBTLVLCD",t.isIBMer="isIBMer",t.isTestUser="isTestUser",t.isTrial="isTrial",t.productVersion="productVersion",t.partIds="partNumber",t.productID="productId",t.productTitle="productTitle",t.roles="user.role",t.tenantId="tenantId",t.url="url"}(i=e.SegmentKeys||(e.SegmentKeys={})),function(t){t.IBM="ibm.com",t.YOPMAIL="yopmail.com",t.MAILINATOR="mailinator.com",t.COGNOS="cognos.com"}(r=e.EmailDomains||(e.EmailDomains={}));var s=function(){function t(t){this.serviceConfig={enabled:!(!t||!0!==t.enabled),key:t&&t.key&&"string"==typeof t.key?t.key:"",scriptURL:t&&t.scriptURL&&"string"==typeof t.scriptURL?t.scriptURL:"",productTitle:t&&t.productTitle&&"string"==typeof t.productTitle?t.productTitle:"",productID:t&&t.productID&&"string"==typeof t.productID?t.productID:"",versionNumber:t&&t.versionNumber&&"string"==typeof t.versionNumber?t.versionNumber:"",tenantId:t&&t.tenantId&&"string"==typeof t.tenantId?t.tenantId:"",accountId:t&&t.accountId&&"string"==typeof t.accountId?t.accountId:"",accountIdType:t&&t.accountIdType&&"string"==typeof t.accountIdType?t.accountIdType:"",whitelistedValues:t&&t.whitelistedValues&&Array.isArray(t.whitelistedValues)?t.whitelistedValues:[""],digitalContextEnable:!(!t||!t.digitalContextEnable||"boolean"!=typeof t.digitalContextEnable)&&t.digitalContextEnable,whitelist:!(!t||!0!==t.whitelist),autoSPAEnabled:!(!t||!0!==t.autoSPAEnabled),email:t&&t.email&&"string"==typeof t.email?t.email:"",creationTime:t&&t.creationTime&&"string"==typeof t.creationTime?t.creationTime:"",productLocale:t&&t.productLocale&&"string"==typeof t.productLocale?t.productLocale:"",gbt10:t&&t.gbt10&&"string"==typeof t.gbt10?t.gbt10:"",gbt15:t&&t.gbt15&&"string"==typeof t.gbt15?t.gbt15:"",gbt17:t&&t.gbt17&&"string"==typeof t.gbt17?t.gbt17:"",gbt20:t&&t.gbt20&&"string"==typeof t.gbt20?t.gbt20:"",gbtlvlcd:t&&t.gbtlvlcd&&"string"==typeof t.gbtlvlcd?t.gbtlvlcd:"",category:t&&t.category&&"string"==typeof t.category?t.category:null,environment:t&&t.environment&&"string"==typeof t.environment?t.environment:null,partIds:t&&t.partIds&&Array.isArray(t.partIds)?t.partIds.sort():[""],capabilities:t&&t.capabilities&&Array.isArray(t.capabilities)?t.capabilities.sort():[""],isTrial:!t||!0!==t.isTrial&&!1!==t.isTrial?void 0:t.isTrial,roles:t&&t.roles&&Array.isArray(t.roles)?t.roles.sort():[""]}}return Object.defineProperty(t.prototype,"config",{get:function(){return this.serviceConfig},enumerable:!0,configurable:!0}),t.prototype.disableService=function(){this.config.enabled=!1},t.prototype.buildTraits=function(){var t,e=null;return this.isEnabled&&((t={})[i.productVersion]=this.version,t[i.partIds]=this.partIdsString,t[i.tenantId]=this.tenantId,t[i.accountId]=this.accountId,t[i.isIBMer]=this.isIBMer(this.email),t[i.isTestUser]=this.isTestUser(this.email),t.url=a.getSanitizedURL(this.url,this.whitelistedValues,this.whitelist),t.createdAt=this.creationTime,e=t),e},t.prototype.buildContext=function(){var t=null;return this.isEnabled?t={context:{isIBMer:this.isIBMer(this.email),isTestUser:this.isTestUser(this.email),page:this.commonHrefProps}}:console.warn("Instrumentation.ConfigBuilder.buildContext(): Instrumentation is disabled."),t},t.prototype.buildAnalyticsKey=function(){var t;return this.isEnabled&&""!==this.key&&(t={skipIdentify:!0,autoPageEventSpa:this.isAutoSPAEnabled,autoPageView:this.isAutoSPAEnabled,segment:!0,segment_key:this.key,coremetrics:!1,optimizely:!1,nps:!1}),t},t.prototype.buildDigitalDataKey=function(t){var e,n;return this.isEnabled&&""!==this.key&&(n={pageInfo:(e={},e[i.productTitle]=this.productTitle,e.analytics={category:t},e)},this.environment&&(n.appInfo={plan:this.environment})),n},t.prototype.buildDDO=function(){var t,e,n,r,a,s,c,u,l,d={};return this.isEnabled&&(d=o({},this.capabilities&&""!==this.capabilitiesString&&((t={})[i.capabilities]=this.capabilities,t),this.version&&((e={})[i.productVersion]=this.version,e),this.url&&((n={})[i.url]=this.url,n),this.partIds&&""!==this.partIdsString&&((r={})[i.partIds]=this.partIds,r),this.accountIdType&&((a={})[i.accountIdType]=this.accountIdType,a),this.accountId&&((s={})[i.accountId]=this.accountId,s),this.tenantId&&((c={})[i.tenantId]=this.tenantId,c),this.productID&&((u={})[i.productID]=this.productID,u),this.isTrial&&((l={})[i.isTrial]=this.isTrial,l))),d},t.prototype.pageEventPayload=function(){var t,e={};if(this.isEnabled){var n=((t={name:a.getPerspectiveName(this.url),path:this.pathname})[i.browserLanguage]=this.productLocale,t);e=o({},this.commonEvtProps,n,this.commonHrefProps)}return e},t.prototype.trackEventPayload=function(){var t={};if(this.isEnabled){var e={url:a.getSanitizedURL(this.url,this.whitelistedValues,this.whitelist)};t=o({},this.commonEvtProps,e)}return t},Object.defineProperty(t.prototype,"isEnabled",{get:function(){var t=!1;return this.config&&this.config.enabled?t=!0:console.warn("Instrumentation.ConfigBuilder: Instrumentation is disabled."),t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commonHrefProps",{get:function(){return{referrer:a.getSanitizedURL(this.referrer,this.whitelistedValues,this.whitelist),search:a.getSanitizedQueryParams(this.search,this.whitelistedValues,this.whitelist),title:a.getPerspectiveName(this.url),url:a.getSanitizedURL(this.url,this.whitelistedValues,this.whitelist)}},enumerable:!0,configurable:!0}),t.prototype.isIBMer=function(t){var e=!1;this.isEnabled&&(this.validateEmail(t)?e=t.split("@")[1].includes(r.IBM):console.warn("Instrumentation.ConfigBuilder.isIBMer: Invalid email passed as parameter "+t));return e},t.prototype.isTestUser=function(t){var e=!1;if(this.isEnabled)if(this.validateEmail(t)){var n=t.split("@")[1];e=n.includes(r.YOPMAIL)||n.includes(r.MAILINATOR)||n.includes(r.COGNOS)}else console.warn("Instrumentation.ConfigBuilder.isTestUser: Invalid email passed as parameter "+t);return e},t.prototype.validateEmail=function(t){var e=RegExp(/\S+@\S+\.\S+/);return t&&e.test(t)},Object.defineProperty(t.prototype,"commonEvtProps",{get:function(){var t;return(t={})[i.productVersion]=this.version,t[i.productTitle]=this.productTitle,t[i.partIds]=this.partIdsString,t[i.productID]=this.productID,t[i.tenantId]=this.tenantId,t[i.accountId]=this.accountId,t[i.accountIdType]=this.accountIdType,t[i.gbt10]=this.gbt10,t[i.gbt15]=this.gbt15,t[i.gbt17]=this.gbt17,t[i.gbt20]=this.gbt20,t[i.gbtlvlcd]=this.gbtlvlcd,t["custom.capabilities"]=this.capabilitiesString,t[i.roles]=this.rolesString,t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"email",{get:function(){return this.config.email},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"creationTime",{get:function(){return this.config.creationTime},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"productLocale",{get:function(){return this.config.productLocale},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return window.location.href},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"search",{get:function(){return window.location.search},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathname",{get:function(){return window.location.pathname},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"referrer",{get:function(){return window.document.referrer||" "},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"whitelist",{get:function(){return this.config.whitelist},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"whitelistedValues",{get:function(){return this.config.whitelistedValues},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.config.key},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environment",{get:function(){return this.config.environment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this.config.versionNumber},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"productID",{get:function(){return this.config.productID},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"productTitle",{get:function(){return this.config.productTitle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tenantId",{get:function(){return this.config.tenantId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"accountId",{get:function(){return this.config.accountId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"accountIdType",{get:function(){return this.config.accountIdType},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"gbt10",{get:function(){return this.config.gbt10},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"gbt15",{get:function(){return this.config.gbt15},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"gbt17",{get:function(){return this.config.gbt17},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"gbt20",{get:function(){return this.config.gbt20},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"gbtlvlcd",{get:function(){return this.config.gbtlvlcd},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partIds",{get:function(){return this.config.partIds},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partIdsString",{get:function(){return this.partIds.join()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAutoSPAEnabled",{get:function(){return this.config.autoSPAEnabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"capabilities",{get:function(){return this.config.capabilities},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"capabilitiesString",{get:function(){return this.capabilities.join()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isTrial",{get:function(){return this.config.isTrial},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"roles",{get:function(){return this.config.roles},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rolesString",{get:function(){return this.roles.join()},enumerable:!0,configurable:!0}),t}();e.default=s}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n,e,n(4)],void 0===(r=function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.prototype.getSanitizedURL=function(t,e,n){var i="",r="";return t&&e?t.includes("?")?e.some(function(e){return t.includes(e)})&&(r=t.substring(t.indexOf("?"),t.length),i=t.substring(0,t.indexOf("?"))+this.getSanitizedQueryParams(r,e,n)):i=t:console.warn("Instrumentation.URLSanitizer.getSanitizedURL(): Cannot sanitize. Missing url: "+t+" or whitelisted arguments "+e+"."),i},t.prototype.getSanitizedQueryParams=function(t,e,n){var i=new URLSearchParams,r="";if(t)if(!e||0===e.length||null===n&&void 0===n)console.warn("Instrumentation.URLSanitizer.getSanitizedQueryParams(): Missing list of values: "+e+" or whitelist flag is undefined: "+n);else if("?"===t.substring(0,1)){for(var o=new URLSearchParams(t.substring(1)),a=0;a<e.length;a++)o.has(e[a])&&(i.append(e[a],o.get(e[a])),o.delete(e[a]));""!==(r+=n?i.toString():o.toString())&&(r="?"+r)}else console.warn("Instrumentation.URLSanitizer.getSanitizedQueryParams(): Passed argument "+t+" is not valid.");else console.warn("Instrumentation.URLSanitizer.getSanitizedQueryParams(): Cannot sanitize. Missing search string: "+t);return r},t.prototype.getPerspectiveName=function(t){var e="",n=[];if(t){if((n=t.split("?")).length>1){var i=new URLSearchParams(n[1]);i.has("perspective")?e=i.get("perspective"):console.warn("Instrumentation.URLSanitizer.getPerspectiveName(): No perspective name found in the url.")}}else console.warn("Instrumentation.URLSanitizer.getPerspectiveName(): Cannot return perspective name. Missing a valid url: "+t);return e},t}();e.default=n}.apply(e,i))||(t.exports=r)},function(t,e,n){(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){"use strict";var n=t.URLSearchParams?t.URLSearchParams:null,i=n&&"a=1"===new n({a:1}).toString(),r=n&&"+"===new n("s=%2B").get("s"),o="__URLSearchParams__",a=l.prototype,s=!(!t.Symbol||!t.Symbol.iterator);if(!(n&&i&&r)){a.append=function(t,e){h(this[o],t,e)},a.delete=function(t){delete this[o][t]},a.get=function(t){var e=this[o];return t in e?e[t][0]:null},a.getAll=function(t){var e=this[o];return t in e?e[t].slice(0):[]},a.has=function(t){return t in this[o]},a.set=function(t,e){this[o][t]=[""+e]},a.toString=function(){var t,e,n,i,r=this[o],a=[];for(e in r)for(n=d(e),t=0,i=r[e];t<i.length;t++)a.push(n+"="+d(i[t]));return a.join("&")};var c=!!r&&n&&!i&&t.Proxy;t.URLSearchParams=c?new Proxy(n,{construct:function(t,e){return new t(new l(e[0]).toString())}}):l;var u=t.URLSearchParams.prototype;u.polyfill=!0,u.forEach=u.forEach||function(t,e){var n=g(this.toString());Object.getOwnPropertyNames(n).forEach(function(i){n[i].forEach(function(n){t.call(e,n,i,this)},this)},this)},u.sort=u.sort||function(){var t,e,n,i=g(this.toString()),r=[];for(t in i)r.push(t);for(r.sort(),e=0;e<r.length;e++)this.delete(r[e]);for(e=0;e<r.length;e++){var o=r[e],a=i[o];for(n=0;n<a.length;n++)this.append(o,a[n])}},u.keys=u.keys||function(){var t=[];return this.forEach(function(e,n){t.push(n)}),p(t)},u.values=u.values||function(){var t=[];return this.forEach(function(e){t.push(e)}),p(t)},u.entries=u.entries||function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),p(t)},s&&(u[t.Symbol.iterator]=u[t.Symbol.iterator]||u.entries)}function l(t){((t=t||"")instanceof URLSearchParams||t instanceof l)&&(t=t.toString()),this[o]=g(t)}function d(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,function(t){return e[t]})}function f(t){return decodeURIComponent(t.replace(/\+/g," "))}function p(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return s&&(n[t.Symbol.iterator]=function(){return n}),n}function g(t){var n={};if("object"===e(t))for(var i in t)t.hasOwnProperty(i)&&h(n,i,t[i]);else{0===t.indexOf("?")&&(t=t.slice(1));for(var r=t.split("&"),o=0;o<r.length;o++){var a=r[o],s=a.indexOf("=");-1<s?h(n,f(a.slice(0,s)),f(a.slice(s+1))):a&&h(n,f(a),"")}}return n}function h(t,e,n){var i="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);e in t?t[e].push(i):t[e]=[i]}}(void 0!==t?t:"undefined"!=typeof window?window:this)}).call(this,n(5))},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(i=window)}t.exports=i},function(t,e,n){var i,r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});void 0===(i=function(t,e){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.CreatedObject="Created Object",t.ReadObject="Read Object",t.UpdatedObject="Updated Object",t.DeletedObject="Deleted Object",t.SearchedObject="Searched Object",t.RanProcess="Ran Process",t.StartedProcess="Started Process",t.EndedProcess="Ended Process",t.CustomEvent="Custom Event",t.ServiceLogin="Service Login",t.ServiceLogout="Service Logout",t.HybridRatedUsage="Hybrid Rated Usage",t.VideoPlaybackStarted="Video Playback Started",t.VideoPlaybackCompleted="Video Playback Completed",t.ObjectInteraction="Object Interaction"}(n=e.AnalyticsEventType||(e.AnalyticsEventType={}));var i=function(){return function(t,e){this.customName1="action",this.type=t,this.customValue1=e}}();e.AnalyticsEvent=i;var r=function(t){function e(e,n){return t.call(this,e,n)||this}return o(e,t),e}(i),a=function(t){function e(e){return t.call(this,n.CreatedObject,e)||this}return o(e,t),e}(r);e.CreatedObjectEvent=a;var s=function(t){function e(e){return t.call(this,n.ReadObject,e)||this}return o(e,t),e}(r);e.ReadObjectEvent=s;var c=function(t){function e(e){return t.call(this,n.UpdatedObject,e)||this}return o(e,t),e}(r);e.UpdatedObjectEvent=c;var u=function(t){function e(e){return t.call(this,n.DeletedObject,e)||this}return o(e,t),e}(r);e.DeletedObjectEvent=u;var l=function(t){function e(e){return t.call(this,n.SearchedObject,e)||this}return o(e,t),e}(r);e.SearchedObjectEvent=l;var d=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.processType=n,i}return o(e,t),e}(i),f=function(t){function e(e){return t.call(this,n.RanProcess,e)||this}return o(e,t),e}(d);e.RanProcessEvent=f;var p=function(t){function e(e){return t.call(this,n.StartedProcess,e)||this}return o(e,t),e}(d);e.StartedProcessEvent=p;var g=function(t){function e(e){return t.call(this,n.EndedProcess,e)||this}return o(e,t),e}(d);e.EndedProcessEvent=g;var h=function(t){function e(e){var i=t.call(this,n.CreatedObject,"")||this;return i.action=e,i}return o(e,t),e}(r);e.CustomEvent=h;var b=function(t){function e(e,n){return t.call(this,e,n)||this}return o(e,t),e}(i),y=function(t){function e(e){return t.call(this,n.ServiceLogin,e)||this}return o(e,t),e}(b);e.ServiceLoginEvent=y;var v=function(t){function e(e){return t.call(this,n.ServiceLogout,e)||this}return o(e,t),e}(b);e.ServiceLogoutEvent=v;var m=function(t){function e(e){return t.call(this,n.HybridRatedUsage,e)||this}return o(e,t),e}(i);e.HybridRatedUsageEvent=m;var P=function(t){function e(e,n,i){var r=t.call(this,e,n)||this;return r.customName2="videoUrl",r.customValue2=i,r}return o(e,t),e}(i),S=function(t){function e(e,i){return t.call(this,n.VideoPlaybackStarted,e,i)||this}return o(e,t),e}(P);e.VideoPlaybackStartedEvent=S;var I=function(t){function e(e,i){return t.call(this,n.VideoPlaybackCompleted,e,i)||this}return o(e,t),e}(P);e.VideoPlaybackCompletedEvent=I}.apply(e,[n,e]))||(t.exports=i)}])});
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Glass
- * (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/services/CAFEncodingService',['underscore', 'jquery'], function (_, $) {
- /**
- * URLEncodingService implementation utilizing CAF encoding algorithm
- * Described in depth here: https://developer.ibm.com/answers/questions/163966/how-do-i-enable-xss-and-csrf-protection-in-ibm-cog/
- */
- var CAFEncodingService = /*#__PURE__*/function () {
- function CAFEncodingService(glassContext, xssChars) {
- _classCallCheck(this, CAFEncodingService);
- this.glassContext = glassContext;
- this._xssChars = xssChars || '';
- }
- _createClass(CAFEncodingService, [{
- key: "cafEncodeQSValue",
- value: function cafEncodeQSValue(value) {
- var xssEncode = this.glassContext.getCoreSvc('.Config').getXSSChecking();
- if (xssEncode === true) {
- if (_.isObject(value)) {
- var encodedValue = $.extend(true, {}, value);
- this._encodeObjectWithTags(encodedValue);
- return encodedValue;
- } else if (_.isString(value)) {
- return this.encodeWithTags(value);
- }
- }
- return value;
- }
- }, {
- key: "_encodeObjectWithTags",
- value: function _encodeObjectWithTags(objToEncode) {
- for (var item in objToEncode) {
- if (_.isObject(objToEncode[item])) {
- this._encodeObjectWithTags(objToEncode[item]);
- } else if (_.isString(objToEncode[item])) {
- objToEncode[item] = this.encodeWithTags(objToEncode[item]);
- }
- }
- }
- }, {
- key: "encodeWithTags",
- value: function encodeWithTags(data) {
- return 'XSSSTART' + this.encode(data) + 'XSSEND';
- }
- }, {
- key: "encode",
- value: function encode(data) {
- var res = '',
- c = '';
- var str = '' + data; // ensure param is string
- for (var i = 0; i < str.length; i++) {
- c = str.charAt(i);
- if (c == '"') {
- res += '_22';
- } else if (c == '%') {
- res += '*';
- } else if (c == '*') {
- res += '_2a';
- } else if (c == '_') {
- res += '_5f';
- } else {
- res += this._getXSSChar(c);
- }
- }
- return res;
- }
- }, {
- key: "_getXSSChar",
- value: function _getXSSChar(charToTest) {
- var result = '',
- isXSSChar = false;
- for (var j = 0; j < this._xssChars.length; ++j) {
- if (charToTest == this._xssChars.charAt(j)) {
- isXSSChar = true;
- break;
- }
- }
- if (isXSSChar) {
- result += '_';
- var h1 = Math.floor(charToTest.charCodeAt(0) / 16);
- var h2 = charToTest.charCodeAt(0) - h1 * 16;
- result += CAFEncodingService.HEX_CHARS.charAt(h1);
- result += CAFEncodingService.HEX_CHARS.charAt(h2);
- } else {
- result += charToTest;
- }
- return result;
- }
- }]);
- return CAFEncodingService;
- }();
- CAFEncodingService.HEX_CHARS = '0123456789abcdef';
- return CAFEncodingService;
- });
- //# sourceMappingURL=CAFEncodingService.js.map
- ;
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("caglass/nls/StringResources"),require("baglass/core-client/js/core-client/utils/UrlUtils"),require("baglass/core-client/js/core-client/utils/BrowserUtils"),require("baglass/core-client/js/core-client/utils/Utils"));else if("function"==typeof define&&define.amd)define('caglass/caglass.webpack.bundle',["caglass/nls/StringResources","baglass/core-client/js/core-client/utils/UrlUtils","baglass/core-client/js/core-client/utils/BrowserUtils","baglass/core-client/js/core-client/utils/Utils"],t);else{var n="object"==typeof exports?t(require("caglass/nls/StringResources"),require("baglass/core-client/js/core-client/utils/UrlUtils"),require("baglass/core-client/js/core-client/utils/BrowserUtils"),require("baglass/core-client/js/core-client/utils/Utils")):t(e["caglass/nls/StringResources"],e["baglass/core-client/js/core-client/utils/UrlUtils"],e["baglass/core-client/js/core-client/utils/BrowserUtils"],e["baglass/core-client/js/core-client/utils/Utils"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(e,t,n,r){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.postSecondaryLogin=t.SecondaryLoginConstants=void 0;var o,s=r(n(5)),i=r(n(6)),a=r(n(7)),c=r(n(8));!function(e){e.path="/login",e.parameters="secondaryLogin=true",e.successMessageKey="secondaryLoginSuccess",e.refreshMessageKey="secondaryLoginRefresh"}(o=t.SecondaryLoginConstants||(t.SecondaryLoginConstants={}));var l=o.path+"?"+o.parameters;function u(e){e.appController.showMessage(s.default.get(o.successMessageKey),s.default.get(o.refreshMessageKey),"info",["ok","cancel"],"500px",(function(t){"ok"===t.btn&&setTimeout((function(){e.close().then((function(){var e=c.default.getCurrentWindow();e.location=e.location.pathname}))}),1)}),!0,"ANSDialog")}t.postSecondaryLogin=function(e,t){return a.default.isIE()?e.localStorage.secondaryLoginResult=JSON.stringify(t):e.opener?e.opener.postMessage(t):e.close(),t},t.default=function(e,t){var n=e.gateway?e.gateway:"/bi",r=window.location.origin+n+l;t&&(r+="&state="+i.default.base64Encode(JSON.stringify(t)));var o=window.open(r,"");return c.default.getCurrentWindow().onbeforeunload=function(){o&&o.close()},new Promise((function(t,n){try{o&&(o.onbeforeunload=function(){n(new Error("SecondaryLogin cancelled"))}),a.default.isIE()?(window.localStorage.removeItem("secondaryLoginResult"),function(e,t,n){var r=function(o){var s;if(o.key&&"secondaryLoginResult"===o.key&&(s=o.newValue),s&&e){window.removeEventListener("storage",r),window.localStorage.removeItem("secondaryLoginResult");var i=JSON.parse(s);n(i),e.close(),u(t)}};window.addEventListener("storage",r)}(o,e,t)):function(e,t,n){window.addEventListener("message",(function(r){e&&r.source===e&&(n(r.data),e.close(),u(t))}),{once:!0})}(o,e,t)}catch(e){n(e)}})).catch((function(){return e.appController.unlockGlass(),Promise.reject()}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.getNavBar=function(){var e=document.querySelector(".appview.paneColumn:not(.hidden)").getElementsByClassName("navbar");return e&&e.length>0?e[0]:null}}return e.prototype.canExecute=function(e){if(e.glassContext.appController.currentAppView){var t=e.glassContext.appController.currentAppView.hasHomeFlag();return null!==this.getNavBar()&&!t}return!1},e.prototype.doAction=function(){var e=this.getNavBar();null!==e&&e.classList.add("narrow")},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.getNavBar=function(){var e=document.querySelector(".appview.paneColumn:not(.hidden)").getElementsByClassName("navbar");return e&&e.length>0?e[0]:null}}return e.prototype.canExecute=function(e){return!!e.glassContext.appController.currentAppView&&null!==this.getNavBar()},e.prototype.doAction=function(){var e=this.getNavBar();null!==e&&e.classList.remove("narrow")},e}();t.default=r},function(e,t,n){e.exports=n(4)},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r);n.d(t,"HideNavBarItemLabelsAction",(function(){return o.a}));var s=n(2),i=n.n(s);n.d(t,"ShowNavBarItemLabelsAction",(function(){return i.a}));var a=n(0),c=n.n(a);n.d(t,"secondaryLogin",(function(){return c.a})),n.d(t,"postSecondaryLogin",(function(){return a.postSecondaryLogin}))},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r}])}));
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Glass
- * (C) Copyright IBM Corp. 2020
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/services/CredentialDialogBuilder',['baglass/common/ui/SubmitPasswordDialog', 'caglass/nls/StringResources', 'jquery'], function (SubmitPasswordDialog, StringResources, $) {
- var CredentialDialogBuilder = /*#__PURE__*/function () {
- function CredentialDialogBuilder(glassContext, endpoint) {
- _classCallCheck(this, CredentialDialogBuilder);
- this.glassContext = glassContext;
- this.endpoint = endpoint;
- }
- _createClass(CredentialDialogBuilder, [{
- key: "openRenewCredentialDialog",
- value: function openRenewCredentialDialog(oDisplayObjects) {
- return this._openCredentialDialog(oDisplayObjects, StringResources.get('credentialChange'), 'renewCredential');
- }
- }, {
- key: "_openCredentialDialog",
- value: function _openCredentialDialog(oDisplayObjects, title, defaultId) {
- var displayPrompts = this._buildParameters(oDisplayObjects);
- var viewItems = {
- 'glassContext': this.glassContext,
- 'displayPrompts': displayPrompts
- };
- var dialogOptions = {
- 'buttons': [{
- 'text': StringResources.get('ok'),
- 'handler': this._submitCredential.bind(this),
- 'type': 'primary',
- 'defaultId': defaultId
- }, 'cancel'],
- title: title,
- viewOptions: viewItems,
- cancelCallback: function () {
- this._credentialDialogObj.dialog.hide();
- }.bind(this)
- };
- return SubmitPasswordDialog.prototype.openSubmitPasswordDialog(dialogOptions).then(function (credentialDialogObj) {
- this._credentialDialogObj = credentialDialogObj;
- return Promise.resolve();
- }.bind(this), function () {
- return Promise.reject('Failed to open submit-password dialog');
- }.bind(this));
- }
- }, {
- key: "_buildParameters",
- value: function _buildParameters(oDisplayObjects) {
- this.credentialParameters = [];
- var displayParameters = [];
- $.each(oDisplayObjects, function (key, prompt) {
- this.credentialParameters.push(prompt);
- if ('hidden' !== prompt.type && 'display' !== prompt.type) {
- displayParameters.push(prompt);
- }
- }.bind(this));
- return displayParameters;
- }
- }, {
- key: "_submitCredential",
- value: function _submitCredential() {
- $.each(this.credentialParameters, function (key, prompt) {
- var displayObject = $('input[class*="' + prompt.name + '"]');
- if (displayObject.length) {
- var value = displayObject.val();
- if (value) {
- prompt.value = value;
- }
- }
- }.bind(this));
- var options = {
- type: 'POST',
- 'headers': {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json'
- },
- url: this.endpoint,
- data: JSON.stringify({
- 'parameters': this.credentialParameters
- }),
- skipErrorHandling: true
- };
- return this.glassContext.services.ajax.ajax(options).then(function
- /* response */
- () {
- this._submitSuccessHandler();
- return Promise.resolve();
- }.bind(this), function (dfd, jqXHR, textStatus, errorThrown) {
- if (jqXHR.status === this.glassContext.ajaxCodes.UNAUTHORIZED && jqXHR.responseJSON && jqXHR.responseJSON.errorCodeString === 'camAuthUserRecoverable') {
- this._submitErrorHandler(jqXHR, errorThrown, false);
- } else {
- this._submitErrorHandler(jqXHR, errorThrown, true);
- }
- return Promise.reject("Failed to renew credential: ".concat(errorThrown));
- }.bind(this));
- }
- }, {
- key: "_submitSuccessHandler",
- value: function _submitSuccessHandler() {
- this._credentialDialogObj.dialog.hide();
- this.glassContext.appController.showToast(StringResources.get('credentialCreateSuccess'));
- }
- }, {
- key: "_submitErrorHandler",
- value: function _submitErrorHandler(jqXHR, errorThrown, authorized) {
- if (!authorized) {
- // Request failed with incorrect password.
- this.glassContext.appController.showToast(StringResources.get('wrongPassword'), {
- 'type': 'error'
- }); // Rebuild the parameters so the password already read is refreshed.
- this._buildParameters(jqXHR.responseJSON.promptInfo.displayObjects);
- } else {
- this.glassContext.appController.showToast(errorThrown, {
- 'type': 'error'
- });
- this._credentialDialogObj.dialog.hide();
- }
- }
- }]);
- return CredentialDialogBuilder;
- }();
- return CredentialDialogBuilder;
- });
- //# sourceMappingURL=CredentialDialogBuilder.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Glass
- * (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/services/LoginService',['caglass/ajax/CAAuthentication', 'caglass/caglass.webpack.bundle', 'caglass/nls/StringResources', 'caglass/app/services/CredentialDialogBuilder'], function (CAAuthentication, CAGlassBundle, StringResources, CredentialDialogBuilder) {
- var secondarySignOn = CAGlassBundle.secondaryLogin;
- var LoginService = /*#__PURE__*/function () {
- function LoginService(glassContext) {
- _classCallCheck(this, LoginService);
- this.glassContext = glassContext;
- this.caAuth = new CAAuthentication();
- }
- _createClass(LoginService, [{
- key: "secondaryLogin",
- value: function secondaryLogin(camError) {
- var _this = this;
- return secondarySignOn(this.glassContext, camError)["catch"](function (error) {
- _this.glassContext.getCoreSvc('.Logger').error('Secondary login failed', error);
- });
- }
- }, {
- key: "renewCredential",
- value: function renewCredential() {
- var _this2 = this;
- return this.caAuth.storeCredentials(this.glassContext).then(function () {
- return _this2.glassContext.appController.showToast(StringResources.get('credentialRenewed'));
- }, function (error) {
- if (error && error.displayObjects) {
- var dialog = new CredentialDialogBuilder(_this2.glassContext, LoginService.CREDENTIALS_URL);
- return dialog.openRenewCredentialDialog(error.displayObjects);
- } else {
- _this2.glassContext.getCoreSvc('.Logger').error('Missing displayObjects while opening crendential dialog', error);
- return Promise.reject();
- }
- });
- }
- }, {
- key: "recoverFromCamError",
- value: function recoverFromCamError(error) {
- if (!error || error.errorCodeString != 'camAuthUserRecoverable') {
- return Promise.reject(error);
- }
- return this._recoverFromError(error);
- }
- }, {
- key: "_recoverFromError",
- value: function _recoverFromError(error) {
- var jqXHR = {
- responseJSON: error
- };
- var processedError = this.caAuth.processAuthenticationError(this.glassContext, jqXHR);
- if (processedError.displayObjects && processedError.displayObjects.length > 0) {
- return this.secondaryLogin(processedError);
- }
- return Promise.reject(error);
- }
- }]);
- return LoginService;
- }();
- LoginService.CREDENTIALS_URL = 'v1/users/~/credentials';
- return LoginService;
- });
- //# sourceMappingURL=LoginService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI Glass
- *
- * Copyright IBM Corp. 2019, 2020
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/utils/EntitlementObject',[], function () {
- var constants = {};
- constants.ENTITLEMENTS = {
- enabled: true,
- display_name: 'display_name',
- entitled_organization: {
- country_code: 'country_code',
- name: 'name',
- other_identifier: {
- org_id: 'org_id',
- sap_sold_to_site_number: 'string',
- ibm_customer_number: 'ibm_customer_number'
- }
- },
- entitled_user: {
- family_name: 'string',
- email_address: 'user@example.com',
- given_name: 'string',
- language: 'string',
- ibm_unique_id: 'string'
- },
- third_party_marketplace: {
- route_indicator: '3PM'
- },
- entitled_parts: [{
- part_number: 'part_number',
- display_name: 'TRIAL_PART',
- type: 'trial',
- offering: 'CA',
- subscription_id: '2',
- expiration_date: '2020-05-29T23:59:59.000Z',
- abilities: [{
- type: 'CAPABILITY',
- value: 'value1'
- }, {
- type: 'GROUP',
- value: 'value2'
- }]
- }, {
- part_number: 'part_number',
- display_name: 'BASE_PART',
- type: 'base',
- offering: 'CA',
- subscription_id: '3',
- expiration_date: '2019-03-29T23:59:59.000Z',
- abilities: [{
- type: 'GROUP',
- value: 'value1'
- }]
- }, {
- part_number: 'part_number',
- display_name: 'BASE_PART',
- type: 'something else',
- offering: 'CA',
- subscription_id: '4',
- expiration_date: '2019-03-29T23:59:59.000Z',
- abilities: [{
- type: 'GROUP',
- value: 'value1'
- }]
- }],
- tenant_id: 'tenant_id',
- user_id: 'user_id',
- account_id: 'account_id',
- subscription_id: '1',
- product_deployment: {
- product_deployment_location: 'multitenant1.dal10.us-south',
- instance_url: 'https://ca1.analytics.ibm.com',
- offering: 'CA',
- description: 'CA on DAL10 US-South'
- }
- };
- return constants;
- });
- //# sourceMappingURL=EntitlementObject.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * Copyright IBM Corp. 2019, 2020
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/services/DigitalContextService',['underscore', 'caglass/utils/EntitlementObject', 'caglass/utils/CAUtils', 'baglass/utils/Utils'], function (_, EntitlementObject, CAUtils, GlassUtils) {
- /**
- * A service for presenting a Digital Context Object describing entitlement details for cloud users
- * @class
- */
- var DigitalContextService = /*#__PURE__*/function () {
- function DigitalContextService(glassContext) {
- _classCallCheck(this, DigitalContextService);
- this._glassContext = glassContext;
- this._setLogger(glassContext);
- }
- _createClass(DigitalContextService, [{
- key: "initialize",
- value: function initialize() {
- if (this.isEnabled()) {
- if (GlassUtils.getCookieValue(DigitalContextService.DCO_COOKIE) == undefined) {
- return this.fetchEntitlements();
- } else {
- var parsedJsonObject = this.parseJsonFromDcoCookie(GlassUtils.getCookieValue(DigitalContextService.DCO_COOKIE));
- if (parsedJsonObject) {
- this.digitalContext = parsedJsonObject;
- return Promise.resolve(parsedJsonObject);
- }
- }
- }
- return Promise.resolve();
- }
- }, {
- key: "fetchEntitlements",
- value: function fetchEntitlements() {
- var _this = this;
- return this._glassContext.getCoreSvc('.Ajax').ajax({
- url: DigitalContextService.DIGITAL_CONTEXT_URL,
- type: 'POST'
- }).then(function (result) {
- if (result.data && result.data.enabled !== false) {
- _this.digitalContext = result.data;
- CAUtils.preventWritesToObject(_this.digitalContext);
- } else _this._getLogger().error('DigitalContextService Retrieved Entitlement data invalid ');
- })["catch"](function (error) {
- _this._getLogger().error('DigitalContextService Communication error with digitalcontext API', error);
- });
- }
- }, {
- key: "isInitialized",
- value: function isInitialized() {
- return this.digitalContext ? true : false;
- }
- }, {
- key: "isEnabled",
- value: function isEnabled() {
- return this._glassContext.getCoreSvc('.Config').getConfigValueSync('Glass.digitalContextEnabled');
- }
- }, {
- key: "getAccountId",
- value: function getAccountId() {
- if (this.digitalContext && this.digitalContext[DigitalContextService.ACCOUNT_ID]) {
- return this.digitalContext[DigitalContextService.ACCOUNT_ID];
- }
- }
- }, {
- key: "getSubscriptionId",
- value: function getSubscriptionId() {
- var parts = this.getEntitledParts();
- var sbsId = this._findBasePartSbsId(parts);
- if (sbsId) return sbsId;
- var trialSbsId = this._findTrialPartSbsId();
- if (trialSbsId) return trialSbsId;
- return this.digitalContext[DigitalContextService.SUBSCRIPTION_ID];
- }
- }, {
- key: "_findBasePartSbsId",
- value: function _findBasePartSbsId(parts) {
- return parts.map(function (part) {
- return part.type && part.type.toLowerCase() === DigitalContextService.BASE && part[DigitalContextService.SUBSCRIPTION_ID];
- }).filter(function (validPart) {
- return validPart !== false;
- })[0];
- }
- }, {
- key: "_findTrialPartSbsId",
- value: function _findTrialPartSbsId() {
- var trialPart = this.getTrialPart();
- return trialPart && trialPart[DigitalContextService.SUBSCRIPTION_ID];
- }
- }, {
- key: "getValueByKey",
- value: function getValueByKey(key) {
- if (this.digitalContext && this.digitalContext[key]) {
- return this.digitalContext[key];
- }
- }
- }, {
- key: "getTrialPart",
- value: function getTrialPart() {
- var eParts = this.getEntitledParts();
- if (eParts && eParts.length > 0) {
- return this._getTrialParts(eParts);
- }
- }
- }, {
- key: "_getTrialParts",
- value: function _getTrialParts(eParts) {
- var trialPart;
- _.each(eParts, function (part) {
- if (part[DigitalContextService.PART_TYPE] && part[DigitalContextService.PART_TYPE].toLowerCase() == DigitalContextService.TRIAL) {
- trialPart = part;
- return false;
- }
- });
- if (trialPart) {
- return trialPart;
- }
- }
- }, {
- key: "isTrial",
- value: function isTrial() {
- return this.getTrialPart() ? true : false;
- }
- }, {
- key: "getTieredParts",
- value: function getTieredParts() {
- var eParts = this.getEntitledParts();
- if (eParts && eParts.length > 0) {
- return this._getTieredParts(eParts);
- }
- return eParts;
- }
- }, {
- key: "_getTieredParts",
- value: function _getTieredParts(eParts) {
- var tieredParts = [];
- _.each(eParts, function (part) {
- if (part[DigitalContextService.PART_TYPE] && part[DigitalContextService.PART_TYPE].toLowerCase() !== DigitalContextService.TRIAL && part[DigitalContextService.PART_TYPE].toLowerCase() !== DigitalContextService.BASE && part[DigitalContextService.PART_NUMBER] && part[DigitalContextService.PART_NUMBER].toLowerCase() == DigitalContextService.PART_NUMBER) {
- tieredParts.push(part);
- }
- });
- return tieredParts;
- }
- }, {
- key: "getEntitledOrganization",
- value: function getEntitledOrganization() {
- return this.getValueByKey(DigitalContextService.ENTITLED_ORGANIZATION);
- }
- }, {
- key: "getEntitledParts",
- value: function getEntitledParts() {
- if (this.digitalContext && this.digitalContext[DigitalContextService.ENTITLED_PARTS]) {
- return this.digitalContext[DigitalContextService.ENTITLED_PARTS];
- }
- return [];
- }
- }, {
- key: "getEntitledUser",
- value: function getEntitledUser() {
- return this.getValueByKey(DigitalContextService.ENTITLED_USER);
- }
- }, {
- key: "getThirdPartyMarketplace",
- value: function getThirdPartyMarketplace() {
- return this.getValueByKey(DigitalContextService.THIRD_PARTY_MARKETPLACE);
- }
- }, {
- key: "isThirdPartyMarketplace",
- value: function isThirdPartyMarketplace() {
- var thirdPartyMarket = this.getThirdPartyMarketplace();
- return _.isEmpty(thirdPartyMarket) || thirdPartyMarket.route_indicator !== DigitalContextService.THIRD_PARTY_MARKETPLACE_ID ? false : true;
- }
- }, {
- key: "getUserOtherIdentifiers",
- value: function getUserOtherIdentifiers() {
- var entitled_user = this.getEntitledOrganization();
- return entitled_user && entitled_user[DigitalContextService.OTHER_IDENTIFIER];
- }
- }, {
- key: "getICN",
- value: function getICN() {
- var other_identifier = this.getUserOtherIdentifiers();
- return other_identifier && other_identifier[DigitalContextService.ICN];
- }
- }, {
- key: "getOrgId",
- value: function getOrgId() {
- var other_identifier = this.getUserOtherIdentifiers();
- return other_identifier && other_identifier[DigitalContextService.ORG_ID];
- }
- }, {
- key: "getTenantId",
- value: function getTenantId() {
- if (this.digitalContext && this.digitalContext[DigitalContextService.TENANT_ID]) {
- return this.digitalContext[DigitalContextService.TENANT_ID];
- }
- } // partIds are called part_number in PSNext and come from an entitled_part object in the entitled_parts array
- }, {
- key: "getPartIds",
- value: function getPartIds() {
- var eParts = this.getEntitledParts();
- var partIds = [];
- if (eParts && eParts.length > 0) {
- _.each(eParts, function (part) {
- partIds.push(part[DigitalContextService.PART_NUMBER]);
- });
- }
- return partIds;
- }
- }, {
- key: "_getLogger",
- value: function _getLogger() {
- return this._logger;
- }
- }, {
- key: "_setLogger",
- value: function _setLogger(glassContext) {
- if (glassContext && glassContext.getCoreSvc('.Logger')) {
- this._logger = glassContext.getCoreSvc('.Logger');
- } else {
- this._logger = console;
- }
- }
- }, {
- key: "getDigitalContextObject",
- value: function getDigitalContextObject() {
- return this.digitalContext;
- }
- }, {
- key: "getDigitalContextObjectMock",
- value: function getDigitalContextObjectMock() {
- return EntitlementObject.ENTITLEMENTS;
- }
- }, {
- key: "killDcoCookie",
- value: function killDcoCookie() {
- if (this.isEnabled()) {
- return this._glassContext.getCoreSvc('.Ajax').ajax({
- type: 'DELETE',
- url: DigitalContextService.DIGITAL_CONTEXT_URL
- });
- } else return Promise.resolve();
- }
- }, {
- key: "parseJsonFromDcoCookie",
- value: function parseJsonFromDcoCookie(cookie) {
- var parsedJson;
- var splits = cookie.split('_json_');
- try {
- parsedJson = JSON.parse(splits[1]);
- } catch (syntaxException) {
- this._getLogger().error('DigitalContextService Not initialized with an invalid cookie');
- }
- return parsedJson;
- }
- }]);
- return DigitalContextService;
- }();
- DigitalContextService.ACCOUNT_ID = 'account_id';
- DigitalContextService.BASE = 'base';
- DigitalContextService.BASE_URL = 'v1';
- DigitalContextService.DCO_COOKIE = 'dco';
- DigitalContextService.DIGITAL_CONTEXT_ENABLED_CONF = 'Glass.digitalContextEnabled';
- DigitalContextService.DIGITAL_CONTEXT_URL = DigitalContextService.BASE_URL + '/digitalcontext';
- DigitalContextService.ENTITLED_USER = 'entitled_user';
- DigitalContextService.ENTITLED_PARTS = 'entitled_parts';
- DigitalContextService.ENTITLED_ORGANIZATION = 'entitled_organization';
- DigitalContextService.ICN = 'ibm_customer_number';
- DigitalContextService.IS_ENABLED = 'enabled';
- DigitalContextService.PART_NUMBER = 'part_number';
- DigitalContextService.PART_TYPE = 'type';
- DigitalContextService.ORG_ID = 'org_id';
- DigitalContextService.OTHER_IDENTIFIER = 'other_identifier';
- DigitalContextService.SUBSCRIPTION_ID = 'subscription_id';
- DigitalContextService.THIRD_PARTY_MARKETPLACE = 'third_party_marketplace';
- DigitalContextService.THIRD_PARTY_MARKETPLACE_ID = '3PM';
- DigitalContextService.TENANT_ID = 'tenant_id';
- DigitalContextService.TIERED_PART_NUMBER = 'tiered_part_number';
- DigitalContextService.TRIAL = 'trial';
- return DigitalContextService;
- });
- //# sourceMappingURL=DigitalContextService.js.map
- ;
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: CA Glass
- * Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/services/InstrumentationConfigBuilder',[], function () {
- var ACCOUNT_ID_TYPE = 'ssmHubId';
- return /*#__PURE__*/_createClass(function InstrumentationConfigBuilder(glassContext) {
- _classCallCheck(this, InstrumentationConfigBuilder);
- if (glassContext) {
- var configService = glassContext.getCoreSvc('.Config');
- var ups = glassContext.getCoreSvc('.UserProfile');
- var dcs = glassContext.getCoreSvc('.DigitalContext');
- var iConfig = configService.getInstrumentationConfig();
- if (iConfig && iConfig.enabled) {
- iConfig.whitelistedValues = iConfig.whitelistedValues.split(',');
- if (configService) {
- iConfig.versionNumber = configService.getVersion();
- }
- if (ups && ups.userAccount && ups.preferences) {
- iConfig.email = ups.userAccount.email;
- iConfig.capabilities = ups.capabilities;
- iConfig.creationTime = ups.userAccount.creationTime;
- iConfig.productLocale = ups.preferences.productLocale;
- }
- if (dcs && dcs.isInitialized()) {
- iConfig.tenantId = dcs.getTenantId();
- iConfig.accountId = dcs.getOrgId();
- iConfig.accountIdType = ACCOUNT_ID_TYPE;
- iConfig.partIds = dcs.getPartIds();
- iConfig.isTrial = dcs.isTrial();
- }
- }
- return iConfig;
- }
- });
- });
- //# sourceMappingURL=InstrumentationConfigBuilder.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/utils/Notifier',[], function () {
- return /*#__PURE__*/function () {
- function Notifier() {
- _classCallCheck(this, Notifier);
- this.cache = {};
- }
- _createClass(Notifier, [{
- key: "register",
- value: function register(ids, callback) {
- var _this = this;
- if (!Array.isArray(ids)) {
- ids = [ids];
- }
- ids.forEach(function (id) {
- return _this.cache[id] = callback;
- });
- }
- }, {
- key: "notify",
- value: function notify(id) {
- var _this2 = this;
- var promise;
- if (this.cache.hasOwnProperty(id)) {
- try {
- promise = this.cache[id](id);
- } catch (e) {
- return Promise.reject(e);
- }
- promise = promise || Promise.resolve();
- return promise.then(function () {
- _this2.remove(id);
- });
- }
- return Promise.reject("Notifier::notify '".concat(id, "' not found"));
- }
- }, {
- key: "remove",
- value: function remove(id) {
- delete this.cache[id];
- }
- }]);
- return Notifier;
- }();
- });
- //# sourceMappingURL=Notifier.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/services/AlertBannerService',['../utils/Notifier', 'baglass/glass.webpack.bundle', 'baglass/app/services/ConfigService'], function (Notifier, GlassWebpackBundle, ConfigService) {
- var AlertStore = GlassWebpackBundle.AlertStore;
- var AlertBannerService = /*#__PURE__*/function () {
- function AlertBannerService(glassContext) {
- _classCallCheck(this, AlertBannerService);
- this.glassContext = glassContext;
- this.store = AlertStore.create({
- disabled: this._isDisabled()
- });
- this.notifier = new Notifier();
- }
- _createClass(AlertBannerService, [{
- key: "_isDisabled",
- value: function _isDisabled() {
- var config = this.glassContext.getCoreSvc('.Config');
- var disabled = config.getConfigValueSync(ConfigService.DISABLE_ALERTBANNER);
- return disabled;
- }
- }, {
- key: "getDisabled",
- value: function getDisabled() {
- return this.store.disabled;
- }
- }, {
- key: "addAlerts",
- value: function addAlerts(alerts, onDismiss) {
- if (!Array.isArray(alerts)) {
- alerts = [alerts];
- }
- if (onDismiss) {
- this.notifier.register(alerts.map(function (alert) {
- return alert.id;
- }), onDismiss);
- }
- this.store.addAlerts(alerts);
- }
- }, {
- key: "removeAlert",
- value: function removeAlert(index) {
- var _this = this;
- var alert = this.store.getAlertAt(index);
- var updateStore = function updateStore() {
- _this.store.removeAlert(index);
- };
- return this.notifier.notify(alert.id).then(function () {
- updateStore();
- }).catch(function () {
- //if no onDismiss callback was registered for this alert an error is thrown from the notifier.
- //this is a valid case, we can remove the alert from the store without an onDismiss callback.
- //catch is needed to suppress this exception
- updateStore();
- });
- }
- }, {
- key: "getStore",
- value: function getStore() {
- return this.store;
- }
- }]);
- return AlertBannerService;
- }();
- return AlertBannerService;
- });
- //# sourceMappingURL=AlertBannerService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2019, 2022
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/StartupCA',['jquery', 'baglass/app/AppController', 'baglass/services/OfflineOnlineService', 'baglass/nls/StringResources', 'baglass/core-client/js/core-client/utils/PerfUtils', 'baglass/core-client/js/core-client/utils/Utils', 'baglass/utils/Utils', 'caglass/app/services/CAUserProfileService', 'caglass/app/services/LogoutService', 'caglass/ajax/PrepareRequest', 'caglass/ajax/HandleError', 'caglass/ajax/HandleResponse', 'caglass/utils/CAUtils', 'underscore', 'caglass/ba-instrumentation/dist/bundle', 'caglass/app/services/CAFEncodingService', 'caglass/ajax/PrepareRequestURL', 'caglass/app/services/LoginService', 'caglass/app/services/DigitalContextService', 'caglass/app/services/InstrumentationConfigBuilder', 'baglass/services/AlertBannerService', 'jquery-ui', 'jquery-bbq'], function ($, AppController, OfflineOnlineService, StringResources, PerfUtils, CoreUtils, GlassUtils, CAUserProfileService, LogoutService, PrepareRequest, HandleError, HandleResponse, CAUtils, _, InstrumentationBundle, CAFEncodingService, PrepareRequestURL, LoginService, DigitalContextService, InstrumentationConfigBuilder, AlertBannerService) {
- return function (inlineContext) {
- PerfUtils.createPerformanceMark({
- 'component': 'glass-foundation',
- 'name': 'entry',
- 'state': 'start'
- });
- var appController = new AppController({
- '$rootPane': $('#main'),
- installInfo: inlineContext.configuration.installInfo,
- versionInfo: inlineContext.versionInfo,
- authInfo: inlineContext.authInfo,
- perspectives: inlineContext.perspectives
- });
- window.__glassAppController = appController;
- var glassContext = appController.glassContext;
- var configService = glassContext.getCoreSvc('.Config');
- configService.initialize(inlineContext.configuration);
- glassContext.getCoreSvc('.Taxonomy').initialize(inlineContext.taxonomy);
- var cafEncodingService = new CAFEncodingService(glassContext, "<'>");
- glassContext.registerCoreService('.CAFEncoding', cafEncodingService);
- glassContext.getCoreSvc('.URLEncoder').registerQSValueEncoder(cafEncodingService.cafEncodeQSValue.bind(cafEncodingService));
- var ajaxSrv = glassContext.getCoreSvc('.Ajax');
- ajaxSrv.addRequestHandler(new PrepareRequest(glassContext));
- ajaxSrv.addRequestHandler(new PrepareRequestURL(glassContext));
- ajaxSrv.setErrorHandler(new HandleError(glassContext));
- ajaxSrv.addResponseHandler(new HandleResponse(glassContext));
- glassContext.registerCoreService('.Login', new LoginService(glassContext));
- var logoutService = new LogoutService();
- glassContext.services.register('.Logout', logoutService);
- var userProfileService = new CAUserProfileService({
- glassContext: glassContext
- });
- glassContext.services.userProfile = userProfileService;
- glassContext.services.register('.UserProfile', userProfileService);
- var digitalContextService = new DigitalContextService(glassContext);
- glassContext.registerCoreService('.DigitalContext', digitalContextService);
- var instrumentationService = new InstrumentationBundle.InstrumentationService();
- glassContext.registerCoreService('.Instrumentation', instrumentationService);
- var offlineOnlineService = new OfflineOnlineService();
- glassContext.registerCoreService('.OfflineOnline', offlineOnlineService);
- var alertBannerService = new AlertBannerService(glassContext);
- glassContext.registerCoreService('.Message', alertBannerService);
- glassContext.gateway = window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/'));
- appController.detectAccessibilityChange();
- var queryString = _.unescape($('#queryString_data').text());
- var content = GlassUtils.getAppContent(queryString, $.param.fragment(), glassContext);
- var perspective = content.perspective;
- var objRef = content.objRef;
- var context = {
- perspective: perspective,
- content: content
- };
- if (objRef) {
- context.id = objRef;
- context.content.objRef = objRef; //Provide a way for the content views to get the id (in their constructor)
- }
- delete context.content.module;
- glassContext.getCoreSvc('.Events').on('appView:loaded', CAUtils.removeLoadingSpinner.bind(this, glassContext), 'removeLoadingSpinnerFunction');
- $(document).ready(function () {
- if (window.cssVars) {
- window.cssVars();
- }
- var currentWindow = CoreUtils.getCurrentWindow();
- $(currentWindow).on('beforeunload', function () {
- return appController.close(false, true);
- }.bind(this));
- $(currentWindow).on('unload', function () {
- appController.close(true);
- }.bind(this));
- }.bind(this));
- return Promise.all([userProfileService.initialize(inlineContext), digitalContextService.initialize()])["catch"](function (error) {
- glassContext.getCoreSvc('.Logger').error('Error loading UPS and DCS', error);
- return Promise.resolve();
- }).then(function () {
- var instrumentationConfig = new InstrumentationConfigBuilder(glassContext);
- return instrumentationService.initialize(glassContext, instrumentationConfig).then(function () {
- if (instrumentationService.enabled) {
- instrumentationService.track({
- type: 'Service Login'
- });
- }
- return Promise.resolve;
- })["catch"](function (error) {
- glassContext.getCoreSvc('.Logger').error('Error loading the InstrumentationService', error);
- return Promise.resolve(); // handle gracefully - this should not stop the app from rendering
- });
- }).then(function () {
- return appController.openAppView(perspective, context);
- })["catch"](function (error) {
- glassContext.getCoreSvc('.Logger').error('error while showing showing the home page', error);
- CAUtils.removeLoadingSpinner(glassContext);
- return appController.showErrorMessage(StringResources.get('errLoadingView'), StringResources.get('CAInitTitle'));
- });
- };
- });
- //# sourceMappingURL=StartupCA.js.map
- ;
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define('caglass/icons/ba-login-icon-bundle',[],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}({0:function(t,e,n){n("f69f3cc35d9d7e069ab8"),n("c7e74f3ded7b2423ac05"),n("502bc6fc6b5a47d78dca"),n("dd7a6562fd2654d2c026"),n("ade9a0280e3f1ee6338b"),n("3849399a2893e2397738"),t.exports=n("2ea9df5638a4b723c072")},"2b419eb9b5086dc822ae":function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},"2ea9df5638a4b723c072":function(t,e,n){"use strict";n.r(e);var r=n("9689a9c94ae38b47fa2c"),o=n.n(r),i=n("9ce58a7deea14f49ef01"),a=n.n(i),s=new o.a({id:"login-TheOldPassword",use:"login-TheOldPassword-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" id="login-TheOldPassword">\r\n<g>\r\n\t<path d="M25,1L12.611,13.388C11.785,13.138,10.908,13,10,13c-4.971,0-9,4.029-9,9s4.029,9,9,9s9-4.029,9-9\r\n\t\tc0-0.909-0.138-1.785-0.389-2.612L21,17v-2h2l8-8V1H25z M29,6.171L22.172,13H21h-2v2v1.171l-1.803,1.802l-0.848,0.848l0.348,1.147\r\n\t\tC16.898,20.63,17,21.313,17,22c0,3.86-3.141,7-7,7s-7-3.14-7-7s3.141-7,7-7c0.686,0,1.37,0.102,2.031,0.302l1.146,0.348\r\n\t\tl0.848-0.848L25.828,3H29V6.171z" />\r\n\t<circle cx="8" cy="24" r="2" />\r\n\t<rect x="19.757" y="7.5" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 46.6274 -3.3137)" width="8.485" height="1" />\r\n</g>\r\n</symbol>'});a.a.add(s);e.default=s},"3849399a2893e2397738":function(t,e,n){"use strict";n.r(e);var r=n("9689a9c94ae38b47fa2c"),o=n.n(r),i=n("9ce58a7deea14f49ef01"),a=n.n(i),s=new o.a({id:"login-TheNewPassword",use:"login-TheNewPassword-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" id="login-TheNewPassword">\r\n<g>\r\n\t<path d="M25,1L12.611,13.388C11.785,13.138,10.908,13,10,13c-4.971,0-9,4.029-9,9s4.029,9,9,9s9-4.029,9-9\r\n\t\tc0-0.909-0.138-1.785-0.389-2.612L21,17v-2h2l8-8V1H25z M29,6.171L22.172,13H21h-2v2v1.171l-1.803,1.802l-0.848,0.848l0.348,1.147\r\n\t\tC16.898,20.63,17,21.313,17,22c0,3.86-3.141,7-7,7s-7-3.14-7-7s3.141-7,7-7c0.686,0,1.37,0.102,2.031,0.302l1.146,0.348\r\n\t\tl0.848-0.848L25.828,3H29V6.171z" />\r\n\t<circle cx="8" cy="24" r="2" />\r\n\t<rect x="19.757" y="7.5" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 46.6274 -3.3137)" width="8.485" height="1" />\r\n</g>\r\n</symbol>'});a.a.add(s);e.default=s},"502bc6fc6b5a47d78dca":function(t,e,n){"use strict";n.r(e);var r=n("9689a9c94ae38b47fa2c"),o=n.n(r),i=n("9ce58a7deea14f49ef01"),a=n.n(i),s=new o.a({id:"login-CAMPassword",use:"login-CAMPassword-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" id="login-CAMPassword">\r\n<g>\r\n\t<path d="M25,1L12.611,13.388C11.785,13.138,10.908,13,10,13c-4.971,0-9,4.029-9,9s4.029,9,9,9s9-4.029,9-9\r\n\t\tc0-0.909-0.138-1.785-0.389-2.612L21,17v-2h2l8-8V1H25z M29,6.171L22.172,13H21h-2v2v1.171l-1.803,1.802l-0.848,0.848l0.348,1.147\r\n\t\tC16.898,20.63,17,21.313,17,22c0,3.86-3.141,7-7,7s-7-3.14-7-7s3.141-7,7-7c0.686,0,1.37,0.102,2.031,0.302l1.146,0.348\r\n\t\tl0.848-0.848L25.828,3H29V6.171z" />\r\n\t<circle cx="8" cy="24" r="2" />\r\n\t<rect x="19.757" y="7.5" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 46.6274 -3.3137)" width="8.485" height="1" />\r\n</g>\r\n</symbol>'});a.a.add(s);e.default=s},"9689a9c94ae38b47fa2c":function(t,e,n){(function(e){!function(e,n){t.exports=n()}(0,function(){"use strict";var t=function(t){var e=t.id,n=t.viewBox,r=t.content;this.id=e,this.viewBox=n,this.content=r};t.prototype.stringify=function(){return this.content},t.prototype.toString=function(){return this.stringify()},t.prototype.destroy=function(){var t=this;["id","viewBox","content"].forEach(function(e){return delete t[e]})};"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n(function(t,e){t.exports=function(){function t(t){var e=t&&"object"==typeof t;return e&&"[object RegExp]"!==Object.prototype.toString.call(t)&&"[object Date]"!==Object.prototype.toString.call(t)}function e(e,n){var o=n&&!0===n.clone;return o&&t(e)?r(function(t){return Array.isArray(t)?[]:{}}(e),e,n):e}function n(n,o,i){var a=n.slice();return o.forEach(function(o,s){void 0===a[s]?a[s]=e(o,i):t(o)?a[s]=r(n[s],o,i):-1===n.indexOf(o)&&a.push(e(o,i))}),a}function r(o,i,a){var s=Array.isArray(i),c=a||{arrayMerge:n},u=c.arrayMerge||n;return s?Array.isArray(o)?u(o,i,a):e(i,a):function(n,o,i){var a={};return t(n)&&Object.keys(n).forEach(function(t){a[t]=e(n[t],i)}),Object.keys(o).forEach(function(s){t(o[s])&&n[s]?a[s]=r(n[s],o[s],i):a[s]=e(o[s],i)}),a}(o,i,a)}return r.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce(function(t,n){return r(t,n,e)})},r}()}),o=n(function(t,e){e.default={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}},t.exports=e.default}),i=o.svg,a=o.xlink,s={};s[i.name]=i.uri,s[a.name]=a.uri;var c=function(t,e){return void 0===t&&(t=""),"<svg "+function(t){return Object.keys(t).map(function(e){return e+'="'+t[e].toString().replace(/"/g,""")+'"'}).join(" ")}(r(s,e||{}))+">"+t+"</svg>"};return function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},e.createFromExistingNode=function(t){return new e({id:t.getAttribute("id"),viewBox:t.getAttribute("viewBox"),content:t.outerHTML})},e.prototype.destroy=function(){this.isMounted&&this.unmount(),t.prototype.destroy.call(this)},e.prototype.mount=function(t){if(this.isMounted)return this.node;var e="string"==typeof t?document.querySelector(t):t,n=this.render();return this.node=n,e.appendChild(n),n},e.prototype.render=function(){var t=this.stringify();return function(t){var e=!!document.importNode,n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;return e?document.importNode(n,!0):n}(c(t)).childNodes[0]},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(e.prototype,n),e}(t)})}).call(this,n("2b419eb9b5086dc822ae"))},"9ce58a7deea14f49ef01":function(t,e,n){(function(e){!function(e,n){t.exports=n()}(0,function(){"use strict";"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;function t(t,e){return t(e={exports:{}},e.exports),e.exports}var n=t(function(t,e){t.exports=function(){function t(t){var e=t&&"object"==typeof t;return e&&"[object RegExp]"!==Object.prototype.toString.call(t)&&"[object Date]"!==Object.prototype.toString.call(t)}function e(e,n){var o=n&&!0===n.clone;return o&&t(e)?r(function(t){return Array.isArray(t)?[]:{}}(e),e,n):e}function n(n,o,i){var a=n.slice();return o.forEach(function(o,s){void 0===a[s]?a[s]=e(o,i):t(o)?a[s]=r(n[s],o,i):-1===n.indexOf(o)&&a.push(e(o,i))}),a}function r(o,i,a){var s=Array.isArray(i),c=a||{arrayMerge:n},u=c.arrayMerge||n;return s?Array.isArray(o)?u(o,i,a):e(i,a):function(n,o,i){var a={};return t(n)&&Object.keys(n).forEach(function(t){a[t]=e(n[t],i)}),Object.keys(o).forEach(function(s){t(o[s])&&n[s]?a[s]=r(n[s],o[s],i):a[s]=e(o[s],i)}),a}(o,i,a)}return r.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce(function(t,n){return r(t,n,e)})},r}()});var r=t(function(t,e){e.default={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}},t.exports=e.default}),o=r.svg,i=r.xlink,a={};a[o.name]=o.uri,a[i.name]=i.uri;var s,c=function(t,e){return void 0===t&&(t=""),"<svg "+function(t){return Object.keys(t).map(function(e){return e+'="'+t[e].toString().replace(/"/g,""")+'"'}).join(" ")}(n(a,e||{}))+">"+t+"</svg>"},u=r.svg,d=r.xlink,f={attrs:(s={style:["position: absolute","width: 0","height: 0"].join("; ")},s[u.name]=u.uri,s[d.name]=d.uri,s)},l=function(t){this.config=n(f,t||{}),this.symbols=[]};l.prototype.add=function(t){var e=this.symbols,n=this.find(t.id);return n?(e[e.indexOf(n)]=t,!1):(e.push(t),!0)},l.prototype.remove=function(t){var e=this.symbols,n=this.find(t);return!!n&&(e.splice(e.indexOf(n),1),n.destroy(),!0)},l.prototype.find=function(t){return this.symbols.filter(function(e){return e.id===t})[0]||null},l.prototype.has=function(t){return null!==this.find(t)},l.prototype.stringify=function(){var t=this.config.attrs,e=this.symbols.map(function(t){return t.stringify()}).join("");return c(e,t)},l.prototype.toString=function(){return this.stringify()},l.prototype.destroy=function(){this.symbols.forEach(function(t){return t.destroy()})};var p=function(t){var e=t.id,n=t.viewBox,r=t.content;this.id=e,this.viewBox=n,this.content=r};p.prototype.stringify=function(){return this.content},p.prototype.toString=function(){return this.stringify()},p.prototype.destroy=function(){var t=this;["id","viewBox","content"].forEach(function(e){return delete t[e]})};var h=function(t){var e=!!document.importNode,n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;return e?document.importNode(n,!0):n},g=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},e.createFromExistingNode=function(t){return new e({id:t.getAttribute("id"),viewBox:t.getAttribute("viewBox"),content:t.outerHTML})},e.prototype.destroy=function(){this.isMounted&&this.unmount(),t.prototype.destroy.call(this)},e.prototype.mount=function(t){if(this.isMounted)return this.node;var e="string"==typeof t?document.querySelector(t):t,n=this.render();return this.node=n,e.appendChild(n),n},e.prototype.render=function(){var t=this.stringify();return h(c(t)).childNodes[0]},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(e.prototype,n),e}(p),m={autoConfigure:!0,mountTo:"body",syncUrlsWithBaseTag:!1,listenLocationChangeEvent:!0,locationChangeEvent:"locationChange",locationChangeAngularEmitter:!1,usagesToUpdate:"use[*|href]",moveGradientsOutsideSymbol:!1},y=function(t){return Array.prototype.slice.call(t,0)},v=navigator.userAgent,w={isChrome:/chrome/i.test(v),isFirefox:/firefox/i.test(v),isIE:/msie/i.test(v)||/trident/i.test(v),isEdge:/edge/i.test(v)},x=function(t){var e=[];return y(t.querySelectorAll("style")).forEach(function(t){t.textContent+="",e.push(t)}),e},b=function(t){return(t||window.location.href).split("#")[0]},M=function(t){angular.module("ng").run(["$rootScope",function(e){e.$on("$locationChangeSuccess",function(e,n,r){!function(t,e){var n=document.createEvent("CustomEvent");n.initCustomEvent(t,!1,!1,e),window.dispatchEvent(n)}(t,{oldUrl:r,newUrl:n})})}])},_=function(t,e){return void 0===e&&(e="linearGradient, radialGradient, pattern"),y(t.querySelectorAll("symbol")).forEach(function(t){y(t.querySelectorAll(e)).forEach(function(e){t.parentNode.insertBefore(e,t)})}),t};var E=r.xlink.uri,S="xlink:href",O=/[{}|\\\^\[\]`"<>]/g;function C(t){return t.replace(O,function(t){return"%"+t[0].charCodeAt(0).toString(16).toUpperCase()})}var A,B=["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke","style"],N=B.map(function(t){return"["+t+"]"}).join(","),j=function(t,e,n,r){var o=C(n),i=C(r);(function(t,e){return y(t).reduce(function(t,n){if(!n.attributes)return t;var r=y(n.attributes),o=e?r.filter(e):r;return t.concat(o)},[])})(t.querySelectorAll(N),function(t){var e=t.localName,n=t.value;return-1!==B.indexOf(e)&&-1!==n.indexOf("url("+o)}).forEach(function(t){return t.value=t.value.replace(o,i)}),function(t,e,n){y(t).forEach(function(t){var r=t.getAttribute(S);if(r&&0===r.indexOf(e)){var o=r.replace(e,n);t.setAttributeNS(E,S,o)}})}(e,o,i)},k={MOUNT:"mount",SYMBOL_MOUNT:"symbol_mount"},T=function(t){function e(e){var r=this;void 0===e&&(e={}),t.call(this,n(m,e));var o=function(t){return t=t||Object.create(null),{on:function(e,n){(t[e]||(t[e]=[])).push(n)},off:function(e,n){t[e]&&t[e].splice(t[e].indexOf(n)>>>0,1)},emit:function(e,n){(t[e]||[]).map(function(t){t(n)}),(t["*"]||[]).map(function(t){t(e,n)})}}}();this._emitter=o,this.node=null;var i=this.config;if(i.autoConfigure&&this._autoConfigure(e),i.syncUrlsWithBaseTag){var a=document.getElementsByTagName("base")[0].getAttribute("href");o.on(k.MOUNT,function(){return r.updateUrls("#",a)})}var s=this._handleLocationChange.bind(this);this._handleLocationChange=s,i.listenLocationChangeEvent&&window.addEventListener(i.locationChangeEvent,s),i.locationChangeAngularEmitter&&M(i.locationChangeEvent),o.on(k.MOUNT,function(t){i.moveGradientsOutsideSymbol&&_(t)}),o.on(k.SYMBOL_MOUNT,function(t){i.moveGradientsOutsideSymbol&&_(t.parentNode),(w.isIE||w.isEdge)&&x(t)})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={isMounted:{}};return r.isMounted.get=function(){return!!this.node},e.prototype._autoConfigure=function(t){var e=this.config;void 0===t.syncUrlsWithBaseTag&&(e.syncUrlsWithBaseTag=void 0!==document.getElementsByTagName("base")[0]),void 0===t.locationChangeAngularEmitter&&(e.locationChangeAngularEmitter="angular"in window),void 0===t.moveGradientsOutsideSymbol&&(e.moveGradientsOutsideSymbol=w.isFirefox)},e.prototype._handleLocationChange=function(t){var e=t.detail,n=e.oldUrl,r=e.newUrl;this.updateUrls(n,r)},e.prototype.add=function(e){var n=t.prototype.add.call(this,e);return this.isMounted&&n&&(e.mount(this.node),this._emitter.emit(k.SYMBOL_MOUNT,e.node)),n},e.prototype.attach=function(t){var e=this,n=this;if(n.isMounted)return n.node;var r="string"==typeof t?document.querySelector(t):t;return n.node=r,this.symbols.forEach(function(t){t.mount(n.node),e._emitter.emit(k.SYMBOL_MOUNT,t.node)}),y(r.querySelectorAll("symbol")).forEach(function(t){var e=g.createFromExistingNode(t);e.node=t,n.add(e)}),this._emitter.emit(k.MOUNT,r),r},e.prototype.destroy=function(){var t=this.config,e=this.symbols,n=this._emitter;e.forEach(function(t){return t.destroy()}),n.off("*"),window.removeEventListener(t.locationChangeEvent,this._handleLocationChange),this.isMounted&&this.unmount()},e.prototype.mount=function(t,e){void 0===t&&(t=this.config.mountTo),void 0===e&&(e=!1);if(this.isMounted)return this.node;var n="string"==typeof t?document.querySelector(t):t,r=this.render();return this.node=r,e&&n.childNodes[0]?n.insertBefore(r,n.childNodes[0]):n.appendChild(r),this._emitter.emit(k.MOUNT,r),r},e.prototype.render=function(){return h(this.stringify())},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},e.prototype.updateUrls=function(t,e){if(!this.isMounted)return!1;var n=document.querySelectorAll(this.config.usagesToUpdate);return j(this.node,n,b(t)+"#",b(e)+"#"),!0},Object.defineProperties(e.prototype,r),e}(l),L=t(function(t){
- /*!
- * domready (c) Dustin Diaz 2014 - License MIT
- */
- t.exports=function(){var t,e=[],n=document,r=(n.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(n.readyState);return r||n.addEventListener("DOMContentLoaded",t=function(){for(n.removeEventListener("DOMContentLoaded",t),r=1;t=e.shift();)t()}),function(t){r?setTimeout(t,0):e.push(t)}}()});!!window.__SVG_SPRITE__?A=window.__SVG_SPRITE__:(A=new T({attrs:{id:"__SVG_SPRITE_NODE__"}}),window.__SVG_SPRITE__=A);var U=function(){var t=document.getElementById("__SVG_SPRITE_NODE__");t?A.attach(t):A.mount(document.body,!0)};return document.body?U():L(U),A})}).call(this,n("2b419eb9b5086dc822ae"))},ade9a0280e3f1ee6338b:function(t,e,n){"use strict";n.r(e);var r=n("9689a9c94ae38b47fa2c"),o=n.n(r),i=n("9ce58a7deea14f49ef01"),a=n.n(i),s=new o.a({id:"login-tenantid",use:"login-tenantid-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="login-tenantid">\n<path d="M16 21c5.523 0 10-4.477 10-10S21.523 1 16 1 6 5.477 6 11s4.477 10 10 10zm0-18c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8zm8 20H8a4 4 0 0 0-4 4v4h24v-4a4 4 0 0 0-4-4z" />\n</symbol>'});a.a.add(s);e.default=s},c7e74f3ded7b2423ac05:function(t,e,n){"use strict";n.r(e);var r=n("9689a9c94ae38b47fa2c"),o=n.n(r),i=n("9ce58a7deea14f49ef01"),a=n.n(i),s=new o.a({id:"login-CAMNamespace",use:"login-CAMNamespace-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" id="login-CAMNamespace">\n<g>\n\t<g>\n\t\t<g>\n\t\t\t<path d="M24,19c-2.419,0-4.435,1.718-4.899,4h-6.201c-0.13-0.638-0.384-1.23-0.731-1.754l9.078-9.077\n\t\t\t\tC22.036,12.692,22.981,13,24,13c2.762,0,5-2.238,5-5s-2.238-5-5-5c-2.419,0-4.435,1.718-4.899,4h-6.201\n\t\t\t\tC12.436,4.718,10.419,3,8,3C5.238,3,3,5.238,3,8s2.238,5,5,5c2.419,0,4.436-1.718,4.899-4h6.201\n\t\t\t\tc0.13,0.638,0.384,1.23,0.731,1.754l-9.078,9.077C9.964,19.308,9.019,19,8,19c-2.762,0-5,2.238-5,5s2.238,5,5,5\n\t\t\t\tc2.419,0,4.436-1.718,4.899-4h6.201c0.464,2.282,2.481,4,4.899,4c2.762,0,5-2.238,5-5S26.762,19,24,19z M24,5\n\t\t\t\tc1.657,0,3,1.343,3,3s-1.343,3-3,3s-3-1.343-3-3S22.343,5,24,5z M8,11c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3\n\t\t\t\tS9.657,11,8,11z M8,27c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S9.657,27,8,27z" />\n\t\t</g>\n\t</g>\n</g>\n</symbol>'});a.a.add(s);e.default=s},dd7a6562fd2654d2c026:function(t,e,n){"use strict";n.r(e);var r=n("9689a9c94ae38b47fa2c"),o=n.n(r),i=n("9ce58a7deea14f49ef01"),a=n.n(i),s=new o.a({id:"login-CAMUsername",use:"login-CAMUsername-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" id="login-CAMUsername">\r\n<g>\r\n\t<path d="M16,21c5.523,0,10-4.477,10-10S21.523,1,16,1S6,5.477,6,11S10.477,21,16,21z M16,3c4.411,0,8,3.589,8,8s-3.589,8-8,8\r\n\t\ts-8-3.589-8-8S11.589,3,16,3z" />\r\n\t<path d="M24,23H8c-2.209,0-4,1.791-4,4v4h24v-4C28,24.791,26.209,23,24,23z" />\r\n</g>\r\n</symbol>'});a.a.add(s);e.default=s},f69f3cc35d9d7e069ab8:function(t,e,n){"use strict";n.r(e);var r=n("9689a9c94ae38b47fa2c"),o=n.n(r),i=n("9ce58a7deea14f49ef01"),a=n.n(i),s=new o.a({id:"error_24",use:"error_24-usage",viewBox:"0 0 24 24",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="error_24"><path d="M12 1C5.9 1 1 5.9 1 12s4.9 11 11 11 11-4.9 11-11S18.1 1 12 1zm1 16h-2v-2h2v2zm0-4h-2V6h2v7z" /></symbol>'});a.a.add(s);e.default=s}})});
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2018, 2022
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/LoginCA',['jquery', 'underscore', 'baglass/app/AppController', 'caglass/ajax/CAAuthentication', 'baglass/nls/StringResources', 'baglass/core-client/js/core-client/utils/PerfUtils', 'baglass/core-client/js/core-client/utils/Utils', 'baglass/core-client/js/core-client/utils/UrlUtils', 'baglass/core-client/js/core-client/utils/BrowserUtils', 'baglass/utils/Utils', 'caglass/app/services/LogoutService', 'caglass/ajax/PrepareRequest', 'caglass/ajax/HandleError', 'caglass/utils/CAUtils', 'caglass/caglass.webpack.bundle', 'jquery-ui', 'jquery-bbq', '../icons/ba-login-icon-bundle'], function ($, _, AppController, CAAuthentication, StringResources, PerfUtils, CoreUtils, UrlUtils, BrowserUtils, GlassUtils, LogoutService, PrepareRequest, HandleError, CAUtils, CAGlassBundle) {
- var postSecondaryLogin = CAGlassBundle.postSecondaryLogin;
- return function (inlineContext) {
- PerfUtils.createPerformanceMark({
- 'component': 'bi_commons',
- 'name': 'entry',
- 'state': 'start'
- });
- var appController = new AppController({
- '$rootPane': $('#main'),
- installInfo: inlineContext.configuration.installInfo,
- versionInfo: inlineContext.versionInfo,
- perspectives: inlineContext.perspectives
- });
- window.__glassAppController = appController;
- var glassContext = appController.glassContext;
- var configService = glassContext.getCoreSvc('.Config');
- configService.initialize(inlineContext.configuration);
- var ajaxSrv = glassContext.getCoreSvc('.Ajax');
- ajaxSrv.addRequestHandler(new PrepareRequest(glassContext));
- ajaxSrv.setErrorHandler(new HandleError(glassContext));
- var logoutService = new LogoutService();
- glassContext.services.register('.Logout', logoutService);
- var currentWindow = glassContext.window || CoreUtils.getCurrentWindow();
- glassContext.gateway = currentWindow.location.pathname.substr(0, currentWindow.location.pathname.lastIndexOf('/'));
- appController.detectAccessibilityChange();
- var queryString = _.unescape($('#queryString_data').text());
- var content = GlassUtils.getAppContent(queryString, $.param.fragment(), glassContext);
- glassContext.getCoreSvc('.Events').on('appView:loaded', CAUtils.removeLoadingSpinner.bind(this, glassContext), 'removeLoadingSpinnerFunction');
- var requestMethod = inlineContext.requestMethod || 'GET';
- var caAuthentication = new CAAuthentication();
- var loginComplete;
- if (content.legacyLogin) {
- var origin = {
- legacyLogin: true,
- redirectUrl: content.legacyLogin
- };
- loginComplete = caAuthentication.legacyLogin(glassContext, origin).then(function () {
- currentWindow.location = content.legacyLogin;
- });
- } else if (content.secondaryLogin) {
- var state;
- if (content.state) {
- state = JSON.parse(UrlUtils.base64Decode(content.state));
- }
- loginComplete = caAuthentication.secondaryLogin(glassContext, state).then(function (result) {
- return postSecondaryLogin(currentWindow, result);
- })["catch"](function (error) {
- glassContext.getCoreSvc('.Logger').error('Error showing the login prompt', error);
- return appController.showErrorMessage(StringResources.get('unableLogin'), StringResources.get('CAInitTitle'));
- });
- } else {
- loginComplete = caAuthentication.login(glassContext, {
- initialLogin: true,
- requestMethod: requestMethod,
- queryString: $.deparam(queryString)
- }).then(function () {
- if (currentWindow.external && currentWindow.external.HasOnClose) {
- return currentWindow.external.OnClose(0);
- }
- if (requestMethod === 'POST') {
- currentWindow.location.assign(currentWindow.location.pathname + '?' + CAUtils.removeCAMNamespaceHref(queryString));
- } else {
- var currentUrl = new window.URL(currentWindow.location.href);
- var currentPerspective = currentUrl.searchParams.get('perspective');
- if (glassContext.isLoginViewShown() && currentPerspective === glassContext.getCurrentPerspective()) {
- currentUrl.searchParams["delete"]('perspective');
- }
- currentUrl.pathname = currentUrl.pathname.replace('/login', '');
- if (content.CAMNamespace) {
- currentUrl.href = CAUtils.removeCAMNamespaceHref(currentUrl.href);
- }
- currentWindow.location.assign(currentUrl.pathname + currentUrl.search + currentUrl.hash);
- }
- })["catch"](function (error) {
- glassContext.getCoreSvc('.Logger').error('Cannot login', error);
- return appController.showErrorMessage(StringResources.get('unableLogin'), StringResources.get('CAInitTitle'));
- });
- }
- return loginComplete;
- };
- });
- //# sourceMappingURL=LoginCA.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: CA Glass
- * Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /**
- * A simple perspective service responsible for pulling the glass banner message from the config service
- * and adding it as an alert to the whats new banner.
- * @function
- */
- define('caglass/app/services/CloudMaintenanceBannerService',['caglass/nls/StringResources'], function (StringResources) {
- var GLASS_MAINTENANCE_MESSAGE = 'Glass.maintenanceMessage';
- var GLASS_MAINTENANCE_LINK = 'Glass.maintenanceLink';
- var MAINTENANCE_ID = 'MaintenanceMessage';
- var MAINTENANCE_TITLE = 'maintenanceTitle';
- var MAINTENANCE_LINK = 'maintenanceLink';
- return /*#__PURE__*/function () {
- function CloudMaintenanceBannerService() {
- _classCallCheck(this, CloudMaintenanceBannerService);
- }
- _createClass(CloudMaintenanceBannerService, [{
- key: "initialize",
- value: function initialize(glassContext) {
- if (glassContext) {
- var configuration = glassContext.getCoreSvc('.Config');
- if (configuration[GLASS_MAINTENANCE_MESSAGE]) {
- var maintenanceAlert = {
- id: MAINTENANCE_ID,
- title: StringResources.get(MAINTENANCE_TITLE),
- message: configuration[GLASS_MAINTENANCE_MESSAGE]
- };
- if (configuration[GLASS_MAINTENANCE_LINK]) {
- maintenanceAlert['action'] = {
- id: GLASS_MAINTENANCE_LINK,
- label: StringResources.get(MAINTENANCE_LINK),
- url: configuration[GLASS_MAINTENANCE_LINK]
- };
- }
- var whatsNewService = glassContext.getCoreSvc('.Message');
- if (whatsNewService) {
- whatsNewService.addAlerts([maintenanceAlert]);
- }
- }
- }
- }
- }]);
- return CloudMaintenanceBannerService;
- }();
- });
- //# sourceMappingURL=CloudMaintenanceBannerService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/services/all',['./CAFEncodingService', './CAUserProfileService', './CloudMaintenanceBannerService', './CredentialDialogBuilder', './DigitalContextService', './InstrumentationConfigBuilder', './LoginService', './LogoutService'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/app/all',['./StartupCA', './LoginCA', './services/all'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/common/services/WhatsNewService',['underscore', 'baglass/app/services/ConfigService'], function (_, ConfigService) {
- var WhatsNewService = /*#__PURE__*/function () {
- function WhatsNewService() {
- var _this = this;
- _classCallCheck(this, WhatsNewService);
- this._loadMessage = function (event) {
- if (!_this._perspectivesLoaded[event.perspective]) {
- _this._perspectivesLoaded[event.perspective] = true;
- _this._getWhatsNewMessages(event.perspective);
- }
- };
- this.dismissMessage = function (id) {
- window.localStorage.setItem(_this._getDismissalID(id), true);
- };
- }
- _createClass(WhatsNewService, [{
- key: "initialize",
- value: function initialize(glassContext) {
- this.glassContext = glassContext;
- this._perspectivesLoaded = {};
- this.messageService = this.glassContext.getCoreSvc('.Message');
- if (this._isDisabled()) {
- return;
- }
- glassContext.getCoreSvc('.Events').on('appView:loaded', this._loadMessage);
- this._getWhatsNewMessages();
- }
- }, {
- key: "_isDisabled",
- value: function _isDisabled() {
- var config = this.glassContext.getCoreSvc('.Config');
- var isWhatsNewDisabled = config.getConfigValueSync(ConfigService.DISABLE_WHATSNEWSERVICE);
- var isMessageServiceDisabled = this.messageService ? this.messageService.getDisabled() : true;
- return isMessageServiceDisabled || isWhatsNewDisabled;
- }
- }, {
- key: "_getWhatsNewMessages",
- value: function _getWhatsNewMessages(currentPerspective) {
- var _this2 = this;
- return this._getMessagesAjax(currentPerspective).then(function (result) {
- var messages = result.data;
- if (messages && _.isArray(messages) && messages.length > 0) {
- messages = messages.filter(function (message) {
- return !_this2.isMessageDismissed(message.id);
- });
- if (_this2.messageService) {
- _this2.messageService.addAlerts(messages, _this2.dismissMessage);
- }
- }
- });
- }
- }, {
- key: "_getMessagesAjax",
- value: function _getMessagesAjax(perspective) {
- return this.glassContext.getCoreSvc('.Ajax').ajax({
- url: perspective ? WhatsNewService.ENDPOINT_PATH + perspective : WhatsNewService.ENDPOINT_PATH,
- headers: {
- 'accept-language': this.glassContext.getCoreSvc('.UserProfile').getProductLocale()
- }
- });
- }
- }, {
- key: "isMessageDismissed",
- value: function isMessageDismissed(id) {
- return window.localStorage.getItem(this._getDismissalID(id)) != null;
- }
- }, {
- key: "_getDismissalID",
- value: function _getDismissalID(id) {
- return id + '-' + this.glassContext.getCoreSvc('.UserProfile').getAccountID();
- }
- }]);
- return WhatsNewService;
- }();
- WhatsNewService.ENDPOINT_PATH = 'v1/whatsnew/';
- return WhatsNewService;
- });
- //# sourceMappingURL=WhatsNewService.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/common/services/all',['./WhatsNewService'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/common/all',['./services/all'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Glass
- * (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('caglass/utils/all',['./CAUtils', './EntitlementObject'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /*
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: admin
- *
- * (C) Copyright IBM Corp. 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/Promise',['bluebird'], function (Promise) {
- Promise.prototype.fail = Promise.prototype.catch;
- Promise.prototype.done = Promise.prototype.then;
- // By default, BlueBird uses MutationObservers to ensure async callbacks.
- // We have seen cases on IE where mutation events are delayed or fail
- // completely, resulting in hung promises that have actually resolved.
- // As a workaround, we can set the scheduler to use setTimeout for IE
- // until we drop support for IE11.
- if (/\b(MSIE|Trident|Edge)\b/.test(navigator.userAgent)) {
- Promise.setScheduler(function (fn) {
- setTimeout(fn, 0);
- });
- }
- Object.defineProperty(window, 'Promise', {
- get: function get() {
- return Promise;
- },
- set: function set() {
- try {
- throw new Error('Tried to override the global Promise object');
- } catch (err) {
- console.warn(err);
- }
- }
- });
- return Promise;
- });
- //# sourceMappingURL=Promise.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI
- *
- * Copyright IBM Corp. 2015, 2018
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/ProgressToast',['./View', 'underscore', 'jquery', 'toastr', '../utils/Utils', '../nls/StringResources', './ToastMessage', '../utils/JQueryExt', 'jquery-ui'], function (View, _, $, toastr, utils, StringResources, ToastMessage) {
- /**
- * @augments ToastMessage
- */
- var ProgressToast = ToastMessage.extend(
- /**
- * @lends ProgressToast.prototype
- */
- {
- open: false,
- hide: false,
- currentBar: null,
- progressPercentage: null,
- statusBars: null,
- _onComplete: null,
- REMOVE_DELAY: 3000,
- DEFAULT_DURATION: 500,
- /**
- * @classdesc Class allowing to create a progress toast
- * @constructs
- * @public
- * @param {Object} [options] Options to override the behaviour of the toast.
- * @param {String} [options.showMethod] : How the toast will show up (show, fadeIn, slideDown)
- * @param {String} [options.hideMethod] : How the toast will hide (hide, fadeOut,slideUp)
- * @param {Function} [options.onHidden] : Override the default callback when the toast is hidden
- * @param {Function} [options.onShown] : Override the default callback when the toast is shown
- * @param {Function} [options.onDetails] : Set the callback for the details btn and display it
- * @param {Boolean} [options.noHideBtn] Hide the hide button
- * @param {Boolean} [options.noCancelBtn] Hide the cancel button
- * @param {Boolean} [options.noDetailsBtn] Hide the details button
- * @example var progress = new Progress();
- * @returns a progress object
- * */
- defaultOptions: {
- 'newestOnTop': true,
- 'tapToDismiss': false,
- 'positionClass': 'toast-top-center',
- 'preventDuplicates': false,
- 'hideDuration': 500,
- 'showEasing': 'swing',
- 'hideEasing': 'linear',
- 'showMethod': 'slideDown',
- 'hideMethod': 'slideUp',
- 'onClick': function onClick() {},
- 'iconClasses': {
- success: 'toast-progress'
- }
- },
- btns: {
- hide: {
- class: 'hide-action',
- i18n: 'progressHideBtn',
- callback: function callback(e) {
- $(e.target).blur();
- this.remove(0);
- this.setNextTabFocus(this.$el);
- }
- },
- cancel: {
- class: 'cancel',
- i18n: 'cancel',
- callback: function callback(e) {
- $(e.target).blur();
- this.remove(0);
- this.setNextTabFocus(this.$el);
- }
- },
- details: {
- class: 'details',
- i18n: 'details'
- }
- },
- render: function render(message) {
- var $btnWrapper = $('<div></div>', {
- style: 'float:right;padding-right:16px;'
- });
- _.each(this.btns, function (btn, name) {
- var $btn = $('<button type="button" tabIndex="0" class="toast-close-button ' + btn.class + '" role="button">' + StringResources.get(btn.i18n) + '</button>');
- btn.$btn = $btn;
- var capName = name.charAt(0).toUpperCase() + name.slice(1);
- var callback = btn.callback || this.toastrOptions['on' + capName];
- if (_.isUndefined(callback) || this.toastrOptions['no' + capName + 'Btn'] === true) {
- this.hideButton(name);
- }
- if (_.isFunction(callback)) {
- this['on' + capName](callback.bind(this));
- }
- $btnWrapper.append($btn);
- }.bind(this));
- var pMessage = _.isUndefined(message) ? StringResources.get('defaultProgressMessage') : message;
- this.$el = toastr.success(_.escape(pMessage));
- /*
- * Remove applicable container aria attributes added by Toastr
- * micro library which causes all visible toasts to be read again.
- */
- this.$el.parent().removeAttr('role aria-live');
- this.setMessage(pMessage);
- var toastId = this._getUniqueId();
- var toastMsgId = toastId + 'Msg';
- this.$el.attr({
- 'id': toastId,
- 'aria-labelledby': toastMsgId
- });
- this.$el.find('div.toast-close-button').attr('class', 'toast-buttons');
- var $barWrapper = $('<div>', {
- 'class': 'linear-bar-wrapper'
- });
- var $loadingBar = $('<div>');
- var $loadingIndefMeter = $('<div>', {
- 'class': 'loading-indef-meter hidden'
- });
- var $indicator = $('<div>', {
- 'class': 'loading-indicator'
- });
- var $loadingMeter = $('<div>', {
- 'class': 'loading-meter'
- });
- var $loadingComplete = $('<div>', {
- 'class': 'loading-complete hidden'
- });
- var $loadingMeteorPause = $('<div>', {
- 'class': 'loading-pause-grey hidden'
- });
- var $loadingBarPause = $('<div>', {});
- var $loadingMeteorFail = $('<div>', {
- 'class': 'loading-fail-grey hidden'
- });
- $loadingBar.append($indicator);
- $loadingMeter.append($loadingBar);
- $barWrapper.append($loadingMeter);
- $loadingMeteorPause.append($loadingBarPause);
- $barWrapper.append($loadingMeteorPause);
- $barWrapper.append($loadingMeteorFail);
- $barWrapper.append($loadingIndefMeter);
- $barWrapper.append($loadingComplete);
- this.currentBar = $loadingMeter;
- this.statusBars = {
- 'progress': $loadingMeter,
- 'indefinite': $loadingIndefMeter,
- 'pause': $loadingMeteorPause,
- 'fail': $loadingMeteorFail,
- 'complete': $loadingComplete
- };
- this.progressPercentage = 0;
- this.$el.append($btnWrapper);
- this.$el.append($barWrapper);
- $(this.$el).unbind('mouseenter mouseleave');
- this.$el.find('.toast-message').attr('id', toastMsgId);
- return this.$el;
- },
- /**
- * Show the progress toast on the screen
- * @public
- * @param {String} [message] : Message of the progress toast
- * @example progress.show('Uploading started');
- * */
- show: function show(message) {
- if (!this.open) {
- this.open = true;
- toastr.options = this.toastrOptions;
- return this.render(message);
- }
- },
- /**
- * Hide a button
- * @public
- * @param {String} [button] : Button that you want to hide, (hide, cancel, or details)
- * @example progress.hideButton('cancel');
- * */
- hideButton: function hideButton(button) {
- if (_.isString(button)) {
- var name = button.toLowerCase();
- var $btn = this.btns[name].$btn;
- if ($btn) {
- $btn.addClass('hidden');
- }
- }
- },
- /**
- * Show a button
- * @public
- * @param {String} [button] : Button that you want to show, (hide, cancel, or details)
- * @example progress.showButton('cancel');
- * */
- showButton: function showButton(button) {
- if (_.isString(button)) {
- var name = button.toLowerCase();
- var $btn = this.btns[name].$btn;
- if ($btn) {
- $btn.removeClass('hidden');
- }
- }
- },
- /**
- * Change the progress bar to definite progress
- * @public
- * @param {String} [message] : Message of the progress toast
- * @example progress.progress('message');
- * */
- progress: function progress(message) {
- var finalMessage = _.isUndefined(message) ? StringResources.get('defaultProgressMessage') : message;
- this.setMessage(finalMessage);
- this._setStatusToBar('progress');
- this._changeBorderColor('progress');
- this._setBarToNormal();
- },
- /**
- * Change the progress bar to fail
- * @public
- * @param {String} [message] : Message of the progress toast
- * @example progress.fail('message');
- * */
- fail: function fail(message) {
- var finalMessage = _.isUndefined(message) ? StringResources.get('defaultFailMessage') : message;
- this.setMessage(finalMessage);
- this._setStatusToBar('fail');
- this._changeBorderColor('fail');
- },
- /**
- * Change the progress bar to pause
- * @public
- * @param {String} [message] : Message of the progress toast
- * @example progress.pause('message');
- * */
- pause: function pause(message) {
- var finalMessage = _.isUndefined(message) ? StringResources.get('defaultPauseMessage') : message;
- this.setMessage(finalMessage);
- this._setStatusToBar('pause');
- this.currentBar.children().css('width', this.progressPercentage + '%');
- },
- /**
- * Change the progress bar to indefinite progress
- * @public
- * @param {String} [message] : Message of the progress toast
- * @example progress.indefinite('message');
- * */
- indefinite: function indefinite(message) {
- var finalMessage = _.isUndefined(message) ? StringResources.get('defaultIndefiniteMessage') : message;
- this.setMessage(finalMessage);
- this._changeBorderColor('indefinite');
- this._setStatusToBar('indefinite');
- },
- /**
- * Change the current message
- * @public
- * @param {String} [message] : Message of the progress toast
- * @example progress.setMessage('new message');
- * */
- setMessage: function setMessage(message) {
- if (message) {
- this.$el.find('.toast-message').text(message);
- utils.activateAriaAlert(message);
- }
- },
- /**
- * Override callback when cancel button is clicked
- * @public
- * @param {Function} [callback] : The callback
- * @example progress.onCancel(function(){alert('cancel called');});
- * */
- onCancel: function onCancel(callback) {
- this.btns['cancel'].$btn.on('primaryaction', function (e) {
- callback(e);
- this.open = false;
- }.bind(this));
- },
- /**
- * Override callback when hide button is clicked
- * @public
- * @param {Function} [callback] : The callback
- * @example progress.onHide(function(){alert('hide called');});
- * */
- onHide: function onHide(callback) {
- this.btns['hide'].$btn.on('primaryaction', function (e) {
- callback(e);
- this.hide = true;
- }.bind(this));
- },
- /**
- * Override callback when details button is clicked
- * @public
- * @param {Function} [callback] : The callback
- * @example progress.onDetails(function(){alert('details called');});
- * */
- onDetails: function onDetails(callback) {
- this.btns['details'].$btn.on('primaryaction', function (e) {
- callback(e);
- }.bind(this));
- },
- /**
- * Reset the progress bar to 0
- * @public
- * @example progress.reset();
- * */
- reset: function reset() {
- this.statusBars.progress.find('> div').css('width', 0);
- this.progress();
- this.progressPercentage = 0;
- if (this.open) {
- this.open = false;
- }
- },
- /**
- * Get current progress
- * @public
- * @example progress.getCurrentProgress();
- * @return {Integer} Value of the current progress.
- * */
- getCurrentProgress: function getCurrentProgress() {
- return this.progressPercentage;
- },
- /**
- * Remove toast
- * @public
- * @param {Integer} [delay] : Delay for the progress to be removed
- * @example progress.getCurrentProgress();
- * */
- remove: function remove(delay) {
- if (this.open) {
- var $currentProgress = $('#' + this.$el.attr('id'));
- delay = _.isUndefined(delay) ? this.REMOVE_DELAY : delay;
- return new Promise(function (resolve) {
- setTimeout(function () {
- toastr.clear($currentProgress);
- resolve();
- }.bind(this), delay);
- });
- }
- },
- /**
- * Set the progress bar to a certain percent
- * @public
- * @param {Integer} [percent] : The percentage of the bar [0-100]
- * @param {Object} [options] : Options to override the animation
- * @param {Integer} [options.duration] : Duration of the animation
- * @param {String} [options.completeMsg] : Message when the progress is complete
- * @param {Function} [options.onComplete] : Callback when the progress is complete
- * @param {Integer} [options.removeDelay] : Delay for the progress to remove itself (-1 to not remove it)
- * @param {Boolean} [options.isComplete] : Set the bar to complete state when true
- * @example
- * progress.setComplete(100, {'duration': 5000, 'onComplete':function(){alert('complete');}}
- * @return {Boolean} If the animation worked or not
- * */
- setComplete: function setComplete(percent, options) {
- var usedDuration;
- if (_.isUndefined(percent)) {
- return false;
- }
- if (!this.currentBar.hasClass('loading-meter')) {
- this.progress();
- }
- if (!this.open || this.progressPercentage > percent || percent > 100) {
- return false;
- }
- if (!_.isUndefined(options)) {
- usedDuration = _.isUndefined(options.duration) ? this.DEFAULT_DURATION : options.duration;
- }
- var usedWidth = percent + '%';
- this.progressPercentage = percent;
- var animationOptions = {
- width: usedWidth
- };
- var animationProperties = {
- duration: usedDuration,
- easing: 'swing'
- };
- animationProperties.complete = function () {
- var completeFct = false;
- var completeMessage;
- var delay;
- var isComplete;
- if (!_.isUndefined(options)) {
- if (!_.isUndefined(options.completeMsg)) {
- completeMessage = options.completeMsg;
- }
- if (_.isFunction(options.onComplete)) {
- completeFct = true;
- }
- isComplete = options.isComplete;
- delay = _.isUndefined(options.removeDelay) ? this.REMOVE_DELAY : options.removeDelay;
- }
- if (isComplete) {
- if (_.isUndefined(completeMessage)) {
- completeMessage = StringResources.get('defaultCompleteMessage');
- }
- if (!this.hide) {
- if (delay >= 0) {
- this.remove(delay).then(function () {
- this.open = false;
- }.bind(this));
- }
- this._setBarToComplete(completeMessage);
- this._changeBorderColor('complete');
- } else {
- var toast = new ToastMessage();
- toast.show(completeMessage);
- }
- }
- if (completeMessage) {
- this.setMessage(completeMessage);
- }
- if (completeFct) {
- options.onComplete();
- }
- }.bind(this);
- this.$el.find('.loading-meter > div').animate(animationOptions, animationProperties);
- return true;
- },
- /****Private functions****/
- _getUniqueId: function _getUniqueId() {
- return this.viewId + _.uniqueId('_progress');
- },
- _setStatusToBar: function _setStatusToBar(status) {
- this.currentBar.addClass('hidden');
- this.statusBars[status].removeClass('hidden');
- this.currentBar = this.statusBars[status];
- },
- _setBarToComplete: function _setBarToComplete() {
- this._setStatusToBar('complete');
- this.btns['cancel'].$btn.addClass('hidden');
- },
- _changeBorderColor: function _changeBorderColor(status) {
- this.$el.removeClass('progress indefinite fail complete');
- this.$el.addClass(status);
- },
- _setBarToNormal: function _setBarToNormal() {
- this._setStatusToBar('progress');
- this.btns['cancel'].$btn.removeClass('hidden');
- }
- });
- return ProgressToast;
- });
- //# sourceMappingURL=ProgressToast.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2016, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/DatasetExecutionManager',['../ui/core/Events', '../nls/StringResources', '../ui/ProgressToast', './Deferred', 'underscore'], function (Events, StringResources, ProgressToast, Deferred, _) {
- 'use strict';
- var DatasetExecutionManager = Events.extend({
- init: function init() {
- DatasetExecutionManager.inherited('init', this, arguments);
- this._backgroundExecutions = {};
- // We want to ping a lot at the start and then slow down if the dataset take a long time
- this._pingTimeouts = [300, 600, 1000, 1500, 2000, 4000, 6000, 10000];
- this._defaultOptions = {
- 'showToastWhenDone': true
- };
- },
- /**
- Will execute a dataset in the background. If the dataset is already running,
- then it will be canceled before the new run is triggered.
- @param options.id {string} - store ID of the dataset to run
- @param options.name {stirng} - the name of the data set to execute. Will be shown in the toast
- @param options.showToastWhenDone {boolean} - default is true, set to false if you don't want a toast to be displayed when the dataset is done running
- @param options.glassContext {object} - the glassContext object
- @param options.isRefresh {boolean} - default false. Set to true if doing a refresh from the context menu
- **/
- execute: function execute(options) {
- var deferred = new Deferred();
- _.defaults(options, this._defaultOptions);
- // If we're already running the dataset then cancel it before we start another run
- if (this.isExecuting(options.id)) {
- this.cancel(options, false);
- }
- var timestamp = Date.now();
- options.timestamp = timestamp;
- this._backgroundExecutions[options.id] = {
- 'status': 'executing',
- 'timestamp': timestamp,
- 'isRefresh': options.isRefresh
- };
- if (options.showToastWhenDone) {
- this._createProgressToast(options);
- }
- var data = JSON.stringify({
- 'options': {
- 'delivery': {
- 'save': {
- 'notify': false
- }
- }
- }
- });
- options.glassContext.services.ajax.post('v1/datasets/' + options.id + '/executions', {
- 'headers': {
- 'Content-Type': 'application/vnd.ibm.bi.platform.execution+json; charset=UTF-8',
- 'Accept': 'application/json'
- },
- 'datatype': 'json',
- 'data': data
- }).then(function (result, status, xhr) {
- this._backgroundExecutions[options.id].executionURL = xhr.getResponseHeader('location');
- this._backgroundExecutions[options.id].eventID = result.eventID;
- deferred.resolve();
- this._pingForStatus(options);
- }.bind(this), function () {
- this._rejectDeferredObjects(options, 'failed');
- deferred.reject();
- }.bind(this));
- return deferred.promise;
- },
- /**
- Will create the progress toast to show the user that the data set is being loaded
- **/
- _createProgressToast: function _createProgressToast(options) {
- var progressToast = new ProgressToast();
- progressToast.show(this._getToastMessage(options));
- progressToast.indefinite(this._getToastMessage(options));
- progressToast.onCancel(function (options) {
- this.cancel(options, true);
- }.bind(this, options));
- progressToast.onHide(function (options) {
- this._hideProgressToast(options.id);
- }.bind(this, options));
- this._backgroundExecutions[options.id].progressToast = progressToast;
- },
- /**
- Hide the progress toast
- **/
- _hideProgressToast: function _hideProgressToast(id) {
- var execution = this._backgroundExecutions[id];
- if (execution && execution.progressToast) {
- execution.progressToast.remove(0);
- execution.progressToast = null;
- }
- },
- _showErrorToast: function _showErrorToast(options) {
- var execution = this._backgroundExecutions[options.id];
- if (options.showToastWhenDone) {
- if (execution && execution.progressToast) {
- // We don't want the error progress toast to get cleaned up, so null it out here
- // so our cleanup code doesn't know to hide it. Sneaky sneaky.
- var progressToast = execution.progressToast;
- execution.progressToast = null;
- progressToast.fail(this._getToastMessage(options));
- progressToast.hideButton('cancel');
- } else {
- options.glassContext.appController.showToast(this._getToastMessage(options), {
- 'type': 'error'
- });
- }
- }
- },
- _showCancelledRefreshToast: function _showCancelledRefreshToast(options) {
- options.glassContext.appController.showToast(this._getToastMessage(options), {
- 'type': 'info'
- });
- },
- /**
- Will query the server for the status of the execution every once in a while until the status of the execution is complete|failed. This method
- will query a lot at the begining and slow down the longer the dataset is executing.
- @param options.id {string} - store ID of the dataset to run
- @param options.type {string} - type of the object being executed
- @param options.showToastWhenDone {boolean} - default is true, set to false if you don't want a toast to be displayed when the dataset is done running
- @param options.glassContext {object} - the glassContext object
- **/
- _pingForStatus: function _pingForStatus(options) {
- var execution = this._backgroundExecutions[options.id];
- // If the timestamp in the options doesn't match the timestamp on the execution object then another execution for the same dataset
- // has started and the one we're currently pinging for has been cancelled.
- if (!execution || options.timestamp !== execution.timestamp || !execution.executionURL || execution.status === 'cancelled') {
- return;
- } else if (execution.status === 'failed') {
- this._rejectDeferredObjects(options, 'failed');
- this._cleanupAfterExecutionFinished(options.id);
- return;
- } else if (!this.isExecuting(options.id)) {
- this._processExecutionStatus(execution.status, options);
- return;
- }
- options.glassContext.services.ajax.get(execution.executionURL, {
- 'headers': {
- 'Content-Type': 'application/vnd.ibm.bi.platform.execution+json; charset=UTF-8',
- 'Accept': 'application/json'
- },
- 'datatype': 'json'
- }).then(function (response) {
- execution.status = response.status;
- this._processExecutionStatus(execution.status, options);
- }.bind(this), function () {
- // The ping failed, not much we can do
- this._rejectDeferredObjects(options, 'statusPingFailed');
- });
- },
- /**
- Deal with the status of the execution
- **/
- _processExecutionStatus: function _processExecutionStatus(status, options) {
- var execution = this._backgroundExecutions[options.id];
- switch (status) {
- case 'complete':
- case 'succeeded':
- // We could get a status of complete back for a cancelled execution. Double check here to make sure we didn't cancel anything
- if (execution.status === 'cancelled') {
- this._rejectDeferredObjects(options, 'cancelled');
- } else {
- this._resolveDefferedObjects(options.id);
- if (options.showToastWhenDone) {
- options.glassContext.appController.showToast(this._getToastMessage(options));
- }
- this.trigger('loadComplete', { id: options.id });
- }
- this._cleanupAfterExecutionFinished(options.id);
- break;
- case 'cancelled':
- this._rejectDeferredObjects(options, 'cancelled');
- this._cleanupAfterExecutionFinished(options.id);
- break;
- case 'failed':
- this._rejectDeferredObjects(options, 'failed');
- this._cleanupAfterExecutionFinished(options.id);
- break;
- case 'executing':
- case 'pending':
- var pingTimeoutIndex = options.pingTimeoutIndex || 0;
- pingTimeoutIndex += 1;
- if (pingTimeoutIndex >= this._pingTimeouts.length) {
- pingTimeoutIndex = this._pingTimeouts.length - 1;
- }
- options.pingTimeoutIndex = pingTimeoutIndex;
- setTimeout(function () {
- this._pingForStatus(options);
- }.bind(this), this._pingTimeouts[pingTimeoutIndex]);
- break;
- default:
- this._cleanupAfterExecutionFinished(options.id);
- console.log('Unknown status returned by ' + execution.executionURL + '. Status of: ' + status);
- }
- },
- /**
- Will reject all deferred objects associated to a running dataset. This will let the callers know that
- something went wrong - request got cancelled or a fault happened.
- **/
- _rejectDeferredObjects: function _rejectDeferredObjects(options, status) {
- var execution = this._backgroundExecutions[options.id];
- if (!execution) {
- return;
- }
- execution.status = status;
- if (status === 'failed') {
- this._showErrorToast(options);
- }
- // Reject any deferred objects that were waiting until the request was complete
- if (execution.deferredObjects) {
- execution.deferredObjects.forEach(function (deferred) {
- deferred.reject({
- 'status': status
- });
- }.bind(this));
- }
- },
- /**
- Will resolve all deferred objects associated to a running dataset.
- **/
- _resolveDefferedObjects: function _resolveDefferedObjects(id) {
- var execution = this._backgroundExecutions[id];
- // Reject any deferred objects that were waiting until the request was complete
- if (execution.deferredObjects) {
- execution.deferredObjects.forEach(function (deferred) {
- deferred.resolve();
- }.bind(this));
- }
- },
- _cleanupAfterExecutionFinished: function _cleanupAfterExecutionFinished(id) {
- this._hideProgressToast(id);
- this._backgroundExecutions[id] = {
- 'status': this._backgroundExecutions[id].status
- };
- },
- /**
- Cancels a currently running dataset. There's no reason to wait for the cancel to finish, so this method will simply return right after it sends the request.
- @param options.id {string} - store ID of the dataset to run
- @param options.glassContext {object} - the glassContext object
- @param showCancelToast {boolean} - default true, should we show a toast after the cancel
- **/
- cancel: function cancel(options, showCancelToast) {
- this._hideProgressToast(options.id);
- var execution = this._backgroundExecutions[options.id];
- if (!execution || !this.isExecuting(options.id)) {
- return;
- }
- execution.status = 'cancelled';
- if (showCancelToast !== false) {
- this._showCancelledRefreshToast(options);
- }
- // Reject all deferred object waiting for the completion since we're being asked to cancel
- this._rejectDeferredObjects(options, 'cancelled');
- if (execution.executionURL) {
- options.glassContext.services.ajax.delete(execution.executionURL, {
- 'headers': {
- 'Content-Type': 'application/vnd.ibm.bi.platform.execution+json; charset=UTF-8',
- 'Accept': 'application/json'
- },
- 'datatype': 'json'
- });
- }
- },
- /**
- @param id {string} - store ID of the dataset
- @returns {promise}
- - will be resolved when the dataset specified by options.id is complete.
- - will be rejected if the dataset execution fails or gets canceled. The reason returns will be an object
- reason.status {string} : the status of request (fault | cancelled)
- reason.msg {string}: In the case of a fault, the error message
- **/
- whenComplete: function whenComplete(id) {
- var status = this.getStatus(id);
- var execution = this._backgroundExecutions[id];
- // If the dataset is already done then resolve the promise right away
- if (!execution || status === 'complete') {
- return Promise.resolve();
- } else if (status === 'failed' || status === 'cancelled') {
- // The dataset already failed, reject the promise
- var err = new Error();
- err.status = status;
- return Promise.reject(err);
- } else {
- if (!execution.deferredObjects) {
- execution.deferredObjects = [];
- }
- var deferred = new Deferred();
- execution.deferredObjects.push(deferred);
- return deferred.promise;
- }
- },
- /**
- Will return the last known status for the id provided
- @param id {string} - store ID of the dataset
- @return {string} - complete | pending | executing | failed | null (if id isn't found)
- **/
- getStatus: function getStatus(id) {
- return this._backgroundExecutions[id] ? this._backgroundExecutions[id].status : null;
- },
- /**
- The UI doesn't distinguish between pending and executing, so treat both of them as 'executing'
- **/
- isExecuting: function isExecuting(id) {
- var status = this.getStatus(id);
- return status === 'pending' || status === 'executing';
- },
- _getToastMessage: function _getToastMessage(options) {
- var execution = this._backgroundExecutions[options.id];
- if (!execution) {
- return '';
- }
- var stringId = '';
- if (execution.isRefresh) {
- switch (execution.status) {
- case 'executing':
- case 'pending':
- stringId = 'datasetRefreshing';
- break;
- case 'complete':
- case 'succeeded':
- stringId = 'datasetFinishedRefreshing';
- break;
- case 'failed':
- stringId = 'datasetRefreshFailed';
- break;
- case 'cancelled':
- stringId = 'datasetRefreshCancelled';
- break;
- }
- } else {
- switch (execution.status) {
- case 'executing':
- case 'pending':
- stringId = 'datasetLoading';
- break;
- case 'complete':
- case 'succeeded':
- stringId = 'datasetFinishedLoading';
- break;
- case 'failed':
- stringId = 'datasetLoadingFailed';
- break;
- case 'cancelled':
- stringId = 'datasetLoadingCancelled';
- break;
- }
- }
- return StringResources.get(stringId, {
- 'name': options.name
- });
- }
- });
- return new DatasetExecutionManager();
- });
- //# sourceMappingURL=DatasetExecutionManager.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Cognos Analytics
- * Copyright IBM Corp. 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/Downloader',['../ui/core/Class', 'jquery', 'underscore'], function (Class, $, _) {
- 'use strict'; //NOSONAR: meant to be strict
- var Downloader = Class.extend({
- /**
- * Download a file
- * @options.url {string} - hyperlink for download
- * @options.name {string} - download name, not preserved when using fallback
- * @options.fallback {boolean} - when html5 download is not supported should we fall back to using an iFrame, defaults true
- */
- init: function init(options) {
- this.fallback = true; // default
- Downloader.inherited('init', this, arguments);
- _.extend(this, options);
- },
- /**
- * Starting point for using downloder. Prompts user to save or open file
- */
- doDownload: function doDownload() {
- if (this.url) {
- this._removeContainers();
- if (this._useHtml5Download()) {
- this._html5Download();
- } else {
- this._iFrameDownload();
- }
- return Promise.resolve();
- } else {
- if (this.logger) {
- this.logger.error('Downloader url is undefined.');
- }
- return Promise.reject(new Error('Downloader url is undefined.'));
- }
- },
- _useHtml5Download: function _useHtml5Download() {
- if (!this.fallback) {
- return true;
- }
- var downloadAttrSupported = 'download' in document.createElement('a');
- return downloadAttrSupported;
- },
- _html5Download: function _html5Download() {
- Downloader.container = $('<div>').hide().on('click', function (evt) {
- evt.stopPropagation();
- }).appendTo('body');
- var $hyperlink = $('<a>', {
- 'target': '_blank',
- 'href': this.url,
- 'download': this.name ? this.name : true
- }).appendTo(Downloader.container);
- this._fireDownload($hyperlink);
- },
- _iFrameDownload: function _iFrameDownload() {
- Downloader.container = $('<iframe>').hide().attr('src', this.url).appendTo('body');
- },
- _removeContainers: function _removeContainers() {
- if (Downloader.container) {
- Downloader.container.remove();
- Downloader.container = null;
- }
- },
- _fireDownload: function _fireDownload($hyperlink) {
- if ($hyperlink.length) {
- $hyperlink[0].click();
- }
- }
- });
- return Downloader;
- });
- //# sourceMappingURL=Downloader.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/PromptCapabilities',[], function () {
- return {
- BOUND_RANGE: 'boundRange',
- DEFAULT_VALUE_NOT_ACCEPTABLE: 'defaultValueNotAcceptable',
- DISCRETE_VALUE: 'discreteValue',
- EXCLUDE_VALUE: 'excludeValues',
- MULTIVALUED: 'multivalued',
- OPTIONAL: 'optional',
- UNBOUNDED_RANGE: 'unboundedRange'
- };
- });
- //# sourceMappingURL=PromptCapabilities.js.map
- ;
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2015, 2016
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define('baglass/core-client/js/core-client/utils/PromptManager',['../ui/core/Class', '../utils/ClassFactory', 'underscore', 'jquery'], function (BaseClass, ClassFactory, _, $) {
- 'use strict';
- /**
- * This class is the framework to handle queries that need to prompt user for parameters.
- * It makes sure that only one prompting dialog is displayed at a time and if many queries wait for the same parameters, user doesn't get prompted
- * many times for the same parameters.
- */
- var PromptManager = BaseClass.extend({
- init: function init() {
- PromptManager.inherited('init', arguments);
- this.inProgressMap = {};
- this.pendingPrompts = [];
- },
- /**
- * Function to handle the sign on prompting dialog when the query involves a data source with prompted sign on.
- * @param {Object} options - mandatory : set of passed in properties
- * @param {String} options.dataSourceName - mandatory : CM data source name
- * @param {String} options.dataSourceConnectionName - mandatory : data source connection name (used to create the credential in CM when user submits)
- * @param {Object} options.glassContext - mandatory : used to send UPS request to save credential in CM
- * @param {Object} dfd - optional : deferred object, used to control only one sign on dialog is displayed at a time
- * @param {boolean} options.promptForPasswordOnly - optional : if passed, only the password will be shown in the sign on dialog (not the username)
- * @param {boolean} options.isPowerCube - optional : if passed, the UPS credential password key will use cubePassword instead of password
- * @example
- * PromptManager.promptForDataSourceSignon({
- * 'dataSourceName' : My data source,
- * 'dataSourceConnectionName' : My connection,
- * 'glassContext' : Glass context object
- * });
- *
- */
- promptForDataSourceSignon: function promptForDataSourceSignon(options, dfd) {
- var key = 'promptForSignon' + options.dataSourceName;
- var deferred = this.inProgressMap[key];
- if (!deferred) {
- deferred = dfd || $.Deferred();
- if (this._isPrompting()) {
- var pending = this._getPendingPrompt(key);
- if (pending) {
- deferred = pending.deferred;
- } else {
- this.pendingPrompts.push({
- promptFunction: this.promptForDataSourceSignon.bind(this, options, deferred),
- id: key,
- deferred: deferred
- });
- }
- } else {
- this.inProgressMap[key] = deferred;
- this._getSignOnDialog(options, key, deferred);
- }
- }
- return deferred.promise();
- },
- _getSignOnDialog: function _getSignOnDialog(options, key, deferred) {
- var opts = {
- 'dataSourceName': options.dataSourceName,
- 'dataSourceConnectionName': options.dataSourceConnectionName,
- 'glassContext': options.glassContext,
- 'displayErrMsg': true,
- 'promptForPasswordOnly': options.promptForPasswordOnly,
- 'isPowerCube': options.isPowerCube,
- 'onSubmit': function () {
- this._removeInProgress(key);
- deferred.resolve();
- }.bind(this),
- 'onCancel': function () {
- this._removeInProgress(key);
- deferred.reject();
- }.bind(this)
- };
- return ClassFactory.instantiate('../ui/content/dialog/SignOnDialog', opts).then(function (signOnDialog) {
- signOnDialog.open();
- return signOnDialog;
- });
- },
- _getPendingPrompt: function _getPendingPrompt(id) {
- var pending = null;
- for (var i = 0; i < this.pendingPrompts.length; i++) {
- if (this.pendingPrompts[i].id === id) {
- pending = this.pendingPrompts[i];
- break;
- }
- }
- return pending;
- },
- _executeNextPrompt: function _executeNextPrompt() {
- if (this.pendingPrompts.length > 0) {
- this.pendingPrompts[0].promptFunction();
- this.pendingPrompts.splice(0, 1);
- }
- },
- _removeInProgress: function _removeInProgress(id) {
- delete this.inProgressMap[id];
- this._executeNextPrompt();
- },
- _isPrompting: function _isPrompting() {
- return Object.keys(this.inProgressMap).length > 0;
- }
- });
- return new PromptManager();
- });
- //# sourceMappingURL=PromptManager.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /**
- * Pulls locales out of requirejs config. This config is set via config.js on the index page.
- */
- define('baglass/core-client/js/core-client/i18n/Locales',['require','exports','module'],function (require, exports, module) {
- return module.config() && module.config().locales || [];
- });
- //# sourceMappingURL=Locales.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/i18n/Utils',[], function () {
- return {
- /**
- * Splits a locale tag into its potential parts (language, script and region).
- * Make sure part is capitalized correctly.
- *
- * Some example tags:
- * en (language)
- * en-SG (language, region)
- * zh-Hant-HK (language, script, region)
- *
- * @param locale {string}
- * @returns {Array[lang, region]}
- * @private
- */
- parseLocale: function parseLocale(locale) {
- var separator = locale.indexOf('-') != -1 ? '-' : '_';
- var split = locale.split(separator);
- var lang = null,
- script = null,
- region = null;
- function capitalize(str) {
- return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
- }
- lang = split[0].toLowerCase();
- if (split.length === 3) {
- script = capitalize(split[1]);
- region = split[2].toUpperCase();
- } else if (split.length === 2) {
- if (split[1].length <= 2) {
- region = split[1].toUpperCase();
- } else {
- script = capitalize(split[1]);
- }
- }
- return {
- lang: lang,
- script: script,
- region: region,
- toString: function toString() {
- var result = [lang];
- if (script) {
- result.push(script);
- }
- if (region) {
- result.push(region);
- }
- return result.join('-');
- }
- };
- }
- };
- });
- //# sourceMappingURL=Utils.js.map
- ;
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- //Object.entries polyfill
- if (!Object.entries) {
- Object.entries = function (obj) {
- var ownProps = Object.keys(obj),
- i = ownProps.length,
- resArray = new Array(i); // preallocate the Array
- while (i--) {
- resArray[i] = [ownProps[i], obj[ownProps[i]]];
- }return resArray;
- };
- }
- define('baglass/core-client/js/core-client/i18n/Load',['require', 'text!ecma402/cldr/config/availableLocales.json', 'underscore', 'module', './Locales', './Utils', 'text'], function (require, availableLocalesRes, _, module, localesConfig, i18nUtils) {
- return {
- id: module.id,
- load: function load(name, req, onload, config) {
- var _this = this;
- if (config && config.isBuild) {
- onload();
- } else {
- var baseLocales = localesConfig.map(function (locale) {
- return _this._resolveLocale(locale);
- });
- var parentLocales = [];
- baseLocales.forEach(function (locale) {
- var _i18nUtils$parseLocal = i18nUtils.parseLocale(locale),
- lang = _i18nUtils$parseLocal.lang,
- region = _i18nUtils$parseLocal.region;
- if (region && !_.contains(baseLocales, lang)) {
- parentLocales.push(lang);
- }
- });
- var locales = ['root'].concat(parentLocales, _toConsumableArray(baseLocales));
- var dependencies = [];
- locales.forEach(function (locale) {
- dependencies.push('text!ecma402/cldr/' + locale + '/custom_numbers.json');
- dependencies.push('text!ecma402/cldr/' + locale + '/ca-gregorian.json');
- });
- var cldrData = null;
- Promise.all(this._loadDependencies(req, dependencies)).then(function (data) {
- data.forEach(function (record) {
- if (record) {
- var currentLocale = Object.entries(record.data.main)[0][0];
- if (cldrData === null) {
- cldrData = record.data.main;
- } else if (cldrData[currentLocale]) {
- Object.assign(cldrData[currentLocale], record.data.main[currentLocale]);
- } else {
- Object.assign(cldrData, record.data.main);
- }
- }
- });
- onload(cldrData);
- }).catch(function (err) {
- console.error('Failed to load cldr data.', err);
- onload(cldrData);
- });
- }
- },
- /**
- * Requirejs does not hit the success callback if any one of the dependencies fail.
- * This method will create a promise for each dependency which is guaranteed to resolve.
- * Failed promises will resolve empty.
- *
- * @param req - requirejs
- * @param dependencies - array of dependency paths.
- * @returns {Array} of promises
- * @private
- */
- _loadDependencies: function _loadDependencies(req, dependencies) {
- var promises = [];
- var localRegEx = /cldr\/([a-zA-z-]+)\//;
- dependencies.forEach(function (dependency) {
- var locale = dependency.match(localRegEx)[1];
- promises.push(new Promise(function (resolve) {
- req([dependency], function (data) {
- resolve({
- data: JSON.parse(data),
- locale: locale,
- path: dependency
- });
- }, function () {
- resolve();
- console.warn('Unable to load formatting resource: \'' + dependency + '\'');
- });
- }));
- });
- return promises;
- },
- _resolveLocale: function _resolveLocale(locale) {
- if (locale) {
- var indDash = locale.indexOf('-');
- var availableLocales = JSON.parse(availableLocalesRes).availableLocales;
- var normLocale = locale;
- if (indDash > 0) {
- var localeTag = i18nUtils.parseLocale(locale);
- normLocale = localeTag.toString();
- if (!_.contains(availableLocales, normLocale)) {
- if (_.contains(availableLocales, localeTag.lang)) {
- normLocale = localeTag.lang;
- } else {
- normLocale = 'en';
- }
- }
- }
- if (!_.contains(availableLocales, normLocale)) {
- normLocale = 'en';
- }
- return normLocale;
- }
- return 'en';
- }
- };
- });
- //# sourceMappingURL=Load.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/i18n/Const',[],function () {
- var TOKENS = {
- DOW: 'dddd',
- FULL_M: 'MMMM',
- LONG_M: 'MMM',
- MEDIUM_M: 'MM',
- MO: 'Mo',
- SHORT_M: 'M',
- D: 'D',
- DO: 'Do',
- DD: 'DD',
- Y: 'Y',
- Y_SHORT: 'YY',
- A: 'A',
- ZZ: 'zz'
- };
- var SIZES = ['full', 'long', 'medium', 'short'];
- var TYPES = {
- numbers: 'numbers',
- dates: 'dates'
- };
- return { TOKENS: TOKENS, SIZES: SIZES, TYPES: TYPES };
- });
- //# sourceMappingURL=Const.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /**
- * This class provides locale specific formatting resources such as list separator.
- */
- define('baglass/core-client/js/core-client/i18n/FormatResources',['../ui/core/Class', './Load!', './Const', './Locales', './Utils'], function (Class, resources, Const, locales, i18nUtils) {
- var FormatResources = null;
- FormatResources = Class.extend({
- init: function init() {},
- /**
- * @param required locale
- * @returns locale specific list separator symbol
- */
- getListSeparatorSymbol: function getListSeparatorSymbol(locale) {
- return this._lookupResource(locale, 'numbers.symbols-numberSystem-latn.list');
- },
- getShortNumberFormatPatterns: function getShortNumberFormatPatterns(locale) {
- return this._lookupResource(locale, 'numbers.decimalFormats-numberSystem-latn.short.decimalFormat');
- },
- getDateFormatPatterns: function getDateFormatPatterns(locale) {
- var formats = this._lookupResource(locale, 'dates.calendars.gregorian.dateFormats');
- formats.short = formats.short.replace(/yy/, 'y');
- return formats;
- },
- getTimeFormatPatterns: function getTimeFormatPatterns(locale) {
- return this._lookupResource(locale, 'dates.calendars.gregorian.timeFormats');
- },
- getDateTimeFormatPatterns: function getDateTimeFormatPatterns(locale) {
- var _this = this;
- var resources = this._lookupResource(locale, 'dates.calendars.gregorian.dateTimeFormats');
- var sizes = Const.SIZES;
- var dateRegx = /\{1\}/;
- var timeRegx = /\{0\}/;
- var result = {};
- sizes.forEach(function (size) {
- var datePattern = _this.getDateFormatPatterns(locale)[size];
- var timePattern = _this.getTimeFormatPatterns(locale)[size];
- var dateTimePattern = resources[size];
- result[size] = dateTimePattern.replace(dateRegx, datePattern).replace(timeRegx, timePattern);
- });
- return result;
- },
- /**
- * CLDR data is represented in a hierarchy for a locale
- * <root>
- * <lang (e.g zh)>
- * <lang-script (e.g. zh-Hant)>
- * <lang-script-region (e.g. zh-Hant-HK)>
- * <lang-region (e.g. zh-HK)>
- *
- * This method will build a prototype tree representing this hierarchy for a specified locale with a given path
- *
- * @param locale {string}
- * @param path {string} - object path to navigate
- * @returns {object} - cldr data
- * @private
- */
- _lookupResource: function _lookupResource() {
- var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'root';
- var path = arguments[1];
- var parsedLocal = i18nUtils.parseLocale(locale);
- var lang = parsedLocal.lang,
- script = parsedLocal.script,
- region = parsedLocal.region;
- var resource = this._getResource(lang + '.' + path);
- if (resource === null) {
- resource = this._getResource('root.' + path);
- }
- if (script) {
- resource = this._extendResource(resource, lang + '-' + script + '.' + path);
- }
- if (script && region) {
- resource = this._extendResource(resource, lang + '-' + script + '-' + region + '.' + path);
- }
- if (!script && region) {
- resource = this._extendResource(resource, lang + '-' + region + '.' + path);
- }
- return resource;
- },
- /**
- * Extend a cldr data object with a child object retrieved by the supplied path (e.g. extending 'en' with 'en-US')
- *
- * @param resource - cldr data
- * @param childPath - path to child cldr object (e.g. "en-US.numbers.decimalFormats-numberSystem-latn.short.decimalFormat")
- * @returns {*}
- * @private
- */
- _extendResource: function _extendResource(resource, childPath) {
- var childResource = this._getResource(childPath);
- if (childResource !== null) {
- return typeof resource === 'string' ? childResource : Object.assign(Object.create(resource), childResource);
- }
- return resource;
- },
- /**
- * Traverse object by path
- * @param path {string} - e.g. 'root.childObject.property
- * @returns {object || null}
- * @private
- */
- _getResource: function _getResource(path) {
- var result = path.split('.').reduce(function (obj, prop) {
- return obj ? obj[prop] : null;
- }, resources);
- return result === undefined ? null : result;
- }
- });
- return new FormatResources();
- });
- //# sourceMappingURL=FormatResources.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/i18n/CurrencySymbols',[], function () {
- // Util for ecma402/IntlShim; returns a mapping of international currency code mapped to currency symbol,
- // and a replacement string for cases that ecma402/IntlShim uses an incorrect currency symbol for a currency code.
- return {
- 'AED': { symbol: 'د.إ.' },
- 'ARS': { symbol: '$' },
- 'AUD': { symbol: '$', replace: 'A$' },
- 'BDT': { symbol: '৳' },
- 'BRL': { symbol: 'R$' },
- 'CAD': { symbol: '$', replace: 'CA$' },
- 'CHF': { symbol: 'Fr.' },
- 'CLP': { symbol: '$' },
- 'CNY': { symbol: '¥', replace: 'CN¥' },
- 'COP': { symbol: '$' },
- 'CZK': { symbol: 'Kč' },
- 'DKK': { symbol: 'kr' },
- 'DZD': { symbol: 'د.ج.' },
- 'EGP': { symbol: 'ج.م.' },
- 'EUR': { symbol: '€' },
- 'GBP': { symbol: '£' },
- 'HKD': { symbol: 'HK$' },
- 'HUF': { symbol: 'Ft' },
- 'IDR': { symbol: 'Rp' },
- 'ILS': { symbol: '₪' },
- 'INR': { symbol: '₹' },
- 'IRR': { symbol: '﷼' },
- 'JPY': { symbol: '¥' },
- 'KRW': { symbol: '₩' },
- 'KZT': { symbol: '₸' },
- 'MXN': { symbol: '$' },
- 'MYR': { symbol: 'RM' },
- 'NGN': { symbol: '₦' },
- 'NOK': { symbol: 'kr' },
- 'PEN': { symbol: 'S/.' },
- 'PHP': { symbol: '₱' },
- 'PKR': { symbol: '₨' },
- 'PLN': { symbol: 'zł' },
- 'RON': { symbol: 'lei' },
- 'RUB': { symbol: 'руб.' },
- 'SAR': { symbol: '﷼' },
- 'SEK': { symbol: 'kr' },
- 'SGD': { symbol: 'S$' },
- 'THB': { symbol: '฿' },
- 'TRY': { symbol: 'TL' },
- 'TWD': { symbol: 'NT$' },
- 'UAH': { symbol: '₴' },
- 'USD': { symbol: '$', replace: 'US$' },
- 'VEF': { symbol: 'Bs.F.' },
- 'VND': { symbol: '₫' },
- 'ZAR': { symbol: 'R' }
- };
- });
- //# sourceMappingURL=CurrencySymbols.js.map
- ;
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/ar.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd، MMMM[ ]D[، ]Y",\n "dddd، D[ ]MMMM[، ]Y",\n "dddd، Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMMM[ ]D[، ]Y",\n "D[ ]MMMM[، ]Y",\n "Y[ ]MMMM[ ]D"\n ],\n "medium": [\n "MM[/]DD[/]Y",\n "DD[/]MM[/]Y",\n "Y[/]MM[/]DD"\n ],\n "short": [\n "M[/]D[/]Y",\n "D[/]M[/]Y",\n "Y[/]M[/]D"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/zh-cn.json',[],function () { return '{\n\t"defaultOrder": [2,2,2,2],\n\t"dateFormats": {\n "full": [\n "M[月]D[日]Y年dddd",\n "D[日]M[月]Y年dddd",\n "Y[年]M[月]D日dddd"\n ],\n "long": [\n "M[月]D[日]Y[年]",\n "D[日]M[月]Y[年]",\n "Y[年]M[月]D[日]"\n ],\n "medium": [\n "M[月]D[日]Y[年]",\n "D[日]M[月]Y[年]",\n "Y[年]M[月]D[日]"\n ],\n "short": [\n "M[/]D[/]Y",\n "D[/]M[/]Y",\n "Y[/]M[/]D"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/cs.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[. ]D[ ]Y",\n "dddd, D[. ]MMMM[ ]Y",\n "dddd, Y[. ]MMMM[. ]D"\n ],\n "long": [\n "MMMM[. ]D[ ]Y",\n "D[. ]MMMM[ ]Y",\n "Y[. ]MMMM[. ]D"\n ],\n "medium": [\n "M[. ]D[. ]Y",\n "D[. ]M[. ]Y",\n "Y[. ]M[. ]D"\n ],\n "short": [\n "MM[.]DD[.]YY",\n "DD[.]MM[.]YY",\n "YY[.]MM[.]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/da.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd d. MMMM[ ]D[. ]Y",\n "dddd d. D[. ]MMMM[ ]Y",\n "dddd d. Y[ ]MMMM[ ]D[.]"\n ],\n "long": [\n "MMMM[ ]D[. ]Y",\n "D[. ]MMMM[ ]Y",\n "Y[. ]MMMM[ ]D"\n ],\n "medium": [\n "MMM[ ]D[. ]Y",\n "D[. ]MMM[ ]Y",\n "Y[ ]MMM[ ]D[.]"\n ],\n "short": [\n "MM[/]DD[/]Y",\n "DD[/]MM[/]Y",\n "Y[/]MM[/]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/nl.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd MMMM[ ]D[ ]Y",\n "dddd D[ ]MMMM[ ]Y",\n "dddd Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMMM[ ]D[ ]Y",\n "D[ ]MMMM[ ]Y",\n "Y[ ]MMMM[ ]D"\n ],\n "medium": [\n "MMM[-]D[-]Y",\n "D[-]MMM[-]Y",\n "Y[-]MMM[-]D"\n ],\n "short": [\n "M[-]D[-]YY",\n "D[-]M[-]YY",\n "YY[-]M[-]D"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/en.json',[],function () { return '{\n\t"defaultOrder": [0,0,0,0],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[ ]D[, ]Y",\n "dddd, D[ ]MMMM[, ]Y",\n "dddd, Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMMM[ ]D[, ]Y",\n "D[ ]MMMM[, ]Y",\n "Y[ ]MMMM[ ]D"\n ],\n "medium": [\n "MMM[ ]D[, ]Y",\n "D[ ]MMM[, ]Y",\n "Y[ ]MMM[ ]D"\n ],\n "short": [\n "M[/]D[/]Y",\n "D[/]M[/]Y",\n "Y[/]M[/]D"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/en-au.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[ ]D[ ]Y",\n "dddd, D[ ]MMMM[ ]Y",\n "dddd, Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMMM[ ]D[ ]Y",\n "D[ ]MMMM[ ]Y",\n "Y[ ]MMMM[ ]D"\n ],\n "medium": [\n "MMM[ ]D[ ]Y",\n "D[ ]MMM[ ]Y",\n "Y[ ]MMM[ ]D"\n ],\n "short": [\n "M[/]D[/]YY",\n "D[/]M[/]YY",\n "YY[/]M[/]D"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/en-ie.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd MMMM[ ]D[ ]Y",\n "dddd D[ ]MMMM[ ]Y",\n "dddd Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMMM[ ]D[ ]Y",\n "D[ ]MMMM[ ]Y",\n "Y[ ]MMMM[ ]D"\n ],\n "medium": [\n "MMM[ ]D[ ]Y",\n "D[ ]MMM[ ]Y",\n "Y[ ]MMM[ ]D"\n ],\n "short": [\n "MM[/]DD[/]Y",\n "DD[/]MM[/]Y",\n "Y[/]MM[/]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/fo.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM D[.] Y",\n "dddd, D[.] MMMM Y",\n "dddd, Y MMMM D[.]"\n ],\n "long": [\n "MMMM[. ]D[ ]Y",\n "D[. ]MMMM[ ]Y",\n "Y[. ]MMMM[ ]D"\n ],\n "medium": [\n "MM[.]DD[.]Y",\n "DD[.]MM[.]Y",\n "Y[.]MM[.]DD"\n ],\n "short": [\n "MM[.]DD[.]YY",\n "DD[.]MM[.]YY",\n "YY[.]MM[.]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/fi.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[ta ]D[ta ]Y",\n "dddd, D[. ]MMMM[ta ]Y",\n "dddd, Y[. ]MMMM[ta ]D"\n ],\n "long": [\n "MMMM[. ]D[ta ]Y",\n "D[. ]MMMM[ta ]Y",\n "Y[. ]MMMM[. ]D"\n ],\n "medium": [\n "M[.]D[.]Y",\n "D[.]M[.]Y",\n "Y[.]M[.]D"\n ],\n "short": [\n "M[.]D[.]Y",\n "D[.]M[.]Y",\n "Y[.]M[.]D"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/fr-ch.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[ ]D[ ]Y",\n "dddd, D[ ]MMMM[ ]Y",\n "dddd, Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMMM[ ]D[ ]Y",\n "D[ ]MMMM[ ]Y",\n "Y[ ]MMMM[ ]D"\n ],\n "medium": [\n "MMM[ ]D[ ]YY",\n "D[ ]MMM[ ]YY",\n "YY[ ]MMM[ ]D"\n ],\n "short": [\n "MM[.]DD[.]YY",\n "DD[.]MM[.]YY",\n "MM[.]DD[.]YY"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/hu.json',[],function () { return '{\n\t"defaultOrder": [2,2,2,2],\n\t"dateFormats": {\n "full": [\n "MMMM[ ]D[. ]Y., dddd",\n "D[. ]MMMM[. ]Y., dddd",\n "Y[. ]MMMM[ ]D., dddd"\n ],\n "long": [\n "MMMM[ ]D[. ]Y[.]",\n "D[. ]MMMM[. ]Y[.]",\n "Y[. ]MMMM[ ]D[.]"\n ],\n "medium": [\n "MMM[ ]D[. ]Y[.]",\n "D[. ]MMM[ ]Y[.]",\n "Y[. ]MMM[ ]D[.]"\n ],\n "short": [\n "MM[. ]DD[. ]Y[.]",\n "DD[. ]MM[. ]Y[.]",\n "Y[. ]MM[. ]DD[.]"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/it.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd MMMM[ ]D[ ]Y",\n "dddd D[ ]MMMM[ ]Y",\n "dddd Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMMM[ ]DD[ ]Y",\n "DD[ ]MMMM[ ]Y",\n "Y[ ]MMMM[ ]DD"\n ],\n "medium": [\n "MMM[/]DD[/]Y[/]",\n "DD[/]MMM[/]Y",\n "Y[/]MMM[/]DD"\n ],\n "short": [\n "MM[/]DD[/]YY",\n "DD[/]MM[/]YY",\n "YY[/]MM[/]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/ja.json',[],function () { return '{\n\t"defaultOrder": [2,2,2,2],\n\t"dateFormats": {\n "full": [\n "M[月]D[日]Y年dddd",\n "D[日]M[月]Y年dddd",\n "Y[年]M[月]D日dddd"\n ],\n "long": [\n "M[月]D[日]Y[年]",\n "D[月]M[日]Y[年]",\n "Y[年]M[月]D[日]"\n ],\n "medium": [\n "MM[/]DD[/]Y",\n "DD[/]MM[/]Y",\n "Y[/]MM[/]DD"\n ],\n "short": [\n "MM[/]DD[/]YY",\n "DD[/]MM[/]YY",\n "YY[/]MM[/]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/ko.json',[],function () { return '{\n\t"defaultOrder": [2,2,2,2],\n\t"dateFormats": {\n "full": [\n "M[월 ]D[일 ]Y년 dddd",\n "D[일]M[월 ]Y년 dddd",\n "Y[년 ]M[월 ]D일 dddd"\n ],\n "long": [\n "M[월 ]D[일]Y[년]",\n "D[일]M[월 ]Y[년]",\n "Y[년 ]M[월 ]D[일]"\n ],\n "medium": [\n "M[. ]D[. ]Y[.]",\n "D[. ]M[. ]Y[.]",\n "Y[. ]M[. ]D[.]"\n ],\n "short": [\n "M[. ]D[. ]YY[.]",\n "D[. ]M[. ]YY[.]",\n "YY[. ]M[. ]D[.]"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/nb.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd MMMM[. ]D[ ]Y",\n "dddd D[. ]MMMM[ ]Y",\n "dddd Y[. ]MMMM[. ]D"\n ],\n "long": [\n "MMMM[. ]D[ ]Y",\n "D[. ]MMMM[ ]Y",\n "Y[. ]MMMM[. ]D"\n ],\n "medium": [\n "MMM[ ]D[. ]Y",\n "D[. ]MMM[ ]Y",\n "Y[. ]MMM[ ]D"\n ],\n "short": [\n "MM[.]DD[.]YY",\n "DD[.]MM[.]YY",\n "YY[.]MM[.]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/pl.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[ ]D[ ]Y",\n "dddd, D[ ]MMMM[ ]Y",\n "dddd, Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMMM[ ]D[ ]Y",\n "D[ ]MMMM[ ]Y",\n "Y[ ]MMMM[ ]D"\n ],\n "medium": [\n "MM[-]DD[-]Y",\n "DD[-]MM[-]Y",\n "Y[-]MM[-]DD"\n ],\n "short": [\n "MM[-]DD[-]YY",\n "DD[-]MM[-]YY",\n "YY[-]MM[-]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/pt.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[ de ]D[ de ]Y",\n "dddd, D[ de ]MMMM[ de ]Y",\n "dddd, Y[ de ]MMMM[ de ]D"\n ],\n "long": [\n "MMMM[ de ]D[ de ]Y",\n "D[ de ]MMMM[ de ]Y",\n "Y[ de ]MMMM[ de ]D"\n ],\n "medium": [\n "MMM[ de ]D[ de ]Y",\n "D[ de ]MMM[ de ]Y",\n "Y[ de ]MMM[ de ]D"\n ],\n "short": [\n "MM[/]DD[/]Y",\n "DD[/]MM[/]Y",\n "Y[/]MM[/]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/ru.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[ ]D[ ]Y[ г.]",\n "dddd, D[ ]MMMM[ ]Y[ г.]",\n "dddd, Y[ ]MMMM[ ]D[ г.]"\n ],\n "long": [\n "MMMM[ ]D[ ]Y[ г.]",\n "D[ ]MMMM[ ]Y[ г.]",\n "Y[ ]MMMM[ ]D[ г.]"\n ],\n "medium": [\n "MMM[ ]D[ ]Y[ г.]",\n "D[ ]MMM[ ]Y[ г.]",\n "Y[ ]MMM[ ]D[ г.]"\n ],\n "short": [\n "MM[.]DD[.]YY",\n "DD[.]MM[.]YY",\n "YY[.]MM[.]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/sk.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd MMMM[. ]D[ ]Y",\n "dddd D[. ]MMMM[ ]Y",\n "dddd Y[. ]MMMM[. ]D"\n ],\n "long": [\n "MMMM[. ]D[ ]Y",\n "D[. ]MMMM[ ]Y",\n "Y[. ]MMMM[. ]D"\n ],\n "medium": [\n "M[. ]D[. ]Y",\n "D[. ]M[. ]Y",\n "Y[. ]M[. ]D"\n ],\n "short": [\n "M[. ]D[. ]Y",\n "D[. ]M[. ]Y",\n "Y[. ]M[. ]D"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/es.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "dddd, MMMM[ de ]D[ de ]Y",\n "dddd, D[ de ]MMMM[ de ]Y",\n "dddd, Y[ de ]MMMM[ de ]D"\n ],\n "long": [\n "MMMM[ de ]D[ de ]Y",\n "D[ de ]MMMM[ de ]Y",\n "Y[ de ]MMMM[ de ]D"\n ],\n "medium": [\n "MM[/]DD[/]Y",\n "DD[/]MM[/]Y",\n "Y[/]MM[/]DD"\n ],\n "short": [\n "MM[/]DD[/]YY",\n "DD[/]MM[/]YY",\n "YY[/]MM[/]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/sv.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,2],\n\t"dateFormats": {\n "full": [\n "dddd MMMM[ ]D[ ]Y",\n "dddd D[ ]MMMM[ ]Y",\n "dddd Y[ ]MMMM[ ]D"\n ],\n "long": [\n "MMM[ ]D[ ]Y",\n "D[ ]MMM[ ]Y",\n "Y[ ]MMM[ ]D"\n ],\n "medium": [\n "MM[-]DD[-]Y",\n "DD[-]MM[-]Y",\n "Y[-]MM[-]DD"\n ],\n "short": [\n "MM[-]DD[-]Y",\n "DD[-]MM[-]Y",\n "Y[-]MM[-]DD"\n ]\n}\n}\n';});
- define('text!baglass/core-client/js/core-client/i18n/custom/locale/tr.json',[],function () { return '{\n\t"defaultOrder": [1,1,1,1],\n\t"dateFormats": {\n "full": [\n "MMMM[ ]DD[ ]Y dddd",\n "DD[ ]MMMM[ ]Y dddd",\n "Y[ ]MMMM[ ]DD dddd"\n ],\n "long": [\n "MMMM[ ]D[ ]Y",\n "D[ ]MMMM[ ]Y",\n "Y[ ]MMMM[ ]D"\n ],\n "medium": [\n "MMM[ ]D[ ]Y",\n "D[ ]MMM[ ]Y",\n "Y[ ]MMM[ ]D"\n ],\n "short": [\n "MM[.]D[.]Y",\n "D[.]MM[.]Y",\n "Y[.]MM[.]D"\n ]\n}\n}\n';});
- /**
- * Note this is an autogenerated file from the ba-locale-config project.
- */
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/i18n/custom/locale/all',['text!./ar.json', 'text!./zh-cn.json', 'text!./cs.json', 'text!./da.json', 'text!./nl.json', 'text!./en.json', 'text!./en-au.json', 'text!./en-ie.json', 'text!./fo.json', 'text!./fi.json', 'text!./fr-ch.json', 'text!./hu.json', 'text!./it.json', 'text!./ja.json', 'text!./ko.json', 'text!./nb.json', 'text!./pl.json', 'text!./pt.json', 'text!./ru.json', 'text!./sk.json', 'text!./es.json', 'text!./sv.json', 'text!./tr.json'], function (ar, zhcn, cs, da, nl, en, enau, enie, fo, fi, frch, hu, it, ja, ko, nb, pl, pt, ru, sk, es, sv, tr) {
- return {
- no: JSON.parse(nb),
- nono: JSON.parse(nb),
- ar: JSON.parse(ar),
- ardz: JSON.parse(ar),
- arbh: JSON.parse(ar),
- areg: JSON.parse(ar),
- ariq: JSON.parse(ar),
- arjo: JSON.parse(ar),
- arkw: JSON.parse(ar),
- arlb: JSON.parse(ar),
- arly: JSON.parse(ar),
- arma: JSON.parse(ar),
- arom: JSON.parse(ar),
- arqa: JSON.parse(ar),
- arsa: JSON.parse(ar),
- arsy: JSON.parse(ar),
- artn: JSON.parse(ar),
- arae: JSON.parse(ar),
- arye: JSON.parse(ar),
- zhcn: JSON.parse(zhcn),
- zhhk: JSON.parse(zhcn),
- zhmo: JSON.parse(zhcn),
- zhsg: JSON.parse(zhcn),
- zhtw: JSON.parse(zhcn),
- zh: JSON.parse(zhcn),
- cs: JSON.parse(cs),
- cscz: JSON.parse(cs),
- da: JSON.parse(da),
- dadk: JSON.parse(da),
- nl: JSON.parse(nl),
- nlnl: JSON.parse(nl),
- en: JSON.parse(en),
- envi: JSON.parse(en),
- enus: JSON.parse(en),
- or: JSON.parse(en),
- orin: JSON.parse(en),
- zu: JSON.parse(en),
- zuza: JSON.parse(en),
- enau: JSON.parse(enau),
- ensg: JSON.parse(enau),
- el: JSON.parse(enau),
- elgr: JSON.parse(enau),
- hi: JSON.parse(enau),
- hiin: JSON.parse(enau),
- pa: JSON.parse(enau),
- pain: JSON.parse(enau),
- enie: JSON.parse(enie),
- fr: JSON.parse(enie),
- frfr: JSON.parse(enie),
- frlu: JSON.parse(enie),
- ga: JSON.parse(enie),
- gaie: JSON.parse(enie),
- fo: JSON.parse(fo),
- fofo: JSON.parse(fo),
- de: JSON.parse(fo),
- deat: JSON.parse(fo),
- debe: JSON.parse(fo),
- dede: JSON.parse(fo),
- delu: JSON.parse(fo),
- dech: JSON.parse(fo),
- fi: JSON.parse(fi),
- fifi: JSON.parse(fi),
- frch: JSON.parse(frch),
- itch: JSON.parse(frch),
- hu: JSON.parse(hu),
- huhu: JSON.parse(hu),
- it: JSON.parse(it),
- itit: JSON.parse(it),
- ja: JSON.parse(ja),
- jajp: JSON.parse(ja),
- ko: JSON.parse(ko),
- kokr: JSON.parse(ko),
- nb: JSON.parse(nb),
- nbno: JSON.parse(nb),
- nn: JSON.parse(nb),
- nnno: JSON.parse(nb),
- pl: JSON.parse(pl),
- plpl: JSON.parse(pl),
- ro: JSON.parse(pl),
- roro: JSON.parse(pl),
- pt: JSON.parse(pt),
- ptbr: JSON.parse(pt),
- ru: JSON.parse(ru),
- ruru: JSON.parse(ru),
- ruua: JSON.parse(ru),
- sk: JSON.parse(sk),
- sksk: JSON.parse(sk),
- es: JSON.parse(es),
- esar: JSON.parse(es),
- escr: JSON.parse(es),
- esdo: JSON.parse(es),
- esec: JSON.parse(es),
- essv: JSON.parse(es),
- esni: JSON.parse(es),
- espy: JSON.parse(es),
- eses: JSON.parse(es),
- esus: JSON.parse(es),
- esuy: JSON.parse(es),
- esve: JSON.parse(es),
- sv: JSON.parse(sv),
- svse: JSON.parse(sv),
- tr: JSON.parse(tr),
- trtr: JSON.parse(tr)
- };
- });
- //# sourceMappingURL=all.js.map
- ;
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * (C) Copyright IBM Corp. 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/i18n/custom/Date',['./locale/all'], function (customLocaleData) {
- var DISPLAY_ORDER = {
- MDY: 0,
- DMY: 1,
- YMD: 2
- };
- var FORMAT_LENGTH = {
- SHORT: 'short'
- };
- var FORMAT_LENGTH_INDEX = {
- 'full': 0,
- 'long': 1,
- 'medium': 2,
- 'short': 3
- };
- var REGEX_META_CHARS = '[\\^$.|?*+(){}';
- /**
- * Class to customize dates
- *
- */
- var CustomDateUtil = function () {
- function CustomDateUtil() {
- _classCallCheck(this, CustomDateUtil);
- }
- _createClass(CustomDateUtil, null, [{
- key: 'getDateFormat',
- value: function getDateFormat(locale, customSettings) {
- var formatLength = customSettings.formatLength,
- separator = customSettings.separator,
- displayOrder = customSettings.displayOrder;
- formatLength = formatLength || FORMAT_LENGTH.SHORT;
- var localeData = customLocaleData[locale] || customLocaleData['en'];
- var sFormat = '';
- displayOrder = displayOrder ? DISPLAY_ORDER[displayOrder] : localeData.defaultOrder[FORMAT_LENGTH_INDEX[formatLength]];
- sFormat = localeData.dateFormats[formatLength][displayOrder];
- if (separator) {
- //Find a match that starts with '[' and ends with ']'' but don't contain
- //[ or ]
- sFormat = sFormat.replace(/\[[^[\]]*\]/g, function () {
- return separator;
- });
- //Delete separators at the beginning and end
- separator = REGEX_META_CHARS.includes(separator) ? '\\\\' + separator : separator;
- var startEndSeparators = new RegExp('(' + separator + '$|^' + separator + ')', 'g');
- sFormat = sFormat.replace(startEndSeparators, function () {
- return '';
- });
- }
- return sFormat;
- }
- }]);
- return CustomDateUtil;
- }();
- return {
- getDateFormat: CustomDateUtil.getDateFormat
- };
- });
- //# sourceMappingURL=Date.js.map
- ;
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /**
- * This class implements formatting functionality
- *
- * Supported formatSpec for numbers
- * formatSpec: {
- * type: 'number | currency | percent', // default - number, scientific - NOT SUPPORTED YET
- * currencyCode: 'e.g. CAD | USD | EUR', // optional, ISO 4217 currency code http://en.wikipedia.org/wiki/ISO_4217
- * minimumFractionDigits: see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat
- * decimalFormatLength: 'short' // supported for 'number' type only, abbreviates numbers to short format 1,000 -> 1K
- * }
- *
- * Supported formatSpec for dates
- * formatSpec: {
- * type: 'date | time | datetime | year',
- * formatLength: 'short | medium | long | full', // default short
- * timeZone: 'local | UTC', // optional, format to local or utc timezone
- * }
- */
- define('baglass/core-client/js/core-client/i18n/Formatter',['../ui/core/Class', 'moment-timezone', 'ecma402/IntlShim', './FormatResources', './CurrencySymbols', 'underscore', './Const', '../i18n/custom/Date'], function (Class, moment, IntlPolyfill, formatResources, CurrencySymbols, _, Const, DateCustomizer) {
- var Formatter = null;
- var FORMATTER_TYPE = {
- NumberFormat: 'NumberFormat'
- };
- var FRACTION_DIGITS = {
- MIN: 0,
- MAX: 20
- };
- Formatter = Class.extend({
- init: function init() {
- this.formatterCache = {};
- },
- /**
- * Parses the decimal number for different locales
- * @param value string representation of the localized decimal
- * @returns the number representation of the decimal
- */
- parseDecimal: function parseDecimal(value, locale) {
- /**
- * escape any regex characters
- * change ' ' to \s to handle all space types
- *
- * @param text
- * @returns {*}
- */
- function escapeRegexString(text) {
- var escStr = text.replace(/[-[\]{}()*+?.,\\^$|]/g, '\\$&');
- return escStr.replace(/[\s]/g, '\\s');
- }
- var decimalSeparator = this.formatNumber(0.1, locale ? { locale: locale } : null).substring(1, 2);
- var decimalSepRe = new RegExp('[' + escapeRegexString(decimalSeparator) + ']');
- //remove all chars that are not a digit or a decimalSeparator
- var invalidCharsRe = new RegExp('[^\\d' + escapeRegexString(decimalSeparator) + ']', 'g');
- var cleanedValue = value.replace(invalidCharsRe, '');
- return Number(cleanedValue.replace(decimalSepRe, '.'));
- },
- /**
- * Formats the value based on the given formatSpec
- * @param value input value
- * @param spec format spec that follow the syntax above
- * @returns string value formatted to the formatSpec and rules of the dojo locale
- */
- format: function format(value, spec) {
- if (!spec) {
- return this.formatNumber(value, { type: 'decimal' });
- } else {
- if ((value === undefined || value === null || value === '') && spec.defaultValue) {
- return spec.defaultValue;
- } else if (spec.type === 'date' || spec.type === 'datetime' || spec.type === 'time' || spec.type === 'lastModified') {
- return this.formatDateTime(value, spec);
- } else if (spec.type === 'year') {
- return this.formatYear(value, spec);
- } else if (spec.type === 'text') {
- return this.formatText(value, spec);
- } else {
- return this.formatNumber(value, spec);
- }
- }
- },
- /**
- * Formats the value based on the given number formatSpec
- * @param value input value
- * @param spec format spec that follow the syntax above
- * @returns string value formatted to the formatSpec and rules of the requirejs locale
- */
- formatNumber: function formatNumber(value, spec) {
- if (_.isNaN(value)) {
- return 'NaN';
- }
- var result = value;
- var options = { style: 'decimal' };
- var locale = spec && spec.locale || this._getUserLocale();
- if (spec) {
- if (spec.type === 'currency') {
- if (spec.currencyCode) {
- options.style = spec.type;
- options.currency = spec.currencyCode;
- options.currencyDisplay = spec.currencyDisplay;
- }
- options.useGrouping = spec.useGrouping;
- // minimum/maximumFractionDefaults should be undefined if not explicitly set in the spec.
- // This allows JP/KR to use their proper default (0)
- var minFractionDigit = 0;
- if (_.isNumber(spec.minimumFractionDigits)) {
- minFractionDigit = spec.minimumFractionDigits;
- options.minimumFractionDigits = spec.minimumFractionDigits;
- }
- if (_.isNumber(spec.maximumFractionDigits)) {
- options.maximumFractionDigits = Math.max(spec.maximumFractionDigits, minFractionDigit);
- }
- options.pattern = spec.pattern;
- //Adding support for Abbreviation if type is Currency.
- if (spec.decimalFormatLength && spec.decimalFormatLength === 'short') {
- return this._formatShortNumber(value, locale, spec);
- }
- } else if (spec.type === 'percent') {
- if (spec.convertPercent === false) {
- value = value / 100;
- }
- options.style = spec.type;
- if (_.isNumber(spec.minimumFractionDigits)) {
- options.minimumFractionDigits = spec.minimumFractionDigits;
- }
- if (_.isNumber(spec.maximumFractionDigits)) {
- options.maximumFractionDigits = spec.maximumFractionDigits;
- }
- options.useGrouping = spec.useGrouping;
- } else {
- _.extend(options, spec);
- if (spec.decimalFormatLength && spec.decimalFormatLength === 'short') {
- return this._formatShortNumber(value, locale, spec);
- }
- }
- }
- var nf = this._getFormatter(locale, options, FORMATTER_TYPE.NumberFormat);
- if (spec && spec.pattern) {
- nf.resolved.pattern = spec.pattern;
- }
- result = nf.format(value);
- // ecma402/IntlShim is dependent on locale for showing the currency symbol (ie: if the currency is not supported by the locale,
- // the formatter uses the international currency code instead of the symbol). Here, we ensure that the symbol is used for that case
- if (options.currency && spec.currencyDisplay !== 'code' && CurrencySymbols[options.currency]) {
- var replace = CurrencySymbols[options.currency].replace ? CurrencySymbols[options.currency].replace : options.currency;
- result = result.replace(replace, CurrencySymbols[options.currency].symbol);
- }
- // if currencySymbol is set, replace any existing currency with custom symbol
- if (spec && spec.currencySymbol && spec.currencyDisplay !== 'code') {
- var symbol = options.currency && CurrencySymbols[options.currency] && CurrencySymbols[options.currency].symbol;
- if (symbol) {
- result = result.replace(symbol, spec.currencySymbol);
- } else {
- result = spec.currencySymbol + result;
- }
- }
- result = this._addNumberLabel(result, spec);
- return !result || result === 'NaN' || result === '-NaN' ? value : result;
- },
- /**
- * Formats the value based on the given date/time formatSpec
- * @param value a Date object
- * @param spec format spec that follow the syntax above
- * @returns string value formatted to the formatSpec and rules of the requirejs locale
- */
- formatDateTime: function formatDateTime(value, spec) {
- var result = null;
- var locale = this._getUserLocale();
- var timezone = moment.tz.guess();
- var momentDatetimeFormat = 'l';
- var type = '';
- if (spec) {
- type = spec.type || '';
- if (type === 'lastModified') {
- spec.type = 'datetime';
- }
- locale = spec.locale || locale;
- momentDatetimeFormat = this._getDateTimeFormat(locale, spec);
- timezone = spec.timezone || timezone;
- }
- try {
- if (this.isTimeOnly(value)) {
- result = moment.utc('1970-01-01T' + value).locale(locale).format(momentDatetimeFormat);
- } else if (type === 'lastModified') {
- result = moment.utc(value, 'ddd, DD MMM YYYY HH:mm:ss [GMT]').tz(timezone).format(momentDatetimeFormat);
- } else {
- //Date or DateTime
- if (type === 'year') {
- momentDatetimeFormat = this._getMomentDateTimeFormatOption(value, spec);
- }
- /*
- * Value needs to be created into a new Date because UTC date strings ie(Thu ,14 Jul 2016 14:43:00 GMT) are returned as invalid date.
- */
- if (moment.tz(value, timezone).locale(locale).tz(timezone).format(momentDatetimeFormat) === 'Invalid Date') {
- result = moment.tz(new Date(value), timezone).locale(locale).tz(timezone).format(momentDatetimeFormat);
- } else {
- var sFormat = '';
- if (spec.displayOrder || spec.separator) {
- //return non-locale format
- sFormat = this._getCustomDateFormat(locale, spec);
- result = moment.tz(value, timezone).locale(locale).format(sFormat);
- } else {
- result = moment.tz(value, timezone).locale(locale).format(momentDatetimeFormat);
- }
- }
- }
- } catch (e) {
- result = value;
- }
- return !result ? value : result;
- },
- formatYear: function formatYear(value, spec) {
- var result = '';
- var momentDatetimeFormat = 'l';
- if (spec) {
- momentDatetimeFormat = this._getMomentDateTimeFormatOption(value, spec);
- }
- result = moment(value + '010').format(momentDatetimeFormat);
- return result;
- },
- /**
- * Formats the value based on the given text formatSpec
- * @param value a string
- * @param spec format spec that follow the syntax above
- * @returns string value formatted to the formatSpec
- */
- formatText: function formatText(value, spec) {
- // currently no text-specific formatting
- void spec;
- return value;
- },
- _getUserLocale: function _getUserLocale() {
- return requirejs.s.contexts._.config.locale || 'en-us';
- },
- _getCustomDateFormat: function _getCustomDateFormat(locale, spec) {
- var _spec = {
- formatLength: spec.formatLength || spec.dateStyle,
- displayOrder: spec.displayOrder,
- separator: spec.separator
- };
- return this.getCustomDateFormat(locale, _spec);
- },
- /**
- * Determines if the value parameter has only the time component of an ISO timestamp
- * A full ISO timestamp is : YYYY-MM-DDTHH:mm:ssZ
- * Time only would be HH:mm:ssZ
- */
- isTimeOnly: function isTimeOnly(value) {
- var d = new Date(value); //eg '12:01:01' or '12:01:01Z' or '1989-01-01T12:01:01Z'
- var t = d.getTime();
- if (isNaN(t)) {
- d = new Date('1970-01-01T' + value);
- t = d.getTime();
- if (isNaN(t)) {
- d = new Date('1970-01-01T' + value + 'Z');
- t = d.getTime();
- if (isNaN(t)) {
- return false;
- }
- return true;
- }
- return true;
- }
- return false;
- },
- _formatShortNumber: function _formatShortNumber(value, locale, spec) {
- var strValue = String(Math.round(Math.abs(value)));
- var numOfDigits = strValue.length;
- var nf;
- if (numOfDigits <= 3) {
- var _options2 = {};
- if (spec.currencyCode) {
- _options2.style = 'currency';
- _options2.currency = spec.currencyCode;
- }
- nf = this._getFormatter(locale, _options2, FORMATTER_TYPE.NumberFormat);
- return nf.format(value);
- }
- var patterns = formatResources.getShortNumberFormatPatterns(locale);
- var patternKeys = Object.keys(patterns);
- var lastKey = patternKeys[patternKeys.length - 1];
- var maxNumOfDigits = lastKey.substring(0, lastKey.indexOf('-')).length;
- if (strValue.length > maxNumOfDigits) {
- numOfDigits = maxNumOfDigits;
- }
- var maximumSignificantDigits = spec.maximumSignificantDigits ? spec.maximumSignificantDigits : strValue.length > 15 ? strValue.length - 15 + 3 : 3;
- var pattern = patterns[this._generatePatternKey(numOfDigits)];
- var numberOfZeros = pattern.lastIndexOf('0') - pattern.indexOf('0') + 1;
- if (maximumSignificantDigits < numberOfZeros) {
- maximumSignificantDigits = numberOfZeros;
- }
- var options = {
- maximumFractionDigits: 2,
- maximumSignificantDigits: maximumSignificantDigits
- };
- // apply applicable currency options
- if (spec.currencyCode) {
- options.style = 'currency';
- options.currency = spec.currencyCode;
- options.currencyDisplay = spec.currencyDisplay;
- }
- nf = this._getFormatter(locale, options, FORMATTER_TYPE.NumberFormat);
- var formatResult = nf.format(value / this._getDevisionFactor(numOfDigits, numberOfZeros));
- var result;
- //handle case where currency symbol is at the end (e.g. 500 k $CA)
- if (spec.currencyCode && !isNaN(parseInt(formatResult.charAt(0)))) {
- var _formatResult$split = formatResult.split(/\s/),
- _formatResult$split2 = _slicedToArray(_formatResult$split, 2),
- num = _formatResult$split2[0],
- currencySymbol = _formatResult$split2[1];
- result = pattern.replace(/0+/g, num) + ' ' + currencySymbol;
- } else {
- result = pattern.replace(/0+/g, formatResult);
- }
- // Set label if set
- result = this._addNumberLabel(result, spec);
- return result.replace(/'/g, '');
- },
- _addNumberLabel: function _addNumberLabel(result, spec) {
- if (spec && spec.numberLabel) {
- result = spec.numberLabelPosition && spec.numberLabelPosition === 'left' ? spec.numberLabel + result : result + spec.numberLabel;
- }
- return result;
- },
- _getDevisionFactor: function _getDevisionFactor(numOfDigits, numberOfZeros) {
- return Math.pow(10, numOfDigits - numberOfZeros);
- },
- _generatePatternKey: function _generatePatternKey(digits) {
- var zeros = new Array(digits).join('0');
- return '1' + zeros + '-count-other';
- },
- _getFormatter: function _getFormatter(locale, options, type) {
- var _options = this._getFormatTypeValidOptions(options, type);
- var key = this._createCacheKey(locale, _options, type);
- var formatter = this.formatterCache[key];
- if (!formatter) {
- formatter = new IntlPolyfill[type](locale, _options);
- this.formatterCache[key] = formatter;
- }
- return formatter;
- },
- _getFormatTypeValidOptions: function _getFormatTypeValidOptions(options, type) {
- var opt = options;
- switch (type) {
- case FORMATTER_TYPE.NumberFormat:
- opt = this._getValidNumberOptions(opt);
- break;
- }
- return opt;
- },
- _getValidNumberOptions: function _getValidNumberOptions(options) {
- var opt = _.extend(options);
- var _assignValidFractionDigits = function _assignValidFractionDigits(fractionDigits) {
- if (!_.isUndefined(opt[fractionDigits])) {
- if (opt[fractionDigits] > FRACTION_DIGITS.MAX) {
- opt[fractionDigits] = FRACTION_DIGITS.MAX;
- } else if (opt[fractionDigits] < FRACTION_DIGITS.MIN) {
- opt[fractionDigits] = FRACTION_DIGITS.MIN;
- }
- }
- };
- _assignValidFractionDigits('minimumFractionDigits');
- _assignValidFractionDigits('maximumFractionDigits');
- return opt;
- },
- _createCacheKey: function _createCacheKey(locale, options, type) {
- var names = Object.keys(options).sort();
- var output = [type, locale];
- var name;
- for (var i = 0; i < names.length; i++) {
- name = names[i];
- output.push(name, options[name]);
- }
- return output.join();
- },
- isInt: function isInt(value) {
- return typeof value === 'number' && value % 1 === 0;
- },
- _hasTime: function _hasTime(value) {
- return value instanceof Date || this.isInt(value) || value.indexOf('T') > 0 || value.indexOf(':') > 0;
- },
- _getMomentDateTimeFormatOption: function _getMomentDateTimeFormatOption(value, spec) {
- /*jshint maxcomplexity:26 */
- // This formatter for date/time handles these types as defined in the header
- // date || time || datetime || year
- var sFormat = 'l';
- var format;
- if (spec.type === 'time' || this.isTimeOnly(value)) {
- format = spec.formatLength || spec.timeStyle;
- // Time formats
- switch (format) {
- case 'full':
- sFormat = 'HH:mm:ss A'; // 24 hours
- break;
- case 'long':
- sFormat = 'hh:mm:ss A';
- break;
- case 'medium':
- sFormat = 'h:m:s A';
- break;
- case 'short':
- sFormat = 'LT';
- break;
- default:
- sFormat = 'LT';
- break;
- }
- } else if (spec.type === 'year') {
- // Year type
- switch (spec.formatLength) {
- case 'full':
- case 'long':
- case 'medium':
- sFormat = 'YYYY';
- break;
- case 'short':
- sFormat = 'YY';
- break;
- default:
- sFormat = 'YYYY';
- break;
- }
- } else if (spec.type === 'date') {
- format = spec.formatLength || spec.dateStyle;
- switch (format) {
- case 'full':
- sFormat = 'LLLL';
- break;
- case 'long':
- sFormat = 'LLL';
- break;
- case 'medium':
- sFormat = 'll';
- break;
- case 'short':
- sFormat = 'l';
- break;
- default:
- sFormat = 'l';
- break;
- }
- } else if (spec.type === 'datetime' || this._hasTime(value)) {
- format = spec.formatLength || spec.dateStyle;
- switch (format) {
- case 'full':
- sFormat = 'LLLL';
- break;
- case 'long':
- sFormat = 'LLL';
- break;
- case 'medium':
- sFormat = 'lll';
- break;
- case 'short':
- sFormat = 'l LT';
- break;
- default:
- sFormat = 'l LT';
- break;
- }
- }
- return sFormat;
- },
- _getDateTimeFormat: function _getDateTimeFormat(locale, spec) {
- var cldr2MomentFormat = function cldr2MomentFormat(sFormat) {
- var TOKENS = Const.TOKENS;
- // replace comments
- sFormat = sFormat.replace(/'[^']+'/g, function (m) {
- m = m.replace(/'/g, '');
- return '[' + m + ']';
- });
- sFormat = sFormat.replace(/\bEEEE\b/, TOKENS.DOW);
- sFormat = sFormat.replace(/\bcccc\b/, TOKENS.DOW);
- sFormat = sFormat.replace(/\bdd\b/, TOKENS.DD);
- sFormat = sFormat.replace(/\bd\b/, TOKENS.D);
- sFormat = sFormat.replace(/\byy\b/, TOKENS.Y_SHORT);
- sFormat = sFormat.replace(/\by\b/, TOKENS.Y);
- sFormat = sFormat.replace(/\ba\b/, TOKENS.A);
- sFormat = sFormat.replace(/\bzzzz\b/, TOKENS.ZZ);
- return sFormat;
- };
- var formatLength = spec.formatLength || spec.dateStyle || spec.timeStyle || 'short';
- if (Const.SIZES.indexOf(formatLength) === -1) {
- formatLength = 'short';
- }
- var getter = void 0;
- switch (spec.type) {
- case 'time':
- getter = formatResources.getTimeFormatPatterns;
- break;
- case 'date':
- getter = formatResources.getDateFormatPatterns;
- break;
- case 'datetime':
- getter = formatResources.getDateTimeFormatPatterns;
- break;
- default:
- getter = formatResources.getDateTimeFormatPatterns;
- }
- return cldr2MomentFormat(getter.call(formatResources, locale)[formatLength]);
- },
- /**
- * Returns a custom moment format based on spec and locale
- */
- getCustomDateFormat: function getCustomDateFormat(locale, spec) {
- return DateCustomizer.getDateFormat(locale, spec);
- }
- });
- return new Formatter();
- });
- //# sourceMappingURL=Formatter.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI UI_Commons
- * (C) Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/DateTimeUtils',['moment-timezone', '../i18n/Formatter', 'baglass/services/LogService'], function (moment, Formatter, LogService) {
- return {
- //maps the formatLength to the string used for localized formats of date used by momentjs
- LOCALIZED_DATE_FORMAT: {
- 'long': 'ddd LL',
- 'medium': 'll',
- 'short': 'l'
- },
- //maps the formatLength to the string used for localized formats of datetime used by momentjs
- LOCALIZED_DATETIME_FORMAT: {
- 'long': 'llll',
- 'medium': 'lll',
- 'short': 'l LT'
- },
- //maps the formatLength to the string used for localized formats of time used by momentjs
- LOCALIZED_TIME_FORMAT: {
- 'long': 'LTS',
- 'short': 'LT'
- },
- LOCALE_MOMENT_MAP: {
- 'zh-hans': 'zh-cn',
- 'zh-hans-sg': 'zh-cn',
- 'zh-sg': 'zh-cn',
- 'zh-hant': 'zh-tw',
- 'zh-hant-hk': 'zh-tw',
- 'zh-hk': 'zh-tw',
- 'zh-mo': 'zh-tw'
- },
- _userTimeLocale: function _userTimeLocale(timeLocale) {
- var userTimeLocale = timeLocale ? timeLocale : {};
- var _userTime = {
- contentLocale: userTimeLocale.contentLocale || 'en',
- timeZone: userTimeLocale.timeZone || 'America/New_York'
- };
- var momentMap;
- // See https://github.com/moment/moment/issues/3099, there is no default "zh" language
- if ((momentMap = this.LOCALE_MOMENT_MAP[_userTime.contentLocale.toLowerCase()]) !== undefined) {
- _userTime.contentLocale = momentMap;
- }
- return _userTime;
- },
- /**
- * Use Formatter class to do all formatting
- * @param type {string} what we are formatting ie. 'date', 'time', 'datetime'
- * @param value
- * @param format {string} - format ie. 'short', 'medium', 'long', 'full'
- * @param timeLocale {object} - locale info
- * @returns {*|string}
- */
- format: function format(type, value, formatLength, timeLocale) {
- timeLocale = this._userTimeLocale(timeLocale);
- var spec = {
- type: type,
- locale: timeLocale.contentLocale,
- timezone: timeLocale.timeZone,
- formatLength: formatLength
- };
- return Formatter.format(value, spec);
- },
- /*
- * Returns localized-formatted date for the timezone specified in the user's preferences.
- * Default timezone if none found - America/New_York
- * Default formatLength - short
- *
- * long - September 4, 1989
- * medium - Sep 4, 1989
- * short - 09/04/1989
- */
- formatDate: function formatDate() {
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return this.format.apply(this, ['date'].concat(args));
- },
- /*
- * Returns localized-formatted datetime for the timezone specified in the user's preferences
- * Default timezone if none found - America/New_York
- * Default formatLength - short
- *
- * long - September 4, 1989 8:30 PM
- * medium - Sep 4, 1989 8:30 PM
- * short - 09/04/1989 8:30PM
- */
- formatDateTime: function formatDateTime() {
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- return this.format.apply(this, ['datetime'].concat(args));
- },
- /*
- * Returns localized-formatted time for the timezone specified in the user's preferences
- * Default timezone if none found - America/New_York
- * Default formatLength - short
- *
- * long - 8:30:30 PM
- * short - 8:30 PM
- */
- formatTime: function formatTime() {
- for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args[_key3] = arguments[_key3];
- }
- return this.format.apply(this, ['time'].concat(args));
- },
- /**
- * @public
- * Return true if a given locale uses 24hr time format, and false if it uses 12hr.
- * Uses Moment's built in locale information.
- * Throws an exception if no locale is provided.
- *
- * @param {string} contentLocale - the locale to check, eg. 'en'
- * @returns {boolean} true if the locale uses 24hr time format. False if the locale uses 12hr time format or no locale data is found.
- * @throws {Error} if no contentLocale is provided
- */
- is24HrFormat: function is24HrFormat(contentLocale) {
- if (!contentLocale) {
- var logger = new LogService();
- logger.error('No locale provided');
- }
- var localeData = moment.localeData(contentLocale) || moment.localeData('en');
- var timeFormat = localeData.longDateFormat('LT');
- return timeFormat.indexOf('H') > -1;
- },
- /**
- * Returns a custom moment format based on spec and locale
- */
- getCustomDateFormat: function getCustomDateFormat(locale, spec) {
- return Formatter.getCustomDateFormat(locale, spec);
- }
- };
- });
- //# sourceMappingURL=DateTimeUtils.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/utils/all',['./Promise', './DatasetExecutionManager', './dom-utils', './Downloader', './PromptCapabilities', './PromptManager', './DateTimeUtils', './PerfUtils'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: BI UI Commons
- *
- * Copyright IBM Corp. 2015, 2016
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/dialogs/BaseShareAndEmbedDialog',['./GenericViewDialog', 'jquery', '../../nls/StringResources', '../../utils/BrowserUtils'], function (BaseDialog, $, StringResources, BrowserUtils) {
- /**
- * Base class for the Share and Embed Modal dialogs.
- * It is not meant to be used as is but rather extended.
- *
- * @param - options // anything that you want to keep as part of the dialog instance.
- *
- */
- var BaseShareAndEmbedDialog = BaseDialog.extend({
- init: function init(options) {
- var dialogOptions = {
- 'buttons': [{
- 'text': StringResources.get('copyText'),
- 'handler': this.copyToClipboard.bind(this),
- 'type': 'primary',
- 'defaultId': 'copy_button'
- }, 'cancel'],
- 'blockerClass': 'newModalDialog'
- };
- $.extend(true, dialogOptions, options);
- BaseShareAndEmbedDialog.inherited('init', this, [dialogOptions]);
- },
- setFocus: function setFocus() {
- var container = this._container();
- var textField = container.find('.displayedURLOrCode')[0];
- // if iPad disable readonly so text selection options appear
- if (BrowserUtils.isIPad()) {
- $(textField).attr('readonly', false);
- }
- $(textField).on('focus', function () {
- // select() fails on iOS Safari, use setSelectionRange()
- textField.setSelectionRange(0, textField.value.length);
- //disable mouseup event so text isn't deselected
- $(textField).mouseup(function (e) {
- e.preventDefault();
- });
- });
- $(textField).focus();
- },
- copyToClipboard: function copyToClipboard() {
- this.setFocus();
- document.execCommand('copy');
- },
- destroy: function destroy() {
- BaseShareAndEmbedDialog.inherited('destroy', this, arguments);
- }
- });
- return BaseShareAndEmbedDialog;
- });
- //# sourceMappingURL=BaseShareAndEmbedDialog.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/dialogs/MessageBox',['./BaseDialog', 'jquery', 'underscore'], function (BaseDialog, $, _) {
- var Dialog = null;
- Dialog = BaseDialog.extend({
- _buttons: ['ok'],
- init: function init(sType, sTitle, sMessage) {
- this._props = {
- 'type': sType,
- 'title': sTitle,
- 'msg': sMessage
- };
- this.id = 'com-ibm-ca-messageBoxTitle';
- this.contentId = 'com-ibm-ca-messageBoxContent';
- Dialog.inherited('init', this, [this._props]);
- },
- renderContent: function renderContent(n) {
- n.append($('<div>', {
- 'class': 'messageBox ' + this._props.type,
- 'html': _.escape(this._props.msg)
- }));
- return n;
- },
- renderTitle: function renderTitle(n) {
- n.text(this._props.title);
- return n;
- }
- });
- return Dialog;
- });
- //# sourceMappingURL=MessageBox.js.map
- ;
- /**
- * An extension of a MessageBox to provide a confirmation dialog
- *
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/dialogs/ConfirmationDialog',['./MessageBox'], function (MessageBox) {
- var ConfirmationDialog = null;
- ConfirmationDialog = MessageBox.extend(
- /**
- * @lends ConfirmationDialog.prototype
- */
- {
- _buttons: ['ok', 'cancel'],
- _confirmCallback: null,
- _cancelCallback: null,
- /**
- * Opens the Confirmation dialog
- * @param {function} confirm - A callback to use when the user clicks OK
- * @param {function} cancel - A callback to use when the user clicks Cancel
- */
- confirm: function confirm(_confirm, cancel) {
- this._confirmCallback = _confirm;
- this._cancelCallback = cancel;
- ConfirmationDialog.inherited('open', this);
- },
- ok: function ok() {
- ConfirmationDialog.inherited('ok', this, arguments);
- if (this._confirmCallback) {
- this._confirmCallback();
- }
- },
- cancel: function cancel() {
- ConfirmationDialog.inherited('cancel', this, arguments);
- if (this._cancelCallback) {
- this._cancelCallback();
- }
- }
- });
- return ConfirmationDialog;
- });
- //# sourceMappingURL=ConfirmationDialog.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * Copyright IBM Corp. 2017, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/dialogs/all',['./BaseDialog', './BaseShareAndEmbedDialog', './ConfirmationDialog', './GenericViewDialog', './MessageBox'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI
- * Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/ui/all',['./dialogs/all', './ProgressToast'], function () {});
- //# sourceMappingURL=all.js.map
- ;
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2016, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define('baglass/core-client/js/core-client/i18n/V5Formatter',['../ui/core/Class', 'underscore', './Formatter'], function (Class, _, formatter) {
- var FormatUtils = null;
- // Map the model format type to our format type
- var TYPE_MAP = {
- numberFormat: 'number',
- currencyFormat: 'currency',
- percentFormat: 'percent',
- dateFormat: 'date',
- dateTimeFormat: 'datetime',
- timeFormat: 'time',
- stringFormat: 'text'
- };
- // Map our property names to the model format property names
- var V5_PROP_MAP = {
- decimalSize: function decimalSize(modelSpec) {
- if (modelSpec.decimalSize) {
- return { minimumFractionDigits: parseInt(modelSpec.decimalSize), maximumFractionDigits: parseInt(modelSpec.decimalSize) };
- }
- },
- useGrouping: function useGrouping(modelSpec) {
- return _.isUndefined(modelSpec.useGrouping) ? {} : { useGrouping: modelSpec.useGrouping === 'true' };
- },
- currencyCode: 'currencyCode',
- currencySymbol: 'currencySymbol',
- useIntlSymbol: function useIntlSymbol(modelSpec) {
- return { currencyDisplay: modelSpec.useIntlSymbol === 'true' ? 'code' : 'symbol' };
- },
- dateStyle: 'dateStyle',
- dateSeparator: 'separator',
- displayOrder: 'displayOrder',
- timeStyle: 'timeStyle',
- numberLabel: 'numberLabel',
- numberLabelPosition: 'numberLabelPosition',
- whenMissing: function whenMissing(modelSpec) {
- if (modelSpec.whenMissing) {
- return { defaultValue: modelSpec.whenMissing };
- }
- }
- };
- // Map that contains the list of supported v5 model properties for each format type that we support
- var SUPPORTED_V5_PROPS_MAP = {
- number: ['decimalSize', 'useGrouping', 'numberLabel', 'numberLabelPosition', 'whenMissing'],
- currency: ['decimalSize', 'currencyCode', 'currencySymbol', 'useIntlSymbol', 'useGrouping', 'numberLabel', 'numberLabelPosition', 'whenMissing'],
- percent: ['decimalSize', 'useGrouping', 'whenMissing'],
- date: ['dateStyle', 'dateSeparator', 'displayOrder', 'whenMissing'],
- datetime: ['dateStyle', 'timeStyle'],
- time: ['timeStyle', 'whenMissing'],
- text: ['whenMissing']
- };
- var SUPPORTED_V5_PROPS = ['decimalSize', 'currencyCode', 'currencySymbol', 'useIntlSymbol', 'useGrouping', 'dateStyle', 'timeStyle', 'numberLabel', 'numberLabelPosition', 'whenMissing'];
- var SUPPORTED_V5_TYPES = ['numberFormat', 'currencyFormat', 'percentFormat', 'dateFormat', 'dateTimeFormat', 'timeFormat', 'stringFormat'];
- /**
- * Convert an ICU format json spec into a format spec that our formatter understands
- *
- */
- FormatUtils = Class.extend({
- /**
- * Get the formatted value of a raw value, based on a V5 format spec
- *
- * @param value - raw value
- * @param moserObject - MoserObject corresponding to where the value is from
- * @param spec - model v5 format spec (optional)
- *
- */
- format: function format(value, moserObject, spec) {
- var formatSpec = spec ? spec : moserObject.getFormat();
- if (!formatSpec) {
- return value;
- }
- var finalSpec = this.getFormatSpec(formatSpec);
- // Dev flag for testing new formatter currently being implemented:
- // if (devFlag) { return newFormatter(value, moserObject, spec); }
- if (finalSpec) {
- return formatter.format(value, this.getFormatSpec(spec));
- }
- return value;
- },
- getFormatSpec: function getFormatSpec(specString) {
- var formatSpec = null;
- if (specString) {
- try {
- var spec = _.isObject(specString) ? specString : JSON.parse(specString);
- formatSpec = this._getFormatSpec(spec);
- } catch (e) {
- // TODO: log when the glass logging is available
- console.error('Invalid format spec: ' + specString);
- }
- }
- return formatSpec;
- },
- /**
- * Get the equivalen format spec from a model format spec
- *
- * @param modelSpec - model format spec
- *
- */
- _getFormatSpec: function _getFormatSpec(modelSpec) {
- var formatGroup = this._getFormatGroup(modelSpec);
- // Pick the first property
- var modelSpecSection = null;
- var name;
- if (formatGroup) {
- for (name in formatGroup) {
- if (formatGroup.hasOwnProperty(name)) {
- modelSpecSection = formatGroup[name];
- break;
- }
- }
- }
- var spec = null;
- if (modelSpecSection && name in TYPE_MAP) {
- spec = {
- type: TYPE_MAP[name]
- };
- this._fillInSpecProperties(spec, formatGroup);
- }
- return spec;
- },
- /**
- * Add all properties from a model spec to the format spec
- *
- * @param spec - format spec
- * @param modelSpec - model format spec
- */
- _fillInSpecProperties: function _fillInSpecProperties(spec, modelSpec) {
- var flatSpec = {};
- _.each(modelSpec, function (group) {
- for (var key in group) {
- flatSpec[key] = group[key];
- }
- });
- var supportedV5Props = SUPPORTED_V5_PROPS_MAP[spec.type];
- _.each(supportedV5Props, function (prop) {
- var propName = V5_PROP_MAP[prop];
- if (_.isObject(propName)) {
- _.extend(spec, propName(flatSpec));
- } else {
- var value = flatSpec[prop];
- if (value !== undefined) {
- spec[propName] = value;
- }
- }
- });
- },
- /**
- * Get the value of a given format spec property from the model format spec
- *
- * @param name - format spec property name
- * @param modelSpec - model spec
- */
- _getPropValue: function _getPropValue(name, modelSpec) {
- var value;
- var modelSpecName = V5_PROP_MAP[name];
- if (modelSpecName && _.isFunction(modelSpecName)) {
- value = modelSpecName(modelSpec);
- } else {
- value = modelSpec[modelSpecName];
- }
- return value;
- },
- _getFormatGroup: function _getFormatGroup(spec) {
- return spec.formatGroup || spec.format && spec.format.formatGroup;
- },
- /**
- * Get the V5 properties supported by the formatter
- * @return {String[]}
- */
- getSupportedV5Props: function getSupportedV5Props() {
- return SUPPORTED_V5_PROPS;
- },
- /**
- * Get the formatter supported format type from the model format type (V5 spec format type)
- * @param type - The model format type (V5 spec format type)
- */
- getFormatType: function getFormatType(type) {
- return TYPE_MAP[type];
- },
- /**
- * Get the V5 types supported by the formatter
- * @return {String[]}
- */
- getSupportedV5Types: function getSupportedV5Types() {
- return SUPPORTED_V5_TYPES;
- }
- });
- return new FormatUtils();
- });
- //# sourceMappingURL=V5Formatter.js.map
- ;
- define("js/glass/bundle", function(){});
|